import h5py

f = h5py.File('../data/mc.hdf5', mode='r')

list(f.keys())

d = f['samples']

d.value.shape

"""
Explanation: MCMC Step Size
01 - Exploratory
Author: Michael Gully-Santiago
Thursday, January 21, 2016
We want to know more about optimal step sizes.
End of explanation
"""


import matplotlib.pyplot as plt
% matplotlib inline
% config InlineBackend.figure_format = 'retina'
import seaborn as sns

from IPython.display import Image

!chain.py --files ../data/mc.hdf5 --chain --burn=10000

Image(filename='walkers.png')

!chain.py --files ../data/mc.hdf5 --triangle --burn=10000

Image(filename='triangle.png')

"""
Explanation: It's a $50000 \times 6$ dataset.
End of explanation
"""


!chain.py --files ../data/mc.hdf5 --cov

Image(filename='cor_coefficient.png')

import numpy as np

ojs = np.load('opt_jump.npy')

ojs.shape

"""
Explanation: Not bad!  There is little constraint on $\log{g}, Z$, but we sort of expected that.
End of explanation
"""


