Skip to content

Distributions

gpjax.distributions

tfd = tfp.distributions module-attribute
DistrT = TypeVar('DistrT', bound=tfd.Distribution) module-attribute
__all__ = ['GaussianDistribution'] module-attribute
GaussianDistribution

Bases: Distribution

Multivariate Gaussian distribution with a linear operator scale matrix.

Parameters:

Name Type Description Default
loc Optional[Float[Array, ' N']]

The mean of the distribution. Defaults to None.

None
scale Optional[LinearOperator]

The scale matrix of the distribution. Defaults to None.

None
Returns
GaussianDistribution: A multivariate Gaussian distribution with a linear operator scale matrix.
loc = loc instance-attribute
scale = cola.PSD(scale) instance-attribute
event_shape: Tuple property

Returns the event shape.

__init__(loc: Optional[Float[Array, ' N']] = None, scale: Optional[LinearOperator] = None) -> None

Initialises the distribution.

mean() -> Float[Array, ' N']

Calculates the mean.

median() -> Float[Array, ' N']

Calculates the median.

mode() -> Float[Array, ' N']

Calculates the mode.

covariance() -> Float[Array, 'N N']

Calculates the covariance matrix.

variance() -> Float[Array, ' N']

Calculates the variance.

stddev() -> Float[Array, ' N']

Calculates the standard deviation.

entropy() -> ScalarFloat

Calculates the entropy of the distribution.

log_prob(y: Float[Array, ' N']) -> ScalarFloat

Calculates the log pdf of the multivariate Gaussian.

Parameters:

Name Type Description Default
y Optional[Float[Array, ' N']]

the value of which to calculate the log probability.

required
Returns
ScalarFloat: The log probability of the value.
sample(seed: KeyArray, sample_shape: Tuple[int, ...])

See Distribution.sample.

kl_divergence(other: GaussianDistribution) -> ScalarFloat