gwkokab.analysis.utils.priors ============================= .. py:module:: gwkokab.analysis.utils.priors Functions --------- .. autoapisummary:: gwkokab.analysis.utils.priors.DirichletElement gwkokab.analysis.utils.priors.get_processed_priors Module Contents --------------- .. py:function:: DirichletElement(order: int, n_dimensions: int, validate_args: Optional[bool] = None, **kwargs) -> numpyro.distributions.Distribution Conditional Dirichlet Distribution. A `DirichletElement` is a distribution over the :math:`N`-dimensional simplex, where :math:`N` is the :code:`n_dimensions` parameter. The :math:`n`-th order Dirichlet distribution given by the :code:`order`. The distribution is defined as, .. math:: \forall n \in \{0, N-2\}, p(x_n \mid x_0, \cdots, x_{n-1}) = \frac{(N-n-1)(1-\alpha_n-x_n)^{N-n-1}}{(1-\alpha_n)^{N-n-1}}, \qquad x_n \in [0, \alpha_n] where :math:`\alpha_n = \sum_{i=0}^{n-1} \alpha_i` and :math:`x_n` is the :code:`order`-th element of the simplex. .. math:: p(x_{N-1}\mid x_0, \cdots, x_{N-2}) = \frac{1}{1-\alpha_{N-1}}, \qquad x_{N-1} \in [0,\alpha_{N-1}] :param order: order of the DirichletElement :type order: int :param n_dimensions: number of dimensions :type n_dimensions: int :param validate_args: whether to validate the arguments, by default None :type validate_args: Optional[bool], optional :returns: DirichletElement distribution :rtype: Distribution :raises KeyError: Missing concentration parameters for `DirichletElement` of order {order} .. py:function:: get_processed_priors(params: List[str], priors: dict) -> dict Get the processed priors from a list of parameters. A processed prior is either an instantiated prior or a tuple of :code:`(jax.tree_util.Partial, lazy_vars)` where :code:`lazy_vars` is a dictionary of lazy variables. :param params: list of parameters :type params: List[str] :param priors: dictionary of priors :type priors: dict :returns: dictionary of processed priors :rtype: dict :raises ValueError: if the prior value is invalid