class sakkara.model.DistributionComponent(generator: Callable, name: str | None = None, group: str | Tuple[str, ...] | None = None, **subcomponents: Any)#

Class for components whose variable is generated by a PyMC distribution

Parameters:
  • generator (Callable) – PyMC callable for the distribution to use

  • name (str) – Name of the corresponding variable to register in PyMC, defaults to None

  • group (Union[str, Tuple[str, ...]]) – Group of which the component is defined for, defaults to None

  • members (Iterable[Any]) – Subset of members of column the component is defined for, defaults to None

  • **subcomponents – Underlying components/objects passed as parameters to PyMC distribution, should correspond

to keyword of generator

Example

import pymc as pm
from sakkara.model import DistributionComponent as DC
sigma_comp = DC(pm.HalfNormal)
n = DC(pm.Normal, sigma=sigma_comp)
build_variable() None#

Build the variable, performed after prebuild and build_group.