Saturday, August 22, 2015

Find linear regression equation, y = ax + b. The data of following table gives the weekly maintenance cost (Rupees) to the age (in months) of 5...

We know that if  y  = ax+b is a linear regression 
equation of y on x, then  the sum of the squared deviation , S =  Sigma(Yi - aXi -b)^2.
We can minimise this squared diviation by equating the partial derivatives with respect
to b and a to zero and solve for x  and b and a .


So
dabaS/db = 0 and dabaS/daba a = 0 gives to the normal equations in b and a solving which
we can determine the equation Y = aX+b. So the required normal equations are
:


summation 2( Yi - a* Xi -sigma b)  = 0
and


Summation2(Yi-aXi-b)Xi = 0. Both these equations could
be simplified as:


a* summation Xi + nb = summation
Yi


a*summation Xi^2 +b summation Xi = Summation
Xi*Yi.


Solving for a  from these two equations we get  a
and b.



In the given  case we see that the given
data could be scaled down like Ui = (Xi- 30)5 and Vi = (Yi - 310)/10.
Then


U1 = (5-30)/5= -5 , U2 = (15-30)/5=-3 ....U5 =
(60-30)/5 =12.


V1 = (190-310)/10 = -12,  V2 = (250-310)10 =
-6,....,V5 = (395-310)/10 = +8.5.


So we can have the table
below:


.........   Ui        Vi         Ui^2        
Ui*Vi


.........  -5        -12      25             
60


.........  -3        -6        09             
18


.........  00       00       00              
00


.........  04       04      
16              16


.........  06      
8.5      36              
51


---------------------------------------------------


Total:
02       -5.5      86            
145


---------------------------------------------------


Therefore
the normal equations for Ui and Vi are :


a*sum Ui + nb  =
Sum Vi  Or 2Ui+5b = -5.5...................    (1)


a*sum
Ui^2+b*sum Ui = Sum Ui*Vi. Or 86a+2b = 145.....(2)


Solving
the simultaneous equations(1) and (2) we get:


a =
{145*5-(-5.5)*2}/(86*5-2*2) = 736/426 = 1.727699531


b=
(-5.5-2a)/5 = -(5.5+2(736/426))/5 = 
-1.791079812.


Therefore ,


Vi
=  1.727699531Ui - 1.79107912.


Now go back
transformation or  replace  Ui by  (Xi-30)/5 and Vi =
(Yi-310)/10.


Therefore,


(Yi
-310)/10 = 1.727699531(Xi-30)/5  - 1.79107912. Or


Yi =
3.455399062 Xi  + 310 -  1.727699531*30*10/5 
-17.9107912


Yi = 3.455399062Xi + 188.4272369 is the
required equation by the method of least square..


The
estimaied values of Yi 's are: for X= 5, Y = 205.70.
Or


(05, 205.70)


(15 ,
249.26)


(30 , 292.09)


(50 ,
361.20)


(60 , 395.75).

No comments:

Post a Comment

Comment on the setting and character of "The Fall of the House of Usher."How does setting act as a character?

Excellent observation, as it identifies how the settings of Poe's stories reflect the characters of their protagonists. Whet...