The Method of Least Squares Lecture 05

 The Method of Least Squares 

Lecture 05

Introduction

The method of least squares is applicable when there is a strong association between time series observations. demonstrating a trend towards increment or decrement as time increases. This method is suitable for a reliable forecast value.

The principle of least squares is used when the trend is linear or non-linear.

Linear Trend

If time is treated as an independent variable, a mathematical equation in the shape of a straight line, a parabola, or an exponential can be used to calculate the secular trend. Let's assume that the secular trend is linear. Then the equation of the least squares linear trend would be

Y^t = a + b t

The following two normal equations are used to estimate the parameters of the above-stated model.

Yt = na + b t

t Yt = a t + b 

If the time variable (t) is coded by taking the time deviation from the middle point of the time period.

then t = 0

a = Yt / n

b = t Yt / 

When the secular trend of a time series graph appears to be a curve, then a parabola of second or third degree or a curve of some other type, such as the exponential, modified exponential, etc., is to be used.

The second degree of parabola

Y^t = a + b t + c t² 

The following three normal equations are used to estimate the parameters of the above-stated model.

 na + b t + c ∑t² = Yt
 a ∑t + b t² + c ∑t³ = ∑t Yt
a ∑ t² + b t³ +  c ∑t⁴ = ∑t² Yt
The simple criterion is that the curve will be best fit, for which ∑(Yt - Y^t)² is minimum.

Practice Question

Determine the trend line by straight-line equation from the following data.

Year

1991

1992

1993

1994

1995

1996

1997

Sale (00,000,000)

21

24

28

18

20

16

25

 Solution: Assign 0 to 1994

a = Yt / n

a = 152 / 7

a = 21.71

b = t Yt / 

b = -12 / 28

b = -0.4285

The estimated model

Y^t = a + b t

Y^t = 21.71- 0.4285 t


Practice Question

Fit a second-degree equation to the following data and find the trend line.

Year

1985

1986

1987

1988

1989

Values

125

160

150

135

170

Solution:

Year

Yt 

t 

Yt 

 

t² Yt 

t³  

t⁴

1985

125

-2

-250

4

500

-8

16

1986

160

-1

-160

1

160

-1

1

1987

150

0

0

0

0

0

0

1988

135

+1

135

1

135

+1

1

1989

170

+2

340

4

680

+8

16

 

740

0

65

10

1475

0

34


 na + b t + c ∑t² = Yt
 a ∑t + b t² + c ∑t³ = ∑t Yt
a ∑ t² + b t³ +  c ∑t⁴ = ∑t² Yt

 5a + 10c = 740
10b = 65
10a a + 34c = ∑t² Yt
b = 6.5
c = -0.357
a = 148.714
The estimated equation
Y^t = 148.714 + 6.5 t - 0.357 t² 

Non-Linear Trend

Exponential Curve

yt = a b^t

The log operator is used to transform the non-linear model into a linear model. 

log10 yt = a + t log10 b


Yt = A + t B


Where:

Yt = log yt, A = log a, and B = log b.

The following equations are used to estimate the transform model parameters.

nA + B t = Yt


A  t + B ∑t² = ∑t Yt

The estimated model is given by:

Y^t = A + Bt

Re-transform the model by taking anti-log.

Practice Question

The GDP grows exponentially with time, as given below:

Year

0

1

2

3

4

5

6

7

8

9

GDP

20.3

21.6

28.5

30.5

30.5

31.5

41.5

44.5

46.8

45.3


Solution:

Year

yt

Yt = log10 yt 

 

t Yt 

Yt² 

0

20.3

1.307496

0

0

1.709546

1

21.6

1.334454

1

1.334454

1.780767

2

28.5

1.454845

2

2.90969

2.116574

3

30.5

1.4843

9

4.4529

2.203146

4

30.5

1.4843

16

5.937199

2.203146

5

31.5

1.498311

25

7.4915533

2.244935

6

41.5

1.618048

36

9.708289

2.61808

7

44.5

1.64836

49

11.53852

2.717091

8

46.8

1.670246

64

13.36197

2.789721

9

45.3

1.65098

81

14.90488

2.742661

45

 

15.15646

285

71.63945

23.12567


nA + B t = Yt


A  t + B ∑t² = ∑t Yt


10 A + 45 B  = 15.15646


45 A + 285 B  = 71.63945


450A + 2025B = 682.0407

450A A + 2850B = 716.3945


825B = 34.3538

B = 0.04

A = 1.13446

The estimated model

Y^t = A + t B

Y^t = 1.13446 + 0.04 t

Re-transformed the model by taking anti-log


anti-log Y^t = anti-log (1.13446 + 0.04 t)


yt = a b^t

yt = 21.26 (0.04)^t

No comments:

Post a Comment

Moving Average Models (MA Models) Lecture 17

  Moving Average Models  (MA Models)  Lecture 17 The autoregressive model in which the current value 'yt' of the dependent variable ...