In: Physics
The following table shows the average stock price, in dollars, of XYZ Corporation in the given month.
Month | Stock price |
---|---|
January 2011 | $43.73 |
February 2011 | $44.23 |
March 2011 | $44.42 |
April 2011 | $45.21 |
May 2011 | $45.92 |
(a) Find the equation of the regression line. (Let P be
the stock price in dollars and t the time in months since
January, 2011. Round the regression coefficients to three decimal
places.)
P(t) =
For the given data
Month | Stock Price |
Jan-11 | 43.73 |
Feb-11 | 44.23 |
Mar-11 | 44.42 |
Apr-11 | 45.21 |
May-11 | 45.92 |
a. let equation of the regression line be y = mx + c
here y represents the stock price and x represents number of months
from January, hence January being 1
so,
From the data
y'(1) = 43.73
y'(2) = 44.23
y'(3) = 44.42
y'(4) = 45.21
y'(5) = 45.92
also,
y(1) = m + c
y(2) = 2m + c
y(3) = 3m + c
y(4) = 4m + c
y(5) = 5m + c
to minimise the error
E = (y'(1) - y(1))^2 + (y'(2) - y(2))^2 + (y'(3) - y(3))^2 + (y'(4)
- y(4))^2 + (y'(5) + y(5))^2 has to be minimised
E = (43.73 - m - c)^2 + (44.23 - 2m - c)^2 + (44.42 - 3m - c)^2 +
(45.21 - 4m - c)^2 + (45.92 - 5m - c)^2 has to be minimised
hence
dE/dm = 0 and dE/dc = 0
dE/dm = -2(43.73 - m - c) - 4(44.23 - 2m - c) - 6(44.42 - 3m - c) -
8 (45.21 - 4m - c) - 10(45.92 - 5m - c) = 0
dE/dc = -2[(43.73 - m - c) + (44.23 - 2m - c) + (44.42 - 3m - c) +
(45.21 - 4m - c) + (45.92 - 5m - c)] = 0
223.51 - 15m - 5c = 0
and
1351.78 = 110m + 30c
c = (1351.78 - 110m)/30
223.51*6 - 1351.78= 15m*6 - 110 m
m = 0.5359 , c = 43.09436666666
hence the equation fo regression is
P(t) = 0.5359*t + 43.094
P(0) = 43.094
P(1) = 43.6299
P(2) = 44.1658
P(3) = 44.7017
P(4) = 45.2376
P(5) = 45.7735
this is clsoe to our data