Last active
January 13, 2017 17:43
-
-
Save jcbozonier/dcf6ffc1523d92e30d879681bec9bcc6 to your computer and use it in GitHub Desktop.
Finding the MLE from PyMC3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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