I've implemented a few Probability Density Functions and sampling methods for an MCMC algorithm, but I'm not really sure how to check if they're consistent or not. For example, if I have a discrete sampling method and probability mass function, I can generate a bunch of samples and check how the empirical distribution compares to the function's prediction. Is there something similar I can do for continuous random variables?

asked Dec 19 '11 at 15:57

Daniel%20Duckwoth's gravatar image

Daniel Duckwoth
954222938

edited Dec 19 '11 at 15:57


2 Answers:

Complementing Kevin's answer, if you prefer to compute the cdf (cumulative density function), which is the integral of the pdf, you can take many samples, sort them by numerical value, plot numerical value versus ranked position (normalized to be between 0 and 1), and see if the step function approaches the shape of the cdf.

answered Dec 20 '11 at 14:58

Alexandre%20Passos's gravatar image

Alexandre Passos ♦
2554154278421

Generate some samples, group them into bins, and check that the empirical bin frequencies match the integral of the pdf over each bin. Calculate the integrals numerically using point samples of the pdf given by your function.

answered Dec 19 '11 at 20:39

Kevin%20Canini's gravatar image

Kevin Canini
126021330

Your answer
toggle preview

powered by OSQA

User submitted content is under Creative Commons: Attribution - Share Alike; Other things copyright (C) 2010, MetaOptimize LLC.