You are on page 1of 7

Case S_ST: Stochastic Trend With Seasonality

A. Modeling:

Modeling for a variable subject to both trend and seasonality takes two
stages. First stage is to reduce the data to a stationary series using
differencing.
Let the variable of interest Y TS have both trend and seasonality. Following
the stochastic trend formulation, we would remove the trend by taking the first
difference:

t 1) 1 L Yt
Yt s Yt TS Y(TS TS

Next, for removing seasonality, we apply the seasonal difference

Yt Yt S Y(tS s ) 1 LS Yt S

The two successive differences would, usually, reduce the data with trend and
seasonality to a stationary data:

Yt 1 Ls 1 L Yt TS 1 LS YtTS Y(TS
t 1)

s Y( t 1) Y( t s 1) Yt
Yt TS YtTS t 1) Yt s Y( t s 1)
Y(TS
TS TS TS TS TS

It is instructive to write the forecasting form of the above model as follows:

1 Yt 1 Yt s 1 Yt
Yt TS Yt TS TS TS

After the data has become stationary, there are several ways to model the
series using ARMA. One example is to use MA(1) and a multiplicative
seasonal MA(s). This modeling is commonly referred to as the airline model,
after the work of Box and Jenkins for forecasting the international airline
passengers.

Yt 1 L 1 Ls t t t 1 t s t s 1

where t is a WN N(0, ). We can also incorporate AR to this model:

1 1L 1 12 L12 Yt 1 L 1 Ls t

1
In the following we will apply the modeling described above for the toy sales
data analyzed earlier.

B. Application:
TOYSALES: Retail Monthly Sales: Hobby, Toy and Game Stores (NSA, Mil.$)
Range: 1977:01 to 1998:10; n= 262
Frequency: Monthly

(1) Timeplot:

yts= log(toysales)
freeze toysales.line
freeze yts.line

TOYSALES YTS = log (TOYSALES)


5000 9

4000 8

3000 7

2000 6

1000 5

0
4
78 80 82 84 86 88 90 92 94 96 98
78 80 82 84 86 88 90 92 94 96 98
TOYSALES
Y

(2) De-trend and de-seasonalize Y = (1 -


L)(1 - L12)YTS

smpl @all
sample s1 @first 1996:09
sample s2 1996:10 @last
smpl s1
'De-trend and de-seasonalize data
series ys=yts-yts(-1)
series y=ys-ys(-12)
freeze ys.line
freeze y.line

2
1.0 .4

0.5 .3

.2
0.0
.1
-0.5
.0
-1.0
-.1

-1.5 -.2

-2.0 -.3
78 80 82 84 86 88 90 92 94 96 78 80 82 84 86 88 90 92 94 96

YS Y

Sample: 1977:01 1996:10


Included observations: 225

Autocorrelation Partial Correlation AC PAC Q-Stat Prob

***|. | ***|. | 1 -0.389 -0.389 34.504 0.000


.|* | *|. | 2 0.069 -0.097 35.603 0.000
.|. | *|. | 3 -0.053 -0.073 36.253 0.000
.|. | *|. | 4 -0.044 -0.104 36.704 0.000
.|. | *|. | 5 0.002 -0.069 36.705 0.000
.|. | .|. | 6 -0.003 -0.040 36.707 0.000
.|. | .|. | 7 -0.014 -0.046 36.754 0.000
.|. | .|. | 8 0.062 0.036 37.654 0.000
.|* | .|* | 9 0.084 0.145 39.332 0.000
*|. | .|. | 10 -0.087 0.007 41.147 0.000
.|* | .|* | 11 0.090 0.084 43.098 0.000
**|. | **|. | 12 -0.294 -0.259 63.853 0.000

3
Sample: 1977:01 1996:09
Included observations: 236

Autocorrelation Partial Correlation AC PAC Q-Stat Prob

**|. | **|. | 1 -0.211 -0.211 10.633 0.001


**|. | ***|. | 2 -0.278 -0.337 29.170 0.000
.|. | **|. | 3 -0.055 -0.241 29.891 0.000
.|. | *|. | 4 0.059 -0.156 30.736 0.000
.|. | *|. | 5 -0.010 -0.164 30.761 0.000
.|. | *|. | 6 0.001 -0.118 30.761 0.000
.|. | *|. | 7 -0.015 -0.127 30.813 0.000
.|. | .|. | 8 0.059 -0.030 31.680 0.000
.|. | *|. | 9 -0.048 -0.095 32.253 0.000
**|. | ***|. | 10 -0.270 -0.420 50.411 0.000
**|. | *******|. | 11 -0.194 -0.836 59.789 0.000
.|*******| .|***** | 12 0.927 0.598 275.25 0.000

(3) Seasonal ARMA Modeling of Yt

'Fit an Airline Model


ls y c ma(1) sma(12)

Dependent Variable: Y
Method: Least Squares
Sample (adjusted): 1978:02 1996:09
Included observations: 224 after adjustments
Convergence achieved after 12 iterations
Backcast: 1975:12 1976:12

Variable Coefficient Std. Error t-Statistic Prob.

C -0.000596 0.000541 -1.102802 0.2713


MA(1) -0.377704 0.057700 -6.546014 0.0000
SMA(12) -0.907654 0.025482 -35.61901 0.0000

R-squared 0.444438 Mean dependent var -0.001498


Adjusted R-squared 0.439411 S.D. dependent var 0.085792
S.E. of regression 0.064234 Akaike info criterion -2.639252
Sum squared resid 0.911860 Schwarz criterion -2.593560
Log likelihood 298.5962 F-statistic 88.39786
Durbin-Watson stat 2.023755 Prob(F-statistic) 0.000000

4
The estimated model for Yt is:

Yt 1 0.3777 L 1 0.9076 L12 t

= t 0.3777 t 1 0.9077 t 12 0.3428 t 13

where t is WN N(0, = 0.06423).

(4) Incorporating seasonal AR

If the airline model does not produce a WN residual, we might incorporate a


seasonal AR as follows:

1 L 1 Ls Yt 1 L 1 Ls t

Here is the Eviews procedure for fitting the model:

ls y c ar(1) sar(12) ma(1) sma(12)

Dependent Variable: Y
Sample (adjusted): 1979:02 1996:09
Included observations: 212 after adjustments
Convergence achieved after 9 iterations
Backcast: 1975:12 1976:12

Variable Coefficient Std. Error t-Statistic Prob.

C -0.000517 0.000553 -0.933826 0.3515


AR(1) 0.128756 0.096708 1.331386 0.1845
AR(12) 0.184587 0.067453 2.736549 0.0067
MA(1) -0.559133 0.085994 -6.502017 0.0000
SMA(12) -0.920019 0.018319 -50.22273 0.0000

R-squared 0.469681 Mean dependent var -0.000451


Adjusted R-squared 0.459433 S.D. dependent var 0.084245
S.E. of regression 0.061939 Akaike info criterion -2.702017
Sum squared resid 0.794154 Schwarz criterion -2.622853
Log likelihood 291.4138 F-statistic 45.83271
Durbin-Watson stat 1.967792 Prob(F-statistic) 0.000000

1 0.1288L 1 0.1846 L12 Yt 1 0.5591L 1 0.9200 L12 t


with t is WN N(0, =0.06194).

5
(5) Out-of-Sample Forecast

1 L 1 L12 ytst ut
ytst L L12 L13 ytst ut
yts( t 1) ytst 12 ytst 13 ut
1 44 2 4 43
yts t 12

ut t 0.3777 t 1 0.9077 t 12 0.3428 t 13

obs YTS YS Y RESID

1995:08 6.777647 -0.002275 0.002420 0.032358


1995:09 6.771936 -0.005711 -0.005711 0.031996
1995:10 7.000334 0.228399 0.069888 0.032315
1995:11 7.604894 0.604560 -0.007582 0.092726
1995:12 8.315077 0.710183 0.029084 -0.021840
1996:01 6.598509 -1.716568 -0.082024 -0.077496
1996:02 6.677083 0.078574 0.035721 0.049401
1996:03 6.944087 0.267004 0.077715 0.089534
1996:04 6.801283 -0.142804 -0.112103 -0.096871
1996:05 6.857514 0.056231 0.309858 0.065914
1996:06 6.849066 -0.008448 -0.245776 -0.062573
1996:07 6.873164 0.024098 -0.008238 -0.014036
1996:08 6.869014 -0.004149 -0.001874 0.005321
1996:09 6.880384 0.011370 0.017081 0.037635

(a) For h=1

Pred_YTS(1996:10) = YTS(1996:09)+ YTS(1995:10) - YTS(1995:09) + Pred_u(1996:10)

= 6.880384 + (7.000334- 6.771936 = 0.228399) + Pred_u (1996:10 )

= 7.0762

Pred_u (1996:10) = 1996:10 0.37771996:09 0.90771995:10 0.34281995:9

= 0 0.3777(0.037635) 0.9077 (0.032315) + 0.3428(0.031996)

= -0.0325743

6
(b) For h=1, , 24

obs YTS F_YTS

1996:10 7.042286 7.075610


1996:11 7.607381 7.606489
1996:12 8.202482 8.367687
1997:01 6.744059 6.713375
1997:02 6.770789 6.719946
1997:03 6.883463 6.922023
1997:04 6.916715 6.897243
1997:05 6.881411 6.859841
1997:06 6.911747 6.930188
1997:07 6.937314 6.944978
1997:08 6.920672 6.930590
1997:09 6.901737 6.909028
1997:10 7.075809 7.116560
1997:11 7.595387 7.646842
1997:12 8.232174 8.407444
1998:01 6.848005 6.752536
1998:02 6.883463 6.758511
1998:03 7.045777 6.959992
1998:04 6.993015 6.934614
1998:05 6.979145 6.896616
1998:06 7.018402 6.966367
1998:07 7.002156 6.980560
1998:08 7.013915 6.965576
1998:09 7.008505 6.943418
1998:10 7.142037 7.150353

Forecast Performance
9.0

8.5
Forecast: F_YTS
Actual: YTS
Forecast sample: 1996:10 1998:10 8.0
Included observations: 25
7.5
Root Mean Squared Error 0.069847
Mean Absolute Error 0.052554 7.0
Mean Abs. Percent Error 0.723899
Theil Inequality Coefficient 0.004912
Bias Proportion 0.013311 6.5
Variance Proportion 0.634311
Covariance Proportion 0.352379 6.0
1997:01 1997:07 1998:01 1998:07

YTS U
1998:01 1998:07 F_YTS L

YTS

You might also like