hopsy.Mixture#

class hopsy.Mixture(self, components, weights=[1, ..., 1])#

The Mixture is a weighted sum of \(n\) components, so its unnormalized density is given as

\[f(x) = \sum_{i=1}^n w_i f_i(x)\]

The components may be arbitrary python objects implementing the methods as required in a hopsy.PyModel

Parameters:
  • components (list[object]) – The Mixture’s model components.

  • weights (list[float]) – Component weights. If none are given, they will be assumed to be all 1.

Attributes

components

A list of component weights, which has to match the number of components.

weights

A list of model components, where every components is supposed to be a Python object implementing hopsy.Model or being wrapped inside hopsy.PyModel.

Methods

compute_expected_fisher_information(self, x)

deprecated:: 1.4

compute_log_likelihood_gradient(self, x)

deprecated:: 1.4

compute_negative_log_likelihood(self, x)

deprecated:: 1.4

log_curvature(self x)

This method is not implemented, as there exists no closed-form solution to computing the log curvature (typically defined as the expected Fisher information) of a general mixture model.

log_density(self, x)

Computes the log probability density of the model components

log_gradient(self, x)

Computes the gradient of the logarithm of the weighted sum of the probability density functions of the model components