Let me further add what follows:
I copied and paste the following functions from the original code to my notebook:
likelihood_function_generator
lognormal_likelihoods
Then I do what follows:
- initialize parameters mu and sigma to their ML values (as done in the original code, right?)
- likelihood_function_generator('lognormal', args)
- parameters, negative_loglikelihood, iter, funcalls, warnflag, = \
fmin(
lambda p: -sum(np.log(likelihood_function(p, data))),
param, full_output=1, disp=False)
The output of fmin is... the maximum likelihood estimators.
But if I just call powerlaw.Fit(data, 'lognormal', args) I get completely different values.
What is the fit function doing that I am missing?