# How does the presence of multimodally distributed variable/ parameter effect my model?

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.

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')

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

and made predictions, which were also perfect.

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

Can some one please explain this concept.