DCPROGS / HJCFIT

Full maximum likelihood fitting of a mechanism directly to the entire sequence of open and shut times, with exact missed events correction.
GNU General Public License v3.0
7 stars 4 forks source link

PyMC Tutorial and dCK notebooks #155

Open jenshnielsen opened 7 years ago

jenshnielsen commented 7 years ago

@garymacindoe Is this branch the work you did on MCMC?

garymacindoe commented 7 years ago

Yes. This is as far as I got before I left so I committed my work to my fork before wiping my macbook.

I had followed the PyMC Tutorial and was working on adapting the example to do MCMC with HJCFIT, then I'd rebase to delete the tutorial (which is one of the reasons I was working on my fork). I got as far as implementing the model but got stuck trying to get some data.

The book chapter from Michael and Ben (Calderhead) implements the three-state model from the Del Castillo and Katz paper, generates some data from the model using their parameters then uses MCMC to attempt to recover the parameter values from the generated data. This is then repeated with the five state/nine parameter model. PyMC does not support generating data from the model. PyMC3 does but it is currently unfinished. I have some data from Ben in https://github.com/UCL/GMCMC/tree/master/data (in the files named ION_dCK_*) which most likely is the data used for the book chapter but this is in a different format from what the HJCFIT likelihood function expects. Remis suggested getting some real data to perform MCMC on but this wouldn't reproduce the results in the book chapter exactly. You could look into DCPYPS to see how it converts the flat array (from the GMCMC data) into the two-dimensional array that HJCFIT expects or another option would be to write a simplified Metropolis-Hastings sampler that can also be used to generate data.