Beruflich Dokumente
Kultur Dokumente
Outcomes of learning
Calculate
o Moving averages
o Exponentially Smoothed Values
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.
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
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.
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
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
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
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
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
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
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
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
Copy
Use Excel to Plot MA
1200
1000
800
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
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
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
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.
y t ŷ t
M AE t 1
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
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.