0
$\begingroup$

I have come across this sentence many times - "All xs should come from same distribution'. I wanted to understand how will the presence of a multimodally distributed variable effect my modal. I have generated some xs from normal(10,2) distribution and some xs from normal(15,1) distribution. enter image description here

I have set up y= 5*x +6

I have fit a linear regression model and I expected it to not give me accurate predictions but it did.

plt.plot(test_x,test_y,'r--',test_x,y_predicted,'g')

enter image description here

Then I some xs from normal(10,2) and some from uniform(10,20)

enter image description here

and made predictions, which were also perfect.

plt.plot(test_x,test_y,'r--',test_x,y_predicted,'g')

enter image description here

Can some one please explain this concept.

$\endgroup$

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.