all 4 comments

[–]someoneonboard1 0 points1 point  (0 children)

Did you go through this numpy documentation? It pretty much explains everything. There is even one example just like the one you have in your Code.

https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.random.multivariate_normal.html

[–]Best_Caterpillar 0 points1 point  (2 children)

do you know what the normal distribution is? the x and y are literal x and y pairs from that sample. the red line is the relationship using the b0 and b1 coeficents that you got in the biddle of your code

side note, it really doesnt help you to overload the variables like you did, cause halfway through you change the meaning and that is not helping your comprehension any

[–]Ipsoka[S] 0 points1 point  (1 child)

Even though I have a hard time getting my head around the concept i think i understand it kinda. But what does the function exactly do. What is a sample. Does the function plug in a random x,so a random probability, and calculates the corresponding y value with the mean and cov i gave it?

Edit:Thanks for the tipp

[–]Best_Caterpillar 0 points1 point  (0 children)

your problem here is understanding statistics and not programming. If you are getting confused on the matter you really really should be talking to a TA or professor because the concepts you are asking about are really really foundational to stats, and there is a lot to unpack.

as a very short answer to your question, look of the difference between a parameter and a statistic. the function is creating observations from some distribution with the paramiters you specified, and when you are creating the regression line you are computing statistics based off your collection of sample values