jpt.distributions.multivariate

© Copyright 2021, Mareike Picklum, Daniel Nyga.

Classes

MultiVariateGaussian

Extension of dnutils.stats.Gaussian

Module Contents

class jpt.distributions.multivariate.MultiVariateGaussian(mean=None, cov=None, data=None, ignore=-6000000)

Bases: jpt.distributions.univariate.Gaussian

Extension of dnutils.stats.Gaussian

A Multivariate Gaussian distribution that can be incrementally updated with new samples

ignore = -6000000
cdf(intervals)

Computes the CDF for a multivariate normal distribution.

Parameters:

intervals (list of matcalo.utils.utils.Interval) – the boundaries of the integral

pdf()
property mvg

Computes the multivariate Gaussian distribution.

property dim

Returns the dimension of the distribution.

property cov_

Returns the covariance matrix for prettyprinting (precision .2).

property mean_

Returns the mean vector for prettyprinting (precision .2).

conditional(evidence)

Returns a distribution conditioning on the variables in evidence following the calculations described in Conditional distributions, i.e., after determining the partitions of \(\mu\), i.e. \(\mu_{1}\) and \(\mu_{2}\) as well as the partitions of \(\Sigma\), i.e. \(\Sigma_{11}, \Sigma_{12}, \Sigma_{21} \text{ and } \Sigma_{22}\), we calculate the multivariate normal \(N(\overline\mu,\overline\Sigma)\) using

(1)\[\overline\mu = \mu_{1} + \Sigma_{12}\Sigma_{22}^{-1}(a-\mu_{2})\]
(2)\[\overline\Sigma = \Sigma_{11} + \Sigma_{12}\Sigma_{22}^{-1}\Sigma_{21}\]
Parameters:

evidence (dict) – the variables the returned distribution conditions on (mapping indices to values or Intervals of values)

plot(engine=None, **kwargs) Any

Plots the distribution using the given engine.

Parameters:
  • engine – Can be either one of ["plotly", "matplotlib"], or an instance of a rendering engine subclassing DistributionRendering.

  • kwargs – The keyword arguments to pass to the engine as defined in the .plot_multivariate() function of DistributionRendering or its respective subclass defined by engine.

Returns:

the figure object of the plotting engine