pymc icon indicating copy to clipboard operation
pymc copied to clipboard

Split MCMC and Forward sampling functions in sample.py

Open ricardoV94 opened this issue 2 years ago • 7 comments

That file is quite long, and anyway draw and sample_prior/posterior_predictive behave very differently from sample so we could separate them across two files (and same for tests). WDYT?

ricardoV94 avatar Sep 21 '22 08:09 ricardoV94

How would you split them? We could have a submodule sample with prior.py, posterior.py (or mcmc.py).

twiecki avatar Sep 21 '22 10:09 twiecki

I was thinking forward.py vs mcmc.py

ricardoV94 avatar Sep 21 '22 10:09 ricardoV94

We don't call it forward anywhere else though, do we?

twiecki avatar Sep 21 '22 11:09 twiecki

@lucianopaz does. I used to call it ancestral sampling. We do call it here: https://github.com/pymc-devs/pymc/blob/4c92adf9720f6578e51b9ef21e33c29871c67a83/pymc/sampling.py#L1619

ricardoV94 avatar Sep 21 '22 12:09 ricardoV94

OK, I'm fine with either.

twiecki avatar Sep 22 '22 08:09 twiecki

We could move the jax sampling functionality then into that subdir too. We could also make it even more general and have inference/sampling/ and inference/vi/.

twiecki avatar Sep 22 '22 08:09 twiecki

Or just have inference and put both in there.

twiecki avatar Sep 22 '22 08:09 twiecki