Skip to content

Instantly share code, notes, and snippets.

@PDiracDelta
Last active November 7, 2021 17:06
Show Gist options
  • Save PDiracDelta/d6aa8348aa917f1885a58c3db051b130 to your computer and use it in GitHub Desktop.
Save PDiracDelta/d6aa8348aa917f1885a58c3db051b130 to your computer and use it in GitHub Desktop.
Python3 use fmin_l_bfgs_b to get MLE of Negative Binomial for binned data.
optimized_result = fmin_l_bfgs_b(log_likelihood_binned,
x0=initial_params,
# fprime=log_likelihood_deriv,
args=(X,),
approx_grad=True,
bounds=bounds)
MLE_params = {'size': optimized_result[0][0], 'prob': optimized_result[0][1]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment