Please use set.seed(422) and provide R code
Problem 1. Dr. Lee wants to find an upper-tail critical value of chi-squared distribution but he doesn't remember the whole probability density function (pdf). Luckily, he remembers the pdf of the chi-squared distribution up to some constant, 2 k f(x) < x2-12-Ź, x > 0. e = 1. (20 pts) Use the Metropolis-Hastings algorithm to generate a random sample of size 10,000 from the chi-squared distribution with 5 degrees of freedom (k = 5). Find 95th percentile (or quantile) of your sample which can be used as upper-tail critical value when the significance level is 0.05. (Hint: Use the log-normal distribution (meanlog 0, sdlog Xt) as proposal dis- tribution. To calculate the log-normal density, use dlnorm(x, meanlog, sdlog). To generate sample from the log-normal density, use rlnorm(n, meanlog, sdlog).) = =
Please use set.seed(422) and provide R code
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Please use set.seed(422) and provide R code
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!