Skip to content

Instantly share code, notes, and snippets.

@jcbozonier
Last active January 13, 2017 17:43
Show Gist options
  • Save jcbozonier/dcf6ffc1523d92e30d879681bec9bcc6 to your computer and use it in GitHub Desktop.
Save jcbozonier/dcf6ffc1523d92e30d879681bec9bcc6 to your computer and use it in GitHub Desktop.
Finding the MLE from PyMC3
mle = {}
for var_name in ['a','h','k','sigma']:
var_mass, var_bins = np.histogram(trace[var_name], bins=np.arange(-50000,50000, 0.1), density=True)
var_averaged_bins = 0.5*(var_bins[1:] + var_bins[:-1])
bin_index = np.argmax(var_mass)
mle[var_name] = var_averaged_bins[bin_index]
print(mle);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment