Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(d)Write a function called rsin2 which generates random values from the density f(x)/k, 0 c: x (d)Write a function called rsin2 which generates random values
(d)Write a function called rsin2 which generates random values from the density f(x)/k, 0 c: x
(d)Write a function called rsin2 which generates random values from the density f (x)/k, O < x < 2m , where k is the area found above. The function should take a single argument specifying how many samples are required, e.g. would return a vector of 10 samples from this distribution. Use the rejection method to draw the samples. Plot a histogram based on 1000 samples. (e)Use your function to draw a sample of 1,000,000 samples, and calculate a 95% confidence interval for the mean. (By symmetry, the true mean must be It. Did your confidence interval cover the true value?)
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