Title: Week 6 objectives
1Week 6 objectives
- 1. The general time series model
- 2. Trend, seasonal, cyclic and error components
- 3. Detrending and deseasonalisation using Minitab
- 4. Estimating a smooth cyclic pattern
- 5. Forecasting
- 6. Multiplicative and additive deseasonalisation
2Time Series Plot
A time series is a series of values of a
numerical variable, recorded at equally spaced
time points
Minitab command Graph gt Time Series Plot
31. The general time series model
(similar to a multiple linear regression model)
Observe , i 1, 2, ... , n, where T, S
and C stand for 'trend', 'seasonal' and 'cyclic
terms respectively. Trend steady increase or
decrease Seasonal regular, periodic pattern over
eg months or quarters in a year, days in a week,
etc Cyclic smooth fluctuations of irregular
sizes and longer periods
4Terminology for seasonal effects
- A period consists of a number of seasons with
the same pattern recurring in each period - So the seasons could be months within a
period of a year - Or the seasons could be days within a period
of a week - Or possibly quarters within a year, etc
5Lecture exercise 1
Which components are present?
- a trend?
- a seasonal pattern?
- how many seasons within a period?
- any underlying cycles?
6Lecture exercise 2 quarterly data
Which components are present?
- a trend?
- a seasonal pattern?
- how many seasons within a period?
- any underlying cycles?
7Fitting a Time Series Model
A two-stage approach 1. Fit trend and seasonal
terms using linear regression or a related
method 2. Fit the cyclic term by carrying out a
smoothing operation, (for example moving
averages), on the residuals "left over" from
stage 1.
8Using Minitab to fit Time Series Models - Stage 1
(These steps will be needed for the Assignment)
Use Stat gt Time Series gt Decomposition. Select
Additive under "Model Type", either Trend plus
seasonal or Seasonal only under "Model
Components" and choose among output options.
Under "Storage", if the Residuals box is ticked,
Minitab will store the residuals in a column
"RESI", after fitting the model. "RESI" can then
be re-used for smoothing to estimate the cyclic
components.
9Minitab output for Stage 1
- Trend line
- Seasonal indices
- Boxplots of data, residuals (both indexed by
season) - Time series plots of original data
deseasonalised data (seasonally
adjusted) detrended data both detrended
and deseasonalised data - Which of these plots is used to estimate
underlying cycles?
10Lecture example 2
Time series analysis of a quarterly record of
building starts
11Stage 1 Time series plots
12Stage 1 Boxplots of data and residuals
13Stage 1 Trend line and Seasonal Indices
Building Starts example Trend Line Equation Yt
139.3994.30408t Seasonal Indices Period
Index 1 -17.8125 2
1.31250 3 10.1875 4
6.31250
14Interpreting coefficients
- The coefficient of slope is interpreted as in
linear regression, after seasonal effects have
been removed - Similarly, the seasonal coefficients are
interpreted as the difference of average
responses for particular seasons from the overall
average within a period, after trend effects have
been removed - To de-trend, Minitab subtracts the trend line
equation from the original data series - To de-seasonalise, Minitab subtracts seasonal
coefficients from the original data - Note all this is for additive de-seasonalisation
15Interpreting trend in Building Starts example
Trend Line Equation Yt139.3994.30408t
The estimate of slope in the trend line suggests
that, if the seasonal effects have been removed,
the number of building starts is expected to
increase by 4 per quarter on average. Note we
do not interpret the intercept.
16Interpreting seasonal coefficients in Building
starts example
The estimated seasonal index for the 2nd quarter
is 1.31. This means that on average, if trend
effects have been removed, the average number of
building starts for the 2nd quarter is expected
to be 1.3 more than annual average.
Seasonal Indices Period Index 1
-17.8125 2 1.31250 3
10.1875 4 6.31250
Lecture exercise 3 How would you interpret the
estimated seasonal index for the first quarter?
17Stage 2 Methods for smoothing the residuals
18Methods for smoothing the residuals
Moving averages the MA(k) method is a series of
averages of k successive readings. e.g. MA(3)
19Methods for smoothing the residuals
Moving averages the MA(k) method is a series of
averages of k successive readings. e.g. MA(4)
20Methods for smoothing the residuals
21Methods for smoothing the residuals
Exponential smoothing also averages, but from
the present, backwards in time, and gives more
weight to the current observation than to those
in the past
- Where Ea ?ea (1- ?) Ea-1
- ea is the residual at time a
- Ea is the exponentially smoothed value at time a
- A is an assigned weight between 0 and 1
- E1 e1
22An example of the exponential smoothing when ?
0.8
Ea ?ea (1- ?) Ea-1 0.8ea (1- 0.8) Ea-1
23Moving averages pros and cons
- a simple method
- the effect of having k too large
(oversmoothing) or k too small (undersmoothing)
is understandable - - a piece of the series is lost at each end
- - so MA is not suitable for forecasting and
prediction
24Exponential smoothing pros and cons
- Better for prediction than MA
- - A parameter called alpha (?) needs to be
chosen. This measures the relative weight given
to the present observation compared to the past
observations - - The lower the value of alpha, the more
smoothing is used - - There is an in-built lag, which shifts any
pattern to the right
25After detrending and deseasonalising, smoothing
to estimate a smooth underlying cycle
Building Starts Example Stage 2
- Minitab command
- StatgtTime SeriesgtMoving average.
- Select the residuals column stored from the
decomposition stage, say RESI1, as Variable,
enter 8 as MA length, tick Center the moving
averages, and then tick Plot smoothed vs. actual
under Results.
26Building Starts Example Stage 2
Lecture exercise 4 What does the smooth curve
suggest about cyclic effects for building starts?
27Another smoothing example
Lecture exercise 5 What does the smooth curve
suggest about cyclic effects for Dow Jones?
28Another smoothing example
29In Time series decomposition, when residuals are
smoothed to estimate underlying cyclic terms,
what order of moving average should be used?
- A good principle is to choose a multiple of the
number of seasons in a period. - This eliminates any inaccuracies arising from the
estimation of seasonal coefficients. For
example, for quarterly data, choose from MA(4),
MA(8), MA(12) etc.
30Forecasting
- Minitab provides forecasts from Time series model
fitting (tick the box Generate Forecasts in the
Dialogue Box, and enter details) - Forecasting into the immediate future is more
reliable than the far future - The immediate past needs to be representative of
the near future, ie conditions need to be stable
31Minitab forecasts of the next four quarters
32 Additive and multiplicative models
The Time series model considered so far is an
additive model , where the various
influences combine additively. For some time
series (especially those in Finance) the
combination is multiplicative in nature, eg
Taking logs or a similar operation converts the
series to an additive series, which after fitting
is converted back to the original scale.
33How to recognise whether additive or
multiplicative deseasonalisation is needed?
- Additive when fluctuations from one observation
to the next have the same scale throughout the
time series - Multiplicative when scale of the fluctuations
seems proportional to the general response level
34Lecture exercise 6
Additive or multiplicative deseasonalisation?
Answer
35Lecture example 3
Time series analysis of monthly sales of jeans
36Lecture example 3 continued
37Lecture exercise 7
Interpretation of the trend coefficient in the
jeans example Trend Line Equation Yt 456.491
2.46033t
38Interpretation of multiplicative seasonal
indices for the jeans example
Multiplicative seasonal indices are interpreted
as multiplicative factors. Thus, index for the
4th month is 0.406 (which is January, because the
record starts in October and 1st observation is
assigned seasonal period 1). This means that, if
trend effects have been removed, the average
sales in January is at 40.6 of (or 59.4 below)
the average over all seasons. (Note can make
January season 1 by specifying 1st observation to
be season 10. Try yourself!)
39Lecture exercise 8
Seasonal Indices Period Index 1
1.06177 2 1.10639 3
0.872265 4 0.405828 5
0.945314 6 1.14059 7
1.01747 8 1.00487 9
1.07613 10 1.05145 11
1.10408 12 1.21384
- If trend effects are removed, for what proportion
of months are the monthly sales more than 10
different from the annual average?
Answer
40Estimated cycles from smoothed residuals for the
jeans example
Lecture exercise 9 Why moving average of order
12?
41Review of fitting a Time Series Model
Step 1 Obtain a time series plot of the
data. Step 2 Decide whether additive or
multiplicative model should be used. Step 3 Use
Minitab to fit the chosen model this is a
two-stage approach Stage 1. Fit trend and
seasonal terms save residuals Stage 2. Fit the
cyclic term by carrying out a smoothing operation
(use moving averages), on the residuals "left
over" from Stage 1
42Building starts example Steps 1 2
Additive or multiplicative deseasonalisation?
Answer additive
43Step 3 Time series decompositionStage 1
detrending and deseasonalisation
44Seasonal coefficients and trend line equation
Seasonal Indices Period Index 1
-17.8125 2 1.31250 3 10.1875
4 6.31250
Trend Line Equation Yt139.3994.30408t
45(after detrending and deseasonalising)
Stage 2 Estimating a smooth cycle