pele.potentials.MLCost#

class pele.potentials.MLCost(data, log_probf=None, probf=None)[source]#

Cost function to be used for maximum likelihood optimization.

Parameters:
dataarray of floats

The observed data.

log_probfcallable log_probf(data, parameters)

Log of probability function which takes an array of data and an array of parameters and returns a float value

probfcallable probf(data, parameters)

Probability function which takes an array of data and an array of parameters and returns a float value

Examples

To get maximum likelihood estimates of the parameters, do e.g.:

pot = MLCost(observed, probf=gauss) optimizer = LBFGS_CPP(parameters, pot) result = optimizer.run() opt_parameters = result.coords

Methods

NumericalDerivative(coords[, eps])

return the gradient calculated numerically

NumericalHessian(coords[, eps])

return the Hessian matrix of second derivatives computed numerically

getEnergy(parameters)

return the energy at the given coordinates

getEnergyGradient(coords)

return the energy and gradient at the given coordinates

getEnergyGradientHessian(coords)

return the energy, gradient, and Hessian at the given coordinates

getEnergyGradientNumerical(coords)

getGradient(coords)

return the gradient at the given coordinates

getHessian(coords)

return the hessian

get_error_estimate(opt_parameters[, ...])

Get confidence interval on ML estimated parameters.

get_interval(par_idx)

test_potential(coords[, eps])

print some information testing whether the analytical gradients are correct

Attributes