probcomp / GenExperimental.jl

Featherweight embedded probabilistic programming language and compositional inference programming library
MIT License
17 stars 2 forks source link

Alternative sampler for normal inverse Wishart predictive #86

Open marcoct opened 6 years ago

marcoct commented 6 years ago

To draw from the predictive, the current implementation first draws the parameters from the Normal-Inverse-Wishart posterior, and then draws the datum from the multivariate normal with the sampled parameters. It might be possible to sample more efficiently from the predictive using the fact that it is a multivariate student T distribution. This fact can be found in Murphy's textbook, although I have not verified the derivation or the details of the result.

This is done in Venture (https://github.com/probcomp/Venturecxx/blob/f0e21834973a90e58b0a32cda9e81d78d4a6064d/backend/lite/cmvn.py), but there are some dubious notes and I have not verified this technique.

A reference for sampling from multivariate student T that may be useful: https://journal.r-project.org/archive/2013-2/hofert.pdf

marcoct commented 6 years ago

For reference, normal inverse Wishart was implemented in https://github.com/probcomp/Gen.jl/pull/87