JuliaStats / Klara.jl

MCMC inference in Julia
Other
166 stars 38 forks source link

Draw samples from a pdf #153

Closed mauro3 closed 7 years ago

mauro3 commented 7 years ago

I have a probability density function p(x), where x::Vector{Float64}, and would like to draw samples from it. How would I do that?

papamarkou commented 7 years ago

Hi @mauro3, I assume you obviously mean statistically dependent samples using MCMC? Take a look at this script for example, which samples from plogtarget (which is an unnormalized Gamma) using Metropolis Hastings:

https://github.com/JuliaStats/Klara.jl/blob/master/doc/examples/Gamma/MH.jl

If you need more help, I will be able to resume Klara development and support in two weeks' time that the academic term is finished.

mauro3 commented 7 years ago

Yes, using MCMC. I'll study that example. If I got more questions, I'll report back. Thanks!