Inference with EMCEE
Last updated
Last updated
For now this only work from branch emcee_batch
You need, under inference, to add method: emcee
and modify the statistics:
as shown in the diff below (basically: all resampling goes to one subsection, with some minor changes to names).
To see which llik options and regularization (e.g do you want to weigh more the last weeks for forecasts, or do you want to add the sum of all subpop) see files statistics.py.
Install gempyor from branch emcee_batch . Test your config by running:
on your laptop. If it works, it should produce:
plots of simulation directly from your config
plots after the fits with the fits and the parameter chains
and h5 file with all the chains
and in model_output, the final hosp/snpi/seir/... files in the flepiMoP structure.
It will output something like
```
Here, it says the config fits 92 parameters, we'll keep that in mind and choose a number of walkers greater than (ideally 2 times) this number of parameters.
Install gempyor on the cluster. test it with the above line, then modify this script:
so you need to have:
-c
(number of core) equal to roughly half the number of walkers (slots/parallel chains)
mem to be around two times the number of walkers. Look at the computes nodes you have access to and make something that can be prioritized fast enough.
nsamples is the number of final results you want, but it's fine not to care about it, I rerun the sampling from my computer.
To resume from an existing run, add the previous line --resume
and it 'll start from the last parameter values in the h5 files.
To analyze run postprocessing/emcee_postprocess.ipynb
First, this plots the chains and then it runs nsamples (you can choose it) projection with the end of the chains and does the plot of the fit, with and without projections