skgpuppy.MLE module

class skgpuppy.MLE.MLE(density, theta0, support=None, dims=None, fisher_matrix=None)

Bases: object

A class for numerical maximum likelihood estimation

Parameters:
  • density – lambda x,theta with x and theta being vectors
  • theta0 – the initial parameters of the density
  • dims – Number of dimensions of x
  • support – The support of the density
  • fisher_matrix – Fisher Information Matrix for the density (containts functions of theta)

Note

Either support or dims has to be supplied (support is recommended for estimating the fisher information)

get_fisher_function(order=1)

Calculate the fisher information matrix

Parameters:order – using derivates of this order (1 or 2)
Returns:function (w.r.t. theta) calculating the fisher information matrix

Note

If the fisher information matrix was provided to the constructor, then this is used instead of the numerical methods.

mle(observations)
Parameters:observations – vector of x vectors
Returns:theta (estimated using maximum likelihood estimation)
mle_ci(observations, alpha=0.05)

95% CI (if alpha is not given)

Returns:lower bound, upper bound
sigma(theta, observations=None, n=1)

Estimate the quality of the MLE.

Parameters:
  • theta – The parameters theta of the density
  • observations – A list of observation vectors
  • n – Number of observations
Returns:

The variances corresponding to the maximum likelihood estimates of theta (quality of the estimation) as 1-d array (i.e. diagonal of the cov matrix)

Note

Either the observations vector or n have to be provided.