0

If $X \sim N(\theta,1)$ with Cauchy as robust prior

$$\pi(\theta) = \frac{1}{\pi(1+\theta^2)} \qquad -\infty < \theta < \infty$$

how to do the rejection sampler in R, and use it to generate 10, 000 samples from the posterior distribution. with using R function 'rcauchy' to simulate from π(θ); $\pi$($\theta$) is a proposal distribution.

Kindly please help

  • " r function rcauchy" needs clarification. – herb steinberg Dec 08 '18 at 02:41
  • Why do you need to use rejection sampling here? You can just generate $10{,}000$ samples ${\theta_1, \dots,\theta_{10{,}000}}$ from the Cauchy distribution and then simulate ${X_1, \dots, X_{10{,}000}}$ by simulating $X_i \sim N(\theta_i, 1)$. – Alex Dec 16 '18 at 17:36

0 Answers0