pele.potentials.ml#
- class pele.potentials.ml.MLCost[source]
-
class MLCost(BasePotential):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
- MLCost.get_error_estimate()[source]
-
def get_error_estimate(self, opt_parameters, log_l_variation=0.5):Get confidence interval on ML estimated parameters.
- Parameters:
- opt_parametersarray of floats
The optimum parameters as obtained from the ML method.
- log_l_variationfloat, optional
The variation in the log-likelihood upon changing the values of the parameters within the confidence interval: log_likelihood(interval[0]) <= log_likelihood(opt_parameters) - log_l_variation log_likelihood(interval[1]) <= log_likelihood(opt_parameters) - log_l_variation
Examples
To get an estimate on the confidence interval of the optimum parameters, do e.g.:
error = pot.get_error_estimate(result)