Integrate utility of saving of HDF5 file of poserior chain in run_mcmc methods
Currently, one has to seperately call the utility save_chain_to_hdf5
in utils.py
in order to save the full chain of posteriors answer from a run_mcmc output; something like
mcmc_posterior_chain = processed_sensing_obj.run_mcmc(
fmin=mcmc_params_fitregion_Hz[iDate][0],
fmax=mcmc_params_fitregion_Hz[iDate][1],
burn_in_steps=MCMC_PARAMS_BURNINSTEPS,
steps=MCMC_PARAMS_STEPS,
save_to_file=MCMC_JSONRESULTSFILE)
pydarm.utils.save_chain_to_hdf5(
MCMC_HDF5RESULTSFILE,
model_parameters_file,
mcmc_params_fitregion_Hz[iDate][0],
mcmc_params_fitregion_Hz[iDate][1],
'sensing',
mcmc_posterior_chain)
It'd be great if run_mcmc
method could trigger a save of of the full posterior chain like one triggers a save of the hdf5 file, (and retain the ability to also save the results the json file) like
mcmc_posterior_chain = processed_sensing_obj.run_mcmc(
fmin=mcmc_params_fitregion_Hz[iDate][0],
fmax=mcmc_params_fitregion_Hz[iDate][1],
burn_in_steps=MCMC_PARAMS_BURNINSTEPS,
steps=MCMC_PARAMS_STEPS,
save_results_to_json=MCMC_JSONRESULTSFILE,
save_posteriorchain_to_hdf5=MCMC_HDF5RESULTSFILE)