particles.distributions.IndepProd

class IndepProd(*dists)[source]

Product of independent univariate distributions.

The inputs/outputs of IndeProd are numpy ndarrays of shape (N,d), or (d), where d is the number of univariate distributions that are passed as arguments.

Parameters:

dists (list of ProbDist objects) – The probability distributions of each component

Example

To define a bivariate distribution:

biv_dist = IndepProd(Normal(scale=2.), Gamma(2., 3.))
samples = biv_dist.rvs(size=9)  # returns a (9, 2) ndarray

Note

This is used mainly to define multivariate state-space models, see module state_space_models. To specify a prior distribution, you should use instead StructDist.

__init__(*dists)[source]

Methods

__init__(*dists)

logpdf(x)

pdf(x)

ppf(u)

rvs([size])

shape(size)

Attributes

dim