0
$\begingroup$

Good Morning. I am working on an assignment where i need to perform the following tasks: 1.Create 500 observations based on standard normal distribution and store them in variable X 2.Create 500 observations based on Normal distribution and store them in variable err 3.Using X and err generate y as y = -1+0.5*X+err

I have performed tasks 1 and 2 : mean0 = 0 std = 1 X = np.random.normal(mean0,std,500)

mean1 = 0.5 var = 0.75 err = np.random.normal(mean1,var,500)

CAN ANYONE HELP ME WITH THE SNIPPET OF HOW TO GENERATE A LIST OF y FROM X AND err?

$\endgroup$
1
  • $\begingroup$ What happens if you do y = -1+0.5*X+err? $\endgroup$
    – Dave
    Nov 30 '21 at 3:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.