Is it possible to sample from a user provided target measure in PyMC3 in an easy way? I.e. I want to be able to provide black box functions logposterior(theta)
and grad_logposterior(theta)
that and sample from those instead of specifying a model in PyMC3s modeling language.
This is a bit clunky. You'd need to create a new Theano Op
. Here are a few examples: https://github.com/Theano/Theano/blob/master/theano/tensor/slinalg.py#L32
You then need to create a distribution class that evaluates the logp via your new Op
, for example: https://github.com/pymc-devs/pymc3/blob/master/pymc3/distributions/continuous.py#L70
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With