Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 1. Dr. Lee wants to check the mean of a chi-squared distribution with 4 degrees of freedom is 4. The chi-squared distribution with 4
Problem 1. Dr. Lee wants to check the mean of a chi-squared distribution with 4 degrees of freedom is 4. The chi-squared distribution with 4 degrees of freedom has density function f (2) = -xe-2, x>0. 1. (20 pts) Use the rejection sampling to generate a random sample of size 10,000 from the chi- squared distribution with 4 degrees of freedom. Find the Monte Carlo estimate of Ef (X) from the generated sample. (Hint: Use the log-normal distribution (meanlog = 0, sdlog = 2) as proposal distribution. To calculate the log-normal density, use dlnorm (x, meanlog, sdlog). To generate sample from the log-normal density, use rinorm (n, meanlog, sdlog).) 2. (20 pts) This time use the importance sampling to estimate the mean of the chi-squared distribu- tion with 4 degrees 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 log-normal distribution (meanlog = 0, sdlog = 2) as importance function. To calculate the log-normal density, use dlnorm (x, meanlog, sdlog). To generate sample from the log-normal density, use rlnorm(n, meanlog, sdlog).) Problem 2. Dr. Lee wants to generate random sample from t distribution with v = 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 and he knows we can still use the Metropolis algorithm although we only know the t distribution up to some constant. - (v+ 1) / 2 f (20) ox - 00
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started