pygsti.extras.drift.probtrajectory.maxlikelihood#
- maxlikelihood(probtrajectory, clickstreams, times, minp=0.0001, maxp=0.999999, method='Nelder-Mead', return_opt_output=False, options=None, verbosity=1)#
Implements maximum likelihood estimation over a model for a time-resolved probabilities trajectory, and returns the maximum likelihood model.
- Parameters:
model (ProbTrajectory) – The model for which to maximize the likelihood of the parameters. The value of the parameters in the input model is used as the seed.
clickstreams (dict) – The data, consisting of a counts time-series for each measurement outcome. This is a dictionary whereby the keys are the outcome labels and the values are list (or arrays) giving the number of times that measurement outcome was observed at the corresponding time in the times list.
times (list or array) – The times associated with the data. The probabilities are extracted from the model at these times (see the model.get_probabilites method), to implement the model parameters optimization.
minp (float, optional) – A positive value close to zero. The value of p below which x*log(p) is approximated using a Taylor expansion (used to smooth out the parameter boundaries and obtain better fitting performance). The default value should be fine.
maxp (float, optional) – A positive value close to and <= 1. The value of p above which x*log(p) the boundary on p being <= 1 is enforced using a smooth, quickly growing function. The default value should be fine.
method (str, optional) – Any value allowed for the method parameter in scipy.optimize.minimize().
verbosity (int, optional) – The amount of print to screen.
return_opt_output (bool, optional) – Whether or not to return the output of the optimizer.
- Returns:
ProbTrajectory – The maximum likelihood model returned by the optimizer.
if return_opt_output –
- optout
The output of the optimizer.