In: Statistics and Probability
Dr. Lee wants to calculate the mean of a t distribution with ν = 4 degrees of freedom. However, he doesn’t remember the full probability density function (pdf) of the t distribution. Luckily, he remembers the pdf of the t distribution up to some constant. f(x) ∝ (1 + x2/ν)−(ν+1)/2, −∞ < x < ∞. 1. Use the rejection sampling to generate a random sample of size 10,000 from the t dis- tribution with ν = 4 degrees of freedom. Find the Monte Carlo estimate of Ef(X) from the generated sample and draw a plot to show the convergence of the Monte Carlo approximation. (Hint: Use the standard Cauchy distribution (location = 0, scale = 1) as proposal dis- tribution. To calculate the Cauchy density, use dcauchy().) 2. Use the importance sampling to estimate the mean of the t distribution with ν = 4 de- grees of freedom. In other words, find the Monte Carlo estimate of Ef (X ) directly using the importance sampling. Also, draw a plot to show the convergence of the importance sampling approximation. (Hint: Use the standard Cauchy distribution (location = 0, scale = 1) as importance function. To calculate the Cauchy density, use dcauchy().)
The means obtained from both the sampling techniques are nearly 0 and we also know that t distribution has mean 0(if its mean exist which eventually will exist since degrees of freedom=4>1 where t with degree of freedom =1 is cauchy whose mean doesn't exist).