Note 2
Note 2
𝒚 = 𝜷𝒐 + 𝜷𝟏 𝒙 + 𝜺
• 𝜀 is an error term and accounts for deviations of the actual data from the straight
𝑖𝑖𝑑
line specified by the model equation. 𝜀 𝑁 0, 𝜎 & .
~
5
´ linear regression models because they are linear in the unknown parameters
(the 𝛽 ' 𝑠), and not because they necessarily describe linear relationships between
𝒚 = 𝜷𝒐 + 𝜷𝟏 𝒙𝟏 + 𝜷𝟐 𝒙𝟐 + ⋯ +𝜷𝒌 𝒙𝒌 + 𝜺
𝒚 = 𝜷𝒐 + 𝜷𝟏 𝒙 + 𝜷𝟐 𝒙𝟐 + 𝜺
𝑦! = 𝛽" + 𝛽# 𝑡 + 𝜀 ; 𝑡 = 1,2, … , 𝑛.
Where:
and 𝜀 is an error term and accounts for deviations of the actual data from the straight line
𝑖𝑖𝑑
specified by the model equation. 𝜀 𝑁 0, 𝜎 $ .
~
7 Notes:
´ The general form of the trend model is:
𝑦* = 𝑓(𝑡) + 𝜀+
Where 𝑓(𝑡): is a function that can have various forms, such as, linear, quadratic ,
exponential…etc.
´ For non-liner trend, for example quadratic trend, we might consider using 𝑡
both and 𝑡 & .
8
4 𝑡 𝑦! = 𝛽" 4 𝑡 + 𝛽# 4 𝑡 $
we get:
% ∑ !'! (∑ ! ∑ '!
𝑏# = % ∑ !"( ∑ ! "
𝑏" = 𝑦6! − 𝑏# 𝑡̅
Where:
∑ 𝑦! ∑𝑡
𝑦6! = 𝑎𝑛𝑑 𝑡̅ =
𝑛 𝑛
11 Notes:
´ Estimate the trend equation of the following time series, and predict
the trend in 2013? Plot the data? (Assume that it is a linear trend)
50
45
40
35
yt
30
25
20
Year
17 Regression Approach Using Matrix Notations
Where :
𝑿𝒕 :is an (𝑛×2) matrix of the levels of the regressor variables ( the elements of
its first column are all equal to one, and the elements of its second column are
values of the time units 1,2,3, … , 𝑛)
𝜀7
𝛽: 𝜀8
𝛽6 = ; 𝜀6 = ⋮
𝛽7 8×7
𝜀9 9×7
To estimate the regression coefficient using the least square method we multiply the
20 regression equation
𝑦 = 𝑿𝛽
Where
1 1 … 1
𝑿8 = ,
1 2 … 𝑛 #×:
21 1 1 𝑛 <𝑡
1 1 … 1 1 2
𝑿8 𝑿 = ⋮ ⋮ =
1 2 … 𝑛 #×:
1 𝑛 :×#
<𝑡 < 𝑡#
#×#
and
:
𝑦! < 𝑦"
1 1 … 1 𝑦# ";!
𝑿8 𝑦 = ⋮ = :
1 2 … 𝑛 #×:
𝑦: :×! < 𝑡𝑦"
";! #×!
Then equation (1) become:
22
:
< 𝑦" 𝑛 <𝑡
";! 𝛽<
: =
𝛽! #×!
< 𝑡𝑦" <𝑡 < 𝑡#
";! #×! #×#
Then multiply both sides of Eq. (1) by 𝑿8 𝑿 =! (the inverse of 𝑿8 𝑿) from the
left (we assume that this inverse exists), where
23
< 𝑡# −<𝑡
1
𝑿8 𝑿 =! = #
𝑛 ∑ 𝑡# − ∑ 𝑡 −<𝑡 𝑛
#×#
and its known that
(𝐴)=!𝐴 = 𝐼
∴ 𝑿8 𝑿 =! 𝑿8 𝑿 = 𝑰
𝛽C = 𝑿8 𝑿 =! 𝑿8 𝑦
24 The fitted values of the response variable from the regression model are
computed from
𝑦$ = 𝑿𝛽C
and the residuals ( the difference between the actual observation y; and the
corresponding fitted value) can be written as an 𝑛×1 vector denoted by
𝒆 = 𝑦 − 𝑦$ = 𝒚 − 𝑿𝛽C
25 Predication methods of new observations
Point forecasts: which is the estimate of the possible future values at the point
𝑡< and is computed by
𝑦$ 𝑿< = 𝑿8𝒐 𝛽C
where
1
𝑿< = ; 𝑿8𝒐 = 𝟏 𝒕𝒐
𝑡<
´ Prediction Interval (PI): giving a range of future values the random variable
26
could take with relatively high probability. Therefore, a 100 1 − 𝛼 percent
predication interval for the future observation at the point 𝑡< is given by
where
and
∑$ 0
!"# A! =A
%
S=
:=#
27 Notes:
´ Confidence interval (CI): is an interval estimate on the mean of the
response distribution at a specific point. while the Prediction
Interval (PI ) is an interval estimate on a single future observation
from the response distribution at that point.
6 21 1 91 −21
𝑿) 𝑿 = ;∴ 𝑿) 𝑿 (# =
21 91 $×$ 105 −21 6
175
𝑿) 𝑦 =
695
1 91 −21 175
∴ 𝛽: =
105 −21 6 695
1 1330 12.67
𝛽: = =
105
495 4.71
30 ´ Thus, trend regression model is:
P𝒕 = 𝟏𝟐. 𝟔𝟕 + 𝟒. 𝟕𝟏 𝒕
𝒚
4. Prediction interval:
1
𝑿< = ; 𝑿8𝒐 = 𝟏 𝟖
8
1
𝑿8𝒐 𝑿8 𝑿 =! = −77 25
105
𝑿8𝒐 𝑿8 𝑿 =! 𝑿
< = 𝟏. 𝟏𝟕
31 81.9059
S= = 20.476 = 4.525
4
Then ,
That is, 95% that the number of births in 2017 falls between 31.83 and 68.87.
32