If Y depends on X, we have ordinary 2D regression line.
But if Y depends on m variables X1,X2,...,Xm then we need to find m values of b to accompany all Xi. Formally speaking
Y=a+b1X1+b2X2+b3X3+...+bmXm
Matrix form of the equation
We define 2 matrices
XB=[1x1x2...xm]=ab1b2...bm
Then we can rewrite Y with X and B as:
Y=X⋅B
Generalized matrix form
Now we want to generalize the experiment, instead of 1 observation, we want to do n observations.
We would have n variables y1,y2,y3,...,yn First, we have equation form
You have finished 10 days of statistics challenge. I have learned a lot and so did you.
I hope it benefits you as much as it does to me.
Thanks Hackerrank for the challenges and inspirations.