You are on page 1of 21

Chapter 13: Time Series Models

Outcomes of learning
Calculate
o Moving averages
o Exponentially Smoothed Values

Plot the graphs of


o Moving Averages
o Exponentially Smoothed Values

Forecast future values


Identify buying and selling signals in stock prices
Choose the best forecasting model

Most of the financial data are recorded at different points of time. These data are known as time
series data. Table 12.1 shows an example of time series data. It is recorded annually, and therefore is
an annual time series data. Other frequencies: quarterly, monthly, weekly, daily.

Table 12.1: Malaysian Money Demand Data


M2
Money Demand M2
(M2) in Millions Money Demand (M2)
Year Ringgit Year in Millions Ringgit
1969 3718.500 1988 64072.100
1970 4122.300 1989 74392.800
1971 4668.200 1990 83902.900
1972 7551.900 1991 96092.500
1973 7551.900 1992 114481.000
1974 8713.900 1993 139800.000
1975 9981.500 1994 160366.000
1976 12748.200 1995 198873.000
1977 14819.000 1996 238209.000
1978 17466.500 1997 292217.000
1979 21706.400 1998 296472.000
1980 27991.800 1999 337138.000
1981 32772.700 2000 354702.000
1982 37899.900 2001 362512.000
1983 42264.100 2002 383542.000
1984 47733.200 2003 426061.000
1985 50412.200 2004 534163.000
1986 56096.800 2005 616178.000
1987 59771.700 2006 718216.000
Figures 12.1 and 12.2 show the plots of the Malaysian Money Demand for different sample periods.

Figure 12.1: Malaysian Money Demand (1965 – 2006)

800000.000
Malaysian Money Demand (1980-2006)

700000.000
Malaysia Money Demand (Millions Ringgit)

600000.000

500000.000

400000.000

300000.000

200000.000

100000.000

0.000
1975 1980 1985 1990 1995 2000 2005 2010
Year

Over the long run, there is a linear increasing trend.


Movement of the series is predictable.

800000.000 Malaysian Money Demand (1980-2006)

700000.000
Malaysia Money Demand (Millions Ringgit)

600000.000

500000.000

400000.000

300000.000

200000.000

100000.000

0.000
1975 1980 1985 1990 1995 2000 2005 2010
-100000.000

-200000.000
Year
Some data are lying outside the straight line due to random variations/disturbances – irregular
changes that are not following the long-term trend.

800000.000 Malaysian Money Demand (1969-2006)

700000.000
Malaysia Money Demand (Millions Ringgit)

600000.000

500000.000

400000.000

300000.000

200000.000

100000.000

0.000
1965 1970 1975 1980 1985 1990 1995 2000 2005 2010
Year

over the long run, there is a linear increasing curvilinear trend.


Movement of the series is predictable.

900000.000 Malaysian Money Demand (1969-2006)

800000.000
Malaysia Money Demand (Millions Ringgit)

700000.000

600000.000

500000.000

400000.000

300000.000

200000.000

100000.000

0.000
1965 1970 1975 1980 1985 1990 1995 2000 2005 2010
Year
random variations/disturbances are again observed.
 Long-term trend is less clear for higher frequency data.
 Movement/Behavior of these series are less obvious/predictable.
 Need the help of time series models to trace/capture the movement.
 Time Series Models:
o Moving Average
o Exponential Smoothing
o Autoregressive Process

12.2 Moving Average

A financial analysis tool that shows the average value of a security’s price over a period of time.
Use to smooth out the random variation so as to uncover the direction of a trend in the time series.
To compute the three-period moving average for any time period:

Vt 1  Vt  V t 1
3

where
Vt = Value of the time series at that time
Vt-1 = Value in the previous time period
Vt+1 = Value in the following time period

Time Period Stock Price 3-Period Moving Average


1965 27 -
1966 17.3 (27+17.3+32.5)/3=25.6
1967 32.5 (17.3+32.5+42.8)/3=30.9
1968 42.8 39.1
1969 42.0 44.1
1970 47.4 32.5
1971 8.2 27.8
1972 27.7 25.6
1973 41 29.3
1974 19.2 27.8
1975 23.1 -
 The MA is placed at the center of the group of values being averaged.
 To compute the 5-period MA,
o Obtain the average value of 5 consecutive values and place the MA in the center of
the group of values.
Time Period Stock Price 5-Period Moving Average
1965 27
1966 17.3
1967 32.5 34.8
1968 42.8 31.7
1969 42 33.4
1970 47.4 34.9
1971 8.2 30.9
1972 27.7 27.8
1973 41 23.8
1974 19.2
1975 23.1

4-period MA
Time Period Stock Price 4-Period 4-Period Centered Moving
Moving Average
Average
1965 27

1966 17.3
29.9
1967 32.5 (29.9+33.7)/2=31.8
33.7
1968 42.8 37.4
41.2
1969 42 38.1
35.1
1970 47.4 33.2
31.3
1971 8.2 31.2
31.1
1972 27.7 27.6
24.0
1973 41 25.9
27.8
1974 19.2

1975 23.1

 The moving averages fall in between the time periods.


 Creating various problems – graphing difficulty.
 Centering the moving averages corrects the problem.
 Compute the 2-period MA of the Moving averages.
Commonly use moving average in analysis the movement of daily stock prices

 30-day MA, 50-day MA and 100-day MA.


 Different time span tell different story.
 The shorter the time span, the more sensitive the MA will be to prices changes.
 The longer the time span, the less sensitive or the more smoothed the MA will be.
 The choice of time frame is subjective.

1400

1200

1000

800
Series1
600 30 per. Mov. Avg. (Series1)

400

200

0
16
31
46
61
76
91
106
121
136
151
166
181
196
211
226
241
256
271
286
1
0
0

200
400
600
800
1000
1200
1400
200
400
600
800
1000
1200
1400

1 1
11 11
21 21
31 31
41 41
51 51
61 61
71 71
81 81
91 91
101 101
111 111
121 121
131 131
141 141
151 151
161 161
171 171
181 181
191 191
201 201
211 211
221 221
231 231
241 241

Series1
251 251
Series1

261 261
271 271
281 281
291 291

2 per. Mov. Avg. (Series1)


50 per. Mov. Avg. (Series1)

100 per. Mov. Avg. (Series1)


Usefulness of Moving Average
 Forecast future values
o The last MA value is the predicted value for the future.
 Determine the direction of the long-term trend
 Identify turning point/reversal.
 Benchmark for trading strategy.

o Crossovers:
 When the price moves below the moving average, it is expected to fall-selling signal,
sell the stock, if any, before you lose your investment.

1400

1200

1000

800
Series1
600 50 per. Mov. Avg. (Series1)

400

200

0
16
31
46
61
76
91
106
121
136
151
166
181
196
211
226
241
256
271
286
1

 When the price protrudes the moving average, it is expected to rise- buying signal

 Crossovers may not always give correct signals.

Filters:
 Filtering is used to increase our confidence about a signal/an indicator.
 One may wait until the price crosses above the MA and is at least 10% above the MA to
make sure that it is a true crossover.

 Setting the percentile to high could result in “missing the boat” and buying the stock at the
peak.
Double crossovers
 When shorter MA crosses the longer MA from above, it is a strong sign of selling signal (price
is going to fall).
1150

1100

1050

1000
Series1
30 per. Mov. Avg. (Series1)
950
100 per. Mov. Avg. (Series1)

900

850

800
13
19
25
31
37
43
49
55
61
67
73
79
85
91
97
103
109
115
121
127
133
139
1
7

 When shorter MA crossovers the longer MA from below, it is a strong sign of buying signal
(price is going to rise).
1150

1100

1050

1000
Series1
30 per. Mov. Avg. (Series1)
950
50 per. Mov. Avg. (Series1)

900

850

800
17
33
49
65
81
97
1

113
129
145
161
177
193
209
225
241
257
273
289
305
321
Tripple Crossovers

 For extra insurance.


 The shortest moving average must pass through the two higher ones.
 Even stronger signal.
1150

1100

1050

1000 Series1
30 per. Mov. Avg. (Series1)
950 50 per. Mov. Avg. (Series1)
100 per. Mov. Avg. (Series1)
900

850

800
18
35
52
69
86
103
120
137
154
171
188
205
222
239
256
273
290
307
1

Using Excel to compute MA


Press Enter

Copy
Use Excel to Plot MA

Plot the data

Point to any part of the graph, right click the mouse


1400

1200

1000

800
Series1

600 30 per. Mov. Avg. (Series1)

400

200

0
11
16
21
26
31
36
41
46
51
56
61
66
71
76
81
86
91
96
1
6
Excel Built-in function for MA
Note: the first value is placed at the end of the group of 3.
12.3 Exponential Smoothing

2 drawbacks of moving average method:


Do not have MAs for the first and last sets of data – loss of important information.
MA “forgets” most of the previous time-series values.
The 3-year moving average for year 2000 depends on the values in year 1999, 2000
and 2001. Values in year 1998 and before have no influence on this MA.

Exponential Smoothing
Addresses the above problems.
Takes into account of all previous observations.
Assigns more weight to the latest observations.
Also known as Exponential Smoothing Moving Average or Exponential Moving
Average (EMA).
(the MA we previously study is also known as Simple Moving Average).

EMA formula

St  wyt  (1  w)St 1 , (for t  2)

Where
St = Exponential smoothed time series at time t
Yt = Time series at time t
St-1 = Exponentially smoothed time series at time t-1
W= Smoothing constant, where 0  w  1

Note: Set St  y t
S2  wy2  (1  w)St
S3  wy3  (1  w )wy2  (1  w ) y t 
S3  wy3  w (1  w ) y 2  (1  w ) 2 y t


S4  wy4  (1  w ) wy3  w (1  w ) y 2  (1  w ) 2 y t 
S3  wy4  w (1  w ) y 3  w (1  w ) 2 y 2  (1  w ) 3 y t

Smoothing constant w is chosen on the basis of how much smoothing is required.


The smaller the w, the smoother is the resulted series.
Time Period Stock Price w=0.3 w=0.8
1965 27 27 27
1966 17.3 0.3(17.3)+0.7(27)=24.1 19.2
1967 32.5 0.3(32.5)+0.7(24.1)=26.6 29.8
1968 42.8 0.3(42.8)+0.7(26.6)=31.5 40.2
1969 42 34.6 41.6
1970 47.4 38.5 46.2
1971 8.2 29.4 15.8
1972 27.7 28.9 25.3
1973 41 32.5 37.9
1974 19.2 28.5 22.9
1975 23.1 26.9 23.1

(1-w) = damping factor.


The larger the damping factor, the smoother will be the resulted series.
For w =0.3, damping factor =0.7.
For w =0.8, damping factor = 0.2.
Usefulness of EMA
 Similar to MA.
 Forecasting – the last EMA is the predicted future values
 Trace the direction of trend
 Identify the reversal
 Trading strategies.

EMA with w =0.8 represents a shorter term trend


EMA with w=0.2 represents a longer term trend

The longer term trend is smoother.

Buying signal –shorter term trend cuts the longer term trend from below.

Selling signal – shorter term trend cuts the longer term trend from above.
Forecasting

One of the main objectives of modelling a financial series is to forecast/predict the future values of
the series.

Normally, a financial analyst will estimate a few models for the same set of data, and then choose
the bet model for the purpose of forecasting, based on certain objective criteria.

Few commonly used forecast accuracy criteria include:

Mean Absolute Error

y t  ŷ t
M AE  t 1

Mean Absolute Percentage Error


n y t  ŷ t
 t 1 yt
MAPE   100%
n
Root Mean Square Error
n

 y  ŷ t 
2
t
RMSE  t 1
 100%
n
Among a group of models, the model with the smallest values of MAE, RMSE or MAPE is regarded as
the best (most accurate) model.

y t  ŷ t  y t  ŷ t  2
Time actual Forecasted (3-period y  ŷ
t t
Period MA)
y t

1966 17.3 25.6 8.3 68.89 0.479769


1967 32.5 30.9 1.6 2.56 0.049231
1968 42.8 39.1 3.7 13.69 0.086449
1969 42 44.1 2.1 4.41 0.05
1970 47.4 32.5 14.9 222.01 0.314346
1971 8.2 27.8 19.6 384.16 2.390244
1972 27.7 25.6 2.1 4.41 0.075812
1973 41 29.3 11.7 136.89 0.285366
1974 19.2 27.8 8.6 73.96 0.447917
average 8.066666667 101.22 0.464348
Forecast Accuracy
Criterion MAE RMSE MAPE
y t  ŷ t  y t  ŷ t  2
Time actual Forecasted (3-period y  ŷ
t t
Period MA)
y t

1966 17.3
1967 32.5 34.8 2.3 5.29 0.070769
1968 42.8 31.7 11.1 123.21 0.259346
1969 42 33.4 8.6 73.96 0.204762
1970 47.4 34.9 12.5 156.25 0.263713
1971 8.2 30.9 22.7 515.29 2.768293
1972 27.7 27.8 0.1 0.01 0.00361
1973 41 23.8 17.2 295.84 0.419512
1974 19.2
average 10.64285714 167.1214286 0.570001
Forecast Accuracy
Criterion MAE RMSE MAPE

The 3-period MA has a smaller MAE value as compared to the 5-period MA. Thus, by the MAE
forecast accuracy criteria, 3-period MA model is more accurate than the 5-period moving average
model. This conclusion is supported by the RMSE and MAPE criterion. S, 3-period MA model should
be chosen to forecast the future value of stock price.

You might also like