Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this exercise we are going to use simulation to verify the result of exercise 3. In R sample x1, . . . , x100

In this exercise we are going to use simulation to verify the result of exercise 3. In R sample x1, . . . , x100 from a normal distribution with mean 2 and standard deviation 1.5. These numbers will stay fix for the rest of the exercise. In R sample 1, . . . , 100 from a uniform distribution on the interval [0.9, 1.1]. These numbers will stay fix for the rest of the exercise. Sample now i, for i = 1, . . . , 100, from a normal distribution with mean 0 and standard deviation i. Calculate yi = 2 3xi i. Now compute the value of the estimator 0 using these data (x1, y1), . . . , (x100, y100). You can use the R built-in function lm if you want or use the formula given in class. Repeat the process 1000 times and record in a vector the 1000 obtained 0. (Advice: To do that create a function that samples the values of and return the value of 0. Use then function replicate to apply the function created 1000 times. Remember that you can always use ?replicate to ask R for help). Attention: Every

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Finite Mathematics and Its Applications

Authors: Larry J. Goldstein, David I. Schneider, Martha J. Siegel, Steven Hair

12th edition

978-0134768588, 9780134437767, 134768582, 134437764, 978-0134768632

More Books

Students also viewed these Mathematics questions

Question

explains the relationship consumers have with magazines

Answered: 1 week ago