exoplanet-dev / exoplanet

Fast & scalable MCMC for all your exoplanet needs!
https://docs.exoplanet.codes
MIT License
206 stars 52 forks source link

Fixing a parameter for MCMC runs #80

Closed shbhuk closed 4 years ago

shbhuk commented 4 years ago

I wanted to check what is the best way to fix a variable for the MCMC runs, such that it is treated as a constant and not included in the sampling chains, but still included in the log probability calculation?

For example can I provide a list of variable names of the pm.sample? I did look at the PyMC3 documentation but was unable to find something along these lines.

Do you know of some xo or pymc3 functionality that lets one do this? Something like ecc = xo.constant('ecc', 0.2), I guess I could give it a Uniform Prior between 0.2 (say) and 0.2000001?

My goal is to try different models, with some different parameters fixed and compare the results..

This package is working great so far (so thanks for that), and before I implemented some kludge solution for this, I wanted to see if there is a proper way to do it..

lgrcia commented 4 years ago

You can use pymc3.Deterministic(“name”, value)

shbhuk commented 4 years ago

Thank you, the label should have been question, and not enhancement.

shbhuk commented 4 years ago

Just a note for future reference, value has to be a Theano variable..