TuringLang / AdvancedMH.jl

Robust implementation for random-walk Metropolis-Hastings algorithms
https://turinglang.org/AdvancedMH.jl/dev/
MIT License
88 stars 17 forks source link

Customized distributions #50

Open marouanehanhasse opened 3 years ago

marouanehanhasse commented 3 years ago

I actually have one question, does AdvancedMH supports customized distributions?

cpfiffer commented 3 years ago

For the proposal distributions? Yeah, I don't see why not.

cpfiffer commented 3 years ago

You can give it a Function which supports literally any type of proposal, and anything that inherits Distribution from Distributions.jl.

marouanehanhasse commented 3 years ago

oh that's great because i've been trying to work with the package for my code with a customized distribution here: (https://github.com/marouanehanhasse/Quantum_Relay/blob/master/src/distributions.jl) where everything is defined for my model and i have a log target function that is defined like this : target(x::Vector)= log(qrs.prob(qq, x, mask_q1)) + log(qrs.prob(x)) where qq,mask_q1 are vectors or arrays as x but i don't really know hoe to do it in my case