Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Answer the following question by showing the R code. Use R to simulate k standard normal random variables of your choices of sample size n.
Answer the following question by showing the R code.
Use R to simulate k standard normal random variables of your choices of sample size n. Let's call them Zi,i-1...k. Show the following: a) Visually show that the i2 has similar distribution as X2 distribution with k degrees of freedom. (hint for R novice) it might be easier to define an n k matrix, where each column is randomly generated by a standard normal distribution, then use the rowSums function to calculate sum of squares. b) Look up the R package fitdistrplus, and use the R function fitdistr to show that ,2 is indeed fitted to a x random variable. Try a range of different n and k, and report your findings. (Note, you may use the BFGS method with an initial value of df - 1 to fit the distribution chi-squared.)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