2
$\begingroup$

I am new to Bayesian. I want to draw data from the posterior predictive distribution p(y|D).

Do we need to find the CDF of the posterior predictive distribution and use the monte Carlo method or is there another way for simulation in bayesian?

my model has a complicated posterior predictive distribution p(y|D), so I cannot derive CDF. if I can use monte Carlo, can I draw data with pdf?

$\endgroup$
4
  • 1
    $\begingroup$ Could you tell us something about the posterior? $\endgroup$
    – utobi
    Commented Nov 13, 2022 at 23:20
  • $\begingroup$ Generally, people will use Markov-chain Monte Carlo to generate samples from posteriors/posterior predictives. $\endgroup$ Commented Nov 13, 2022 at 23:28
  • $\begingroup$ Let's say we have Weibull distribution with unknown scale and shape parameters where the scale parameter has Gamma and the shape has N(mu, sigma) $\endgroup$
    – Mmmm
    Commented Nov 13, 2022 at 23:43
  • $\begingroup$ I got this R code here stats.stackexchange.com/questions/499933/… which helps me understand M-H MCMC to estimate parameters but I do not understand how to generate data from the posterior predictive distribution $\endgroup$
    – Mmmm
    Commented Nov 14, 2022 at 0:06

1 Answer 1

1
$\begingroup$

If $p(x | \theta)$ denotes the distribution of the data ($\theta$ denoting the parameter) and $\pi(\theta | x^{\textrm{obs}})$ denotes the posterior distribution of $\theta$ then you can simulate from the posterior predictive distribution by applying this two-stages procedure:

  • simulate $\theta$ according to $\pi(\theta | x^{\textrm{obs}})$;

  • then simulate an observation $x$ according to $p(x | \theta)$.

$\endgroup$
7
  • $\begingroup$ Thanks for your answer but in the second stage How can I simulate data? Do I need to use transformation (inverse sampling)? $\endgroup$
    – Mmmm
    Commented Nov 14, 2022 at 19:09
  • $\begingroup$ @Mmmm What is the distribution of your data and which software do you use? $\endgroup$ Commented Nov 14, 2022 at 19:49
  • $\begingroup$ I use the Weibull distribution of my data with unknown scale and shape parameters and I use the R programme. similar to this question answer stats.stackexchange.com/questions/499933/… but I have the prior for the scale parameter is Gamma and normal distribution for the shape parameter. $\endgroup$
    – Mmmm
    Commented Nov 14, 2022 at 20:21
  • $\begingroup$ @Mmmm So you can use the rweibull function. $\endgroup$ Commented Nov 14, 2022 at 20:38
  • $\begingroup$ yes, you are right for the likelihood data but what I mean here is sampling from the predictive posterior distribution $\endgroup$
    – Mmmm
    Commented Nov 14, 2022 at 20:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.