Upload
mimie-liz
View
245
Download
0
Embed Size (px)
Citation preview
8/7/2019 Chapter 13 FM
1/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 isan annual time series data. Other frequencies: quarterly, monthly, weekly, daily.
Table 12.1: Malaysian Money Demand Data
Year
M2
Money Demand
(M2) in Millions
Ringgit Year
M2
Money Demand (M2)
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
8/7/2019 Chapter 13 FM
2/21
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)
Over the long run, there is a linear increasing trend.
Movement of the series is predictable.
0.000
100000.000
200000.000
300000.000
400000.000
500000.000
600000.000
700000.000
800000.000
1975 1980 1985 1990 1995 2000 2005 2010
MalaysiaM
oneyDemand(MillionsRinggit)
Year
Malaysian Money Demand (1980-2006)
-200000.000
-100000.000
0.000
100000.000
200000.000
300000.000
400000.000
500000.000
600000.000
700000.000
800000.000
1975 1980 1985 1990 1995 2000 2005 2010MalaysiaMoneyDeman
d(MillionsRinggit)
Year
Malaysian Money Demand (1980-2006)
8/7/2019 Chapter 13 FM
3/21
Some data are lying outside the straight line due to random variations/disturbances irregular
changes that are not following the long-term trend.
over the long run, there is a linear increasing curvilinear trend.
Movement of the series is predictable.
random variations/disturbances are again observed.
0.000
100000.000
200000.000
300000.000
400000.000
500000.000
600000.000
700000.000
800000.000
1965 1970 1975 1980 1985 1990 1995 2000 2005 2010
MalaysiaM
oneyDemand(MillionsRinggit)
Year
Malaysian Money Demand (1969-2006)
0.000
100000.000
200000.000
300000.000
400000.000
500000.000
600000.000
700000.000
800000.000
900000.000
1965 1970 1975 1980 1985 1990 1995 2000 2005 2010
MalaysiaMoneyDeman
d(MillionsRinggit)
Year
Malaysian Money Demand (1969-2006)
8/7/2019 Chapter 13 FM
4/21
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 Smoothingo Autoregressive Process
12.2 Moving Average
A financial analysis tool that shows the average value of a securitys 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:
3
VVV 1tt1t
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 -
8/7/2019 Chapter 13 FM
5/21
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 271966 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
Moving
Average
4-Period Centered Moving
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.01973 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.
8/7/2019 Chapter 13 FM
6/21
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.
0
200
400
600
800
1000
1200
1400
116
31
46
61
76
91
106
121
136
15
1
166
181
196
211
226
241
25
6
27
1
286
Series1
30 per. Mov. Avg. (Series1)
8/7/2019 Chapter 13 FM
7/21
0
200
400
600
800
1000
1200
1400
111
21
31
41
51
61
71
81
91
101
111
121
131
141
15
1
161
17
1
181
191
201
211
221
231
241
25
1
261
27
1
281
291
Series1
50 per. Mov. Avg. (Series1)
0
200
400
600
800
1000
1200
1400
111
21
31
41
51
61
71
81
91
101
111
121
131
141
15
1
161
17
1
181
191
201
211
221
231
241
25
1
261
27
1
281
291
Series1
2 per. Mov. Avg. (Series1)
100 per. Mov. Avg. (Series1)
8/7/2019 Chapter 13 FM
8/21
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.
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.
0
200
400
600
800
1000
1200
1400
116
31
46
61
76
91
106
121
136
15
1
166
181
196
211
226
241
25
6
27
1
286
Series1
50 per. Mov. Avg. (Series1)
8/7/2019 Chapter 13 FM
9/21
Double crossovers
When shorter MA crosses the longer MA from above, it is a strong sign of selling signal (price
is going to fall).
When shorter MA crossovers the longer MA from below, it is a strong sign of buying signal
(price is going to rise).
800
850
900
950
1000
1050
1100
1150
1 713
19
25
31
37
43
49
55
61
67
73
79
85
91
97
103
109
115
121
127
133
139
Series1
30 per. Mov. Avg. (Series1)
100 per. Mov. Avg. (Series1)
800
850
900
950
1000
1050
1100
1150
117
33
49
65
81
97
113
129
145
161
177
193
209
225
241
257
27
3
289
305
321
Series1
30 per. Mov. Avg. (Series1)
50 per. Mov. Avg. (Series1)
8/7/2019 Chapter 13 FM
10/21
Tripple Crossovers
For extra insurance.
The shortest moving average must pass through the two higher ones.
Even stronger signal.
Using Excel to compute MA
800
850
900
950
1000
1050
1100
1150
118
35
52
69
86
103
120
137
15
4
17
1
188
205
222
239
25
6
27
3
290
307
Series1
30 per. Mov. Avg. (Series1)
50 per. Mov. Avg. (Series1)
100 per. Mov. Avg. (Series1)
8/7/2019 Chapter 13 FM
11/21
Press Enter
Copy
8/7/2019 Chapter 13 FM
12/21
Use Excel to Plot MA
Plot the data
Point to any part of the graph, right click the mouse
8/7/2019 Chapter 13 FM
13/21
8/7/2019 Chapter 13 FM
14/21
0
200
400
600
800
1000
1200
1400
1 611
16
21
26
31
36
41
46
51
56
61
66
71
76
81
86
91
96
Series1
30 per. Mov. Avg. (Series1)
8/7/2019 Chapter 13 FM
15/21
Excel Built-in function for MA
8/7/2019 Chapter 13 FM
16/21
Note: the first value is placed at the end of the group of 3.
8/7/2019 Chapter 13 FM
17/21
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, 2000and 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
1ttt S)w1(wyS , )2tfor(
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 1w0
Note: Set tt yS
t22 S)w1(wyS
t
2
233
t233
y)w1(y)w1(wwyS
y)w1(wy)w1(wyS
t
3
2
2
343
t
2
2344
y)w1(y)w1(wy)w1(wwyS
y)w1(y)w1(wwy)w1(wyS
Smoothing constant w is chosen on the basis of how much smoothing is required.
The smaller the w, the smoother is the resulted series.
8/7/2019 Chapter 13 FM
18/21
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.21969 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.
8/7/2019 Chapter 13 FM
19/21
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.
8/7/2019 Chapter 13 FM
20/21
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 choosethe bet model for the purpose of forecasting, based on certain objective criteria.
Few commonly used forecast accuracy criteria include:
Mean Absolute Error
n
yy
MAE
n
1t
tt
Mean Absolute Percentage Error
%100n
y
yy
MAPE
n
1t t
tt
Root Mean Square Error
%100
n
yy
RMSE
n
1t
2
tt
Among a group of models, the model with the smallest values of MAE, RMSE or MAPE is regarded as
the best (most accurate) model.
Time
Period
actual Forecasted (3-period
MA)
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.3902441972 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
tt yy 2tt yy t
tt
y
yy
8/7/2019 Chapter 13 FM
21/21
Time
Period
actual Forecasted (3-period
MA)
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.
tt yy 2tt yy t
tt
y
yy