Home > Chapter 1 Overview of Time Series

Page 1 |

This book deals with data collected at equally spaced points in time. The discussion begins with a single observation at each point. It continues with

Page 2 |

When you perform univariate time series analysis, you observe a single series over time. The goal is to model the historic series and then to use the model to forecast future values of the series. You can use some simple SAS/ETS software procedures to model low-order polynomial trends and autocorrelation. PROC FORECAST automatically fits an overall linear or quadratic trend with autoregressive (AR) error structure when you specify METHOD=STEPAR. As explained later, AR errors are not the most general types of errors that analysts study. For seasonal data you may want to fit a Winters exponentially smoothed trend-seasonal model with METHOD=WINTERS. If the trend is local, you may prefer METHOD=EXPO, which uses exponential smoothing to fit a local linear or quadratic trend. For higher-order trends or for cases where the forecast variable Y

Page 3 |

An alternative to using X-11 is to model the seasonality as part of an ARIMA model or, if the seasonality is highly regular, to model it with indicator variables or trigonometric functions as explanatory variables. A final introductory point about the PROC X11 program is that it identifies and adjusts for outliers.* If you are unsure about the presence of seasonality, you can use PROC SPECTRA to check for it; this procedure decomposes a series into cyclical components of various periodicities. Monthly data with highly regular seasonality have a large ordinate at period 12 in the PROC SPECTRA output SAS data set. Other periodicities, like multiyear business cycles, may appear in this analysis. PROC SPECTRA also provides a check on model residuals to see if they exhibit cyclical patterns over time. Often these cyclical patterns are not found by other procedures. Thus, it is good practice to analyze residuals with this procedure. Finally, PROC SPECTRA relates an output time series Y

* Recently the Census Bureau has upgraded X-11, including an option to extend the series using ARIMA models prior to applying the centered

filters used to deseasonalize the data. The resulting X-12 is incorporated as PROC X12 in SAS software.

Page 4 |

PROC ARIMA emulates PROC AUTOREG if you choose not to model the inputs. ARIMA can also fit a richer error structure. Specifically, the error structure can be an autoregressive (AR), moving average (MA), or mixed-model structure. PROC ARIMA can emulate PROC FORECAST with METHOD=STEPAR if you use polynomial inputs and AR error specifications. However, unlike FORECAST, ARIMA provides test statistics for the model parameters and checks model adequacy. PROC ARIMA can emulate PROC FORECAST with METHOD=EXPO if you fit a moving average of order

Page 5 |

forecast considerably better than its competitors in some time intervals but not in others. In

Multivariate Models with Random Inputs

PROC ARIMA

Intervention Models Transfer Function Models

PROC FORECAST METHOD=EXPO

Exponential Smoothing Models

PROC AUTOREG

Autocorrelated Residuals

PROC FORECAST METHOD=STEPAR

Time Series Errors

PROC VARMAX

Multivariate Models with Random Inputs

Page 6 |

SAS/ETS Procedures 1 2 3 4 5 6 7 FORECAST T Y Y N�� Y Y Y AUTOREG T Y* Y Y Y Y Y X11 T Y* N N Y Y N X12 T Y* Y Y Y N Y SPECTRA F N N N Y N N ARIMA T Y* Y Y N N N STATESPACE T Y Y* Y Y N N VARMAX T Y Y Y Y N N MODEL T Y* Y Y Y N Y Time Series Forecasting System T Y Y Y Y Y Y * = requires user intervention N = no

�� = supplied by the program

T = time domain analysis F = frequency domain analysis Y = yes

This section introduces linear regression, an elementary but common method of mathematical modeling. Suppose that at time

Page 7 |

0 1 1 2 2

Y X X

t t t t

= �� +�� +�� +�� For this model, assume that the errors

t��

• have the same variance at all times t • are uncorrelated with each other ( t�� and s�� are uncorrelated for t different from s) • have a normal distribution.

These assumptions allow you to use standard regression methodology, such as PROC REG or PROC GLM. For example, suppose you have 80 observations and you issue the following statements:

TITLE ��PREDICTING SALES USING ADVERTISING��; TITLE2 ��EXPENDITURES AND COMPETITORS�� SALES��; PROC REG DATA=SALES; MODEL SALES=ADV COMP / DW; OUTPUT OUT=OUT1 P=P R=R; RUN;

Page 8 |

2 1 0 and,, ��

�¦�

. The standard errors are incorrect if the assumptions on

t�� are not satisfied. You have created an output data set called OUT1 and have

called for the Durbin-Watson option to check on these error assumptions.

The test statistics produced by PROC REG are designed specifically to detect departures from the null hypothesis (

t��

:H0

uncorrelated) of the form

t t t

e + �Ѧ�=�� −1

1

:H where

1

<�� and

t�� is related to 1−

��t , is

called an AR (autoregressive) error of the first order.

Page 9 |

The Durbin-Watson option in the MODEL statement produces the Durbin-Watson test statistic

( )

2 2 2 1 1

ˆ ˆ ˆ /

n n t t t t t

d

= − =

= �� �� − �� �� �� where

0 1 1 2 2

ˆ ˆ ˆ ˆ Y X X

t t t t

�� = − �� − �� − �� If the actual errors t�� are uncorrelated, the numerator of

)

2

1 2 ��− n

and the denominator has an expected value of approximately

2

��n . Thus, if the errors t�� are uncorrelated, the ratio

��t

than in the independent case, so

1−

��−��t

t

should be smaller. It follows that

0 1 2

and

, ,

�� �� �� for the intercept, ADV, and COMP) and n=80 observations. In general, if you want

to test for positive autocorrelation at the 5% significance level, you must compare

* Exact p-values for

Page 10 |

The output also produced a first-order autocorrelation, denoted as

ˆ 0.283

�� = When

( )

1/ 2 1/ 2 2

ˆ ˆ / 1

n �� − ��

is approximately distributed as a standard normal variate. Thus, a value

( )

1/ 2 1/ 2 2

ˆ ˆ / 1

n �� − ��

exceeding 1.645 is significant evidence of positive autocorrelation at the 5% significance level. This is especially helpful when the number of observations exceeds the largest in the Durbin-Watson table—for example,

80 (.283)/

2

283.01

−

= 2.639 You should use this test only for large

( )

1/ 2 1/ 2 2

ˆ ˆ / 1

n �� − ��

test, the Durbin- Watson test is preferable. In general,

)

��−

ˆ12 .

This is easily seen by noting that

and Durbin and Watson also gave a computer-intensive way to compute exact p-values for their test statistic

PROC AUTOREG DATA=NCSALES; MODEL SALES=ADV ADV1 / DWPROB; RUN;

The resulting

PROC AUTOREG DATA=NCSALES; MODEL SALES=ADV ADV1 COMP / DWPROB; RUN;

Now, in

2 1

ˆ ˆ ˆ ˆ/

t t t −

��= �� �� ��

�� ��

2 2 1

ˆ ˆ ˆ d ( ) /

t t t −

= �� − �� ��

�� ��

Page 11 |

period. This means our advertising dollar simply shifts the timing of sales rather than increasing the level of sales. Having no autocorrelation evident, you fit the model in PROC REG asking for a test that the coefficients of ADV and ADV1 add to 0.

PROC REG DATA = SALES; MODEL SALES = ADV ADV1 COMP; TEMPR: TEST ADV+ADV1=0; RUN;

Page 12 |

Page 13 |

Occasionally, a very regular seasonality occurs in a series, such as an average monthly temperature at a given location. In this case, you can model seasonality by computing means. Specifically, the mean of all the January observations estimates the seasonal level for January. Similar means are used for other months throughout the year. An alternative to computing the twelve means is to run a regression on monthly indicator variables. An indicator variable takes on values of 0 or 1. For the January indicator, the 1s occur only for observations made in January. You can compute an indicator variable for each month and regress Y

Page 14 |

PROC AUTOREG DATA=ALL; MODEL CHANGE = T1 T2 S1 S2 S3 / DWPROB; RUN;

Page 15 |

This gives

�� + 1 �� X1t + 2 �� X2t + Zt

where Zt = �� Zt–1 + gt Note how the error term Z

Page 16 |

and in quarter 1 (where S1=1, S2=S3=0) is given by

PC = 679.4 –1725.83 – 44.99 t + 0.99 t

2

etc. Thus the coefficients of S1, S2, and S3 represent shifts in the quadratic polynomial associated with the first through third quarters and the remaining coefficients calibrate the quadratic function to the fourth quarter level. In

Page 17 |

DATA ALL; SET NCSALES EXTRA; RUN;

Now run PROC AUTOREG on the combined data, noting that the extra data cannot contribute to the estimation of the model parameters since CHANGE is missing. The extra data have full information on the explanatory variables and so predicted values (forecasts) will be produced. The predicted values P are output into a data set OUT1 using this statement in PROC AUTOREG:

OUTPUT OUT=OUT1 PM=P;

Using PM= requests that the predicted values be computed only from the regression function without forecasting the error term Z. If NLAG= is specified, a model is fit to the regression residuals and this model can be used to forecast residuals into the future. Replacing PM= with P= adds forecasts of future Z values to the forecast of the regression function. The two types of forecast, with and without forecasting the residuals, point out the fact that part of the predictability comes from the explanatory variables, and part comes from the autocorrelation—that is, from the momentum of the series. Thus, as seen in

Page 18 |

PROC REG; MODEL CHANGE = T T2 S1 S2 S3 / P CLI; TITLE ��QUARTERLY SALES INCREASE��; RUN;

Page 19 |

Page 20 |

What does this sales change model say about the level of sales, and why were the levels of sales not used in the analysis? First, notice that a cubic term in time, bt3, when differenced becomes a quadratic term: bt3 – b(t–1)3 = b(3t2 – 3t + 1). Thus a quadratic plus seasonal model in the differences is associated with a cubic plus seasonal model in the levels. However if the error term in the differences satisfies the usual regression assumptions, which it seems to do for these data, then the error term in the original levels can��t possibly satisfy them—the levels appear to have a nonstationary error term. Ordinary regression statistics are invalid on the original level series. If you ignore this, the usual (incorrect here) regression statistics indicate that a degree 8 polynomial is required to get a good fit. A plot of sales and the forecasts from polynomials of varying degree is shown in

Page 21 |

Often, you analyze some transformed version of the data rather than the original data. The logarithmic transformation is probably the most common and is the only transformation discussed in this book. Box and Cox (1964) suggest a family of transformations and a method of using the data to select one of them. This is discussed in the time series context in Box and Jenkins (1976, 1994). Consider the following model:

( )

X 0 1

Y

t t t��

= �� ��

Taking logarithms on both sides, you obtain

( ) ( )

( )

( )

0 1

log Y log log X log

t t t��

= �� + �� +

Now if

( )

log

t t��

�� =

and if

t�� satisfies the standard regression assumptions, the regression of log(Y

produces the best estimates of log(

0

�� ) and log(

1

�� ).

As before, if the data consist of (X1, Y1), (X2, Y2), ..., (X

MODEL LY=X / P CLI;

where

LY=LOG(Y);

is specified in the DATA step. This produces predictions of future LY values and prediction limits for them. If, for example, you obtain an interval −1.13 < log(Y

( )

X 0 1

Y

t t t��

= �� ��

the overall shape of the plot resembles that of

( )

X 0 1

Y = �� ��

Page 22 |

See

1

�� moves away from 1 in either direction; the actual points are scattered

around the appropriate curve. Because the error term �� is multiplied by ( )

X 0 1

�� �� , the variation

around the curve is greater at the higher points and lesser at the lower points on the curve.

Page 23 |

Page 24 |

To analyze and forecast the series with simple regression, you first create a data set with future values of time:

DATA TBILLS2; SET TBILLS END=EOF; TIME+1; OUTPUT; IF EOF THEN DO I=1 TO 24; LFYGM3=.; TIME+1; DATE=INTNX('MONTH',DATE,1); OUTPUT; END; DROP I; RUN;

�� and

( )1

log �� in the following model: ( ) ( ) ( )

0 1

LFYGM3 log log *TIME log

t

= �� + �� + ��

You also produce predicted values and check for autocorrelation by using these SAS statements:

PROC REG DATA=TBILLS2; MODEL LFYGM3=TIME / DW P CLI; ID DATE; TITLE 'CITIBASE/CITIBANK ECONOMIC DATABASE'; TITLE2 'REGRESSION WITH TRANSFORMED DATA'; RUN;

The result is shown in

Page 25 |

CITIBASE/CITIBANK ECONOMIC DATABASE

REGRESSION WITH TRANSFORMED DATA Dependent Variable: LFYGM3 Analysis of Variance Sum of Mean Source DF Squares Square F Value Prob>F Model 1 32.68570 32.68570 540.633 0.0001 Error 248 14.99365 0.06046 C Total 249 47.67935 Root MSE 0.24588 R-square 0.6855 Dep Mean 1.74783 Adj R-sq 0.6843 C.V. 14.06788 Parameter Estimates Parameter Standard T for H0: Variable DF Estimate Error Parameter=0 Prob > |T| INTERCEP 1 1.119038 0.03119550 35.872 0.0001 TIME 1 0.005010 0.00021548 23.252 0.0001 REGRESSION WITH TRANSFORMED DATA Dep Var Predict Std Err Lower95% Upper95% Obs DATE LFYGM3 Value Predict Predict Predict Residual 1 JAN62 1.0006 1.1240 0.031 0.6359 1.6122 -0.1234 2 FEB62 1.0043 1.1291 0.031 0.6410 1.6171 -0.1248 3 MAR62 1.0006 1.1341 0.031 0.6460 1.6221 -0.1334 4 APR62 1.0043 1.1391 0.030 0.6511 1.6271 -0.1348 5 MAY62 0.9858 1.1441 0.030 0.6562 1.6320 -0.1583 (More Output Lines) 251 NOV82 . 2.3766 0.031 1.8885 2.8648 . (More Output Lines) 270 JUN84 . 2.4718 0.035 1.9827 2.9609 . 271 JUL84 . 2.4768 0.035 1.9877 2.9660 . 272 AUG84 . 2.4818 0.035 1.9926 2.9711 . 273 SEP84 . 2.4868 0.035 1.9976 2.9761 . 274 OCT84 . 2.4919 0.036 2.0025 2.9812 . Sum of Residuals 0 Sum of Squared Residuals 14.9936 Predicted Resid SS (Press) 15.2134 DURBIN-WATSON D 0.090 (FOR NUMBER OF OBS.) 250 1ST ORDER AUTOCORRELATION 0.951

Page 26 |

Now, for example, you compute:

( ) ( ) ( ) ( ) ( )

0

1.119 1.96 0.0312 log 1.119 1.96 0.0312

− < �� < +

Thus,

0

2.880 3.255

< �� <

is a 95% confidence interval for 0 �� . Similarly, you obtain

1

1.0046 1.0054

<�� <

which is a 95% confidence interval for 1 �� . The growth rate of Treasury bills is estimated from this model to be between 0.46% and 0.54% per time period. Your forecast for November 1982 can be obtained from 1.888 < 2.377 < 2.865 so that 6.61 < FYGM3251 < 17.55 is a 95% prediction interval for the November 1982 yield and exp(2.377) = 10.77 is the predicted value. Because the distribution on the original levels is highly skewed, the prediction 10.77 does not lie midway between 6.61 and 17.55, nor would you want it to do so. Note that the Durbin-Watson statistic is

=��

to compute

( )

1/ 2 1/ 2 2

ˆ ˆ n / 1

�� − ��

= 48.63 which is greater than 1.645. At the 5% level, you can conclude that positive autocorrelation is present (or that your model is misspecified in some other way). This is also evident in the plot, in

2 x

�� . Then y = exp(x) and y has

median exp(Mx) and mean exp(Mx+ ½ 2

x

�� ) For this reason, some authors suggest adding half the

error variances to a log scale forecast prior to exponentiation. We prefer to simply exponentiate and think of the result, for example, exp(2.377) = 10.77, as an estimate of the median, reasoning that this is a more credible central estimate for such a highly skewed distribution.

- Análise Setorial
- CRIS Training Scheduling Documentation Overview
- /****************************************************************************
- This article is from the ERIC/CSMEE data base (article ED 380 279).
- Physics 121: Electricity & Magnetism – Lecture 13 E-M Oscillations and AC Current Dale E. Gary Wenda Cao NJIT Physics Department
- West Business Law 9th
- Quasiconvex Programming
- Malaysia—Update
- Contracts Outline, Prof. James J. White, University of Michigan Law School
- 1 Cost Accounting Quiz Chapter 9 Name______________________________________ Cost Accounting Quiz Chapter 9 *******
- CUSTOMER SATISFACTION CUSTOMER SATISFACTION The most important asset of any organization is its customers Satisfied cus
- Drug Discovery and Drug Development in the Kinase Inhibitory Field with Nested Chemical Library TM
- Slide 1
- In situ ATR-IR spectroscopy study of adsorbed protein: Visible light denaturation of bovine serum albumin on TiO2
- A Contextual Approach to Scientific Understanding
- Requirements Elicitation Techniques
- QUANTILE REGRESSION
- Untitled
- LAWS OF THE REPUBLIC OF VANUATU
- 2 The Space of Cognitive Vision
- "Do not despise these small beginnings, for the Lord rejoices to see the work begin ..." Zechariah 4:10

- Reading Teaching Chinese as a foreign language
- Web based Teaching
- Web based Curriculum Design
- Cytosine methylation
- Epigenetic inheritance and variation
- Hybrid
- Maize
- seedling
- embryo
- endosperm
- Skutterudite thermoelectric material
- nanocomposite
- microstructure
- thermoelectric properties
- service behavior
- Restricted network
- Moving Objects
- Nearest neighbor queries
- Uncertainty track
- Probability neighbors
- Agent construction contract

All Rights Reserved Powered by Free Document Search and Download

Copyright © 2011This site does not host pdf,doc,ppt,xls,rtf,txt files all document are the property of their respective owners. complaint#nuokui.com