This action might not be possible to undo. Are you sure you want to continue?

SAS for

®

**Forecasting Time Series
**

second edition

John C. Brocklebank, Ph.D. David A. Dickey, Ph.D.

The correct bibliographic citation for this manual is as follows: Brocklebank, John C., and David A. Dickey. 2003. SAS® for Forecasting Time Series, Second Edition. Cary, NC: SAS Institute Inc.

**SAS® for Forecasting Time Series, Second Edition
**

Copyright © 2003 by SAS Institute Inc., Cary, NC, USA Jointly co-published by SAS Institute and Wiley 2003. SAS Institute Inc. ISBN 1-59047-182-2 John Wiley & Sons, Inc. ISBN 0-471-39566-8 All rights reserved. Printed in the United States of America. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute Inc. U.S. Government Restricted Rights Notice: Use, duplication, or disclosure of this software and related documentation by the U.S. government is subject to the Agreement with SAS Institute and the restrictions set forth in FAR 52.227-19, Commercial Computer Software-Restricted Rights (June 1987). SAS Institute Inc., SAS Campus Drive, Cary, North Carolina 27513. 1st printing, May 2003 SAS Publishing provides a complete selection of books and electronic products to help customers use SAS software to its fullest potential. For more information about our e-books, e-learning products, CDs, and hardcopy books, visit the SAS Publishing Web site at support.sas.com/pubs or call 1-800-727-3228. SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. Other brand and product names are trademarks of their respective companies.

®

97 noitacifitnedI ledoM fo yrammuS 4.3.3 97 slaudiseR fo kcehC erauqS-ihC 3.3.3 65 noitacifitnedI seireS emiT 2.3.3 55 ytilibitrevnI dna ytiranoitatS 1.3.3 55 noitacifitnedI ledoM 3.3 25 snoitciderP erutuF 2.2.3 15 snoitciderP daehA-petS-enO 1.2.3 15 noitciderP 2.3 05 noitatoN dna ygolonimreT 2.1.3 94 dnuorgkcaB lacitsitatS 1.1.3 94 noitcudortnI 1.3

94

............................................................

led o M AMIRA laren eG ehT 3 re tp ahC

54 GER CORP ni ledoM RA na gnittiF 3.2 14 secnairavoC rof snoitauqE reklaW-eluY 3.2.2 04 seireS emiT rof B noitatoN tfihskcaB 2.2.2 03 AMIRA CORP htiw gnitsaceroF 1.2.2 92 gnitsaceroF 2.2 82 dnuorgkcaB lacitsitatS 2.1.2 72 noitatoN dna ygolonimreT 1.1.2 72 noitcudortnI 1.2

72

.......................................................

n o iss ergero tu A :sled o M elp miS 2 re tp ahC

12 ataD demrofsnarT htiw noissergeR 3.3.1 31 ytilanosaeS ralugeR ylhgiH 2.3.1 6 noissergeR raeniL 1.3.1 6 noissergeR :sledoM elpmiS 3.1 4 etalerretnI serudecorP erawtfoS STE/SAS woH 2.2.1 2 snoitpO 1.2.1 2 erawtfoS STE/SAS dna sdohteM sisylanA 2.1 1 noitcudortnI 1.1

1

.....................................................................

**seireS e m iT f o weivrevO 1 re tp ahC
**

stnemgdelwonkcA ecaferP

xi

....................................................................................................

iiv

...................................................................................................................

Contents

062 noitcnuF esnopseR eslupmI 3.2.5 852 seulavnegiE dna noitargetnioC 2.2.5 652 noitcudortnI 1.2.5 652 noitargetnioC 2.5 942 secnairaV lauqenU rof HCRAGI dna ,HCRAG ,HCRA 4.1.5 542 secnairaV lauqenU 3.1.5 142 ytisrevinU a ta dnameD ygrenE :elpmaxE 2.1.5 932 srorrE evissergerotuA 1.1.5 932 secnairaV lauqenU dna srorrE seireS emiT htiw noissergeR 1.5

932

.....................................

s n o itacilp p A laicep S :led oM AMIRA ehT 5 re tp ahC

4.4

3.4

732 kcattA tsirorreT 4.4.4 332 )noitnevretnI( eracS kliM 3.4.4 132 detisiveR seireS noitcurtsnoC 2.4.4 322 selaS liateR aniloraC htroN 1.4.4 322 selpmaxE rehtruF 312 noitnevretnI :B3 esaC 4.3.4 381 snoitcnuF refsnarT lareneG :3 esaC 3.3.4 971 snoitcnuF refsnarT elpmiS :2 esaC 2.3.4 761 srorrE seireS emiT htiw noissergeR :1 esaC 1.3.4 761 elpmaxE dna ygolodohteM 761 noitnevretnI :B3 esaC 6.2.4 661 srotacidnI gnidaeL :A3 esaC 5.2.4 661 noitcnuF refsnarT lareneG :3 esaC 4.2.4 561 noitcnuF refsnarT elpmiS :2 esaC 3.2.4 561 noitnevretnI :A1 esaC 2.2.4 461 srorrE seireS emiT htiw noissergeR :1 esaC 1.2.4 461 selbairaV yrotanalpxE htiw sledoM 541 noitacifitnedI ledoM 2.1.4 341 gniledoM lanosaeS ot noitcudortnI 1.1.4 341 seireS emiT lanosaeS

2.4 1.4

341

...........................

**s n o itacilp pA yr o tcu d o rtn I :led oM AMIRA ehT 4 re tp ahC
**

041 yrammuS 5.3 821 seuqinhceT noitacifitnedI rehtO 01.4.3 321 dnerT raeniL a evomeR ot gnicnereffiD 9.4.3 311 ataD yranoitatsnoN rof sledoM 8.4.3 501 seireS revliS dna seireS MBI gnitsaceroF :selpmaxE 7.4.3 401 stsaceroF no gnicnereffiD fo tceffE 6.4.3 201 seireS yranoitatsnoN 5.4.3 79 8 seireS rof tnemetatS ETAMITSE 4.4.3 59 AMIRA CORP ni desU sdohteM noitamitsE 3.4.3 09 sisylanA tropxE leetS dna norI :elpmaxE 2.4.3 18 8–1 seireS rof tnemetatS YFITNEDI 1.4.3 08 snoitcurtsnI dna selpmaxE 4.3

iv Contents

453 yaleD eruP dna ,esahP ,niaG no sliateD 5.01.7 053 ataD reviR esueN eht fo sisylanA lartcepS-ssorC 4.01.7 643 stnemetatS ARTCEPS CORP 3.01.7 443 artcepS esahP dna edutilpmA-ssorC gniterpretnI 2.01.7 143 seititnauQ lartcepS-ssorC gniterpretnI 1.01.7 143 sisylanA lartcepS-ssorC 01.7 043 margodoireP dehtoomS ehT :murtcepS eht gnitamitsE 9.7 933 )gnidaeR lanoitpO( liateD lacitamehtaM emoS 8.7 533 ytisneD lartcepS ehT 7.7 433 gnisailA dna snoitautculF tsaF ylemertxE 6.7 033 seicneuqerF cinomraH 5.7 823 esioN etihW rof gnitseT 4.7 623 decudortnI ARTCEPS CORP 3.7 423 ytivitcA emyznE tnalP :elpmaxE 2.7 323 noitcudortnI :ataD cidoireP 1.7

323

............................................................................

sisylanA lartcepS 7 re tp ahC

703 elpmaxE detalumiS 3.3.6 503 snoitalerroC lacinonaC 2.3.6 503 secnairavoC morf denimreteD srotceV etatS 1.3.6 203 ECAPSETATS CORP 3.6 103 2 noisnemiD fo )1,1(AMRA 2.2.6 892 selpmaxE etairavinU emoS 1.2.6 892 selpmaxE eroM 2.6 492 sledoM AMRA rotceV dna ecapS etatS fo ecnelaviuqE 3.1.6 582 elpmaxE etairavitluM elpmiS A 2.1.6 382 selpmaxE etairavinU elpmiS emoS 1.1.6 382 noitcudortnI 1.6

382

.....................................................................

gn iled oM ecapS etatS 6 re tp ahC

972 stsaceroF dna scitsongaiD 11.2.5 772 setamitsE eht gniterpretnI 01.2.5 572 XAMRAV CORP 9.2.5 372 sgaL eroM dna stpecretnI 8.2.5 072 rotceV gnitargetnioC eht gnitamitsE 7.2.5 562 elpmaxE evitartsullI nA 6.2.5 362 stooR tinU dna noitargetnioC 5.2.5 062 sledoM redrO-rehgiH ni stooR 4.2.5

Contents

v

983 583

....................................................................................................................

xednI

............................................................................................................

secnerefeR

9.8 8.8 7.8 6.8 5.8 4.8 3.8 2.8 1.8

383 yrammuS 183 tnempoleveD ledoM gnikeeS-laoG 673 syalpsiD lacihparG 673 scirteM ecnamrofreP laoG ssenisuB 573 tnempoleveD dracerocS 863 erudecorP FPH 263 metsyS gnitsaceroF seireS emiT ehT 063 ledoM ataD gnitsaceroF 953 noitcudortnI

953

.........................................................

gn itsacero F d n a gniniM ataD 8 re tp ahC

vi

Contents

Preface

A time series is a set of ordered observations on a quantitative characteristic of a phenomenon at equally spaced time points. The goal of univariate time series analysis is to forecast values of a single historical series. The goal of multivariate time series analysis can be to model the relationships among component series as well as to forecast those components. Time series analysis can be accomplished most effectively by the SAS procedures ARIMA, STATESPACE, SPECTRA, and VARMAX. To use these procedures properly, you must (1) understand the statistics you need for the analysis and (2) know how to invoke the procedures. SAS for Forecasting Time Series, Second Edition, makes it easier for you to apply these procedures to your data analysis problems. Chapter 1, “Overview of Time Series,” reviews the goals and key characteristics of time series. The analysis methods available through SAS/ETS software are presented, beginning with the simpler procedures FORECAST, AUTOREG, and X11 and continuing with the more powerful SPECTRA, ARIMA, and STATESPACE. This chapter shows the interrelationships among the various procedures. It ends with a discussion of linear regression, seasonality in regression, and regression with transformed data. Chapter 2, “Simple Models: Autoregression,” presents the statistical background necessary to model and forecast simple autoregressive (AR) processes. A three-part forecasting strategy is used with PROC ARIMA to identify, estimate, and forecast. The backshift notation is used to write a time series as a weighted sum of past shocks and to compute covariances through the Yule-Walker equations. The chapter ends with an example involving an AR process with regression techniques by overfitting. Chapter 3, “The General ARIMA Model,” extends the class of models to include moving averages and mixed ARMA models. Each model is introduced with its autocovariance function. Estimated autocovariances are used to determine a model to be fit, after which PROC ARIMA is used to fit the model, forecast future values, and provide forecast intervals. A section on time series identification defines the autocorrelation function, partial autocorrelation function, and inverse autocorrelation function. Newer identification techniques are also discussed. A catalog of examples is developed, and properties useful for associating different forms of these functions with the corresponding time series are described. This chapter includes the results of 150 observations generated from each of eight sample series. Stationarity and invertibility, nonstationarity, and differencing are discussed. Chapter 4, “The ARIMA Model: Introductory Applications,” describes the ARIMA model and its introductory applications. Seasonal modeling and model identification are explained, with Box and Jenkins’s popular airline data modeled. The chapter combines regression with time series errors to provide a richer class of forecasting models. Three cases are highlighted: Case 1 is a typical regression, case 2 is a simple transfer function, and case 3 is a general transfer function. New in Chapter 4 for the second edition are several interesting intervention examples involving analyses of

.skcatta tsirorret ,1002 ,11 rebmetpeS eht fo emulov kcots enilria no tceffe eht klim detniat tuoba yticilbup fo sesahcrup klim no tceffe eht ecnatsissa yrotcerid rof gnigrahc fo sllac no tceffe eht

including many that have been discussed thus far.” deals with the process of forecasting many time series with little intervention by the user. a characteristic that cannot be handled with the general ARIMA transfer function approach. These are also discussed and illustrated. Chapter 8. The chapter also includes a discussion detailing the use of PROC HPF. This chapter presents new developments since the first edition of the book. New for the second edition is more in-depth discussion of tests for white noise and the ideas behind spectral analysis.” describes the SPECTRA procedure and how spectral analysis is used to detect sinusoidal components in time series models.viii Preface Chapter 5. Chapter 7. and a section on canonical correlation analysis and Akaike’s information criterion is included. Spectra for different series. Multivariate models in which individual nonstationary series vary together over time are referred to as “cointegration” or “error correction” models. and white noise tests are covered. Next. “Data Mining and Forecasting. In periodogram analysis. The STATESPACE procedure is outlined. which provides a menu-driven interface to SAS/ETS and SAS/GRAPH procedures in order to facilitate quick and easy analysis of time series data. an automated high-performance forecasting procedure that is designed to forecast thousands of univariate time series. . Fourier coefficients. regressions are run on a sequence of values to find hidden periodicities. Examples of multivariate processes and their state space equations are shown. The goal of the chapter is to illustrate a modern automated interface for a collection of forecasting models. “State Space Modeling.” uses the AR model to motivate the construction of the state vector. The chapter ends with the analysis of a bivariate series exhibiting feedback. “The ARIMA Model: Special Applications. “Spectral Analysis. Chapter 8 also examines the SAS/ETS Time Series Forecasting System (TSFS). the equivalence of state space and vector ARMA models is discussed. The chapter ends with a discussion of cross-spectral analysis.” extends the regression with time series errors class of models to cases where the error variance can change over time—the ARCH and GARCH class. smoothing the periodogram. Chapter 6.

Sanford Gayle. Allen. Ann A. Stephenie Joyner. Hastings. For the second edition we gratefully acknowledge the SAS technical reviewers. Patricia Spain. Wayne A. Tom Grant. who were understanding and supportive throughout the writing of this book. Vicki H. Gul Ege. Council.Acknowledgments For the 1986 edition we owe a great debt to students of the SAS Applied Time Series Analysis and Forecasting course. Larry Stewart. Dickey. Herbert Kirk. Robert P. For the production of the manuscript. Houston Stokes of the University of Illinois at Chicago and David Booth of Kent State University. John West. Kathryn A. and Youngjin Park. We are also grateful to the two outside reviewers. We would like to acknowledge several people at SAS whose efforts have contributed to the completion of the second edition: Keith Collins. Brent Cohen. Stephen Ewing. Sam Pipkin. Blank for her patience and diligence. Lehman. Giesbrecht. . we would like to thank our wives. who made valuable suggestions on the subject material and generally stimulated our interest. Finally. David M. Julie Platt. Francis G. Evan Anderson. Brocklebank and Barbara S. Fuller. and Houston Stokes. and Patrice Cherry. Candy Farrell. Bob Lucas. we owe special thanks to Deborah S. We are also indebted to Alice T. Ed Huddleston. DeLong and Bart Killam enthusiastically reviewed and offered comments on several chapters.

x .

1 retpahC . slowly evolving change in the series level. an approaching deadline may increase production over several days. and autocorrelation.1 6 noissergeR :sledoM elpmiS 3. if a plot of sales over time shows a steady increase of $500 per month. Three important characteristics of time series are often encountered: seasonality.1 31 ytilanosaeS ralugeR ylhgiH 2. absenteeism. This is an example of positive autocorrelation. Autocorrelation is the phenomenon that distinguishes time series from other branches of statistical analysis.2. although actual production varies from this mean of 100. autocorrelation is a local phenomenon.3. For multivariate series. Variation can be caused by machine failure. A machine may malfunction for several days. Another example of positive autocorrelation is the flow rate of a river. then falling again. as well as forecasts of these components. for example. when data are collected monthly and the value of the series in any given month is closely related to the value of the series in that same month in previous years.1 2 snoitpO 1. Normal production is 100 units per day. may be of interest. the deviations are positively autocorrelated. Consider variation around the seasonal level: you may see high flow rates for several days following rain and low flow rates for several days during dry periods.3. consider a manufacturing plant that produces computer parts. It continues with k series being observed at each point and then analyzed together in terms of their interrelationships. One of the main goals of univariate time series analysis is to forecast future values of the series. Secondary goals are smoothing.1 Overview of Time Series 1.1 Introduction This book deals with data collected at equally spaced points in time.1 2 erawtfoS STE/SAS dna sdohteM sisylanA 2. resulting in a run of low productivity. A trend is a regular. interpolating. A trend is a long-term movement in the series. relationships among component series. Changes that can be modeled by loworder polynomials or low-frequency sinusoids fit into this category. trend. In contrast. then rising above 100 and staying high for a while.3. 4 etalerretnI serudecorP erawtfoS STE/SAS woH 2. you may fit a linear trend to the sales data. or incentives like bonuses or approaching deadlines. For example.1 1 noitcudortnI 1. and so on. Seasonality can be very regular or can change slowly over a period of years. For example.1 6 noissergeR raeniL 1.1 12 ataD demrofsnarT htiw noissergeR 3. Seasonality occurs. The discussion begins with a single observation at each point. and modeling of the structure.2. Similarly. When deviations from an overall trend tend to be followed by deviations of a like sign. with data falling and staying below 100 for a few days.

As explained later. you may prefer METHOD=EXPO.2. AR errors are not the most general types of errors that analysts study. The autocorrelation pattern depends on the worker's habits. if desired. with their transfer function options. however. which uses exponential smoothing to fit a local linear or quadratic trend. are preferable when the explanatory variable's future values are unknown. or PROC ARIMA. One approach to modeling seasonality in time series is the use of seasonal indicator variables in PROC AUTOREG to model a highly regular seasonality. As a second example.2 Analysis Methods and SAS/ETS Software 1. PROC VARMAX. For seasonal data you may want to fit a Winters exponentially smoothed trend-seasonal model with METHOD=WINTERS. you can expect a low temperature reading to be followed by a high reading. 1. If the explanatory variable is a nondeterministic time series. If the trend is local. An example is a worker's attempt to control temperature in a furnace. Another approach to seasonality is to remove it from the series and to forecast the seasonally adjusted series with other seasonally adjusted series used as inputs. For higher-order trends or for cases where the forecast variable Yt is related to one or more explanatory variables Xt.2) can be computed as far into the future as desired. PROC FORECAST automatically fits an overall linear or quadratic trend with autoregressive (AR) error structure when you specify METHOD=STEPAR. Also. PROC AUTOREG treats future values of the explanatory variable as known. Polynomials in time and seasonal indicator variables (see Section 1. The WINTERS method of PROC FORECAST uses updating equations similar to exponential smoothing to fit a seasonal multiplicative model. The time he spends exercising daily displays negative autocorrelation. The U.3. an athlete may follow a long workout day with a short workout day and vice versa. Census Bureau has adjusted thousands of series with its X-11 seasonal adjustment package. If you are using seasonally adjusted figures as explanatory variables.2 SAS for Forecasting Time Series Negative autocorrelation occurs less often than positive autocorrelation. If he reads and adjusts the temperature each minute. − .S. this procedure is useful. The goal is to model the historic series and then to use the model to forecast future values of the series. but suppose he reads a low value of a furnace temperature and turns up the heat too far and similarly turns it down too far when readings are high. actual future values are not available. You can use some simple SAS/ETS software procedures to model low-order polynomial trends and autocorrelation. you observe a single series over time. You can seasonally adjust your own data using PROC X11. so user-supplied forecasts of future values with PROC AUTOREG may give incorrect standard errors of forecast estimates. which is the census program set up as a SAS procedure. the AR error series from PROC AUTOREG or from PROC FORECAST with METHOD=STEPAR can include some correlation at seasonal lags (that is. it may relate the deviation from trend at time t to the deviation at time t 12 in monthly data). PROC AUTOREG estimates this relationship and fits an AR series as an error term.1 Options When you perform univariate time series analysis. This package is the result of years of work by census researchers and is the basis for the seasonally adjusted figures that the federal government reports. More sophisticated procedures like PROC STATESPACE.

accounts for the fact that these inputs are forecast when you compute prediction error variances and prediction limits for forecasts. Without a doubt. Future values of nondeterministic. that is. models vector processes with possible explanatory variables. remaining near some constant. it is good practice to analyze residuals with this procedure. Explanatory time series as inputs to a transfer function model can also be accommodated. The idea is that each element of the response vector might be a nonstationary process. the X in VARMAX. Local trending and even long-term upward or downward drifting in the data can be accommodated in ARIMA models through differencing. and one member of the class is fit to the historic data. PROC SPECTRA also provides a check on model residuals to see if they exhibit cyclical patterns over time. Over time the boats drift arbitrarily far from any particular location. As in PROC STATESPACE. the most powerful and sophisticated methodology for forecasting univariate series is the ARIMA modeling methodology popularized by Box and Jenkins (1976). A final introductory point about the PROC X11 program is that it identifies * and adjusts for outliers. which. If you are unsure about the presence of seasonality. if the seasonality is highly regular. This enables the analyst to separate long-term movements from short-term movements. including an option to extend the series using ARIMA models prior to applying the centered filters used to deseasonalize the data. over time. like multiyear business cycles. Cointegration is an idea that has become quite popular in recent econometrics. Then the model is used to forecast the series. The resulting X-12 is incorporated as PROC X12 in SAS software. this approach assumes that at each time point you observe a vector of responses each entry of which depends on its own lagged values and lags of the other vector entries. and seasonality can be local. unlike the previously mentioned procedures. but unlike STATESPACE. the difference in their positions would never be too far from 0. PROC VARMAX. Prices of two similar stocks might. and yet one or more linear combinations of the responses are stationary. one that has no tendency to return to a mean or deterministic trend function. A flexible class of models is introduced. Their location might be expressible mathematically as a random walk with no tendency to return to a particular point. and yet if they are indeed similar. may appear in this analysis. seasonality for month t may be closely related to seasonality for this same month one or two years previously but less closely related to seasonality for this month several years previously. you can use PROC SPECTRA to check for it. Nevertheless. * . this procedure decomposes a series into cyclical components of various periodicities. A relatively new procedure.Chapter 1: Overview of Time Series 3 An alternative to using X-11 is to model the seasonality as part of an ARIMA model or. An analogy is two lifeboats adrift in a stormy sea but tied together by a rope. Thus. their price difference may not get too far from 0. vary according to a random walk with no tendency to return to a given mean. Seasonal data can be accommodated. Often these cyclical patterns are not found by other procedures. because they are tied together. cross-spectral analysis estimates the change in amplitude and phase when a cyclical component of an input series is used to predict the corresponding component of an output series. Other periodicities. Monthly data with highly regular seasonality have a large ordinate at period 12 in the PROC SPECTRA output SAS data set. Finally. independent input series can be forecast by PROC ARIMA. Specifically. Recently the Census Bureau has upgraded X-11. PROC SPECTRA relates an output time series Yt to one or more input or explanatory series Xt in terms of cycles. VARMAX also allows explanatory variables X as well as cointegration among the elements of the response vector. to model it with indicator variables or trigonometric functions as explanatory variables.

PROC ARIMA produces more reasonable forecast intervals. Instead of arbitrarily choosing a smoothing constant. ARIMA can also fit a richer error structure. fitting and forecasting are almost automatic. Chavern gives an example in which PROC STATESPACE. Furthermore. “The General ARIMA Model. and cross-correlations of the time series. you can put data on sales. unlike FORECAST.2 How SAS/ETS Software Procedures Interrelate PROC ARIMA emulates PROC AUTOREG if you choose not to model the inputs. PROC ARIMA can emulate PROC FORECAST with METHOD=EXPO if you fit a moving average of order d to the dth difference of the data. fails to give as accurate a forecast as a certain vector autoregression. moving average (MA). and interest rates into the procedure and automatically produce forecasts of these series. Although PROC STATESPACE and PROC VARMAX are sophisticated in theory. as necessary in PROC FORECAST METHOD=EXPO. It is not necessary to intervene. You can use PROC STATESPACE and PROC VARMAX to model multiple time series without these restrictions. they are easy to run in their default mode. The identification process is more complicated when you use input series. PROC STATESPACE uses an information criterion to select a model. but you must be certain that you have a property known as stationarity in your series to obtain theoretically valid results. advertising. ARIMA provides test statistics for the model parameters and checks model adequacy.2.) Bailey shows a PROC STATESPACE . thus eliminating the difficult identification process in PROC ARIMA. inverse autocorrelations. (However. These ARIMA restrictions may be unrealistic in many examples. lack of feedback corresponds to there being no thermostat in the room. if the temperature Tt in a room at time t is to be explained by current and lagged furnace temperatures Ft. PROC ARIMA does everything the simpler procedures do and does it better. partial autocorrelations. PROC ARIMA can emulate PROC FORECAST with METHOD=STEPAR if you use polynomial inputs and AR error specifications. the stationarity of the data is questionable. Unlike PROC ARIMA. unemployment rates. Feedback and cross-correlated input series are allowed. or mixed-model structure. For example. Although the automatic modeling in PROC STATESPACE sounds appealing. Later chapters explain in detail what these terms mean and how to use them. For proper identification. the ARIMA methodology requires that inputs be independent of each other and that there be no feedback from the output series to the input series. to benefit from this additional flexibility and sophistication in software. in its default mode. In short. However. Once you identify a model. Specifically.4 SAS for Forecasting Time Series 1. The theory allows you to model several time series together. However. and stationarity is required to use PROC STATESPACE appropriately. A thermostat causes the furnace temperature to adjust to recent room temperatures. you must have enough expertise and time to analyze the series. accounting for relationships of individual component series with current and past values of the other series. the data tell you what smoothing constant to use when you invoke PROC ARIMA. the error structure can be an autoregressive (AR). The stationarity concept is discussed in Chapter 3. For example. two papers in the Proceedings of the Ninth Annual SAS Users Group International Conference (one by Bailey and the other by Chavern) argue that you should use such automated procedures cautiously. You must be able to identify and specify the form of the time series model using the autocorrelations.” where you will learn how to make nonstationary series stationary.

In SAS Views: SAS Applied Time Series Analysis and Forecasting. Table 1. The dimension of the model is overestimated when 50 observations are used. Figure 1. Figure 1. but the procedure is successful for samples of 100 and 500 observations from this simple series. PROC ARIMA is a viable alternative.1 shows the interrelationships among the SAS/ETS software procedures mentioned.1 lists some common questions and answers concerning the procedures.1 How SAS/ETS Software Procedures Interrelate RAPETS=DOHTEM TSACEROF CORP srorrE seireS emiT AMIRA CORP sledoM noitnevretnI slaudiseR detalerrocotuA GEROTUA CORP ECAPSETATS CORP stupnI modnaR htiw sledoM etairavitluM OPXE=DOHTEM TSACEROF CORP sledoM gnihtoomS laitnenopxE stupnI modnaR htiw sledoM etairavitluM sledoM noitcnuF refsnarT XAMRAV CORP . As you continue reading the rest of the book. it is wise to consider intervening in the modeling procedure through PROC STATESPACE’s control options. If a transfer function model is appropriate. you may want to refer back to this chapter to clarify the relationships among the various procedures. Brocklebank and Dickey generate data from a simple MA model and feed these data into PROC STATESPACE in the default mode.Chapter 1: Overview of Time Series 5 forecast considerably better than its competitors in some time intervals but not in others. Thus. This chapter introduces some techniques for analyzing and forecasting time series and lists the SAS procedures for the appropriate computations.

1 shows a simple plot of monthly sales versus date. Output 1. an elementary but common method of mathematical modeling. X2t. Is a frequency domain analysis (F) or time domain analysis (T) conducted? Are forecasts automatically generated? Do predicted values have 95% confidence limits? Can you supply leading indicator variables or explanatory variables? Does the procedure run with little user intervention? Is minimal time series background required for implementation? Does the procedure handle series with embedded missing values? SAS/ETS Procedures FORECAST AUTOREG X11 X12 SPECTRA ARIMA STATESPACE VARMAX MODEL Time Series Forecasting System Answers 1 T T T T F T T T T T 2 Y Y* Y* Y* N Y* Y Y Y* Y 3 Y Y N Y N Y Y* Y Y Y 4 ′ 5 Y Y Y Y Y N Y Y Y Y 6 Y Y Y N N N N N N Y 7 Y Y N Y N N N N Y Y N Y N Y N Y Y Y Y Y * = requires user intervention = supplied by the program F = frequency domain analysis ′ N = no T = time domain analysis Y = yes 1.3. 3.6 SAS for Forecasting Time Series Table 1. Yt could be sales in month t. 2. . X1t could be advertising expenditure in month t. 4. 6.1 Linear Regression This section introduces linear regression. Suppose that at time t you observe Yt. 5. 7.3 Simple Models: Regression 1. You also observe explanatory variables X1t. and X2t could be competitors' sales in month t. and so on.1 Selected Questions and Answers Concerning SAS/ETS Software Procedures Questions 1. For example.

such as PROC REG or PROC GLM. OUTPUT OUT=OUT1 P=P R=R. RUN. )s morf tnereffid t rof detalerrocnu era s ε dna ε ( rehto hcae htiw detalerrocnu era semit lla ta ecnairav emas eht evah t t . MODEL SALES=ADV COMP / DW.Chapter 1: Overview of Time Series 7 Output 1.noitubirtsid lamron a evah t ε For this model. assume that the errors • ε+ t 2 X2β + 1X1β + 0β = Y t • • t . suppose you have 80 observations and you issue the following statements: TITLE “PREDICTING SALES USING ADVERTISING”. PROC REG DATA=SALES.1 Producing a Simple Plot of Monthly Data A multiple linear regression model relating the variables is t These assumptions allow you to use standard regression methodology. For example. TITLE2 “EXPENDITURES AND COMPETITORS’ SALES”.

1< ρ t t is related to 1− t ε t ε . 0 β Output 1. This type of error term. The standard errors are incorrect if the assumptions on are not satisfied.0 48640719.1 451.15 eulaV F and et is an uncorrelated series.2 serauqS fo muS 97 77 2 FD latoT C rorrE ledoM ecruoS 188770989642 31E1190362.2 Performing a Multiple Regression The test statistics produced by PROC REG are designed specifically to detect departures from the uncorrelated) of the form null hypothesis ( 1000.0 |T| > borP 3955.759373 rorrE dradnatS 706506. in which where called an AR (autoregressive) error of the first order.0 F>borP 041.0 08 493.2274603 naeM peD 22759.t ε 8 SAS for Forecasting Time Series Output 1. is e + 1−t ερ = :0 H ε :1H t ε 382.4 31E9518109.sbO fo rebmuN roF( D nostaW-nibruD 33456480.5 122.1 55893.0 1000.0 1000.2 shows the estimates of . 2 β dna .0 5075.7013.1 31E2281625.01 5610072 etamitsE retemaraP 1 1 1 FD PMOC VDA PECRETNI elbairaV 0=retemaraP :0H rof T setamitsE retemaraP qs-R jdA erauqs-R 51612.0576971.V.1 erauqS naeM ecnairaV fo sisylanA SELAS :elbairaV tnednepeD 1LEDOM :ledoM erudecorP GER ehT SELAS 'SROTITEPMOC DNA SERUTIDNEPXE GNISITREVDA GNISU SELAS GNITCIDERP .7 noitalerrocotuA redrO ts1 ).C 17807.61 .0 1000. You have created an output data set called OUT1 and have called for the Durbin-Watson option to check on these error assumptions. 1β .979694 ESM tooR 31E899724.

positive autocorrelation is present.1 β . the Durbin-Watson bounds do not hold when lagged values of the dependent variable appear on the right side of the regression. Suppose an important variable. Thus. which is evidence of negative autocorrelation. The smallest possible value for d is 0. the numerator of d has an expected value of about 2 X 2β ε Σ ˆ − / t 1X1β 2 ) 1− t ˆ ˆ ε − t ε ( 2 =ntΣ = d ˆ − 0β 2 ˆ β − dna t Y = tε ˆ . the ratio d should be approximately 2. Even with k and n fixed.59 < d < 1. it seems to be the most common. the critical value must be between dL=1.* Three warnings apply to the Durbin-Watson test.Chapter 1: Overview of Time Series 9 The Durbin-Watson option in the MODEL statement produces the Durbin-Watson test statistic t 1= t ˆ n 2 − where t is closer to than in the independent case. Thus. you would be unable to reject the null hypothesis of uncorrelated errors. which equals the number of explanatory variables. Second. you would not know correct bounds for the critical value. the critical value can vary depending on actual values of the independent variables. excluding the intercept and n (number of observations) to obtain the bounds dL and dU for any given regression (Draper and Smith 1998). The results of Durbin and Watson imply that if k=3 and n=80. Specifically. Third.69 you cannot be sure whether d is to the left or right of the actual critical value c because you know only that 1. had been omitted in the sales example. If d were less than 1. It follows that d should also be smaller. ′ ′ ′ ′ * Exact p-values for d are now available in PROC AUTOREG as will be seen in Output 1. if you incorrectly specify the model. you must compare d=1. In this case. Some practitioners use d as a lack-of-fit statistic. if the errors are 2 σ )1 − n(2 ε t ε If the actual errors are uncorrelated. if you want ( to test for positive autocorrelation at the 5% significance level. If d is significantly less than 2. ADV. If d>2. 1− t ε t . compute d =4–d and compare the results to dL and dU. and COMP) and n=80 observations. This omission could produce a significant d.59 you would reject the null hypothesis of uncorrelated errors in favor of the alternative: negative autocorrelation. In general.2A later in this section.954) were greater than 1. it is designed to detect first-order AR errors. which is justified only if you assume a priori that a correctly specified model cannot have autocorrelated errors and. that significance of d must be due to lack of fit. Note that if 1. Although this type of autocorrelation is only one possibility. When is a Durbin-Watson statistic significant? The answer depends on the number of coefficients in the regression and on the number of observations.59 < c < 1. 1− t ε − t ε t ε 2 σn and the denominator has an expected value of approximately uncorrelated. such as X3t=product availability.59 and dU=1. The test has some power against other types of autocorrelation. if the example had used last month's sales to help explain this month's sales. Most tables use k =k 1. you have k=3 coefficients for the intercept.69. Since d is less than dL. you would reject the null hypotheses of uncorrelated errors in favor of the alternative: positive autocorrelation. 0β .69. so Positive autocorrelation means that should be smaller. the DurbinWatson statistic often lies in the critical region even though no real autocorrelation is present.349 to a critical value. thus.69 Durbin and Watson have constructed tables of bounds for the critical values. First. if d (1.

If they do. Note also the increase in R-square (the proportion of variation explained by the model) from 39% to 82%.2B. MODEL SALES=ADV ADV1 / DWPROB.04 this period but a decrease of $5. MODEL SALES=ADV ADV1 COMP / DWPROB. PROC AUTOREG DATA=NCSALES.10 SAS for Forecasting Time Series The output also produced a first-order autocorrelation. d =1. a value 2 /1 exceeding 1. d is approximately taht g n i to n y b n e es y l isae si sihT . the Durbin- . 2 /1 is approximately distributed as a standard normal variate.5427 (p-value . that is. The resulting Output 1. It is subject to the three warnings given for the Watson test is preferable.0001 < . This is especially helpful when the number of observations exceeds the largest in the Durbin-Watson table—for example.0 denoted as When n is large and the errors are uncorrelated. 2 382. and Durbin and Watson also gave a computer-intensive way to compute exact p-values for their test statistic d. Because of the approximate nature of the ρ − 1(2 2 /1 )ˆ 2 t ε ˆ ∑ 2 / ) 1− t ε − tε ( ˆ ˆ t ε ˆ 2 ∑ / 1− tε t ε ˆ ˆ −1 (. RUN. In general. RUN.639 test. you issue this code to fit a model for sales as a function of this-period and last-period advertising.2A shows a significant d=.8728 is insignificant (p-value . You wonder if the true coefficients on ADV and ADV1 are the same with opposite signs. Thus.0 You should use this test only for large n values. you wonder if these coefficients add to 0. in Output 1. Now. Could this be because of an omitted variable? Try the model with competitor’s sales included. What is the effect of an increase of $1 in advertising expenditure? It gives a sales increase estimated at $6. then the increase we get this period from advertising is followed by a decrease of equal magnitude next ) 2 ρ − 1( / ρ n ˆ ˆ 2 /1 Durbin-Watson test.18 next period. 382.05).283)/ ∑ =ρ ∑ ) ) 2 2 ρ − 1( / ρ n ˆ ˆ ρ − 1( / ρ n ˆ ˆ =d ˆ 2 /1 2 /1 08 =ρ ˆ = 2. PROC AUTOREG DATA=NCSALES.645 is significant evidence of positive autocorrelation at the 5% significance level.2239 > .05). This has been incorporated in PROC AUTOREG. For the sales data.

From Output 1.56 decrease in our sales. a temporary effect.188384ADV1 Output 1.0 6683.563227COMP + 6.Chapter 1: Overview of Time Series 11 period.0 qsR geR 128.077>. PROC REG DATA = SALES. and thus it is possible that advertising just shifts the timing.2A borP xorppA oitaR t 1000.00 in our competitor’s sales is associated with a $0.0 576.0 nostaW-nibruD 6683. RUN.8761 CBS 08027076 ESM 9E6461. TEMPR: TEST ADV+ADV1=0.6 596. MODEL SALES = ADV ADV1 COMP. so at best we would have to substitute estimates of these future values in forecasting our sales.1761 557.0 0490.5408. Having no autocorrelation evident.0 1000. you fit the model in PROC REG asking for a test that the coefficients of ADV and ADV1 add to 0. Note the label TEMPR on the test. Note also that.1 setamitsE serauqS tsaeL yranidrO SELAS = elbairaV tnednepeD WD<BORP qsR latoT CIA ESM tooR EFD rorrE dtS 6069.2358 7245.5390065.05) is not small enough to reject the hypothesis that the coefficients are of equal magnitude. This means our advertising dollar simply shifts the timing of sales rather than increasing the level of sales.2C gives the results. Output 1. It appears that an increase of $1.038203ADV – 5. although we may have information on our company’s plans to advertise. The p-value (.5 ESS eulaV B 132510.6 66441 FD 1 1 1 1VDA VDA tpecretnI elbairaV Predicting Sales from Advertising erudecorP GEROTUA .9818 77 122.0 1469.2C the forecasting equation is seen to be PREDICTED SALES = 35967 – 0.0 1. Notice that the regression is exactly that given by PROC AUTOREG with no NLAG= specified. we would likely not know what our competitor’s sales will be in future months.0 1000.

5302830.1994621396 3 erauqS serauqS FD naeM latoT C rorrE ledoM ecruoS fo muS ecnairaV fo sisylanA SELAS :elbairaV tnednepeD SELAS S'ROTITEPMOC DNA SERUTIDNEPXE GNISITREVDA GNISU SELAS GNITCIDERP 1000.0 901.811 eulaV F 4.7 0=retemaraP :0H rof T 47521915.4244 .0 1000.0 :eulav F 1 :F>borP 67 :FD 55257591 :rotanimoneD :FD 768.3661240132 2.03692 61393.45257591 2.38830136:rotaremuN RPMET :tseT SELAS :elbairaV tnednepeD SELAS S'ROTITEPMOC DNA SERUTIDNEPXE GNISITREVDA GNISU SELAS GNITCIDERP 440.0 1000.sbO fo rebmuN roF( D nostaW-nibruD 483881.0 8768400.31783.0 1140.9684 rorrE dradnatS noitalerrocotuA redrO ts1 ).8639177841 67 7.C naeM peD ESM tooR 1000.0 qsR geR 736.076953 etamitsE retemaraP 1 1 1 1 FD 1VDA VDA PMOC PECRETNI elbairaV setamitsE retemaraP 3618.0 F>borP 820.1 1000.076953 eulaV B 1 1 1 1 FD 1VDA VDA PMOC tpecretnI elbairaV borP xorppA oitaR t 9322.0 48242225.0 50690140.0 2225.0 |T| > borP 499.9534898148 97 548.7322.11 507.1 nostaW-nibruD 3328.7 1915.9265.0 3328.V.3851 CBS 55257591 ESM 9E7784.31783.6 722365.0 0.6 722365.1 ESS setamitsE serauqS tsaeL yranidrO SELAS = elbairaV tnednepeD erudecorP GEROTUA SELAS S'ROTITEPMOC DNA SERUTIDNEPXE GNISITREVDA GNISU SELAS GNITCIDERP Output 1.41 05212.9684 rorrE dtS WD<BORP qsR latoT CIA ESM tooR EFD 483881.0 08 378.0 1000.11 507.0 1000.2B Predicting Sales from Advertising and Competitor’s Sales 12 SAS for Forecasting Time Series .9265.2C Predicting Sales from Advertising and Competitor’s Sales Output 1.0 1000.0 3328.3 6670.4244 67 8278.0 1000.5302830.0 499.4751 393.0 qs-R jdA erauqs-R 30239.

Chapter 1: Overview of Time Series

13

**1.3.2 Highly Regular Seasonality
**

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 Yt on the twelve indicators with no intercept. You can also regress Yt on a column of 1s and eleven of the indicator variables. The intercept now estimates the level for the month associated with the omitted indicator, and the coefficient of any indicator column is added to the intercept to compute the seasonal level for that month. For further illustration, Output 1.3 shows a series of quarterly increases in North Carolina retail sales; that is, each point is the sales for that quarter minus the sales for the previous quarter. Output 1.4 shows a plot of the monthly sales through time. Quarterly sales were computed as averages of three consecutive months and are used here to make the presentation brief. A model for the monthly data will be shown in Chapter 4. Note that there is a strong seasonal pattern here and perhaps a mild trend over time. The change data are plotted in Output 1.6. To model the seasonality, use S1, S2, and S3, and for the trend, use time, T1, and its square T2. The S variables are often referred to as indicator variables, being indicators of the season, or dummy variables. The first CHANGE value is missing because the sales data start in quarter 1 of 1983 so no increase can be computed for that quarter. Output 1.3 Displaying North Carolina Retail Sales Data Set

4032 9022

2T 52 61 9 4 1

84 74

1T 5 4 3 2 1

0 1

3S 0 0 1 0 0

0 0

2S 0 0 0 1 0

0 0

1S 1 0 0 0 1

59.6251 16.345

95.382153.266 42.336 14.8761 .

EGNAHC

)seniL tuptuO eroM(

4Q49 3Q49

ETAD 1Q48 4Q38 3Q38 2Q38 1Q38

84 74

SBO 5 4 3 2 1

14 SAS for Forecasting Time Series

Output 1.4 Plotting North Carolina Monthly Sales

**Now issue these commands:
**

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

Chapter 1: Overview of Time Series

15

This gives Output 1.5. Output 1.5 Using PROC AUTOREG to Get the DurbinWatson Test Statistic

PROC AUTOREG is intended for regression models with autoregressive errors. An example of a model with autoregressive errors is

Note how the error term Zt is related to a lagged value of itself in an equation that resembles a regression equation; hence the term “autoregressive.” The term t represents the portion of Zt that could not have been predicted from previous Z values and is often called an unanticipated “shock” or “white noise.” It is assumed that the e series is independent and identically distributed. This one lag error model is fit using the /NAG=1 option in the MODEL statement. Alternatively, the options /NLAG=5 BACKSTEP can be used to try 5 lags of Z, automatically deleting those deemed statistically insignificant. Our retail sales change data require no autocorrelation adjustment. The Durbin-Watson test has a p-value 0.8608>0.05; so there is no evidence of autocorrelation in the errors. The fitting of the model is the same as in PROC REG because no NLAG specification was issued in the MODEL statement. The parameter estimates are interpreted just as they would be in PROC REG; that is, the predicted change PC in quarter 4 (where S1=S2=S3=0) is given by

2

1931.0 1000.0 1000.0 5300.0 1900.0 5100.0 borP xorppA

8068.0 1229.0 9640.296 402.953 14

805.1042.01 084.11201.3 637.2593.3 oitaR t

setamitsE serauqS tsaeL yranidrO

WD<BORP qsR latoT CIA ESM tooR EFD

7.641 8.641 3.051 6913.0 8244.61 1.002 rorrE dtS

g

erudecorP GEROTUA 0773.2 nostaW-nibruD 1229.0 qsR geR 8741.307 CBS 5.720921 ESM 8210925 ESS 650782.122948717.3051 105238.5271025199.0 888299.44872724.976 eulaV B

t

Z + X 2β + X 1β + 0β = Y

**EGNAHC = elbairaV tnednepeD
**

t2

t 99.0 + t 99.44 – 4.976 = CP

1 1 1 1 1 1 FD

t1

t

3S 2S 1S 2T 1T tpecretnI elbairaV

g+

1 –t

Zρ= Z

t

t

erehw

16 SAS for Forecasting Time Series

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

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 Output 1.6 the data are dots, and the fourth quarter quadratic predicting function is the smooth curve. Vertical lines extend from the quadratic, indicating the seasonal shifts required for the other three quarters. The broken line gives the predictions. The last data point for 1994Q4 is indicated with an extended vertical line. Notice that the shift for any quarter is the same every year. This is a property of the dummy variable model and may not be reasonable for some data; for example, sometimes seasonality is slowly changing over a period of years. Output 1.6 Plotting Quarterly Sales Increase with Quadratic Predicting Function

To forecast into the future, extrapolate the linear and quadratic terms and the seasonal dummy variables the requisite number of periods. The data set extra listed in Output 1.7 contains such values. Notice that there is no question about the future values of these, unlike the case of competitor’s sales that was considered in an earlier example. The PROC AUTOREG technology assumes perfectly known future values of the explanatory variables. Set the response variable, CHANGE, to missing.

t 99.0 + t 99.44 – 38.5271– 4.976 = CP

Chapter 1: Overview of Time Series

17

**Combine the original data set—call it NCSALES—with the data set EXTRA as follows:
**

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 Output 1.5, there is a total R-square and a regression R-square, the latter measuring the predictability associated with the explanatory variables apart from contributions due to autocorrelation. Of course in the current example, with no autoregressive lags specified, these are the same and P= and PM= create the same variable.

gnisu GEROTUA CORP morf seulav detciderp ehT

2T 6313 5203 6192 9082 4072 1062 0052 1042

1T 65 55 45 35 25 15 05 94

3S 0 1 0 0 0 1 0 0

2S 0 0 1 0 0 0 1 0

1S 0 0 0 1 0 0 0 1

EGNAHC . . . . . . . .

.8.1 tuptuO ni deyalpsid era LLA tes atad

ETAD 4Q69 3Q69 2Q69 1Q69 4Q59 3Q59 2Q59 1Q59

SBO 8 7 6 5 4 3 2 1

Output 1.7 Data Appended for Forecasting

18 SAS for Forecasting Time Series

Output 1.8 Plotting Quarterly Sales Increase with Prediction

Because this example shows no residual autocorrelation, analysis in PROC REG would be appropriate. Using the data set with the extended explanatory variables, add P and CLI to produce predicted values and associated prediction intervals.

PROC REG; MODEL CHANGE = T T2 S1 S2 S3 / TITLE “QUARTERLY SALES INCREASE”; RUN;

P

CLI;

Output 1.9 Producing Forecasts and Prediction Intervals with the P and CLI Options in the Model Statement

For observation 49 an increase in sales of –870.4 (i.e., a decrease) is predicted for the next quarter with confidence interval extending from –1695.9 to –44.98. This is the typical after-Christmas sales slump.

9095.5977607 )sserP( SS diseR detciderP 5206.7210925 slaudiseR derauqS fo muS 0 slaudiseR fo muS . . . . . . . . 8.2022 5.6981 6.9353 7.932 2.6781 8.4851 7.2423 8489.446.533 4772.96 0.0571 4.13515.561 6968.999.1851 9.5961600.192 299.472 804.952 374.152 714.422 769.112 521.002 600.591 2.9621 9.289 8.4462 8.5469.0201 4.247 3.2142 4.078. . . . . . . . 65 55 45 35 25 15 05 94 )senil tuptuo erom( 3800.730.741 2.103 7.814. laudiseR 6.7542.6031 3.9211 5.1092 0.562tciderP %59reppU 6.53026.5721.5647.2921 8.5191tciderP %59rewoL 916.351 820.651 856.361 201.271 600.591 tciderP rrE dtS 6.64213.515 1.233 1.7902 4.0901eulaV tciderP 6.38214.266 2.336 4.8761 . EGNAHC raV peD 5 4 3 2 1 sbO esaercnI selaS ylretrauQ 1931.0 1000.0 1000.0 5300.0 1900.0 5100.0 |T| > borP 805.1042.01 084.11201.3 637.2593.3 0=retemaraP :0H rof T 26467596.641 15123848.641 41602133.051 01726913.0 92487244.61 71476421.002 rorrE dradnatS 650782.122948717.3051 105238.5271025199.0 888299.44872724.976 etamitsE retemaraP 1 1 1 1 1 1 FD 3S 2S 1S 2T 1T PECRETNI elbairaV setamitsE retemaraP 6219.0 1229.0 qs-R jdA erauqs-R 62071.821 23552.082 89302.953 .V.C naeM peD ESM tooR 1000.0 F>borP 360.79 eulaV F 685.82090976 64 5205.720921 5206.7210925 14 791.08732521 489.00981626 5 erauqS naeM serauqS fo muS FD latoT C rorrE ledoM ecruoS ecnairaV fo sisylanA EGNAHC :elbairaV tnednepeD ESAERCNI SELAS YLRETRAUQ

Chapter 1: Overview of Time Series

19

20 SAS for Forecasting Time Series

What does this sales change model say about the level of sales, and why were the levels of sales not 3 used in the analysis? First, notice that a cubic term in time, bt , when differenced becomes a quadratic 3 3 2 term: bt – b(t–1) = b(3t – 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 Output 1.10. The first thing to note is that the degree 8 polynomial, arrived at by inappropriate use of ordinary regression, gives a ridiculous forecast that extends vertically beyond the range of our graph just a few quarters into the future. The degree 3 polynomial seems to give a reasonable increase while the intermediate degree 6 polynomial actually forecasts a decrease. It is dangerous to forecast too far into the future using polynomials, especially those of high degree. Time series models specifically designed for nonstationary data will be discussed later. In summary, the differenced data seem to satisfy assumptions needed to justify regression. Output 1.10 Plotting Sales and Forecasts of Polynomials of Varying Degree

1994).3. you obtain ) t Now if t satisfies the standard regression assumptions. you obtain an interval 1.7) = 14.).3 Regression with Transformed Data Often. Yn). (Xn. you analyze some transformed version of the data rather than the original data. Xn+2. This is discussed in the time series context in Box and Jenkins (1976.. .323 < Yn+s < 14. Box and Cox (1964) suggest a family of transformations and a method of using the data to select one of them. Now use the MODEL statement in PROC REG: MODEL LY=X / P CLI. The logarithmic transformation is probably the most common and is the only transformation discussed in this book..323 and exp(2.. (X2. . When t the overall shape of the plot resembles that of ) 1 (0 X β ε( gol + X ) 1β( gol + 0 β t )0 β( gol = ) Y ( gol ε) ε) t t ) 1 (0 X 1 (0 X t β β= β β= ε ( gol = β β= t − t η t t Y Y Y η − . Consider the following model: t Taking logarithms on both sides. Y2). Set Yn+1 through Yn+s to missing values (.13 < log(Yn+s) < 2.7 you can compute exp( 1.88 Note that the original prediction interval had to be computed on the log scale. the only scale on which you can justify a t distribution or normal distribution. Y1).. Xn+s to the data if they are available. 1 where LY=LOG(Y). This produces predictions of future LY values and prediction limits for them. As before. if the data consist of (X1. is specified in the DATA step.13) = .. If.Chapter 1: Overview of Time Series 21 1. for example.88 to conclude . the regression of log(Yt) on 1 and Xt and if produces the best estimates of log( ) and log( ). you can append future known values Xn+1.. When should you use logarithms? A quick check is to plot Y against X.

β β ε around the appropriate curve. the variation . the actual points are scattered becomes more dramatic as around the curve is greater at the higher points and lesser at the lower points on the curve.22 SAS for Forecasting Time Series See Output 1.13. The curvature and especially the variability displayed are similar to those just described. you simply have Xt=t.11 Plotting Exponential Curves ) 1 (0 X Output 1. Because this plot is straighter with more uniform variability. you decide to analyze the logarithms.12 shows a plot of U. Treasury bill rates against time. Output 1. Note that the curvature in the plot moves away from 1 in either direction.11 for several examples of this type of plot. A plot of the logarithm of the rates appears in Output 1.S. In this case. Because the error term 1 β is multiplied by .

12 Plotting NinetyDay Treasury Bill Rates Output 1.Chapter 1: Overview of Time Series 23 Output 1.13 Plotting NinetyDay Logged Treasury Bill Rates .

.15. .24 SAS for Forecasting Time Series To analyze and forecast the series with simple regression. Output 1. . Treasury Bill Data ESABATAD CIMONOCE KNABITIC/ESABITIC EMIT 552 452 352 252 152 472 372 272 172 072 )seniL tuptuO eroM( 3MGYFL . IF EOF THEN DO I=1 TO 24. RUN. TIME+1. LFYGM3=. LFYGM3. The result is shown in Output 1.DATE..S. . . ID DATE. you first create a data set with future values of time: DATA TBILLS2. END. DATE=INTNX('MONTH'. TIME+1. .14 shows the last 24 observations of the data set TBILLS2.1). on TIME to estimate log )1 ( You also produce predicted values and check for autocorrelation by using these SAS statements: PROC REG DATA=TBILLS2. . OUTPUT. β gol ETAD 38RAM 38BEF 38NAJ 28CED 28VON 48TCO 48PES 48GUA 48LUJ 48NUJ )t ( ε gol + EMIT* ) 1β( gol + ) 0β( gol = 3MGYFL SBO 5 4 3 2 1 42 32 22 12 02 )0 β( . SET TBILLS END=EOF. DROP I. You then regress the log T-bill and in the following model: rate. TITLE 'CITIBASE/CITIBANK ECONOMIC DATABASE'. MODEL LFYGM3=TIME / DW P CLI. OUTPUT. RUN. . . TITLE2 'REGRESSION WITH TRANSFORMED DATA'.14 Displaying Future Date Values for U. Output 1.

74 56399.0 0146.1 1431.0 3400.1 8589.1 7789. 28VON 152 )seniL tuptuO eroM( 3851.51 6399.1 2216.2 NOITALERROCOTUA REDRO TS1 ).1 2656.2 5200.V.0 130.0 530.0 1156.1 7289.0 530.2 1179. .0 |T| > borP EMIT PECRETNI elbairaV setamitsE retemaraP 3486. .2 5888.0 qs-R jdA erauqs-R 88760.0laudiseR 0236.SBO FO REBMUN ROF( D NOSTAW-NIBRUD )sserP( SS diseR detciderP slaudiseR derauqS fo muS slaudiseR fo muS .0 F>borP 336.41 0 .C naeM peD ESM tooR 1000.0 030.0 052 090.15 Producing Predicted Values and Checking Autocorrelation with the P.1 1716.0 130.0 530.2 8184.0 030.41 38747. .23 erauqS naeM 53976. . . 2189.41 07586.0 1000.08431.2 9069.1 1726.1 6000.04331.1 88542.0 4312.2 8174.2 8674.1 1921.0 5586.045 eulaV F 64060.1 6299.1 630.0 1441.0 6673. .2 .1 6000.08421.23 serauqS fo muS 942 842 1 FD latoT C rorrE ledoM ecruoS ecnairaV fo sisylanA 3MGYFL :elbairaV tnednepeD ESABA TAD CIMONOCE KNABITIC/ESABITIC Output 1.2 8684.1 130.2 0669. .1 etamitsE retemaraP 1 1 FD 1000.0 830911.1 26YAM 26RPA 26RAM 26BEF 26NAJ ETAD 5 4 3 2 1 sbO tciderP tciderP tciderP eulaV 3MGYFL %59reppU %59rewoL rrE dtS tciderP raV peD ATAD DEMROFSNART HTIW NOISSERGER 252.0 07586.0 .04321.159.32 278.0 rorrE dradnatS 010500.0 9536.0 0646.1 0421.0 130.2 1679. and DW Options in the MODEL Statement ATAD DEMROFSNART HTIW NOISSERGER Chapter 1: Overview of Time Series 25 . .0 530. CLI. 8468.1 3400.2 6799.53 0=retemaraP :0H rof T 84512000.1 1226. 48TCO 48PES 48GUA 48LUJ 48NUJ 472 372 272 172 072 )seniL tuptuO eroM( .1 1931.0 9194.0 05591130.

x σ Suppose X=log(y) and X is normal with mean Mx and variance 2 2 =ρ ˆ Note that the Durbin-Watson statistic of the Durbin-Watson tables.377) = 10. We prefer to simply exponentiate and think of the result.77 is the predicted value.0 = 48. The growth rate of Treasury bills is estimated from this model to be between 0.63 which is greater than 1.1 2 < 0β < 088. Similarly. At the 5% level.1 1 ) < 1β < 6400. Therefore.54% per time period. reasoning that this is a more credible central estimate for such a highly skewed distribution.1( − 911.61 < FYGM3251 < 17. you can conclude that positive autocorrelation is present (or that your model is misspecified in some other way). x ) For this reason.13. Then y = exp(x) and y has . you use 2/ is d=0.46% and 0.26 SAS for Forecasting Time Series Now. some authors suggest adding half the median exp(Mx) and mean exp(Mx+ error variances to a log scale forecast prior to exponentiation. 552.645.1( Thus. because n=250 to compute 1 β σ½ 0 β is a 95% confidence interval for 4500.377) = 10. This is also evident in the plot.377 < 2.0 ( )69. nor would you want it to do so. you should recompute your forecasts and confidence intervals using some of the methods in this book that consider autocorrelation. as an estimate of the median. However.77.090.3 which is a 95% confidence interval for .61 and 17. for example. in Output 1.865 so that 6.1 + 911. the prediction 10.0 ( )69. you obtain is beyond the range n . exp(2. in which the data fluctuate around the overall trend in a clearly dependent fashion. you compute: )2130. 159.1 < ) 0β ( gol < )2130. Because the distribution on the original levels is highly skewed. for example.55. Your forecast for November 1982 can be obtained from 1.77 does not lie midway between 6.55 is a 95% prediction interval for the November 1982 yield and exp(2.888 < 2.2 ρ − 1( / ρ ˆ ˆ 2 /1 .

.3 Yule-Walker Equations for Covariances 41 2. The term for such an sequence is . for example. .2 Statistical Background 28 2. you see that the mean (expected value) of Yt is .2.2 Backshift Notation B for Time Series 40 2.0 ( N t µ− 2− 2− e + ) µ − 2 − tY( ρ = µ − 1 − tY t Y( 2 ρ + 1 − eρ + t e 2 ρ + 1 − teρ + te = µ − 1< ρ t e + ) µ − 1 − tY( ρ t e=µ− t e where is a sequence of uncorrelated t e + ) µ − 1 − tY ( ρ = µ − t t t Y Y Y retpahC 2. you obtain ) When you continue like this.2) ) If you assume ..1 Introduction 2. + ) 2 σ.1 Forecasting with PROC ARIMA 30 2.2. .1 Terminology and Notation Often you can forecast a series Yt simply based on past values Yt-1.3 Fitting an AR Model in PROC REG 45 2. Assuming equation 2. For example.2 Forecasting 29 2. .1 Introduction 27 2.1. Furthermore.1 Terminology and Notation 27 2. suppose Yt satisfies (2. ) 2 ρ − 1( / 2 σ Suppose the variance of Yt-1 is t . 1− t and when you substitute in equation 2.1.1. the effect of the series values before you started collecting data (Y0. for example) is minimal. you obtain (2.1) variables. Then the variance of µ t e µ− 0 ( Y t ρ + 1e1 − ρ + ..2 Simple Models: Autoregression white noise.1.1 holds at all times t. Yt-2. you can write.2.

1.1. Thus. if they decline exponentially at rate as lag j increases. the covariance between Yt and Ys depends only on the time distance | t–s | between these observations and not on the values t and s.. Y( rav j ρ = ) 2 ρ − 1( / 2 σ ρ = ) j ( γ − te 2 t ρ − 1( / 2 σ = )0 ( γ Y( j = ρ 0 =∞ Σ + µ = v oc j (2. j you have ) t An interesting feature is that does not depend on t.801 = )2 ( γ . You can also compute a covariance between Yt and Yt-j from equation 2.12 ) j (γ You know the variance of your process.3) )1 − j ( γ / ) j ( γ = )1( γ = ) 0( γ j = )j ( γ = )0( γ / ) 2( γ / )1 γ ( t Y ρ . Suppose you observe this sequence: .3. is often called the “Wold representation” of the series. 3/2 and.28 SAS for Forecasting Time Series is ) 2. by extending equation 2. which is 342 = )0( γ = ) Y(rav t and you note that 3/2 Also.27 = )3( γ . model 1. Calling this covariance 1< ρ ) − t Y.. Equation 2.342 2 ρ − 1( / 2 σ = 2 σ + ) 2 ρ − 1( / 2 σ 2 ρ . you decide that model 1 is appropriate and that Because ) = )6( γ . in which the series is expressed in terms of a mean and past shocks. Why emphasize variances and covariances? They determine which model is appropriate for your data. as j the that is.23 = )5( γ .261 = )1( γ . This again shows that if effect of shocks in the past is minimal.3. . . One way to determine when model 1 is appropriate is to compute estimates of the covariances of your data and determine if they are of the given form—that is. In other words.2 back into the infinite past.84 = )4 ( γ ) 2 ρ − 1( / 2 σ ) j (γ which shows that the variance of Yt is also . 3/2 3/2 =ρ all the way through the sequence.3.2 Statistical Background You can define Yt as an accumulation of past shocks et to the system by writing the mathematical model shown in equation 2. in fact.

you know that in the discussion above 001 = µ 1 + ne At time n. of your observations). If you have data up to time n. it is easy to compute the forecast of Yn+1 as )00 and the forecast error as 1 + ne Similarly. Because Yn is available. You forecast en+1 by its unconditional mean 0. . assume model 1 holds and estimate 3. en+1 has not occurred and is not correlated with anything that has occurred up to time n. for a general ) + )001 − and ρ = )342 ( ) )3 / 2 ( Y 1− nY()3 / 2( nY()3 / 2( 1− . 2 n ( Y + 1− L +neρ + L + ne nY( )3 / 2( = L µ− ρ+µ= = 001 − 1 + nY + 001 = 1 + nY ˆ 1+ n 2 − n ( Y − 1 + nY ˆ Y 1( + L + 001 L +n ρ+µ = 2σ 2 + ne a forecast L steps into the future is to see if they decrease exponentially. µ− µ Similarly. and Y ˆ . . ρ µ 1+ ne 1− L . Examine estimates of the autocovariances 2. 2 + ne + 1 + ne + )001 − nY ( )3 / 2 ( )3 / 2 ( = + )001 − 1 + nY ( )3 / 2 ( = 2 + ne 001 − 2 + nY and you forecast Yn+2 as )00 with forecast error 1 + ne)3 / 2( with error A forecasting strategy now becomes clear. ρ ρ +.Chapter 2: Simple Models: Autoregression 29 you also know that 531 2. If so. you use an estimate like the mean. You do the following: )j ( γ 1.2 Forecasting How does your knowledge of help you forecast? Suppose you know (in practice. Calculate the prediction ) .

such a decomposition of Yn+L into a prediction that is a function of current and past Y’s. L+n 531 = 2 σ = ) e ( rav µ− Y =µ L+n t Y Y . if the forecasts become 118. It will be shown that for a whole class of models called ARMA models. which can be estimated. 112. was expanded as an infinite sum of past shocks et showing In this section how past shocks accumulate to determine the current deviation of Y from the mean. The forecasts decrease exponentially at rate to the series mean . but you may as well use the series mean to forecast a stationary series far into the future. 238. . ESTIMATE P=1 NOCONSTANT.. RUN. substituting . Y2. and 241.2.09 PROC ARIMA DATA=EXAMPLE. . plus a prediction error that is a linear combination of future shocks (e’s) is possible.001 . like . =Y As an example. The forecast error variances.1 Forecasting with PROC ARIMA 190.721 become 135. 1 < ρ fi Y tneserp eht no tceffe elttil sah oga emit gnol a deneppah taht skcohs fo tceffe ehT and last observation n o i tci d erp eht os } 1+ ne fo noitciderp )ecnairav rorre noitciderp muminim( tseb ehT 1− L ρ+ + 1− L +ne ρ + L +ne { 2 − L 2ρ + + ρ + ρ + 1 σ 4 si n o itci derp taht ni rorre ehT 2 ) µ − nY( ρ+ µ + 1− ne ρ + ne = µ − nY which. The coefficients in these expressions are functions of the model parameters. 233. like si e cnairav rorre 001 = µ L 2 − L2 =ρ ρ ρ + .3 ) 2 ρ − 1( / 2 σ 2 3/2 =ρ σ .8. 221.. for your parameters.5. .4. FORECAST LEAD=5.. shows that + 1− ne ρ + ne{ Lρ + } 1+ ne 1− Lρ + γ= 342 + 1− L +ne ρ + L +ne{ = µ − = e + ) µ − 1− tY( ρ = 2 2)3 / 2 ( − 1 / 531 = { } = nY d na .3 / 2 ρ ˆ You must substitute estimates.246 are analyzed with these statements: .2 . At time n + L this expansion was } t The future shocks (e’s) in item 2 have not yet occurred. IDENTIFY VAR=Y CENTER.1 helps you forecast in the short run. based on .7.6. + 4 ρ + 2 ρ + 1( 2 σ si . . Y200 with mean Y200 = 140.. 102. The forecast error variance converges to the series variance )0 ( This shows that an equation like equation 2.. 2. . 105.30 SAS for Forecasting Time Series and the forecast error variance ) For example. 195. 103. 200 data values Y1.1.1 . 108. but from the historic residuals an estimate of can be obtained so that the error variance can be estimated and a prediction interval calculated.3.

73(1 + .Chapter 2: Simple Models: Autoregression 31 Output 2. | | *******| .0 865601.1 shows the results when you use PROC ARIMA to identify.28054173. If were 0.0 117070.91 exceeds the 5% critical value. .47490.246 – 90.0 ρ | *****| . Also. 956. you have 430.74- σ ) j (γ 5 4 3 2 1 0 gaL 42 32 22 12 02 91 .5 (430.559 535." =ρ ˆ |* |* |** |** |* |* snoitalerrocotuA . .0 027741.25930.0 32734.0 92797. snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM elbairaV fo emaN ) 0( γ / ) j ( γ = ) j (ρ | | | | | | 77752. (The correlation at lag 0 is always and in general . . . to estimate .503 with forecast standard error (430. . .204 630. You forecast Y201 by an estimate of 90. .0 868121.754 Next.653 with forecast standard error 2 .1 Using PROC ARIMA to Identify. this t would have approximately a standard normal distribution in large samples. .0 27533. .425 155.99370. The covariances 1199. you forecast Y202 by 90.88545.0 643841.73).05505386. 2 1 = )0(ρ 249. The ESTIMATE statement produces an estimate significance with the t ratio.1 noitalerroC 93240. 709.0 00000. Dividing each covariance by the variance 1198.091 + . | | *********| .43 0 Y .54 (covariance at lag 0) gives the estimated sequence of correlations.80575)2(140.80575 )) = 26.96 in magnitude would be considered significant at about the 5% level. 402.52711.0 81195.8911 ecnairavoC 324308. . .091) = 122.8. and Forecast erudecorP AMIRA ehT 557331.) The correlation plot shows roughly exponential that you can test for decay.807 485.41960. | | ************| .0 866741. The estimates of are called covariances with j labeled LAG on the printout. is significant. Since t=18.0 .041195768.803 473.0 474921.091) = 130.0 0 rorrE dtS 238841.311725. and forecast.80575(140. estimate. decrease at a rate of about . 524.7275 .- )seniL tuptuO eroM( .5 = 20.6528 Output 2. .246 – 90. The CENTER option tells PROC ARIMA to use the series mean. | |********************| | 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1- | | | | | | µ ρ ˆ 57508.091 + (. 002 78916. 309.0 846841. . Thus a t exceeding 1.0 288741. Estimate. Y srorre dradnats owt skram ". | | ****************| .

< 1000.069902.240. | | . | | . | | . | . .0 852. .0 42481.0 450. | .042 32 22 12 02 91 )seniL tuptuO eroM( | .0800.0960.061841.**| .092797. | | .054230.0 891. *| . | | | | | | 65710.< 1000.353 71.0 630.0711.0 240.0 42 32 22 12 02 91 )seniL tuptuO eroM( | . *| . *| .0 --------------------snoitalerrocotuA-------------------- 1000.0 170.< 1000. |* . and Forecast (continued) 32 SAS for Forecasting Time Series . | | ****************| .0 95621. Estimate.077211. . |* .< qSihC > rP 42 81 21 6 FD 93. | .0noitalerroC 5 4 3 2 1 gaL Output 2.1 Using PROC ARIMA to Identify.0 52630.**| .0 noitalerroC 5 4 3 2 1 gaL | | | | | | .0 111. | | | | | | 01530.0590. | | .0 730.0040. | 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP 26900.0 37401. | | .0 25675.0 162.782 erauqS -ihC 42 81 21 6 gaL oT esioN etihW rof kcehC noitalerrocotuA | | | | | | . |*** ****| . |**.0 633.0 751.0 797.000510. |**. | .0 734. |************ | 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI 45040. | | .029940. *| .0 01270. .0 195.0 31221.0 78510.243 52.543 64.0 342.0 75560. . ***| .025720.0470.0 042.0 722. . *| . . |**** .0 22690. |* .

72 94.0 200.0 rorrE dradnatS 57508.0 650.0 560.9 64.13 1568. PROC ARIMA produced the forecasts and standard errors.4871 CBS 866.0240.0 410. and Forecast (continued) F In the manner previously illustrated.02 rorrE dtS 8421.0581.0 920.75 8198.0230. 640.62 0457.221 6305.0 100.0 1975.84 5268.0360.471 6397.0 500.< |t| > rP xorppA 19.0 --------------------snoitalerrocotuA-------------------- T AM E Output 2.0 700.0 011.1871 CIA 79357.1 Using PROC ARIMA to Identify.5 erauqS -ihC 63 03 42 81 21 6 gaL oT slaudiseR fo kcehC noitalerrocotuA .611 3356.0200.81 eulaV t 16240.0 240.0020.0430.02 etamitsE rorrE dtS 5727.0890.07 6081.1RA retemaraP noitamitsE serauqS tsaeL lanoitidnoC Y L Chapter 2: Simple Models: Autoregression 33 .tnanimreted gol edulcni ton od CBS dna CIA * 002 slaudiseR fo rebmuN 669.0 700. This means that 9327.0470.09 srotcaF evissergerotuA .471 9414.0200.0 qSihC > rP 53 92 32 71 11 5 FD 60.0 330.0 470.0 9536.0 3407.371 2949.0 .0700.0 etamitsE 1.171 7525.171 5628.0150.23 2777.0 3263.1 :1 rotcaF 46090.0301.98 stimiL ecnedifnoC %59 3959.0840.0630.0 6048. Estimate.701 4132.111 0823.0600.0820.031 tsaceroF 502 402 302 202 102 sbO Y elbairav rof stsaceroF )1(**B 57508.0 920.24 6315.0340.0460.02 03.ledom siht ni mret naem oN eulav eht gnitcartbus yb deretnec neeb evah ataD Y elbairav rof ledoM erudecorP AMIRA ehT 0928.0 060.11 64.92 8256.0 470.42 01.)Y 2 − 1− t ( Y Σ / )Y − 1 − tY ( ) Y − t Y( Σ = 57508.034 etamitsE ecnairaV 1 gaL 1000. The coefficients are estimated through the least squares (LS) method.

2 σ σπ 2 σ2 2 2 − pxe ])µ − 1− Y(ρ − ) µ − Y([ 1 2 + ])µ − 1Y(ρ − )µ − 2Y ([ + )µ − 1Y () ρ − 1( ]) µ − 1Y( ρ − )µ − 2Y([ + 2 )µ − 1Y() 2 ρ − 1( = SSU 2 2 σ2 t µ)ρ 1( = µρ µ normal distribution with mean – – and variance 1− t ρ− t Y= t e For the rest of the observations. One alternative estimation scheme is the maximum-likelihood (ML) method and another is unconditional least squares (ULS). it is most convenient to note that Y has a ρ − 1(/ 2 σ µ σπ2 σ2 2 2 − pxe ρ −1 ) 2 ρ-1( 2 )µ. it can be shown that the that maximizes the likelihood is USS/n. … ) σπ2 ( 2 − pxe n ρ −1 . The likelihood function for a set of observations is simply their joint probability density viewed as a function of the parameters. 2 . the joint likelihood is the product of these n probability density functions. where USS represents the unconditional sum estimate of of squares: 2 ]) µ − 1 − nY ( ρ − )µ − nY ([ + …+ … . Viewed in this way. The first observation Y1 is normal with mean and variance . namely 2]) µ − 1− nY (ρ − ) µ − nY ([ + Now substituting the observations for Y in the expression above produces an expression involving .1Y( 2 t 2 2 ne .1 e e 2 σ 2 σ dna . t=2. Using calculus.…. Its probability density function is ) 2 Each of these probability densities is thus given by 2 Because are independent. µ 2 Y Y . 3 . the expression above is called the likelihood function for the data and clearly depends on assumptions about the model form.3. ρ . A discussion of these methods in the context of the autoregressive order 1 model follows.4.34 SAS for Forecasting Time Series where is the mean of the data set and the sums run from 2 to 200.

The three rows in Output 2. corresponding to the sample mean.ρ( µ n Y([+…+ ]) Y 2 ρ 1 Y( ρ ) Y – – – – – Y _ . and maximum likelihood for an autoregressive order 1 model fit to these data.) µ . called a concentrated likelihood. ρ estimated. is used as an estimate of the population mean. and it is seen that these estimates can vary somewhat from method to method when the sample size is very small. Thus it minimizes a slightly different objective function. . Crosshairs in the plot floors indicate the minimizing values. The negative of the likelihood is shown so that a minimum is sought in each case. The slicing plane does not meet the floor at the crosshair mark. The minimization can be modified as leaving only to be estimated. Each plot also shows a vertical slicing plane at =10. unconditional least squares. µ− t Y Y− Y ρ t The ML method can be run on centered data by inserting in USS in place of σ ) 2 ρ − 1(gol )2 / 1( + )SSU (gol )2 / n ( − )2 / n ( − )n / π2(gol )2 / n( − 2 ]) Y 1. The log of the likelihood is 2 For the series 14 15 14 10 12 10 5 6 6 8 the sample average is 10.Y ( [ + 2 ] µ . USS is the objective function to be minimized by the ULS method. although this difference is quite minor for ULS and ML in this small example. 2 In other words the CLS estimate of could be obtained by regressing deviations from the sample mean on their lags with no intercept in this simple centered case.µ Y and.n Y( ρ-) Y )µ . Likewise the that minimizes the cross section plot is not the same as the one minimizing the surface plot. The right panel in each row plots the function to be minimized over a floor of pairs.Y [ ρ n .) µ . These then are the objective functions to be minimized when the sample mean. the expression USS/n is substituted for likelihood function and the resulting expression. µ 1 Y 2 2 1 leaving only to be Y([ . in the current example by inserting in place of The conditional least squares (CLS) method results from assuming that Y0 and all other Ys that occurred before we started observing the series are equal to the mean. it can be modified by inserting in place of ]) µ- 1.Y ( [ + … + 2 ] ) µ . as with the other methods.2 display the objective functions just discussed for conditional least squares. so the sample mean differs somewhat from the estimate that minimizes the objective function. is maximized. The first term cannot be changed by manipulating also minimizes _ _ _ so the CLS method with inserted ρ .Y ( ρ.Chapter 2: Simple Models: Autoregression 35 The estimates that minimize USS are the unconditional least squares (ULS) estimates—that is. in the If full maximum likelihood estimation is desired. 10.n Y ( ρ. with each function truncated by a convenient ceiling plane. The left plots show the cross section from the slicing planes.

IDENTIFY VAR=Y NOPRINT. .36 SAS for Forecasting Time Series Output 2.2 Objective Functions edoc eht morf deniatbo era tolp SLU edis-thgir eht rof seulav gniziminim ehT PROC ARIMA DATA=ESTIMATE. ESTIMATE P=1 METHOD = ULS OUTEST=OUTULS PRINTALL. RUN.

31 4635.3 457411.55 07326.0 2339.55 31064.789470.0 3507.2 907013.SLC rof noitacificeps dohtem on dna doohilekil mumixam rof LM=DOHTEM htiw Output 2.85 76762.01 UM 99954.0 403208.0 7049.0 108100.0 1128.3 457411. ρ .55 74171.1RA 2424.75 21389.0 7597.31 1574.0 585310.21 7684.0 597458.0 773800.2 762743.55 32164.2 762743.55 09725.55 83684.0 403120. The estimates correspond to the coordinate(s) on the horizontal axis (or the floor) corresponding to the minimum.3.0 789470.0 6639.0 8890. The use of the CENTER option in the IDENTIFY statement along with the NOCONSTANT option in the ESTIMATE statement will produce the estimate that minimizes the objective function computed with the sample mean (10).2 907013. A partial output showing the iterations for our small series is shown in Output 2.31 1418.0 8588.31 2140.0 335708.0 425070.65 84027.31 6035.21 2424.3 Using PROC ARIMA to Get Iterations for Parameter Estimates noitamitsE serauqS tsaeL lanoitidnoC Chapter 2: Simple Models: Autoregression 37 .0 370500.0 5839.21 9911.01 UM 74171.31 2034.0 31230.0 7597.85 76762.0 1.0 1919.1 700686.21 7684.0 690540.0 8890.1 554861.31 0832.31 0405.0 1 tirC R 21-E1 21-E1 21-E1 21-E1 21-E1 21-E1 21-E1 21-E1 21-E1 11-E1 01-E1 9-E1 8-E1 7-E1 6-E1 10000.65 74675.0 8131.1RA 9935.0 5886.3 tnatsnoC 0149.0 330300.0 770959.0 3468.0 121798.0 560100.0 550618.0 3049.0 635612.21 9911.1 554861.65 84027.1 132364.26 ESS 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 0 noitaretI The OUTEST data set holds the estimates and related information and PRINTALL shows the iterative steps used to search for the minima.55 87964.55 30064.31 5025.0 1128.75 21389. The second column in each segment is the objective function that is being minimized and should end with the height of the lowest point in each plot.0 3709.26 ESS 4 3 2 1 0 noitaretI noitamitsE serauqS tsaeL lanoitidnoC 826000.55 77818.55 14064.0 1.65 74675.11 7532.31 5053.0 adbmaL 13997.3 tnatsnoC 3468.0 601138.55 15364.1 955902.11 7532.11 0000.0 1 tirC R 9-E1 8-E1 7-E1 6-E1 10000.11 0000.0 8131.0 635612.0 adbmaL 700686.0 366060.0 5886.0 6939.0 3507.0 2829.

0 469332.1 257138.0 3468.25 71007.01 2424.01 UM 74171.0 870820.2267169.0 5328.0 4528.2256469.1 177177.25 03386.0 1128.1RA 93302.0 239010.2286169.0 2628.0 adbmaL 851358.7-E312.0 62510.0 1.3 tnatsnoC 3468.2 762743.1 700686.25 28386.0 adbmaL 9117.0 7937.0 597400.0 401100.0 5837.1RA 93302.0 3507.0 7538.26 93302.0 8131.45 ESS 8 7 6 5 4 3 2 1 0 noitaretI Output 2.01 3905.0 1.65 74675.0 461561.0 1 tirC R 21-E1 11-E1 01-E1 9-E1 8-E1 7-E1 6-E1 10000.3 31230.3 Using PROC ARIMA to Get Iterations for Parameter Estimates (continued) noitamitsE serauqS tsaeL lanoitidnocnU 38 SAS for Forecasting Time Series .0 7597.0 5886.3 457411.0 0738.0 9117.0 1.25 12386.01 1968.0 825600.0 adbmaL 9117.2296169.11 0000.2 326627.0 1 tirC R 21-E1 21-E1 11-E1 01-E1 9-E1 8-E1 7-E1 6-E1 10000.2 97596.01 7015.01 2424.21 9911.0 8890.01 1484.1RA 8384.0 7328.0 3468.0 adbmaL 700686.0 1 tirC R 7-E1 6-E1 10000.01 7283.0 5886.21 7684.01 8294.32ekilgoL 7 6 5 4 3 2 1 0 retI noitamitsE doohilekiL mumixaM 789470.2211269.26 76762.2 700686.26 ESS 2 1 0 noitaretI noitamitsE serauqS tsaeL lanoitidnoC 78000.0 970560.65 84027.01 9745.1 684338.21 UM 91386.01 2533.25 05477.2 764746.0 1 tirC R 7-E1 6-E1 10000.0 1.1 tnatsnoC 0937.0 276630.01 8463.2 907013.0 adbmaL 90407.1 tnatsnoC 2328.2 819907.0 6967.0 1778.1 559627.0 8237.26 ESS 4 3 2 1 0 noitaretI noitamitsE serauqS tsaeL lanoitidnoC 854000.0 8347.1 434948.21 UM 86169.26 93302.01 7006.26 ESS 2 1 0 noitaretI noitamitsE serauqS tsaeL lanoitidnoC 7-E312.1 569203.3 31230.2 971873.1 554861.01 2123.2297733.1RA 0063.11 7532.2 263808.0 554850.25 54613.0 76200.0 810200.0 1 tirC R 9-E1 8-E1 7-E1 6-E1 10000.85 76762.0 9117.01 5094.26 76762.01 8453.0 635612.0 1.2269479.1RA 2424.25 34686.1 153058.75 21389.25 83989.0 5886.0 4737.

t You thus need to study the form of autocorrelations for such AR processes.0 9228.22ekilgoL 5 4 3 2 1 0 noitaretI 2 1 0 noitaretI 3 2 1 0 retI Output 2.26 93302.0 9117.0 1.0 9117.25 73590.25 01428.25 80798.4) which is a second-order autoregressive (AR) process.0 743240.0 adbmaL 8-E1 7-E1 6-E1 10000. In more complex models. as are the other objective functions.0 727331.0 7697.3 31230.1RA 3837.0 3837. the likelihood function is more involved.1RA 35328. after a few iterations.0 9837.25 75328.3 Using PROC ARIMA to Get Iterations for Parameter Estimates (continued) e + ) µ − 2− tY( 2 α + ) µ − 1− tY( 1α = µ− Y t .0 753900. of the autoregressive coefficient. You have no reason to believe that dependence of Yt on past values should be limited to the previous observation Yt-1.45 ESS 93302.25 49928.6885.0 1 tirC R 7-E312. RUN. are substituted in the ULS or ML objective function when one of those methods is specified.0 5886.0 2128. The CLS estimates.0 adbmaL 7-E1 6-E1 10000. For example.2275389. Nevertheless the basic ideas presented here generalize nicely to all models handled by PROC ARIMA.0 6518.0 1 tirC R noitamitsE serauqS tsaeL lanoitidnocnU noitamitsE serauqS tsaeL lanoitidnoC noitamitsE doohilekiL mumixaM 01-E1 9-E1 8-E1 7-E1 6-E1 10000.Chapter 2: Simple Models: Autoregression 39 Notice that each method begins with conditional least squares starting with the sample mean and an estimate.26 ESS 17479.2217479. 379000.0 589200. One way to determine if you have this process is to examine the autocorrelation plot by using the following SAS statements: PROC ARIMA DATA=ESTIMATE.2227479.26 76762.0 1.0 adbmaL 5328. .0 9117.0 950100.1RA 9117.0 824130. IDENTIFY VAR=Y. you may have (2.0 1 tirC R 720000. which is facilitated by writing the models in backshift notation.0 1.

recalling that .27...2 Backshift Notation B for Time Series A convenient notation for time series is the backshift notation B where 1− t . e + 2− tY27.4 results in equation 2. 1 = 1α 2 . + 1( = W + B07..0 =µ Comparing equations 2.2. Thus. B indicates a shifting back of the time subscript. Similarly. linking equations 2. + t e 3 1− B 8. let (2. This technique extends to higher-order processes.5) t or as Algebraic combination shows that ) B27. − 1( / 8 − ) B9. − 1( = Y Y = ) Y( 5B t Y = ) Y(B 1− )X t t Y ) B8 − 1( .40 SAS for Forecasting Time Series 2.1 = + 2 3 e= 2− te46. .1 − 1( / 1 = )B8. you can write Yt as j − = 2α . you obtain + 3 X + 2 Y = ) 1− Y(B = ) Y( 2 B X + X +1 = e 1− e + 1− tY8.. 1− te8. − te j B27. . − 1( / 9 t e).07.6) . For example. + 2 t Y) 2 B + 2 + B07. = e= t 5− t ) B8. 2− t and Now consider the process t In backshift notation this becomes t You can write t and. ) B27.1 − 1( − 0= j + e= ∞Σ = 1( t 1< = t t t t X for .5 and 2. That is.3 in a simplified manner. or . It becomes apparent that the backshift allows you to execute the computations.1 8. − 1− tY07. + B8.1 and 2. t − 1( t t t Y Y Y Y Y Y and You can rewrite (2.5 as t + B07.

8 are less than 1. − ) 2 1− Y(E07. − ) 1− tY tY( E07..8) )2 ) j (γ e1− tY(E .1 = ) 1− Y Y( E + t 3 − te74.Chapter 2: Simple Models: Autoregression 41 where ) 8. when you use j=0.. . You accomplish this by shocks (as in equation 2. you see that Yt-1 involves only et-1.7) t( .(8 j You can see that the influence of early shocks et-j is minimal because .2 + 7 − te36.2 which you can also accomplish by repeated back substitution as in equation 2. by Yt-j and computing expected values.1 = )0( γ + 2 − te71. When you use j=1. )1( γ because the difference in subscripts is 1 = )2 − t( Also recall that )1 −( γ Using these ideas.2. In the same manner.2 j ( γ 27. Note that the weights Wj initially increase before tapering off toward 0.9 and . These equations result from multiplying the time series equation.5. 2.1 = ) j ( γ 0 = ) e1− Y(E j 9.7).1 + − ) 0( γ 07. + e tY(E + ) 2 − tY tY(E27. − )1(γ07.2 t + − 2 σ + )2( γ27. For equation 2. Thus.2 + ) 2 − Y 1− Y(E27.5. for all j>0. .2 t − )1 − + 1− te7.3 Yule-Walker Equations for Covariances You have learned how to use backshift notation to write a time series as a weighted sum of past .1 = )1( γ = ) 2 − Y 1− Y( E 5− te96. (2. Using equation 2. you obtain ) t or where E stands for expected value. Equation 2. et-2.. 6 − te96. you are now ready to compute covariances using the Yule-Walker equations..1 = ) 2tY(E 8− te35. you obtain ) t Furthermore. 9 ( t t t t + + e= − )1 − = t t = )1( γ t j W t Y (2.6 allows you to write Yt as 4 − te36.7 with all subscripts lagged by 1.2 −) j ( γ 07. write your second Yule-Walker equation as )1( γ27.3. such as equation 2.

268 0.788 ( 27. and j=2 are three . ) The Yule-Walker equations for j=0. How do you do it? First.8.91 4 ) ( γ2 2 6. ).268 ( 27. and . you need a model for the data. Using equation 2.772 ) ( γ1 2 1 = )1( γ = )0( γ / )1( γ ) j (γ α = )0 ( γ 063 1.4) are 2 and 0> j .59 31 2 .492 7 − 7.4. If the model is a second-order autoregression like equation 2. With that in mind. Solving these (using ). j=1. You can eliminate the first-order AR model 1 based on the to damp out at a constant exponential rate. 2 ) ( σ 1 γ The autocorrelations do not depend on equations in three unknowns: .728 6 − = )2 ( γ = = 8.788 5 .1 + = )1( γ .322 01 − 2. For example.311 )4.1 )4.751 − − 3 α α + )063( 1α = 5.292 9 − )j ( γ 6.728 ( 7.481 41 5. Thus. 5 σ + − . suppose you You have also seen that PROC ARIMA gives estimates of have a time series with mean 100 and the covariance sequence as follows: 4 . ) 2 − j ( γ 2 α + )1 − j ( γ 1α 9. you get 01 = 2 σ 0( γ )j ( γ 2 σ If you assume a value for compute autocovariances )0 ( γ / ) j ( γ (for example.268 ( 7. and you want to predict five steps ahead. you then compute 01 = σ 2 ) 2( γ .898 1 = = = = / )4 ( γ )j ( γ )j ( 0 )3 ( γ ) 2( γ 093 = )0 ( γ ρ )j ( γ j .713 8 − 5 . .42 SAS for Forecasting Time Series and 587 and so forth.322 4. and .31 21 The last two observations are 130 and 132. failure of 29.772( 2 α + )063( 1α = 093 and )093( 2 − 5 . you can use the Yule-Walker equations to and autocorrelations 5. the Yule-Walker equations for a second-order AR process (see equation 2. you have the Yule-Walker equations 2 )063( 2 α + )093( 1α = 063 σ + )5. )6.521 11 − 9 .772 )0. but 77.

1 = = 2σ with variance . you now write and 1. .32 Using equation 2. you get (2. you compute predictions. − )001 − 231(08. − = 2α − 1−nY(59.. and you compute the one-step-ahead prediction interval from 526. and .9) t Assuming your last observation is Yn. three.59. − )001 − 1+ nY(08. you first write your equation (2.1 + 1( 2 σ 1+ nY ( 8.1 + − j ( γ08.2 + 28. ) 14.. Thus. two. you can find or estimate the coefficients from the Yule-Walker equations.1 = 001 − + )001 − .921 − 1. − ) 001 − 1+nY(08. t 2 e ˆ ) 8. You also can monitor prediction error variances.921 = )001 − 031(59. ) 8.5 + 5. in general.1 + 001 = 2 + nY ˆ ˆ 1+ ne8.08. replacing unknown Yn+j with predictions and en+j with 0 for j>0.1 )526.Chapter 2: Simple Models: Autoregression 43 .1 + nY(59.1 + = 2 + ne 1− te8. 2 1 + 1( 2 σ .2 nY(59. The prediction of Yn+2 arises from and is given by 221 2 +n e The prediction error is 2 + ne with variance 58. . if you know or − )001 − )1 nY(08.1 526. and four steps ahead are then ) 92. If you express Yt in the form of equation 2. . − )001 − 1− tY(08. j ( . To predict.. .9.5 = 2σ 1+ne e + )001 − 2− tY(59.7.5(69. − 1 = 1α These can be solved with s )j ( γ and .1 + 1( 2 σ . 14. can estimate the You can confirm this diagnosis by checking to see that )2 for j=3. 2 σ The prediction error variances for one.5(69.10) .921 )j ( γ 2 +nY 1+nY t t Y Y . + ) 1+ nY )526.1 + 001 = 1+ nY ˆ where you recall that 130 and 132 were the last two observations.2 + )001 − = )001 − + + 2 − te92.2 + 3− te14. 4.2 2 + 292. γ59. The prediction error is 1+ ne to 5. = 1+nY − 1+nY ˆ 2 = 001 − − 001 001 1 + 1( 2 σ 1= = = + 28.1 + 1.

11) when you know or can estimate values .1 − 1( = ) µ − t Y ( ) B59. = M Mp p − 2B 2 α − B1α − 1( = ) µ − Bp te + ) µ − p − tY ( p α+ α −. just as in equation 2. . . te ) .1 − 1( t t tY ( Y( Y( 1 (2. The Wjs taper off toward 0 if all Ms satisfying 0 You have also learned how to compute the system of Yule-Walker equations by multiplying equation for j=0. . = )µ − 2 + B08. . the weights on et-j seem to increase as you move further into the past. . )j ( γ α use these Yule-Walker equations to estimate coefficients ) µ − j −t Y( 1> M are such that . A general review of the discussion so far indicates that an AR model of order p.11 on both sides by . t − 2 M 2 α − M 1α − 1 2 − 2B 2 α − B1α − 1( + B08. .2 + B08. . p ± 59. However. + M08. which is a complex pair of numbers with magnitude 1. you see that the weights eventually taper off toward 0. . can be written in backshift form as te and can be written as an infinite weighted sum of current and past shocks et with te 1− p ) Bp where you can find the Wjs. if you continue to write out the expression for Yt in terms of et. i93 . You can 2.2 + 2B92.1 + 1( = e 1− e ) B59.03. = 2 M59. the roots are equation 2. You have also used covariance patterns to distinguish the second-order AR of the covariances model from the first-order model. . .1 – t e) . the roots are 1. You obtained equation 2.11 and 1. α −. the weights taper off.10 by writing the model t j as t Now replace B with an algebraic variable M.7. The condition of roots having a magnitude greater than 1 is called stationarity and ensures that shocks et-j in the distant past have little influence on the current observation Yt . j=1. j=2. and by computing expected values.5. . .44 SAS for Forecasting Time Series Surprisingly. + 3B14. . = )µ − + ) µ − 2 − Y ( 2 α + ) µ − 1− Y ( 1α = ) µ − + 3B 3W + 2B 2W + B1W + 1( = α −.25. . In In this case. written as . . tY ( ) = t . The key to tapering off the weights involves the characteristic equation 0 If all values of M (roots) that solve this equation are larger than 1 in magnitude.

INPUT SILVER @@. PROC REG DATA=SILVER. Yt-3. DATE=INTNX('MONTH'. OUTPUT. you regress Yt on Yt-1.1). MODEL SILVER=LSILVER1 LSILVER2 LSILVER3 LSILVER4 / SS1. and thus simplify your analysis. MODEL SILVER=LSILVER1 LSILVER2. 846 827 799 768 719 652 580 546 500 493 530 572 632 645 674 693 706 661 648 604 647 684 741 734 708 728 737 729 678 651 627 582 521 501 555 541 485 476 515 606 694 788 761 794 548 700 519 836 565 723 496 846 . You also can simplify the choice of the model's order. RUN. RUN. as illustrated in Output 2. LSILVER4=LSILVER3. RETAIN DATE '01DEC76'D LSILVER1-LSILVER4. PROC PRINT DATA=SILVER. .DATE. “The General ARIMA Model. LSILVER1=SILVER. Yt-2. Output 2. helping you identify the model form appropriate for your data.. LSILVER2=LSILVER1. FORMAT DATE MONYY. As you expand your set of models. you can fit the models by ordinary regression techniques like PROC REG or PROC GLM. RUN. remember that the primary way to distinguish among them is through their covariance functions. TITLE 'MONTH END STOCKS OF SILVER'. RUN.Chapter 2: Simple Models: Autoregression 45 2. The covariance functions are like fingerprints. PROC REG DATA=SILVER. it is crucial to build a catalog of their covariance functions as you expand your repertoire of models. If you deal only with AR processes.” shows that associating autocovariance patterns with models is crucial for determining an appropriate model for a data set. LSILVER3=LSILVER2. Assuming a fourth-order model is adequate. Thus.5. T=_N_. CARDS.3 Fitting an AR Model in PROC REG Chapter 3.4 shows a plot of the stocks of silver at the New York Commodity Exchange in 1000 troy ounces from December 1976 through May 1981 (Fairchild Publications 1981). and Yt-4 using these SAS statements: DATA SILVER.

. .887 496 606 515 674 167 887 496 606 515 497 167 887 496 606 638 497 167 887 496 18RPA 18RAM 18BEF 18NAJ 08CED 25 15 05 94 84 648 638 497 167 887 25 15 05 94 84 )seniL tuptuO eroM( 648 . 3REVLISL 997 728 648 . . 2REVLISL 867 997 728 648 . . 1REVLISL 77YAM 77RPA 77RAM 77BEF 77NAJ ETAD 5 4 3 2 1 T 917 867 997 728 648 REVLIS 5 4 3 2 1 sbO REVLIS FO SKCOTS DNE HTNOM Output 2.4 Plotting Monthly Stock Values 46 SAS for Forecasting Time Series Output 2. 4REVLISL 728 648 . .5 Using PROC PRINT to List the Data and PROC REG to Fit an AR Process . .

0 qS-R jdA erauqS-R 56591.0 |t| > rP 47.1 27359.201 etamitsE retemaraP 1 1 1 1 1 FD 4REVLISL 3REVLISL 2REVLISL 1REVLISL tpecretnI elbairaV setamitsE retemaraP 2988.0 6898.0 65151.2 eulaV t 58151.636 09090.< 1310.0 13244.59 eulaV F 56700.5 38598.040.1601 27482 592783 34507491 SS I epyT 3364.23 raV ffeoC naeM tnednepeD ESM tooR 1000.77 etamitsE retemaraP 1 1 1 FD 2REVLISL 1REVLISL tpecretnI elbairaV setamitsE retemaraP 5998.0 qS-R jdA erauqS-R 55310.568.21 85.73 rorrE dradnatS 63211.< 1000.8301 727822 erauqS naeM 162605 80884 454754 serauqS fo muS 94 74 2 FD latoT detcerroC rorrE ledoM ecruoS ecnairaV fo sisylanA REVLIS :elbairaV tnednepeD 1LEDOM :ledoM erudecorP GER ehT REVLIS FO SKCOTS DNE HTNOM 09265.03 rorrE dradnatS 44116.< F > rP 03.00.141.0 98511.0 |t| > rP 03.1 62148.098583.2 eulaV t 34511.246 21522.0 40958.078094.012900.< F > rP 62.0 87062.022 eulaV F 05854.5 Using PROC PRINT to List the Data and PROC REG to Fit an AR Process (continued) Chapter 2: Simple Models: Autoregression 47 .< 5900.33 raV ffeoC naeM tnednepeD ESM tooR 1000.0 1790.0 73162.0 83012.0 1000.0 07.0 0279.9 27.0 6309.995 03539.5 00067.5901 753401 erauqS naeM 415464 58074 924714 serauqS fo muS 74 34 4 FD latoT detcerroC rorrE ledoM ecruoS ecnairaV fo sisylanA REVLIS :elbairaV tnednepeD 1LEDOM :ledoM erudecorP GER ehT REVLIS FO SKCOTS DNE HTNOM Output 2.

1 1 − 1 = t Y = 746 − t Y . and now the final estimated model t which becomes All parameters are significant according to their t statistics. In Chapter 3. − 2 − tY ( 4116. The fact that M=1 almost solves the characteristic equation 2 M16. suggests that this series may be nonstationary. − 1− tY9094. 1− tY ( 9094.76 34 2 You have identified the model through overfitting. a TEST statement could be used is ) 746 + + 7359. Alternatively. you extend your class of models to include moving averages and mixed ARMA models.1 − F This is insignificant compared to the to produce F.5 shows that lags 3 and 4 may not be needed because the overall F statistic for these two as lags is computed ((1062 + 600) / 2) / 1095 = .77 − M94. These models require more sophisticated fitting and identification techniques than the simple regression with overfitting used in the silver example. t e e + + ) 746 2 − tY4116.48 SAS for Forecasting Time Series Output 2. distribution.

As each new model is introduced.4.3 79 8 seireS rof tnemetatS ETAMITSE 4.3 55 noitacifitnedI ledoM 3. Using estimated autocovariances to determine a model to be fit is called model identification. This helps you use the estimated autocovariances C(j) that PROC ARIMA produces to select an appropriate model for the data.2.4.4.4.3 201 seireS yranoitatsnoN 5.1 Statistical Background 041 yrammuS 5.3 09 sisylanA tropxE leetS dna norI :elpmaxE 2.1.3 94 noitcudortnI 1.3 3.3 08 snoitcurtsnI dna selpmaxE 4.3.3 2.3 97 noitacifitnedI ledoM fo yrammuS 97 slaudiseR fo kcehC erauqS-ihC 65 noitacifitnedI seireS emiT 55 ytilibitrevnI dna ytiranoitatS 4.821 seuqinhceT noitacifitnedI rehtO 01.4.1.3 321 dnerT raeniL a evomeR ot gnicnereffiD 9.4.3 501 seireS revliS dna seireS MBI gnitsaceroF :selpmaxE 7.3 18 8–1 seireS rof tnemetatS YFITNEDI 1.3 05 noitatoN dna ygolonimreT 2.3 25 snoitciderP erutuF 2.1 Introduction Chapter The general class of autoregressive moving average (ARMA) models is developed in this chapter.3.4.1.3 401 stsaceroF no gnicnereffiD fo tceffE 6. forecast future values.3 1. ) j (γ 3.3 15 noitciderP 2.3.3 15 snoitciderP daehA-petS-enO 1.2. its autocovariance function is given.4.3 59 AMIRA CORP ni desU sdohteM noitamitsE 3.4. you can use PROC ARIMA to fit the model.3 3.3 3 The General ARIMA Model . Once you select the model.3 94 dnuorgkcaB lacitsitatS 1.4.3. and provide forecast intervals.3 311 ataD yranoitatsnoN rof sledoM 8.

.4.− = β so and The model is the resulting sequence of autocorrelations is 04 = σβ − 2 . Also. − )j ( γ and is characterized by the fact that 2 B2 α −. .2σ 1− te )j ( and 0 for j>1.1) Clearly. )0 ( γ If each autocovariance is divided by For a moving average like equation 3. − .001 = 2 σ ) 2 β + 1( for j>1. In backshift notation you write .001 = )0 ( γ If you observe the autocovariance sequence .04 = )1( γ . tY( t te t +µ= 1 = )0 ( ρ t t t e where β− e+ µ = t voc t tY tY t Y Y ρ is a white noise (uncorrelated) sequence with mean 0 and variance . . β − .1. ) 2 β + 1( / β− = )1( ρ β− = ) 1− Y . . )j ( ρ . Y( voc =) + e+µ= j − tY .q) as ) ρ µ− ρ −t ( ρ Y t e) q B q β − . 0. .. .0 = )2 ( γ . In the example. )j ( = 2σ 5. you write the mixed autoregressive moving average model ARMA(p.2 Terminology and Notation The moving average of order 1 is given by (3. . 0. . Note that 2 /1 The general moving average of order q is written as q − te q Similarly.β regardless of the value 0.1. . dealing with an MA process of order 1 because . . you know that 2 σβ − = )) 2− eβ − 0 = ) j (γ t 1− te() 1− te β− ) t 2 e((E = )1(γ β + 1( 2 σ = ) 0(γ = ) Y( rav ≤ ) 2 β + 1( / β − ≤ 2 / 1 − γ β − B 1β − 1( + µ = 1− te 1 1− te5.50 SAS for Forecasting Time Series 3. you are and .08 and 0= )j ( for j>1. and and are 0 for j>q.0 = )3 ( γ . the autocorrelations for lags 0 through 4 are 1. q − te qβ − . − 1− te 1β − te = − ) µ − 1− tY ( 1α − ) µ − tY ( ..

parameters are estimated and then used to estimate prediction error variances for several periods ahead. 2 + ne4.1) with mean In practice. so predict Yn+2 by removing “future es” (subscripts greater than n): 1+ nY6. + 2 +ne + ) ne4. 2 + nY 6.2. β− . = + 2 + ne + 1+ nY6. = 3 + ne 3 + ne + + ) 2 + nY ) 2 +n ˆ e 1+ n e4.2 Prediction 3. . + 1+ ne + nY 6... 1+ ne ( 6. First. which has variance 2 + ne4. This example shows that you can readily compute and the prediction error variance is predictions and associated error variances after model parameters or their estimates are available. = = + = = ne42.2 . and 0 + 2 + nY6. The next (n+1) observation in the sequence satisfies ne4.1 One-Step-Ahead Predictions You can further clarify the example above by predicting sequentially one step at a time.0 =µ e) B4. + 1( = + 1+ ne + nY6. + − B1α − 1( − = = nY63. + nY6. = 1+nY ˆ 3 + nY ˆ .( 6. Let n denote the number of available observations. + + 1+ ne4. t Y ) B6. 3. 2 σ63.Chapter 3: The General ARIMA Model 51 or in backshift notation as te ) B q q For example.2σ with error variance 2 +nY Next. . 3 +nY 3 +nY 3 + nY 1+nY − 1( ˆ Finally. 2 σ2 The prediction error is en+1+ en+2. PROC ARIMA provides these computations. the model t is an ARMA(1. 3 + ne ˆ . − + + 2 + nY ( 6.. predict Yn+1 by ne4. ˆ so the prediction error is 2 + ne4.. − B1β − 1( = ) µ − tY ( ) p B p α − .

that is.1) with mean 0.3 4 Y 3= t − = )4− (4.52 SAS for Forecasting Time Series The predictions for the model 1− te4.0 .4(0) = 1. estimate example).3 + e + 1− Y6.0 + 1Y6. is called the conditional sum of squares associated with the parameters 0. An estimate of the white noise variance is given by dividing the conditional sum of squares by n minus the number of estimated parameters.2 Future Predictions Predictions into the future are of real interest.0 + 8e + 9e + 8e 01 = 1e 7e .6(4. estimate future Ys by their predictions.6– 46.4 − = 1 − 3Y = 3r The residual is Then predict by Y 2r .0 = 2r4.2 4. These are one-step-ahead predictions for the historic data. 2 can be computed recursively as follows: — — — 6 1 8– 3– 5 01 noitavre sbO and by and by 3.4. The illustration simply shows what PROC ARIMA is computing. the default in PROC ARIMA.723 with error is 0.4(0) = 2.2 — 835.0 = 3r4.0 + 3Y6. For example. The next three predictions are as follows: 7e is 0. for this ARMA(1. you are performing conditional least squares estimation.344) = 4.01 .723) + 0.1 — 327. the form 7Y )6.6 and 0.01 1 = )5− (4.538 with error is 0. j in the example). In a practical application. Continuing the process as shown.0 + + 52 + 001 .2 656.622 s te = 2 443.4(2.0 6.3– = 1e t Y 4– 1 5– 01 )0( 01 3 Y 6 Y 7Y 8Y 9Y noitciderP ˆ ˆ ˆ laudiseR Predict by Using as an .634 with error PROC ARIMA provides these computations for you. while one-step-ahead computations are used to start the as 0 for t beyond n ( observations in the process.656.2.0 + )5(6.01 46.6(6) + 0.5− = 01 − 5 = 2 r = 1e Start by assuming the mean (0) as a prediction of with implied error using the assumed The residual is predict by estimate of 1 436.538) + 0.0 + )3− (6.4 — 443. If you search over AR and MA parameters to find those that minimize this conditional sum of squares. The sum of squares of these residuals. that is. you use only the data up through (and the assumed ) to predict .7 t . = t Y 46. 7e6.420.6(2.2 e − 5 Y .4– 4. The prediction error variance increases from var(et) to var(Yt).6 4 =2−6=2−n = 1e4.( ˆ j j +7 Y Note that the prediction of is just and thus declines exponentially to the series mean (0 Y 6=n .0 + 2Y6. 4 3.

you find Y( = t e expression into the first.4 Y 3Y 2Y 1Y )2 ( γ )0(γ )1(γ )1(γ )3(γ 4φ )2( γ 3φ = )1( γ 2φ 1 φ )0( γ 5 Y Likewise. 2 − eβ + µ − 1− Y = 1− e β− e+µ = Y t t t t t 1− t 1− te .) µ− j − Y( t j β ∑= e 0= j t ∞ j − te j β 1< β assuming that so that converges to 0 as j gets large. a simple MA(1). the parameters are replaced by estimates. the forecasting methods used in PROC ARIMA are tied to the method of estimation.µ − t Y necessarily the best linear combination of lagged Y values for predicting 2 and ) µ− j − Y( t j β ∑ and. of course. suppose . and which 1− te . The truncated sum is not : prior to time 1. Note that here and φ 1 φ } ] ) µ − 2 − tY( 2φ − ) µ − 1− tY ( 1φ − ) µ − tY ( [{ E Suppose you want to minimize by finding . This procedure requires sample sizes much larger than those in the example above. are not known.2 and are just coefficients. te + )µ − ∞ j −t Y( j β ∑− = µ − 1= j ) t Y( can alternatively be expressed as ∞ Thus the forecast of given data . the “infinite past. Note that so at time you have substituting this second ∞ t t t When ML or ULS estimation is used. . they do not represent autoregressive or moving average parameters.” PROC ARIMA assumes Y values before time 1 are just equal to 1= j 1− t ) µ− j −t Y( j β ∑ 1= j )0( γ )1( γ 2φ = 1 φ . the forecast is based on the expression of as an infinite autoregression. estimated parameters are used to compute predictions and standard errors. . 2 − e β + ) µ − 1− Y (β + ) µ − 2 . . Although they would not have to be. 1− t β− + e= eβ + µ − t t e = 1− tYα − 1− tY 6. They can be determined through PROC ARIMA. to forecast using . t Y= φ − µ− t t t Y e Y t Y 1 φ . For example. you want the minimum variance forecast of 2 based on its two predecessors.) µ− j −t Y( = 3Y ˆ j β ∑−µ= 1= j t Y ˆ 1− t up to time is The expression depends on Y values t Y . In practice. optimal linear forecasts based on the finite past are computed.Chapter 3: The General ARIMA Model 53 and parameter values 1− te4. Using calculus you find )2( γ )1(γ 1− )4 (γ )3( γ )2 (γ )1( γ 1− )0(γ )1(γ )2( γ )3(γ sφ j )2 (γ )0( γ )1( γ )1( γ . If you use conditional least squares. you have Continuing in this fashion. the four are computed as : 2 Y 1 Y φ )µ − 1Y ( 2φ + )µ − 2Y( 1 + µ 3 Y This would give the best forecast of based on a linear combination of )0(γ )1(γ t Y that is.

t Here is the autocovariance at lag h and the equations for the s can be set up for any ARMA to predict the fifth Y − M1β − 1 1=β t t t Y Y . For example. are listed below. the series is said to be “noninvertible. 74. Not only does this negate the discussion above. 2− t 1− te 0 α= Y Y 0 1− e = α ( − ) e + t1α + 0 α ( = 1− Y − t q − te q t β 08. 20. to a constant .) ahead.− − − 12.− − − 15. . out to 2 decimal places. but since a reasonable estimate of cannot be extracted from the data. In the moving average of order has an associated polynomial equation in the algebraic variable M.β structure and any number of lags. noninvertibility can be artificially induced. — . 61. . Note that the parameters of 1 α t1 α + 0α so that in the process of reducing the trend 1> M whose roots must satisfy in order for the series to be invertible. 3− t 2 Y 0 4φ 0 3φ = β− 2φ β + 1 1φ Y t e 16. 23. 4− t =β For an MA(1) process with lag 1 parameter the weights on past Y. 97. used in forecasting 1 step and .0( ( j 41− t 40. a noninvertible moving are best estimated by the . .” indicating that you cannot get a nice. Fortunately in practice it is rare to encounter a naturally measured series that appears to be noninvertible.8. when differences are taken.54 SAS for Forecasting Time Series For reasonably long time series whose parameters are well inside the stationarity and invertibility regions.1. Note the analogy with the characteristic equation computed from the autoregressive coefficients. Increasing to 25 produces weights indistinguishable. 7− t Y t e 62. (See Section 3. The top row shows the first 14 weights assuming infinite past the next two rows show finite past weights for and past observations. 41 = n 9=n gal tsap etinifnI tsap etinif .− − − 14. the weights are quite similar.0 1− t t β− Y = q M qβ − t Y tsap etinif . However. Some practitioners have the false impression that any sort of trend in a time series should be removed by taking differences. one sees that 1− te on this being a fundamental result of basic statistical ordinary least squares regression of theory. − 1− e1β − e = t )h( γ .− − − 08.t t t e + t1 α + 0 α= Y t average has been produced. 46. Y − − q − n 31− t 50. 20. the time series is a simple linear trend plus white noise.0 Despite the fairly large and small n values. 41 = n 6− t Y − 33. 53. it eliminates any sensible model-based forecasting. 5− t t e + 1α = ) 1− e + )1 − t ( 1α + Y 9=n 14. For the MA(1) example with parameter you have 0 0 0 β− 1− j φ β +1 2 β− 0 0 β− β +1 2 β− 0 0 β− β +1 2 β− Y t t e + t1 α + 15. — Y − − 12. the best linear combination forecast used when ML or ULS is specified does not differ by much from the truncated sum used when CLS is specified. from those for the infinite past.− − − 52.− − − 62. 80.− − − 46. If that is done.3. The practitioner perhaps was confused by thinking in a very narrow time series way. If convergent series representation of as a function of current and lagged Y values.) )8.

.3M2=0 are M=1 and M=10/3).3M+.42M2=0 are M=10/7 and M=10/6). . 3− tY61.2. Note that in Section 3. − + − Y) t e= e= 2− tY 4. . A series satisfies the invertibility condition if all Ms for which 0= q Mq The invertibility condition ensures that Yt can be expressed in terms of et and are such that an infinite weighted sum of previous Ys.1) example. In the example. − 2B 2 β − B1β − 1( = − 3− tY61. Any MA process is stationary. In the ARMA(1. − 2B 2 α − B1α − 1( te ) − − + q B q β − . The decreasing weights on lagged values of Y allow you to estimate et from recent values of Y.... B6. t and + 1− tY so + 4− tY460.. α − .1 the forecast of Yn+1 was . the prediction of Y6 with 0 as an estimate of e1 differs from the prediction using the true e1 by the quantity ..3M+.4en.1 Stationarity and Invertibility Consider the ARMA model ) . 1− tY M α − M 1α − 1 β − M 1β − 1 + B3. The model is stationary if all values of M such that 0= p Mp are larger than 1 in absolute value. .. Stationarity ensures that early values of e have little influence on the current value of Y. .01 e1. t Y) 2 − 1( 1−)B4. provided the series is moderately long.1 − 1( + B3. Another example is which is stationary (the roots of 1 1.6Yn+. One AR example is t which is not stationary (the roots of 1 1.1 2 2 − M2 > M2 B24. B3.3 Model Identification 3. − β − . + 1( = e t Y) 2 . µ − tY ( ) p B p α − . .1 − 1( + e= − t t Y = e t Y t t . It also ensures that setting a few values of e to 0 at the beginning of a series does not affect the predictions very much.Chapter 3: The General ARIMA Model 55 3. so the ability to estimate en from the data was crucial..3. − 4− tY460. 2− tY 4.

e + 1− Y8.) ( 1 γ ) 0( γ begins with values and followed by t e = 2 − tY 2 α − 1− tY 1α − t Y For an AR(2) series t e = 1− tYρ − ) 2 t ρ − 1( / 2 σ ρ = Y For an AR(1) series j (such as Series 1 and 2). which is assumed to be the same for every t (stationarity).)1( RA . 1− e8.)FCAP( noitcnuf noitalerrocotua laitrap )FCAI( noitcnuf noitalerrocotua esrevni )FCA( noitcnuf noitalerrocotua 1.3. t t t e= e= e= t t t t t t t t Y Y Y Y ) j (γ )j ( γ . )j ( Recall that is the covariance between Yt and Yt-j. e + 1− Y8. In PROC ARIMA.2. = Y noitcnuF ecnairavocotuA 1.2 Time Series Identification You need to identify the form of the model. 2− e4. 1− e4. + 1− Y 7. IDENTIFY VAR=Y. You can do this in PROC ARIMA by inspecting dataderived estimates of three functions: These functions are defined below. A short catalog of examples is developed.3 2 AM . e + 2− Y94. RUN. = Y ) ( t 1 AM . et is white noise with variance Series 1 2 3 4 5 6 7 8 Model 0 > )1(γ ) j (γ . + 0 < )1( γ ) ( γ 2 RA . For example. = t t t . + ) esion etihw( t t t . the covariance sequence is (such as Series 3 and 4).56 SAS for Forecasting Time Series 3. + 1− e3. − = Y t .)1 = 2 σ t t t t t t t e + 1− tY6. an IDENTIFY statement produces estimates of all these functions. the covariance sequence that satisfy ) . e + 2− Y4.)1( RA . See the listing below of autocovariance functions for Series 1–8 (in these examples. and properties useful for associating different forms of these functions with the corresponding time series forms are summarized. = Y ) ( ) ( 2 RA . − .1( AMRA . + 1− Y3.3. the following SAS statements produce lists and plots of all three of these functions for the variable Y in the data set SERIES: PROC ARIMA DATA=SERIES.

. but ) j (γ 0 = )p − j (γ p . . may oscillate.. from which satisfies 2 α 1 α The covariances may oscillate with a period depending on values are determined from the Yule-Walker equations.1) process 1− te occurs. − )2 − j (γ 2 α ) 0( γ beginning values are − )1 − j (γ 1α . For the ARMA(p. = p − tY p 0 = )2 − α − .. q) beginning values followed by behavior characteristic of an AR(p).. In other words.. Thus. 0≠j 0 = )j ( γ for j>r.β α 0 = )p − j ( γ p α − ) (γ 1 ) 0( γ there is a dropoff from ) to determined by and ) j (γ ) q( γ )1( γ β − e = ) µ − 1− Y ( α − ) µ − Y ( ) 0( γ the q beginning values are . β − . − j (γ 2 α 2 − tY 2 − )1 − α − 1− tY 1α − j ( γ 1α − ) j (γ − )j (γ t t and (such as Series 4). For MA(1). . . For a white noise sequence.. that is. .. the pattern )j ( γ 1< λ < 0 where ) j (γ 2 σβ− 2 σ ) 2 β + 1( = )0 ( γ β− = )1− ( γ = t e ... . = µ− =µ− j λH < )j ( γ )1( γ . . ρ for j> )j ( γ The fact that satisfies the same difference equation as the series ensures that and H is some finite constant. For j>1..1) covariance function. β− . − 2 − te 2 t β− … − 1− .Chapter 3: The General ARIMA Model 57 For a general AR(p) series te it is bounded by a function that decreases exponentially to zero. Beginning t tY tY Y . 1− te For a general MA(q) q − te q For an ARMA(1.. Then =0 for |j|>q. − 1− te1β − te = ) µ − p − tY ( p α− .. )1 − p ( γ α − . an apparently arbitrary drop followed by exponential decay characterizes the ARMA(1..q) process q − te q there are r = max (p – 1. .1 1− te 1 > ) 1− j (γα = t j t β− j ( 1 te γ α − )j ( γ 0 = )j ( γ and for . − ) µ − 1− Y ( 1α − ) µ − Y ( if .

Normalize the autocovariance sequence .8964. = t Y 2 8. = )1( ρ . e + 2 − Y4.3.− = )1( ρ . = )j ( ρ .− ( = )j ( ρ . = t t t )j ( t ρ 4 . − 1− Y7.1657.3 Note that for all series and that 1 = )0 ( ρ )j ( Series ρ ρ 1 j 8.1 > j rof )1 − j ( ρ6. − e = Y 7 0 > j rof 0 = )j ( ρ .e + t 1− t Y8. )j − (ρ = )j ( ) 0(γ / )j ( γ= ) j (γ FCA 2. rather than the magnitude of the sequence is associated with the model by computing autocorrelations form. + e = t t t Y 6 .441. )j ( t ρ 8 1− t Y6.8784. ACF . = . − 1− e3. = 1 > j rof )2 − j ( ρ4.2.1. − Y Y t Model. 2 − e4. = t t t Y Y Y )j ( t ρ 3 . + e = t t 2 > j rof 0 = t )j ( ρ . = )1( ρ . 1− e4.1 = )0 ( ρ .23. = )1( ρ .− = t 5 1 > j rof 0 = )j ( ρ . = ) j 58 SAS for Forecasting Time Series Note that the pattern.− = )2 ( ρ t t t 1 > j rof )2 − j ( ρ94. + 1− Y3. )j ( γ The ACFs for the eight series previously listed are listed below. e = t The ACFs are plotted in Output 3. + )1 − j ( ρ3.1 = )0 ( ρ . 1− e8. = )1( ρ .e + t 1− t Y8.0005. e + 2 − Y94. − )1 − j ( ρ7.

1 Plotting Actual Autocorrelations for Series 1–8 .Chapter 3: The General ARIMA Model 59 Output 3.

60 SAS for Forecasting Time Series Output 3.1 Plotting Actual Autocorrelations for Series 1–8 (continued) .

1 Plotting Actual Autocorrelations for Series 1–8 (continued) .Chapter 3: The General ARIMA Model 61 Output 3.

62 SAS for Forecasting Time Series Output 3.1 Plotting Actual Autocorrelations for Series 1–8 (continued) .

. . For MA or mixed (ARMA) processes.. 2 )2 ( γ b )1( γ 1b j π ˆ In an autoregression of order p. . . “Simple . . b= π j j For each j. )2 − j ( γ )1 − j ( γ π −Y ˆ 2 t π ˆ . The theoretical partial 1 π 1− Y ˆ t j π ˆ j . You can solve the previous set of equations for the catalog of series. .3 γ γ j The PACF is motivated by the regression approach to the silver example in Chapter 2. . the ) j ( γ b . Yt–2 and call the coefficient on .jπ ˆ 2 )0 ( γ . . . )0 ( sequence is useful for identifying the form of a time series model. the theoretical PACF does not become 0 after a fixed number of lags. regress Yt on Yt–1 and call the coefficient on on Yt–1. When you observe an estimated PACF compare its behavior to the behavior shown next to choose a model. Continue in this manner. Next. for an AR(p). . The following is a list of actual partial autocorrelations for Series 1–8: . . = . . j( γ γ γ π .3.jπ ˆ .) As with autocorrelations. . )2 )0 ( )1( −j .Chapter 3: The General ARIMA Model 63 autocorrelations. Yt–2. . The PACF is most useful for identifying AR processes because. autocorrelations estimated by the are obtained by solving equations similar to the regression normal equations. let j (A new set of equations is needed for each j. the coefficients j estimate 0s for all j>p. FCAP 3. . regress Yt Models: Autoregression. . . .2.” First. . . regressing Yt on Yt–1. Yt–j and calling the last coefficient The values are the estimated partial ( π γ )1 − )1( . . the PACF is 0 beyond lag p.

32 0 0 0 0 0.5 0.098 − .1652 0.0944 Yt = et Yt = .8 0.1634 5 0 0 0 0 0.4et–2 0.3Yt–1 + .330 0.272 0 0 0 0.4900 0.8Yt–1 + et Yt = .8 Yt + et Yt = .1267 0.550 − 3 0.4Yt–2 + et Yt = . A list of actual autocorrelations for Series 1 8 follows: Lag Series 1 2 3 4 5 6 7 8 Model Yt = .6Yt–1 + et + .410 0.4698 0 0.512 0.245 0.2215 0.4878 − − − − 0.4et–2 0.8 et–1 − − 1 0.410 − − − − − − Yt = et .3 et–1 .8Yt–1 + et Yt = .500 0.4Yt–2 + et Yt = .328 0.1304 4 0 0 0 0 0.512 0.64 SAS for Forecasting Time Series Lag Series 1 2 3 4 5 6 7 8 Model Yt = .7561 4 0. 7Yt–1 . are given in Output 3.49Yt–2 + et Yt = et + .0173 5 0.4 0.3123 3 0 0 0 0 0.6Yt–1 + et + .365 0.1087 0 0.8 Yt + et Yt = .49Yt–2 + et Yt = et + .756 − − Yt = et .8 2 0 0 0.161 − 0.144 0.3480 − − 0.4et–1 0 0 0.2.64 0.3Yt–1 + .8 0.8 et–1 − − 1 0.343 − 0.0434 Plots of these values against lag number.055 0 0 0 0.2756 0 0.3 e t–1 . with A used as a plot symbol for the ACF and P for the PACF.328 0.8 − 2 0.144 0.64 0.470 0.454 − − − − − 0.4et–1 0 0.163 Yt = et Yt = .7Yt–1 .161 0 0.488 0.

2 Plotting Actual Autocorrelations and Actual Partial Autocorrelations for Series 1–8 .Chapter 3: The General ARIMA Model 65 Output 3.2 shows the plots. Output 3.

2 Plotting Actual Autocorrelations and Actual Partial Autocorrelations for Series 1–8 (continued) .66 SAS for Forecasting Time Series Output 3.

2 Plotting Actual Autocorrelations and Actual Partial Autocorrelations for Series 1–8 (continued) .Chapter 3: The General ARIMA Model 67 Output 3.

68 SAS for Forecasting Time Series Output 3.2 Plotting Actual Autocorrelations and Actual Partial Autocorrelations for Series 1–8 (continued) .

) j ( r − FCA detamitsE no ital errocotua roF . snur noita mmus eht erehw elihw j ≥ i rof 0 = ) i ( γ taht sisehtopyh eht rednu ecnairav etairporppa eht si sihT .3 is the mean of the entire series. Use these estimates to identify the form of the model. The purpose of the plots is to indicate the amount of sampling error in the estimates.j < i rof 0 ≠ ) i ( γ − j + tY() Y ) 0(C / ) j (C − t Y( Σ = ) j (C 4.3.Chapter 3: The General ARIMA Model 69 Begin the PROC ARIMA analysis by estimating the three functions defined above. Each data series contains 150 observations. Define the estimated autocovariance C(j) as n / )Y Compute standard errors for autocorrelations in PROC ARIMA as follows: The group of plots in Output 3.3 illustrates the actual (A) and estimated (E) ACFs for the series.2. Define the estimated = ) j (r .ecnairav siht fo toor erauqs eht si rorre dradnats ehT .1–j ot 1+j– morf n / ) ) i( 2 rΣ ( ecnairav a n gissa Y where the summation is from 1 to n j and autocorrelation by .

3 Plotting Actual and Estimated Autocorrelations for Series 1–8 .70 SAS for Forecasting Time Series Output 3.

3 Plotting Actual and Estimated Autocorrelations for Series 1–8 (continued) .Chapter 3: The General ARIMA Model 71 Output 3.

72 SAS for Forecasting Time Series Output 3.3 Plotting Actual and Estimated Autocorrelations for Series 1–8 (continued) .

) j ( The partial autocorrelations are defined in Section 3.3.2. substitute estimated covariances C(j) covariances for the actual covariances and solve.2.Chapter 3: The General ARIMA Model 73 Output 3.3 .3 Plotting Actual and Estimated Autocorrelations for Series 1–8 (continued) or nearly 0. an approximate standard error for the estimated partial autocorrelation is n 1/2. For j large enough that the actual partial autocorrelation is 0 γ .3 as solutions to equations involving the To estimate these partial autocorrelations.3. − j π FCAP detamitsE 5.

4 Plotting Actual and Estimated Partial Autocorrelations for Series 1–8 . illustrate the actual (A) and estimated (E) PACFs for the series. in Output 3. Output 3.74 SAS for Forecasting Time Series The next group of plots.4.

4 Plotting Actual and Estimated Partial Autocorrelations for Series 1–8 (continued) .Chapter 3: The General ARIMA Model 75 Output 3.

4 Plotting Actual and Estimated Partial Autocorrelations for Series 1–8 (continued) .76 SAS for Forecasting Time Series Output 3.

4 Plotting Actual and Estimated Partial Autocorrelations for Series 1–8 (continued) .Chapter 3: The General ARIMA Model 77 Output 3.

− 1− e003. Thus.( − 043.p) model you obtain if you switch sides with the MA and AR operators.()043. Fit an AR(3) model to obtain estimated coefficients—for example. for example. the IACF of Series 3 is the same as the ACF of Series 6 and vice versa. FCAI 6.3.3.( + 003. = µ − σ))021.3 − The IACF of an ARMA(p. t t t σ) 2 021. − ) µ − 2 − Y ( 043.( − )043. − FCAI detamitsE 7. The inverse autocovariances are estimated by 2 at lag 0.q) model is defined as the ACF of the ARMA(q. the inverse autocorrelation of t + t t e e Y() 2 = µ− = µ− 003.()003. + ) µ − 1− Y ( 003. In the catalog of Series 1–8. −( t + 2 − e043.3 Suppose you know that a series comes from an AR(3) process. The inverse model is the moving average 3− te021.2.()003. 2 2 σ021. t e + )µ − 3− tY ( 021.78 SAS for Forecasting Time Series is defined as the ACF of 1− te8. 2 at lag 1. + σ))021.2. −( t t e = )µ − 2 043. − 1( + 1( t t Y Y Y . at lag 2. and at lag 3. B8.

The formula for this statistic is )j where r(j) is the estimated autocorrelation at lag j and k can be any positive integer.atad eht ot )p(RA tiF 2/1 − n( / ) j ( 2 r 1= j k Σ )2 + n(n .4 Summary of Model Identification At the identification stage. you compute the ACF.3. Use the fact (see Section 3.1) that any invertible ARMA series can be represented as an infinite-order AR and therefore can be approximated by an AR(p) with p large.3=p rof evoba detartsulli sa seires AM gnidnopserroc rof secnairavoc etupmoc . nor do you know the form (it may be MA or ARMA).Chapter 3: The General ARIMA Model 79 In general.setamitse gnitluser eht ot –n fo srorre dradnats ngissA .stneiciffeoc detamitse eht gnisU . The statistic is compared to critical values from a chisquare distribution. the residuals should be white noise and the chi-square statistic should be small (the PROB value should be large). The behavior of functions for different processes is summarized in the following table: . 297). 3. and IACF. A significant chi-square statistic indicates that your model does not fit well.3. you do not know the order p of the process. and Riensel (1994) and the Ljung modification in Ljung and Box (1978. PROC ARIMA uses the autocorrelations to form a statistic whose approximate distribution is chi-square under the null hypothesis that the series is white noise. Behavior of the estimated functions is the key to model identification. Both Q statistics are described in Box. Then do the following: 3. PACF.3. PROC ARIMA calculates the same statistic on the model residuals to test the hypothesis that they are white noise. Set p to the minimum of the NLAG value and one-half the number of observations after differencing. p. Jenkins. In PROC ARIMA several ks are used. If your model is correct. Later in the modeling stage.3 Chi-Square Check of Residuals In the identification stage. The test is the Ljung modification of the Box-Pierce Q statistic.

Thus. q) T T T White noise 0 0 0 where D(q) T 0 means the function drops off to 0 after lag q means the function tails off exponentially means the function is 0 at all nonzero lags. The VAR= option is required. d is 0. NLAG+1 must be greater than p+d+q to obtain initial parameter estimates. RUN. use these SAS statements: PROC ARIMA DATA=SERIES. When you fit an ARIMA(p.q) models discussed so far. . Even with 150 observations.3.4 Examples and Instructions The following pages contain results for 150 observations generated from each of the eight sample series discussed earlier. This is useful because you must use an IDENTIFY statement prior to an ESTIMATE statement. considerable variation occurs. To obtain all of the output shown for the first series Y1. If you have seen the output on a previous run. IDENTIFY VAR=Y1 NLAG=10. 3. The NLAG= option gives the number of autocorrelations to be computed and defaults to 24. the ACFs correspond to the Es in Output 3.d.1 Summary of Model Identification MA(q) ACF PACF IACF D(q) T T AR(p) T D(p) D(p) ARMA(p.80 SAS for Forecasting Time Series Table 3. For the ARMA(p.q). CENTER subtracts the series mean from each observation prior to the analysis. The following options can also be used: NOPRINT suppresses printout. you may want to suppress it with this option. DATA=SASdataset specifies the SAS data set to be analyzed (the default is the most recently created SAS data set).

you decide that Y7 is a white noise series. the MA(2) diagnosis seems appropriate. The generated series has 150 observations.8269 to its right.1 IDENTIFY Statement for Series 1–8 The following SAS statements. Because no model is specified.0092 is the area under the chisquare distribution to the right of the calculated 17. The number 0. produce Output 3.03 is to the right of the 5% critical value. observe that the calculated Q statistic is 17. Try to identify all eight of these series. reading fine detail from the ACF is unlikely. IDENTIFY VAR=Y1 NLAG=10. IDENTIFY VAR=Y2 NLAG=10. Even with 150 observations. more SAS statements IDENTIFY VAR=Y8 NLAG=10. this Q statistic simply tests the hypothesis that the original data are white noise. The ACF is near 0 after two lags. so you can check your diagnosis against the actual model. you see that 17.4.0092 is less than . look at Y6. Contrast this with Y7. At this stage. you decide that Y6 is not a white noise series. without recourse to a chi-square table. so you have significant evidence against the null hypothesis that the considered model is adequate. Therefore.3.F T AM E Y L Chapter 3: The General ARIMA Model 81 3. note the width of the standard error bands on the autocorrelations. A model with few parameters is preferable.03. which would be compared to a chi-square distribution with six degrees of freedom. Because 0. you have identified the form of the model and can assign the remainder of the analysis to PROC ARIMA. indicating that you may choose an MA(2). which means that an AR diagnosis requires perhaps seven lags.2.05. First. Your goal is to use these functions to limit your search to a few plausible models rather than to pinpoint one model at the identification stage. RUN.85 is far to the left of the critical value and nowhere near significance. For example. The 5% critical value is 12.59. Because an MA model has a persistently nonzero PACF and IACF. . 2. where the calculated statistic 2.5: PROC ARIMA DATA=SERIES. A model is needed for Y6.85 has an area 0. You must identify the model because PROC ARIMA does not do it automatically. when used on the generated data. The PACF and IACF are nonzero through several lags.03. These are presented in Section 3.1. Either way.

006530.0 00000. 079161.1 17538.0 64900. | .0 790851.0 891736.0 078360.0 00730.052600. .0 0 rorrE dtS | .0 44491.*****| | ******| | ********| | ************| | ***************| |********************| . | . .0 604061.0 68432.0 22867. . .0 99510.1 noitalerroC 414273.0 435551.0 365021. .0 93842.*****| | . . .0 399918. |********** | | | | | | | | | | 40020. ****| | .202 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | .**| . .0 1000.0 99513. | | | | | | | | | | | 15341. .0 854906.*****| | . |* .069580. .047484.0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 1Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3.842.0 152. |* . ***| | . *| .0 784256.< qSihC > rP 6 FD 27.0 75575. | | | | | | | | | | 80330.0 13560.5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA 82 SAS for Forecasting Time Series .1 815399. .086630.2 ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 051 398016. |* . | .0 55542.0 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | .0 03050. . . |* .0 79904. .0noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI .0 867.0 613. .0 480051.0 475446.022867.015620. .0 44152. . .0 97340. |* ***************| .0 675. *| . .039500. | .0 51960.0 014.1 106394.0 056180.0 765405.0 08820.*****| | . . . |* . .0 668251.0 966731. . .0 185541. | . . |* . *| . .1 679495.0 46211.024270. |* .**| .

| .0 92080.063221. *****| .**| . |**************** | | | | | | | | | | 44300.492 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | . | . |**. . .0 313481.0 24480. |*********** | *************| .1 318242.0- 456. |**.0 838181.1 760414. | .0 037448. **********| . | .78356. | .833. . |**** . .004320. . *| .00000.0 231861.0 50014.0820320.0- 1000.0 0 rorrE dtS | .0 324326.0 869871.1918189.0 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI 738581.054250.0- 084. .0 697.0 80300.033420.0 375.0noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | . |******** | **********| .1557454.0 85005.0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 2Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3.**| .0 66570.0 276471. |* . | .092350. |* . | .0 17872.066101.0 014. .35733. |**************** |********************| | | | | | | | | | | | 22361.2398030.**| . |**. . | *******| .5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 83 .3 ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 051 649047.0 213441.1 40370.0 056180. | . .0 94697. .002001. |* .0 23001.0731097.0 537851. | . . |******. .1 noitalerroC 196494. .0 589221. | .< qSihC > rP 6 FD 42. | .0 94697.89974.057930. ***| . .077140.96062. .**| .0 55930. *| .1 843537. .0 96502.0 55275. | | | | | | | | | | 11200.008610. | . .

. |**** | | | | | | | | | | 44930.022620. | | | | | | | | | | | 61101. . . .0 09851.049360. .0 500113. | .0 829714.000400.0 00000.0 906021. |****** . ***| | *****| | *****| | **********| | *********| |********************| .0 62203.0 614611.0 54852. ***| | .0 209721.5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) 84 SAS for Forecasting Time Series . |* .0 521592. .0 079690. *| . . .****| | .045771. .0 017212.101 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | . | | | | | | | | | | 33940. .0 0 rorrE dtS | . .0 59831.0 356593.302.1 46055. . . .0 58070.0 058472.0noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI 409821. . |* .0 315396. .0 799121. |* . *| .0 97291. *| .1 ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 051 272732. . .0 93494.****| | .0 77170.0 45971.0 61302.0 056180.0 78670.038363.0 74300.0 30354.0 248035.035940. | . . .0 951. . *| .< qSihC > rP 6 FD 65.0 30354. .0 10372.0 494. .024440. .0 252342. *| .0 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | . | . .0 232421.0 1000.0 625211.0 838657. |* .0 67200.0 059521.0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 3Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3.0 71570.045230.0 852.****| | .**| . **| | .0 19820.1 noitalerroC 468451.036340. |* . |* *******| *********| .**| .0 354.0 372. .

0 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | . .1 38512.0- 682. .0 66421.0 21660.0 663990.0 03071.0 501811. |********** **********| .0 522711. . |* .5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 85 .0- 524.0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 4Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3. |* .0 76722.**| . | | . *| .521.0 0 rorrE dtS snoitalerrocotuA esrevnI | .0 93621. ***| . | | . | | **********| .0 00000. . .< qSihC > rP 6 FD 33. *| .095220.0- 094.0 650. **| .0 788423.0 99050.063225.073490.034094. . |**. .68820. |* . . | | | | | | | | | | 50530.19424.023620. | .04682.0 111142.027830.0 296709.48 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | .0 056180.0 29550. ***| . .0 70375.0 11750.0 78600.0 286601. | | . |*********** | | | | | | | | | | 89910.02651. .081990. | . *| .0 099001. |**.1 ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1366021.0 740711.0 38690. . |* .0106018. . *****| .0 09150. *| . . | | . |****** | | . | |********************| | 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 051 291183.0579792.0 45990. | | . | . *| . | .**| .0- 651.0985539. . |******** | | . |**.1 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 891370.0063645.0 716021.0noitalerroC 73830.0 1000. .0 91900.0 872211. |* . | | .34094.0 137911.0560550. |***.0 718732. .011901.

0 93600.0 37450.1 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 9073100. .0 480. |***** *********| . | . |** .0 44000. . *| . | | .0782302. .1 ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1979301.< qSihC > rP 6 FD 84. | |********************| | 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 051 815613.066410.0572258. . | | .5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) 86 SAS for Forecasting Time Series . |* .0 367441. .0 15531.0 68071. . |******* **********| .051621. | | . .0 860110. **| . | | .0- 711. . | | .0 63490.0 912337. | . . | | .0 30310.0083002. | .0 05140. | . .0 40280.0 455361.0 023101. *| . |* . | .0- 230.0 254141.24 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | .92711.68130.0 168432. | | .0 25380.0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 5Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3. .0 0 rorrE dtS snoitalerrocotuA esrevnI | .037944.1 84003.0 52240. . ***| . |* . |************** | | | | | | | | | | 26200. |*** ***| .0- 611.0 1000.0 18600.084010.037194.0 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | .0 155301. **| .077550. | .0 16180. | | | | | | | | | | 71500.0- 294.0712550.0 60396. | . |** . | .0 254990.600. |** . | | .0noitalerroC 97000.16511. .***| .0 187101.0 363201. .0 877101.0 45942.0 39063.0 056180. | | **********| .0 114001.**| .37194.0 025990.039831. | .0 00000.

. .0 97901. . .0- 2900. .0 013090. |*** |**** |*** |**** |****** |**.0 40900.0 49430.0 209980.0 348480. |* .002903.0 545280. | .088631. **| . |* . | .63600. |**.0- 501. | . | .0 560.**| ***| ******| *******| *********| ***********| ***********| .0 998980.900.0 218110.0noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | .087802.0 022090.0 32190.0 09733. | .44410. | .0172703.055210. *| . . .0 66090.77492. *| . .0 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI 739090.0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 6Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3.032941.0 16244.0 412090.0 056180.010501.0 26161. |********************| | | | | | | | | | | | 39360.0 09460. . | .0 776540.04013800.1 ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 051 953341.0043583.0 262911. .1 35240.0 51730. *| .0 190. |** . . .0 37182. . | | | | | | | | | | 60620.71 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | .026800. | .0 30545. | . .0 515811.0 229090.0- 600.0- 592. | .079281. .0 68220. | . . | . | .0288810. | .5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 87 . . | | | | | | | | | | 81540.0 782980.0 27375.00000. |**.0 0 rorrE dtS | .039421. |* . . |****** | .0672731.1 noitalerroC 275380.0 qSihC > rP 6 FD 30.10501.

0 95140. . *| . .**| . | . |* .0 052580. .008810. | . |**. | .0 qSihC > rP 6 FD 58.042480.91210. | . |**.1 ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 051 700320. | .5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) 88 SAS for Forecasting Time Series . | .0 345640.0 196180.0457210.0 53480.0 21020.0 18101. | .0- 210.51210. | | | | | | | | | | 41120. | . .080220.079180.0 976180.0- 301.0 44220. *| .0 39700.054530. |**.0 445601. . . | .0 09400. | .0 131380.0 003380.0 445280.0 655280.08810. . .031201. . . . .0 00000.0 180.0- 210. | .**| .**| . | . |********************| | | | | | | | | | | | 01520. .046330.1 noitalerroC 272620.0 0 rorrE dtS | .015210. | .071860.0 64180. | .0 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | .0 26580. . *| . | .0 090380. .0 984320. | . | | | | | | | | | | 26020.0 42330.0733330. |* .0 621480.0 056180.58130.0- 910.076800. | . .0313701. .2 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | . | .0noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI 602480.1 26751. | .0 671840.0517210. |**. | . | .220. .0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 7Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3. |**. *| . |* .0 47410. *| . | . | .45201.0 9628.0 30640.0086910.

1 noitalerroC 728241.0 660621. |* . | .0 430.0 51931.0 010.0 931.0 500621. *| | . *| | .0 95611.0 852972. *| . . . |* . .0 83927.0 22250.0 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | .601 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | .0 444592.0 595253. | . . |******* ***************| . .059000.0 78011.0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 8Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3.0 612649.0 00000.055540.0 38833. . *| . |* . **| | . .0 12011.0 82740.0 88102. . *| | . | .0 81910.0 38141. |* .0 374520. .0 24373.066520. .0 19660.0 89330. . . .0 579621.0 0 rorrE dtS | .0 056180.060. .068980. | . **| | .**| . . 756821.1 239335.0 1000.0 927.0 679421.077930. .< qSihC > rP 6 FD 56. .0 81710. .0 55950.0 388051.0 37860. | .0 620821. . | | | | | | | | | | | 73650. | | .083927. |************* | | | | | | | | | | 46000. *| .1 50475.0 70120.0 303711. | | | | | | | | | | 83100.0 391848.0 39256. ****| . ***| | . ***| | *******| | ***************| |********************| .0noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI . | .0 50010. .**| . . .0 004953. .2 ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 051 338195.0 952621.0 390680.5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 89 . | .0 35700. .0 170621.0 373.

2 Example: Iron and Steel Export Analysis The U. . iron and steel export yearly series (Fairchild Publications 1981) graphed in Output 3.6 Plotting a Yearly Series The following statements produce the results in Output 3.6 is a good illustration of model identification.90 SAS for Forecasting Time Series 3.7: PROC ARIMA DATA=STEEL. RUN. IDENTIFY VAR=EXPORT NLAG=10.4.S. Output 3.

| | | | | | | | | |

. . . . . . . . . .

*| . |* . **| . |* . *| . |* . |* . | . ***| . |**********

| | | | | | | | | |

63240.0 44730.019970.0 75840.014940.0 01550.035030.090310.086741.0 70184.0noitalerroC

01 9 8 7 6 5 4 3 2 1 gaL

1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI . . . . . . . . .

167781.0 049681.0 727581.0 283581.0 473581.0 671481.0 858281.0 116281.0 842181.0 657051.0 0 rorrE dtS

| . |** | . |** | . |** | . |* | . | | . **| | . **| | . *| | . **| | *********| |********************|

.

| | | | | | | | | | |

84580.42280.57990.50350.61800.0 76890.0 91301.0 35440.0 34401.0 39174.0 00000.1 noitalerroC

188652.0851742.0077992.0424951.0715420.0 435692.0 790013.0 538331.0 938313.0 832814.1 061500.3 ecnairavoC

01 9 8 7 6 5 4 3 2 1 0 gaL

1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 44 45337.1 281814.4

snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM

TROPXE = elbairaV fo emaN erudecorP AMIRA ehT 0891-7391 SNOT NOILLIM NI THGIEW SPARCS GNIDULCXE STROPXE LEETS DNA NORI

Output 3.7 Identifying a Model Using the IDENTIFY Statement For the AR(1) model use the statement Although the Q statistic fails by a slim margin to be significant, the lag 1 autocorrelation 0.47193 is beyond the two standard error bands. Thus, you want to fit a model despite the Q value. From the ACF, it appears that an MA(1) is appropriate. From the PACF and IACF, an AR(1) also appears consistent with these data. You can fit both and select the one with the smallest error mean square. To fit the MA(1) model, use the statement

ESTIMATE Q=1; Chapter 3: The General ARIMA Model 91 ESTIMATE P=1;

92 SAS for Forecasting Time Series

Output 3.7 Identifying a Model Using the IDENTIFY Statement (continued)

**Suppose you overfit, using an MA(2) as an initial step. Specify these statements:
**

PROC ARIMA DATA=STEEL; IDENTIFY VAR=EXPORT NOPRINT; ESTIMATE Q=2; RUN;

Any ESTIMATE statement must be preceded with an IDENTIFY statement. In this example, NOPRINT suppresses the printout of ACF, IACF, and PACF. Note that the Q statistics in Output 3.8 are quite small, indicating a good fit for the MA(2) model. However, when you examine the parameter estimates and their t statistics , you see that more parameters were fit than necessary. An MA(1) model is appropriate because the t statistic for the lag 2 parameter is only 0.85. Also, it is wise to ignore the fact that the previous Q was insignificant due to the large t value, 3.60, associated with the lag 1 coefficient. In Output 3.7 the Q was calculated from six autocorrelations , and the large lag 1 autocorrelation's effect was diminished by the other five small autocorrelations.

--------------------snoitalerrocotuA--------------------

800.0

990.0

−

−

| | | | | | | | | |

1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1-

301.0

. |* . | . |** . |* . |* . | . **| . **| . |*** *********|

0891-7391 SNOT NOILLIM NI THGIEW SPARCS GNIDULCXE STROPXE LEETS DNA NORI esioN etihW rof kcehC noitalerrocotuA 540.0 snoitalerrocotuA laitraP . . . . . . . . . . 401.0 274.0 | | | | | | | | | | noitalerroC 51750.065110.001380.033330.049550.035010.0 58180.0 64870.0 81251.039174.0 qSihC > rP 6850.0 FD 6 gaL 01 9 8 7 6 5 4 3 2 1 erauqS -ihC 51.21 gaL oT 6 erudecorP AMIRA ehT

)2(**B 24231.0 + )1(**B 82065.0 + 1 srotcaF egarevA gnivoM 999334.4

:1 rotcaF

naeM detamitsE

TROPXE elbairaV rof ledoM 060.0521.0750.0 230.0520.0 321.0 361.0180.0 860.0890.0800.0 060.0 201.0630.0 530.0600.0 680.0500.0770.0600.0702.0660.0 500.0 200.03559.0 3589.0 5589.0 3569.0 qSihC > rP 22 61 01 4 FD 01.21 42.6 18.2 85.0 erauqS -ihC 42 81 21 6 gaL oT

--------------------snoitalerrocotuA--------------------

slaudiseR fo kcehC noitalerrocotuA 000.1 294.0 110.02,1AM 294.0 000.1 310.01,1AM 110.0310.0000.1 UM 2,1AM 1,1AM UM retemaraP

setamitsE retemaraP fo snoitalerroC .tnanimreted gol edulcni ton od CBS dna CIA * 44 slaudiseR fo rebmuN 7432.271 CBS 1288.661 CIA 928955.1 etamitsE rorrE dtS 860334.2 etamitsE ecnairaV 999334.4 etamitsE tnatsnoC 2 1 0 gaL 0993.0 8000.0 1000.< |t| > rP xorppA 58.006.333.11 eulaV t 53551.0 24551.0 73193.0 rorrE dradnatS 24231.082065.000434.4 etamitsE 2,1AM 1,1AM UM retemaraP

noitamitsE serauqS tsaeL lanoitidnoC erudecorP AMIRA ehT 0891-7391 SNOT NOILLIM NI THGIEW SPARCS GNIDULCXE STROPXE LEETS DNA NORI

**Output 3.8 Fitting an MA(2) Model with the ESTIMATE Statement
**

Chapter 3: The General ARIMA Model 93

)1(**B 72894.0 + 1 :1 rotcaF srotcaF egarevA gnivoM 610124.4 naeM detamitsE TROPXE elbairaV rof ledoM 270.0941.0930.0 020.0410.0 690.0 641.0570.0 480.0290.0310.0580.0 411.0440.0 250.0820.0531.0100.0970.0490.0 602.0360.0 600.0950.0 8629.0 4789.0 3789.0 6339.0 qSihC > rP 32 71 11 5 FD 00.41 86.6 32.3 13.1 erauqS -ihC 42 81 21 6 gaL oT

--------------------snoitalerrocotuA--------------------

slaudiseR fo kcehC noitalerrocotuA 000.1 800.01,1AM 800.0000.1 UM 1,1AM UM retemaraP

setamitsE retemaraP fo snoitalerroC .tnanimreted gol edulcni ton od CBS dna CIA * 44 slaudiseR fo rebmuN 8831.961 CBS 4075.561 CIA 942355.1 etamitsE rorrE dtS 385214.2 etamitsE ecnairaV 610124.4 etamitsE tnatsnoC 1 0 gaL 6000.0 1000.< |t| > rP xorppA 96.347.21 eulaV t 21531.0 30743.0 rorrE dradnatS 72894.020124.4 etamitsE 1,1AM UM retemaraP

noitamitsE serauqS tsaeL lanoitidnoC erudecorP AMIRA ehT 0891-7391 SNOT NOILLIM NI THGIEW SPARCS GNIDULCXE STROPXE LEETS DNA NORI

**Output 3.9 Fitting an MA(1) Model with the ESTIMATE Statement
**

1− te3894.

+ e + 124.4 =

t

t

Y

94 SAS for Forecasting Time Series

The results are shown in Output 3.9. The Q statistics are still small, so you have no evidence of a lack of fit for the order 1 MA model. The estimated model is now You now fit an MA(1) model using these statements:

PROC ARIMA DATA=STEEL; IDENTIFY VAR=EXPORT NOPRINT; ESTIMATE Q=1; RUN;

Chapter 3: The General ARIMA Model

95

**3.4.3 Estimation Methods Used in PROC ARIMA
**

How does PROC ARIMA estimate this MA coefficient? As in the AR case, three techniques are available:

**In the CLS method you attempt to minimize
**

te 1+p = t 2 n

**where p is the order of the AR part of the process and et is a residual. In the example,
**

) 1− te (

**To illustrate further, suppose you are given data Y1, Y2, . . . , Y6, where you assume
**

1− te

**You find that
**

98.75

and

62.51

Solving

6362.

.92.

−=β

**yields the initial estimate
**

1− tˆ 92. e

Compute

−

−

−

Wt( 0.30)

0

12

4

6

6

0

−

= ) 2 β + 1( / β − = )1(ρ ˆ

−

êt( 0.30)

12

0.60

6.82

6.95

1.91

−

−

êt( 0.29)

12

0.48

6.86

7.01

1.97

−

−

−

Yt

12

3

β

Suppose you want to estimate

3894.

−=β

ˆ

that

β −

β ˆ

124 .4 = µ ˆ µ ˆ

where

and

**.)LM( doohilekil mumixam )SLU( serauqs tsael lanoitidnocnu )SLC( serauqs tsael lanoitidnoc
**

are parameter estimates. Begin by assuming e0=0. ARIMA computations indicate provide the minimum for the iron export data. and from the data given below: Sum of squares 7 9 4 7 7.57 7.57 301.62 300.13

β+µ− ˆ ˆ

−

t

t

Y

e

t

Y

= )0( γ ˆ

= )1( γ ˆ

=

=

t

= ˆ e

Σ

−

Y

t

t

e

− −

96 SAS for Forecasting Time Series

and thus

26.103

6ˆ 2ˆ = 2 e + . . . + 2 e + 21e ˆ

but by how The larger gives a smaller sum of squares, so you would like to continue increasing much? Letting be the true value of the parameter, you can use Taylor's series expansion to write

**You need to compute the derivative Wt. Derivatives are defined as limits—for example,
**

δ / ))β( e − ) δ + β( e( 0→iδl = )β( ˆ ˆ ˆ m

t t t

You have now computed et( .29) and et( .30), so you can approximate Wt by

**otherwise specified. Now, regressing et( .30) on Wt( .30) gives a coefficient
**

) ) 0 ( ) 75.7 (

This is an estimate of

03.

β

**so you compute a new estimate of
**

7516.

by

1

00. = δ

.03.−

=β ˆ

−

− ) 6 ( )19.1( − ) 6 ( )59.6 ( − ) 4 ( )28.6 ( − )21( ) 06.( (

1 .

7513.0

0 =δ

as in the third row of the table above, where

− = ))0 ( +

−

−

2

)6(

1 . /

−

0

+

2

)6 (

)) 03.

+

− = 7513.0 − 03.−

−( e − )92. −( e( −

2

)4 (

t

+ 0β = β − 0β ˆ

+

) 0 ( te

2

β

Because

is white noise, this looks like a regression equation that you can use to estimate

β

**where –Wt is the derivative of et with respect to 3.2 and ignoring the remainder yields
**

)0 (

and Rt is a remainder term. Rearranging equation

and

In PROC ARIMA,

,β ˆ

,03.

− =β ˆ

For example, using Perhaps you can improve upon et values to the previous list and thus compute

.92.

− =β ˆ

t

R

+ )β − 0β()β( W − )β( e = ) 0 β( ˆ ˆ ˆ

t

e ˆ

**Starting with e0=0, values of
**

21

are listed under the Yt values. Thus,

31.003

β

t

84.

e + )β − ˆ

68.6

= )21 −(92. − 3 − = 2ˆ e

6ˆ 2ˆ = 2 e + . . . + 2 e + 21e ˆ

t

− = )0(92. −

0 () ( tW ˆ

= )84.(92. − 7 = 3ˆ e

ββ

0

β

t

β ˆ

) 21( ( /

1Y

= )β( ˆ

W

t

= 1ˆ e

you can add a second row of

(3.2)

.β − 0 β ˆ

t

t

−

e e

unless

Chapter 3: The General ARIMA Model

97

You can extend this method to higher-order and mixed processes. The technique used in PROC ARIMA is more sophisticated than the one given here, but it operates under the same principle. The METHOD=ULS technique more accurately computes prediction error variances and finite sample predictions than METHOD=CLS. METHOD=CLS assumes a constant variance and the same linear combination of past values as the optimum prediction. Also, when you specify METHOD=ML, the quantity to be minimized is not the sum of squares; instead, it is the negative log of the likelihood function. Although CLS, ULS, and ML should give similar results for reasonably large data sets, studies comparing the three methods indicate that ML is the most accurate. Initial values are computed from the Yule-Walker equations for the first round of the iterative procedure as in the example above. See also Section 2.2.1.

**3.4.4 ESTIMATE Statement for Series 8
**

Finally, reexamine the generated series Y8,

1− te4.

**The following statements produce Output 3.10:
**

PROC ARIMA IDENTIFY ESTIMATE ESTIMATE RUN; DATA=SERIES; VAR=Y8 NOPRINT; P=1 Q=1 PRINTALL GRID; P=2 Q=2;

The PRINTALL option shows the iterations. Because the iterations stop when the changes in parameter estimates are small, you have no guarantee that the final parameter estimates have minimized the residual sum of squares (or maximized the likelihood). To check this, use the GRID option to evaluate the sum of squares (or likelihood) on a grid surrounding the final parameter estimates. Examine the grids in Output 3.10 and verify that the middle sum of squares, 164.77, is the smallest of the nine tabulated values. For example, increasing the AR estimate .52459 to .52959 and decreasing the MA estimate –.32122 to –.32622 increases the sum of squares from 164.77 to 164.79. A message associated with the last command indicates that the procedure could not find estimates that minimized the error sum of squares because excess lags are specified on both sides of the ARMA model.

8166.

−=β ˆ

β∆ ˆ

estimation improvement technique until the changes appears to minimize the sum of squares at 271.153.

+ e=

t

7516.

1− tY 6.

−=β ˆ

Using

as an initial value, you can again compute an improvement. Continue iterating the become small. For this data set,

78.172

= )7516. −( 2 e Σ ˆ

−

t

β

This estimate of

results in a lower sum of squares,

t

Y

4 100.0 9-E1 6177.461 slaudiseR derauqS fo muS 151000.0 158020.0 8-E287.4 noitcnuF evitcejbO ni egnahC evitaleR 406000.0 100.0 setamitsE ni egnahC evitaleR mumixaM 3 serauqS tsaeL lanoitidnoC

snoitaretI atleD noitabrutreP evitavireD laciremuN tneiciffeoC adbmaL s'tdrauqraM eulaV noitcnuF evitcejbO noitcnuF evitcejbO noitaretI tsaL morf egnahC erauqS-R tneidarG fo eulaV etulosbA mumixaM eulaV airetirC etanretlA airetirC etanretlA eulaV airetirC eulaV gnippotS noitaretI airetirC noitanimreT detamitsE sretemaraP dohteM noitamitsE

yrammuS noitazimitpO noitamitsE AMIRA 151000.0 458000.0 915500.0 43540.0 1 tirC R 9-E1 8-E1 7-E1 6-E1 10000.0 adbmaL 17631.017631.098631.014931.058271.0tnatsnoC 95425.0 96425.0 91525.0 16625.0 88535.0 1,1RA 22123.020123.089913.051413.071272.01,1AM 65782.026782.003882.005492.024273.0UM 77.461 77.461 77.461 87.461 61.561 ESS 4 3 2 1 0 noitaretI

noitamitsE serauqS tsaeL lanoitidnoC 310711.1 58271.0tsE ecnairaV esioN etihW etamitsE mreT tnatsnoC 1

71272.0etamitsE

setamitsE egarevA gnivoM laitinI 88535.0 etamitsE setamitsE evissergerotuA laitinI noitamitsE yranimilerP erudecorP AMIRA ehT 1

**Output 3.10 Using the ESTIMATE Statement for Series 8: PROC ARIMA
**

98 SAS for Forecasting Time Series

0100.0 430.2 erauqS -ihC 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.1AM UM retemaraP setamitsE retemaraP fo snoitalerroC .461 22623.0041.0 1.0400.0 78532.0 930.0110.461 87.0 950.065292.461 87.0 430.461 77.0- 87.0 000.1RA 096.0etamitsE 1.0 22123.0 450.3 80.1 etamitsE ecnairaV 17631.065782.461 77.1AM :setamitsE raeN dirG no ecafruS ESS 430.0 8579.0 rorrE dradnatS 95425.0 3269.454 CBS 3077.0760.065782.0 7127.222.0 7422.0- 77.0300.1eulaV t 92790.0 010.0 280.1 610.0990.1AM UM retemaraP noitamitsE serauqS tsaeL lanoitidnoC Output 3.5 79.461 22123.0etamitsE tnatsnoC 1 1 0 gaL 1000.0 01801.0 950.0 920.0 050.0150.0 2099.0530.87.0 200.1RA 1.1 096.0 730.11 97.0 510.0 601.0 700.0 1.< 5300.1 etamitsE rorrE dtS 598021.10 Using the ESTIMATE Statement for Series 8: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 99 .0600.0 610.31 57.0400.1RA 1.0 340.00299.tnanimreted gol edulcni ton od CBS dna CIA * 051 slaudiseR fo rebmuN 2208.0)8y( UM )8y( 1.0 qSihC > rP 82 22 61 01 4 FD 91.0220.0 000.461 87.461 87.461 22613.5 22.0 830.544 CIA 427850.1 UM 1.1AM 450.0- 65282.0400.0 |t| > rP xorppA 93.

1RA :setamitsE raeN dirG no ecafruS ESS Output 3.0 87.10 Using the ESTIMATE Statement for Series 8: PROC ARIMA (continued) 100 SAS for Forecasting Time Series .441 942726.detanimret neeb sah ssecorp noitareti ehT .0 77.461 87.461 95425.461 77.461 95425.0 setamitsE ni egnahC evitaleR mumixaM 5 serauqS tsaeL lanoitidnoC egasseM gninraW snoitaretI atleD noitabrutreP evitavireD laciremuN tneiciffeoC adbmaL s'tdrauqraM eulaV noitcnuF evitcejbO noitcnuF evitcejbO noitaretI tsaL morf egnahC erauqS-R tneidarG fo eulaV etulosbA mumixaM eulaV airetirC eulaV gnippotS noitaretI airetirC noitanimreT detamitsE sretemaraP dohteM noitamitsE yrammuS noitazimitpO noitamitsE AMIRA .degrevnoc evah ton yam setamitsE :GNINRAW .461 87.1AM )8y( 1.0 1563.461 87.022623.0naeM detamitsE 8y elbairaV rof ledoM 77.461 95915.1RA :setamitsE raeN dirG no ecafruS ESS 87.461 95925.461 77.461 77.degrevnoc evah ton yam setamitsE 02 100.461 87.0 97.461 87.022123.0 22613.0 .0)8y( UM )8y( 1.0 65282.461 95915.1 100.461 87.0 + 1 :1 rotcaF srotcaF egarevA gnivoM )1(**B 95425.065782.461 95925.0 87.0)8y( 1.461 87.elbatsnu si setamitse wen eht yb denifed ledom ehT :GNINRAW )1(**B 22123.461 97.461 77..461 slaudiseR derauqS fo muS 660811.1 :1 rotcaF srotcaF evissergerotuA 65782.0 7346.0 10000.065292.

0etamitsE 2.0860.0 551.0 13086.0 700.02.0 479.01.1 165.1AM UM retemaraP setamitsE retemaraP fo snoitalerroC .1 48.1 17.)2(**B 96913.1 336.0etamitsE tnatsnoC 2 1 2 1 0 gaL 1600.0551.1AM 1.1RA 2.01289.0 032.0 + )1(**B 91525.944 CIA 685560.0 601.1AM 732.0732.0 1000.0 730.0 2429.0 050.01.1 852.1AM 1.1AM UM retemaraP noitamitsE serauqS tsaeL lanoitidnoC Output 3.11 87.31 67.1 etamitsE ecnairaV 31000.0479.0150.262.0 950.0400.0329.0 86963.0 010.1 srotcaF evissergerotuA 53503.1 369.tnanimreted gol edulcni ton od CBS dna CIA * 051 slaudiseR fo rebmuN 707.10 Using the ESTIMATE Statement for Series 8: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 101 .0110.1 .0 84471.0 430.1 etamitsE rorrE dtS 374531.0 |t| > rP xorppA 87.0 830.0 6179.0 .0 8760.0 53503.0200.0eulaV t 39881.1RA 2.1 UM 2.0 000.0141.< 0960.0990.091525.0 920.1RA 1.0 950.5 22.0244.0 qSihC > rP 62 02 41 8 2 FD 02.4 38.1 srotcaF egarevA gnivoM )2(**B 36525.0 000.2 erauqS -ihC 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.0220.0100.0852.1 96913.0 8919.)1(**B13086.0300.0000.1AM 329.0 610.0 rorrE dradnatS 36525.0000.1RA 369.0700.0 430.0400.0 96753.0 730.0 280.3 70.1RA 244.0 2.0530.0 9453.0 032.0 65034.0 340.0 3974.0 .1RA 1.464 CBS 8356.0 200.0- :1 rotcaF :1 rotcaF naeM detamitsE 8y elbairaV rof ledoM 530.0 165.0336.

− 2− te4. − 1()B − 1( µ− e)B8. Thus.. − 1( = ) µ − ty () 2B525. the example above shows that this method fails when you overfit on both sides of the ARMA equation at once. . with solutions M=1 and M=2. the series 2− te 4. + 1( = ) µ − t tY() . t 2 t B2 = β − B 1β − 1( = B5.. + B525.. α − . α − M 1α − 1 α − B 1α − 1( 1− tY 6. 1 − 1( > M If all Ms that satisfy this equation have t e)7913. 2− tY 6. but the following series is not: t The characteristic equation for the nonstationary example above is 0= 2 M5. the stationarity of a series ) hinges on the solutions M of the characteristic equation 0= p Mp is stationary. t + M5. This unit root nonstationarity has several implications.2). and because one of them is 1 the series is nonstationary. The overfit example at the end of the previous section ended when the common factor neared an “unstable” value. These solutions are called roots of the characteristic polynomial.1 − 1( + B5. each equivalent to the original Y8.. t 3.1 − 1( − ϕ t t Y and add to the first equation. Every yields a different ARMA(2.. obtaining . + ϕ ( + ϕ Now multiply this last equation on both sides by t t t e)B7913. which are explored below. Theoretically. ϕ + 1− e )4..102 SAS for Forecasting Time Series To understand the failure to converge. note that implies that − 1− tY 1− te4.1 − 1( the series is stationary. − α − . te) B 7913. eliminating the common factor. − 1( + t Y( ) t 1− te Y( ) 2 + e= B2 2 2 2 M2 B46. Although you sometimes overfit and test coefficients for significance to select a model (as illustrated with the iron and steel data). e) e ) q Bϕ − 1( Bq p = 2− Yϕ6. + B3086.1 − 1 + B5. + 1( = ) µ − e) B8. the procedure could not find one ARMA(2. − ϕ ( + Y Bp β − . − t + 1( = ) µ − y ()B525. For example.2) model that seemed best. + 1()B − 1( = ) µ − ty ()B525. Notice that is the same as or. − 1− Y )6.)B .4.5 Nonstationary Series The theory behind PROC ARIMA requires that a series be stationary.

by computing and then analyzing the second difference 2− t Because you do not know the model. + 5. Using the IDENTIFY statement.48.1 B 1− tW + B2 − 1( t t t − − W − t t t t t W W W t Y . . produces the correlation function for Wt. If the ACF dies off very slowly. t t + e= µ t Y( ) t Y= + β Y− Y= Y− Y= 2 1− tW5. you can accomplish differencing easily. the first differences Wt satisfy a stationary equation.Chapter 3: The General ARIMA Model 103 First. Yt is the series level and is the first difference or change in the series. you rarely µ + e = µ)5. The statement IDENTIFY VAR=Y(1.4. specifies analysis of the second difference. and For nonseasonal data. how do you know when to difference? You decide by examining the ACF or performing a test as in Section 3.8. is considered to die off slowly in this context even though the initial drop from 1 to .50. The slow dying off may occur after one or two substantial drops in the ACF. As a result. .1). Assuming a nonzero mean in the differenced data is equivalent to assuming a deterministic trend in the original data because You can fit this easily by omitting the NOCONSTANT option. Similarly. . series forecasts do not tend to return to the historic series mean. Note that the sequence 1. expanding the model gives 1− t 8. . or ) 2− t The default is no differencing for the variables. . This is in contrast to stationary series. where 1− t A subsequent ESTIMATE statement operates on Wt. In the nonstationary example.51. where is estimated and where forecasts always approach this estimated mean. The statement IDENTIFY VAR=Y(1).β = ))1 − t(β + α( − ) tβ + α( .49. By substitution.47. often with mean 0. . 1− t so when the levels Yt satisfy an equation with a single unit root nonstationarity. .45. 1− te8. . which shows that drops out of the equation. .1 − 1( + t t Y + 1− Y2 − + e = )µ − Y − 1− Y( − ) 1− Y − Y( t 2− tY5.5 is large and the magnitude of the autocorrelation is not near 1. you can eliminate a double unit root as in 1− te8.t Y∇ 2 t Y∇ The first and second differences are often written difference more than twice. 1− tY5. . a unit root is indicated. so the NOCONSTANT option is normally used.

104 SAS for Forecasting Time Series 3.( 1= i Σ+ − j +nY t n Y( j W t Y Y Σ . when you specify a model with differencing. For example. modeling is done on the differenced series.( i Y− Y= = n 1= i Y j t )5. you can easily derive the forecasts and their variances from the model. so the forecasts converge to 550 + (1)(32) = 582 2 σ +nW + . In general. the first differences 1− t are stationary. . Now j so the forecast of Yn+j is n To illustrate further. + 1− tY5.5jWn as the prediction. the following computation of forecasts shows a few values of Yt.4. If you specify differencing. − ) 1− tY − 2 + nW e = 2− tY5. + t e = ) 2 − tY − 1− tY(5. prediction error variances increase without bound as you predict further into the future. Y2.6 Effect of Differencing on Forecasts PROC ARIMA provides forecasts and 95% upper and lower confidence bounds for predictions for the general ARIMA model.. . Wt. . . and predictions : jY ˆ Actual t Yt Wt Note that i Forecast 99 100(n) 518 43 550 32 101 566 16 102 574 8 103 578 4 104 580 2 98 475 28 approaches 1 as j increases. Yn from this series. but predictions are given for the original series levels. using . in the model t note that t Thus.1 − + 1+ nW W )5. by using estimated parameters and by estimating from the model residuals.. PROC ARIMA accomplishes this task for you automatically. Given data Y1. you predict future values by first predicting future values of Wn+j. Also.

T+1. and the IDENTIFY results in Output 3. yields the forecast error 2 + ne 3.11. the data are analyzed with PROC ARIMA and are forecast 15 periods ahead. Box and Jenkins report values of daily closing prices of IBM stock. . IDENTIFY VAR=PRICE(1) NLAG=15. data lines . + nW5. RUN.Chapter 3: The General ARIMA Model 105 Forecast errors can be computed from the forecast errors of the Ws—for example. IDENTIFY VAR=PRICE CENTER NLAG=15.3 with the variance + nW52.1 2 +nY 2 n 2 + nY ˆ .7 Examples: Forecasting IBM Series and Silver Series An example that obviously needs differencing is the IBM stock price series reported by Box and Jenkins (1976). 2 σ52.( + ) 1+ne + nW52. RUN. INPUT PRICE @@. The plot of the original data is shown in Output 3. PROC ARIMA DATA=IBM. You read in the series and check the ACF: DATA IBM. In this example.( 1 n + + nY n nY + = = 1+ne5.12. CARDS. 2 +n ) 2 + ne and Rewriting + 1+ne5.4. W+ + W+ Y= +Y nW 5.

106 SAS for Forecasting Time Series Output 3.11 Plotting the Original Data .

| ******************| .0 00000.0 870842.0 596351. . |*. | ******************| . | *******************| . . | ******************| . .0 800802.0noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI srorre dradnats owt skram ".0 344511.0 80879.038901. | *******************| . | .0 0 rorrE dtS | ******************| . | *******************| . **| .2256 844.040715.083870. |** . .0 82039.0 627652.0 04399.8686 926.0 950631.0 38509.1 noitalerroC 149.0 399812.0 271691. | .0 850250.6207 856.0 50020.077610.3707 ecnairavoC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 963 40501.0 09230. . | . .028610. . |*.0 34798. .0 93090.0 99079.0 09589.| | | | | | | | | | | | | | | .0 58910.0 71988. |********************| .8196 419. . |********************| .8436 794. | .0 99749.48 0 snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM ECIRP = elbairaV fo emaN erudecorP AMIRA ehT 26VON2 OT 16YAM71 SECIRP KCOTS YLIAD MBI B SEIRES Output 3.12 Identifying the IBM Price Series Chapter 3: The General ARIMA Model 107 .0 582961.0 749832.0326 466. | *******************| .0856 104.6646 589. | *******************| .3676 018. |********************| . | ******************| .011910.5466 177. |*. **| ." 049462.0 19720. | . | .0 177980.7186 334. .5076 785. |********** | | | | | | | | | | | | | | | 37600.0 64939.0 472922. | ******************| .0 733381.0 38369.052720.0 93720. | .7046 010.0 71659. |*.0 01419.9826 290. |********************| | | | | | | | | | | | | | | | | 78088.3796 669. | *******************| . .0 95800.0 51229.

| .0 399.0 905250.054800.0 1000.< 1000. | .0 039.25 ecnairavoC 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 1 863 543842.042180.004399.93100.0 469. | . | .0 849.053510. | . | . | .7904 13. | . | .6 164162.0 179.069350. | . | .0 46350. | . | . |*.0 10420.1 noitalerroC 460053. | **| .040210.12 Identifying the IBM Price Series (continued) 108 SAS for Forecasting Time Series . | . | . | . | . | | | | | | | | | | | | | | | 96410.0 689.0 879.0 419. |*.85580.5312 erauqS -ihC 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | . | **| . | .4 905835. |*. |*.0 78100.022440.2498270.0 0 rorrE dtS | **| .0 229.*| . |*.357250.0 905250.23450. | . |********************| | | | | | | | 68021.031620. |*.< qSihC > rP 21 6 FD 04.0 52320.0 03820.0 266250.0 939.0 00000. | .1957358.7 98972.046170.0 659. |*. |********************| . | .0 921250. | .66430.0410694. | . |*.1718028. | .0 noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP erudecorP AMIRA ehT 26VON2 OT 16YAM71 SECIRP KCOTS YLIAD MBI B SEIRES Output 3.049330.0 327250.01 gnicnereffid yb detanimile )s(noitavresbO snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM gnicnereffiD fo )s(doireP ECIRP = elbairaV fo emaN 609.

056520. |** **| . . |*.*| .0 76680.0 57740.0 005350. | .75560.006420. |*. |*.0 19221. |** .077800.0 006450.0 63210.*| . .1 682384. |*.12 Identifying the IBM Price Series (continued) Chapter 3: The General ARIMA Model 109 . .057320.0 637350. | . .0 36620. **| .*| .*| .2 887340.0 23040. . .4 812941. .006950.0 78120.0 343450.038050. **| .*| .*| . |** .0noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI srorre dradnats owt skram ".0 100074. | .0 14260.3 51 41 31 21 11 01 9 8 7 Output 3. |*.0 10540. .| | | | | | | | | | | | | | | .2993618.0 55540. .0 noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | | | | | | . . . | . **| .1 527585. .0 52860. .0 220450. .16350. . | .090870.019001.0 79670.0 04910. .0 | | | | | | | | | .*| .3 407805.3101544. .086780.3606178.019170. . | . **| . . .084140. .0 108350. | | | | | | | | | 50660.*| . . | | | | | | | | | | | | | | | 06650. .083620. .*| . . |*.085580.0 55420. | .0 43070.*| . |** | | | | | | | | | | | | | | | 26350.0 24770.*| . |*. ." 418450. |*.0 04130. |*.26530.*| .058350.0 640450. |*.*| .0 03660.0 784450. . . .093970.

99340. 0. For example.0 1. Output 3.12 Identifying the IBM Price Series (continued) The ACF dies off very slowly. 6 2 The results are shown in Output 3. The PACF indicates a very high coefficient. the probability of a value larger than 9.1052 211632.0 530. the Q statistics 9. so 9.1AM FD 21 6 erauqS -ihC 24.0 esioN etihW rof kcehC noitalerrocotuA qSihC > rP 4431.9 χ gaL oT 21 6 . is not significant.0860. With a first difference. The ACF of the differenced series looks like white noise. The first autocorrelation is 0.0rorrE dradnatS 30250.71 89.42) autocorrelations of the differenced series. Next. ESTIMATE Q=1 NOCONSTANT.13 Analyzing Daily Series with the ESTIMATE Statement: PROC ARIMA retemaraP --------------------snoitalerrocotuA-------------------450. suppress the printout with the IDENTIFY statement (you have already looked at it but still want PROC ARIMA to compute initial estimates) and estimate the model: PROC ARIMA DATA=IBM.110 SAS for Forecasting Time Series Output 3. RUN.7 23163.0 gaL 1 770.0 CBS CIA etamitsE rorrE dtS etamitsE ecnairaV 630.42 are not significant. in the regression of Yt on Yt–1.98 and 17. In fact. IDENTIFY VAR=PRICE(1) NOPRINT.0450.0|t| > rP xorppA 0790.126.0 420.0etamitsE 85680. The Q statistics are computed with the first six (9. it is common to find an indication of a lag 1 MA term.0 26VON2 OT 16YAM71 SECIRP KCOTS YLIAD MBI B SEIRES noitamitsE serauqS tsaeL lanoitidnoC 220.0 6521.98) and first twelve (17.1erudecorP AMIRA ehT 660.0158.0 121.0 680. therefore.98 in a distribution is .98 is to the left of the critical value and.5052 349.052.08558 with a standard error of about 1/(368)1/2=.13.25 eulaV t 66.0 100.

you ignore an autocorrelation 0. See the forecasts in Output 3. The t statistic –1.0270. The model appears to fit.0 820. --------------------snoitalerrocotuA------------------- 750. In this example.0070.0 021.0 7122.0150.0 500. More attention should be paid to the lower-order and seasonal autocorrelations than to the others.0- .0 990.0 720.0 810.0 710.0700.0 040.Chapter 3: The General ARIMA Model 111 Although the evidence is not strong enough to indicate that the series has a nonzero first-order autocorrelation.ledom siht ni mret naem oN ECIRP elbairaV rof ledoM 370. you nevertheless fit the MA(1) model.93 40. RUN.0 74 14 53 92 32 71 11 5 FD 33. Similarly.13 49.0 2110.65 38. IDENTIFY VAR=PRICE(1) NOPRINT.6 erauqS -ihC 84 24 63 03 42 81 21 6 gaL oT Output 3.0470.0 8910.0650.0 950.0 620.tnanimreted gol edulcni ton od CBS dna CIA * 863 slaudiseR fo rebmuN 500.0 660.0 060.0 450.31 99.0 5632.14.0 820.0slaudiseR fo kcehC noitalerrocotuA 1 )1(**B 85680.0 970.0 530.0 + 1 .0811.94 50.0 2210.0 4900.67 24.66 is significant at the 10% level.04 that attains significance because of autocorrelations . make a third run to forecast: PROC ARIMA DATA=IBM.46 74. FORECAST LEAD=15.0 qSihC > rP 4400.121 at lag 6 that was even bigger than the lag 1 autocorrelation.0 311.0580. ESTIMATE Q=1 NOCONSTANT NOPRINT.0001.118 and .0 520.0 220.113 at lags 16 and 17.0 360.0 960.0980.0 100. therefore.0550.0 :1 rotcaF 611. Ignore this significance in favor of the more parsimonious MA(1) model.0 930.13 Analyzing Daily Series with the ESTIMATE Statement: PROC ARIMA (continued) .0 270.0 140.0 270.0150.0 750.0srotcaF egarevA gnivoM gnicnereffiD fo )s(doireP 730.0 420. residuals from the final fitted model show a Q statistic 31.0 6910.0180.0 030.0660.

383 0723.753 Y − 1− Y t ∇ t 2 − tY( . 1− tY ]senil tuptuo erom[ + ) 3− Y − tsaceroF 7383.173 7267.0 + 1 :1 rotcaF . .7 0692.753 7383.14 Forecasting Daily Series: PROC ARIMA ∇ . estimates the parameters from the data. then by repeated back substitution . is large enough to give a good is called because it does not have approximation to the model. .892 2930.112 SAS for Forecasting Time Series If 1− te as in the IBM example.203 1 )1(**B 85680.ledom siht ni mret naem oN ECIRP elbairav rof stsaceroF ECIRP elbairav rof ledoM srotcaF egarevA gnivoM gnicnereffiD fo )s(doireP rorrE dtS 6662. + 3− t so that ). .343 7400.614 2827.03 9752.633 2102.. PROC ARIMA.Y − 1− Y 2 β + 2 − Yβ + 1− Y ) β − 1( + e 2 β + ) 2− Y − + sbO 273 173 073 483 383 283 t Y 3 − tY no 2 t β+ t ) 1− tY 2 − tY 1− tY( − t β+ β + ) 1− Y − t Y = tY β− 1− tY() t e = 1− tY − t ∇ β − 1( = erehw ( t t Y( = = t t t Y Y ˆ Y t e t Y∇ .31 6586. . .82 erudecorP AMIRA ehT Output 3. . Said and Dickey (1984) extend the test to ARIMA models. unlike PROC FORECAST with METHOD=EXPO.753 7383.133 3044.753 7383.92 6181. Forecasting Yt by such an exponentially weighted sum of past Ys is called single exponential smoothing.003 7841.753 7383.753 7383. Dickey and Fuller (1979) give a formal test of the null hypothesis that an AR series has a unit root nonstationarity versus the alternative that it is stationary.01 1632. however. The t test on µτ p − tY 7583. or . . ..414 7816. in the case of the mixed process.214 stimiL ecnedifnoC %59 26VON2 OT 16YAM71 SECIRP KCOTS YLIAD MBI B SEIRES 7183.873 2665. The test involves a regression of where p is at least as large as the order of the AR process or. Higher degrees of differencing plus the inclusion of more MA terms is equivalent to higher-order exponential smoothing.

1. 3.0 = 2M 2 α − M1α − 1 µ − 1− Y t t e + ))1 − t(β − α − 1− tY (ρ = e + ) 2 − tY − 1− tY ( 2 α − ) µ − 1− tY () 2 α − 1α − 1( − = t written in terms of differences and the lagged level term ( becomes 1− t ). 642). regressions they studied. . then So the term drops out of the model and forecasts do not revert to the mean. The silver series from Chapter 2. “Simple Models: Autoregression.Chapter 3: The General ARIMA Model 113 a Student's t distribution and must be compared to tables provided by Fuller (1996. but it does require the tabulation of a new distribution for the test statistics. There is. This does not mean the test cannot be done.8 Models for Nonstationary Data You can formally test for unit root nonstationarity with careful modeling and special distributions. the AR(2) e + )µ − 2− t Y( 2 α + ) µ − 1− Y( 1α = µ − t t e µ − 1− Y ( + β = Y∇ t e + ) µ − 1− tY (ρ = µ − mrof snoitaived ni )1(RA 1 = ρ : 0H t t e = Y∇ = Y∇ e t t e + 1− t t t Y t t Yρ = Y t Y∇ = 1− Y − Y ) ) µ − 1− Y ( µ − 1− Y ( t t t t t e + 1− tY )1 − ρ( + β + ) tβ + α()ρ − 1( = t β− α− t Y ) 2− tY t t e + 1− tY)1 − ρ( + µ)1 − ρ( = − 1− Y ( t Y . With a little algebra. This discussion suggests a least squares regression of on and with an intercept and the use of the resulting coefficient or t test on the term as a test of the null hypothesis that the series has a unit root nonstationarity. If all roots M exceed 1 in magnitude. one major problem with this idea: nor its t test has a standard distribution. ssergeR t 1− t t . Y− Y t t t t Y∇ Y∇ Y∇ t t t . Here ) 1= M . suggesting a one-tailed test to the left if stationarity is the alternative. however. even when the neither the estimated coefficient of sample size becomes very large. can be Any autoregressive model like the AR(2) model t Stationarity depends on the roots of the characteristic equation so if is a root.0 mrof noisserger ni )1(RA t = ) 2 α − 1α − 1( k − tY k − tY t :eseht no Y∇ e + 1− tY)1 − ρ( = k − tY ∇ 1− ∇ 1− Y ∇ 1− ∇ 1− Y ∇ 1− ∇ 1− Y 1− t Y t t Y Y− Y t Y t Y 1− Y . The leftmost column of the following tables shows the denotes a first difference. 1981) studied the distributions of estimators and t statistics in autoregressive models with unit roots. t . Dickey and Fuller (1979.” is used as an illustration in the next section.1. the coefficient of will be negative. p.4.

1. however. and LSILVER for the lagged level of silver. TEST DEL2=0. PROC REG DATA=SILVER. WHERE PART=1. One very nice feature of these regressions is that the coefficients of the lagged differences have normal distributions in the limit. the t test statistics have the same limit distributions no matter how many augmenting lags are used. . stocks of silver on the New York Commodities Exchange were analyzed in Chapter 2 of this book. the forecast of 2 would be However. Use the third model if you suspect a regular trend up or down in your data. For illustration a lag 1 autoregressive model with autoregressive parameter is shown in the preceding table both in deviations form and in the algebraically equivalent regression form. RUN. The parameter represents a trend slope when ρ t Y 1< ρ t β+ α β 1=ρ µ t Y and is called a “drift” when . the distributions for the coefficients of .114 SAS for Forecasting Time Series The lagged differences are referred to as “augmenting lags” and the tests as “Augmented DickeyFuller” or “ADF” tests. and t are all nonstandard. PROC REG DATA=SILVER.15. might already be a difference of some observed variable). They converge to standard normal distributions. The three regression models allow for three kinds of trends. Fit the first model only if you know the mean of your data is 0 (for example. MODEL DEL=LSILVER DEL1 DEL2 DEL3 DEL4 /NOPRINT. WHERE PART=1. As L . The WHERE PART=1. Tables of critical values and discussion of the theory are given in Fuller (1996). the forecasts have a component that increases at the linear rate For the regression under discussion.) Lβ + nY ρ − 1(/ 2 σ increases. Thus a standard F test to see if a set of these lagged differences can be omitted is justified in large samples. In both cases. but not as powerful as those from the second Note that for known parameters and n data points. statement restricts analysis to the data used in the first edition. If you fit the third model when is really 0. The deviations form is most and if we have appropriate starting values. −t Y∇ . . Fortunately. RUN. 2 σL 1− t Y . DELi for its ith lag. if the L step ahead forecast is with forecast error variance so that the error variance increases without bound in this case. or depending on which model is assumed. t j Some output follows. then the expected value instructive. As an example. The coefficients of Y –1 and the associated t tests have distributions that differ among the three regressions and are nonstandard. the forecast error variance approaches the variance of Y around the trend. DEL4=0. 2 σ) 2 −L2ρ + + 2ρ + 1( 1< ρ for with forecast error variance 1=ρ L+n Y 1< ρ . your tests will be valid. β )n β − α − nY ( Lρ + )L + n(β + α β model. DEL3=0. MODEL DEL=LSILVER DEL1. First you have the result of the test statement for the model with four augmenting lags in Output 3. It shows that if of is 0. as are the t statistics for the individual lagged difference coefficients. We reanalyze the data here using DEL to denote the difference.

thus providing no evidence against leaving out all but the first augmenting lag. this statistic has the distribution tabulated by Dickey and Fuller.0 9860.1 rorrE dradnatS 60801.57 FD 14 3 rotanimoneD rotaremuN − 1 1 1 ecruoS 1LED REVLISL tpecretnI Output 3. stseT tooR tinU relluF-yekciD detnemguA F > rP F 4843. the p-value 0.0 92.0 68. Silver Data |t| > rP 1000. The second PROC REG produces Output 3.05. 642). I VAR = SILVER STATIONARITY=(ADF=(1)) OUTCOV=ADF.3 uaT < rP uaT 7962.287. This is an error because all p-values from PROC REG are computed from the t distribution whereas.037085.282.0- ohR < rP ohR 3831. under the null hypothesis of a unit root.16 PROC REG on Silver Data FD elbairaV Because the printed p-value 0.178 11791.1 5497.0 2800.0 1210.0 36. the F distribution is justified in large samples. the uninformed user might conclude that there is strong evidence against a unit root in favor of stationarity.0 61240.0.6 87.05.1 sgaL dnerT naeM elgniS naeM oreZ epyT Output 3.16.17 contains several tests.0079 is less than 0.71.< 9700.2 eulaV F 23.0 30711. p.Chapter 3: The General ARIMA Model 115 Because this test involves only the lagged differences. This test is also available in PROC ARIMA starting with Version 6 and can be obtained as follows PROC ARIMA DATA=SILVER. Although the sample size here is not particularly large.72 erauqS naeM 08715. The appropriate 5% left tail critical (Fuller 1996.0 59363.51.2803 is not even close to 0. so the statistic is not far enough below 0 value of the limit distribution is to reject the unit root null hypothesis.2511 setamitsE retemaraP etamitsE retemaraP 51176.0 0085.15 Test of Augmenting Lags . Output 3. Nonstationarity cannot be rejected.267. 68.1 1642.0 2011.17 Unit Root Tests.4 7911.0 2326.0 LED elbairaV tnednepeD rof stluseR 1 tseT eulaV t 12.2 Output 3. RUN.0 F > rP 3082.

If it is seen that the coefficient of . If interest lies there is no advantage to using the F statistics. is shown in the printout and has a p-value (. − . 1=ρ t − 1( e + ) 2 − Y − 1− Y (ρm + ) µ − 1− Y ()ρ − 1()m − 1( − = 1− Y − Y e + ) 2 − tY − 1− tY ( 2 α − ) µ − 1− tY () 2 α − 1α − 1( − = t )430711.0 ( ρ t − t ) m − 1()ρ − 1( − .116 SAS for Forecasting Time Series Every observed data point exceeds 400. However. in order to get good power. in terms of lags and trends. which include restrictions only in inference about Simulations indicate that the polynomial deterministic on the intercept and trend as a part of trend should have as low a degree as is consistent with the data. based on simulated size and power results (Dickey 1984).1 = ρ : 0H . 0H 5497. so the model with a constant mean seems reasonable. the PROC REG output strongly indicated that one lagged difference was required.71 − = )251176.0− (05 . so it is not surprising under that an adjustment using that statistic is required to get a test statistic that behaves like Specifically you divide the lag 1 coefficient by . This is no surprise. the tau tests are preferable to these normalized bias tests. − 1(/ )430711. For the silver data. the regression model AR(1) model with coefficient form becomes )1 − ρ(n ˆ t so that the coefficient of is in terms of the roots.05 level against the unit root null hypothesis. as any statistical hypothesis test requires a realistic model for the data.2 )251176. These tests are seen to provide even less evidence against the unit root. 0. Thus the tests with no lagged differences can also be ignored and are not requested here. Similar adjustments can be made in higher-order processes. ρ 05 = n 1− t 1− t Y− Y t Y ) 2− tY .05. is an estimate of m. The output in an shows coefficient (or “normalized bias”) unit root tests that would be computed as For the AR(2) model with roots and m. so any test from a model that assumes a 0 mean can be ignored. Also. The associated tau test. ρ t t − 1− Y ( t . The 50 observations studied thus far do not display any noticeable trend. although tests based on the model with linear trend would be valid and would guard against any unrecognized linear trend. the adjustment for lagged differences is motivated by large sample theory and is not particularly large. then multiply by n. has a p-value exceeding 0.0121) less than 0. then. Furthermore.671152 in the silver example.05 and hence fails to provide significant evidence at the usual 0. )1 − ρ(n ˆ 87. The F type statistics are discussed in Dickey and Fuller (1981). . getting a test with validity and good statistical power requires appropriate decisions about the model. In summary.

the original series of 50 is plotted along with forecasts and confidence bands from an AR(2) that assumes stationarity in levels (solid lines). Notice that the ACF of the original series dies off very slowly. Stationary and Nonstationary Models To illustrate the effects of trends. It is seen that for a few months into the forecast the series stays within the solid line bands. IACF. The three plots along the bottom seem to indicate that differencing has reduced the series to stationarity. the observations burst through his bands. does seem to give a more realistic assessment of the uncertainty inherent in this series. in agreement with the tau statistic. The more recent data are appended to the original 50. Output 3. more data on this series have been collected. never to return. though its bands may seem unpleasantly wide. In Output 3. The ACF. a little further ahead. This could be due to a deterministic trend. . Output 3. or both.Chapter 3: The General ARIMA Model 117 The data analyzed here were used in the first edition of this book.18 Silver Series. The unit root forecast. and an AR(1) fit to the differenced data (dashed lines). The full set of data make it clear that the series is not stationary. He also has much tighter forecast bands.19 shows the logarithm of the closing price of Amazon. Since then. a unit root.com stock. and it appears that the analyst who chooses stationarity is the better forecaster. The data were downloaded from the stock reports available through the Web search engine Yahoo! The closing prices are fairly tightly clustered around a linear trend as displayed in the top part of the figure. and PACF of the series are displayed just below the series plot and those of the differenced series just below that. However.18.

118 SAS for Forecasting Time Series Output 3.19 Amazon Closing Prices .

Output 3. This is in line with what you've learned about unit roots on the autoregressive side. For the model the dual model obtained by switching the backshift so that if is (near) 1 you expect the IACF to behave like operator to the AR side is the ACF of a (near) unit root process—that is. Output 3. to die off slowly. te = t Y t Y )B ρ − 1( .Chapter 3: The General ARIMA Model 119 In contrast. the IACF will die off slowly.com stocks.20 Amazon Volume ρ . but notice the IACF of the differenced series. If a series has a unit root on the moving average side. 1− t eρ − te = . These too show a trend.20 shows the volume of the same Amazon.

0 1000.330.5- setamitsE retemaraP setamitsE retemaraP rorrE dradnatS 42110.074100.0 34378.0 81352000. The apparent mixed message-differencing indicated by the levels’ ACF and too much differencing indicated by the differences’ IACF is not really so inconsistent.0 26420. Output 3. and lagged differences indicated that no lagged differences were needed for the log transformed closing price series and two were needed for volume.0 93931.21 Closing Price and Volume— Unit Root Test t 10520.3 etamitsE retemaraP 01920.045322. Of course a linear trend in the data will make the ACF of the levels appear to die off very slowly.4 51340.0 88510.21.52 94300.0 SS I epyT 20561.1 40296.069931. They find that an essentially linear descent in the IACF is consistent with overdifferencing. the parameter estimates from PROC REG using the differenced series as a response.2- etamitsE retemaraP 12661. as appears to happen in the volume data. t. You just need to think a little outside the class of ARIMA models to models with time trends and ARIMA errors.0 09511.393. Notice that a linear trend is reduced to a constant by first differencing so such a trend will not affect the behavior of the IACF of the differenced series.< 1000. a lagged level.0 rorrE dradnatS 77340.0 52225000. and lagged differences DV1 and DV2 for volume are shown in Output 3.< eulaV t 95.0 |t| > rP 2000. Regression of differences on 1.0 SS I epyT |t| > rP 9900.0 52640. Chang and Dickey (1993) give a detailed proof of what happens to the IACF when such overdifferencing occurs.120 SAS for Forecasting Time Series This behavior is expected anytime is the difference of an originally stationary series.< 1000. LAGC and LAGV as the lag levels of closing price and volume. DATE as the time variable. as is also apparent in the volume data.5 06.2 54.71- Y FD 1 1 1 FD 1 1 1 1 1 CGAL etad tpecretnI 2VD 1VD VGAL etad tpecretnI elbairaV elbairaV .608.005951000.2- eulaV t 08. Using the indicated models.0 6200.0 1410. respectively.0 27460000.0 6410.0 99430.0 36434. This can follow an initial drop-off.264.

There is not evidence for stationarity in closing prices even at the 0. The plot below. these tests can be automated using the IDENTIFY statement in PROC ARIMA. the deviations cannot be distinguished from a unit root process whose variance grows without bound.5 to about 120 over two years’ time. a rather simple model. An investment strategy based on an assumption of reversion of log transformed closing prices to the linear trend line does not seem to be supported here.0068318 in the logarithm implies a multiplicative or 0.2 − − t Y∇ 1= 8138600.6 14. 1999.0 69.t 6= Y∇ 87. data point and follow a path approximately parallel to this trend line.Chapter 3: The General ARIMA Model 121 As before. Recall that this trend curve is simply an exponentiation of the linear trend on the log scale and hence approximates a median. have this positive drift term as their average. This 50% probability number. for example. deserves some comments. the forecast consists of the trend plus an adjustment based on the error correlation structure. First. it is seen that unit roots are rejected even at the 0. random walk with drift. A daily increase of 0. The model (computations not shown) is 1− te74540.0068318) of the model for the differenced series. roughly the predicted 36-fold increase. with this data going from about 3. The top panel of Output 3. (LAGC) for closing price and (LAGV) for The tau statistics (see Fuller 1996) are volume. seems to suffice. and at 0. so it implies a positive change on The differences. Using the large n critical values at significance level 0. not a mean. . For these examples. the assumption that the trend is simply a constant is clearly inappropriate here. − 3− + t e + 8138600.10. at 0. 3− 93. note the strong effect of the logarithmic transformation.05. whereas once logs are taken. which compounds to a -fold increase over the roughly 260 trading days in a year. in which each of these has been transformed back to the original scale by exponentiation. There is a fairly long string of values starting around January 1999 that are pretty far above the trend curve. This was a period of phenomenal growth for many such technology stocks. 68600. clearly only the linear trend tests are to be considered. Thus the volume series displays stationary fluctuations around a linear trend. The residuals from this trend line would not represent forecasting errors from either model. does not even use this curve.3 95. random walk with drift.10 level.01 level for volume.0 (062 e . That is not to refute the undeniable upward trend in the data—it comes out in the intercept or “drift” term (estimate 0. Although power is gained by using a lower-order polynomial when it is consistent with the data. would emanate from the February 1. may be a more easily understood number for an investment strategist than the mean in a highly skewed distribution such as this. 1999.0 = 31. so even though the series seems to hug the linear trend line pretty closely. Any attempt to model on the original scale would have to account for the obviously unequal variation in the data and would require a somewhat complex trend function.22 shows closing price forecasts and intervals for the unit root with drift model (forecast rising almost linearly from the last observation and outermost bands) and for a model with stationary residuals from a linear trend (forecast converging to trend line and interior bands) for the log scale data.01.68% daily increase. Even for the model that assumes stationary but strongly correlated errors. Also note that the chosen model.1 0 e e= )8138600. the median. so a forecast beginning on February 1. average with each passing unit of time.

122 SAS for Forecasting Time Series Output 3.22 Amazon Closing Price (two Models. two Scales) .

Hall (1992) studies several methods and finds that overfitting lagged differences then testing to leave some out is a good method. the usual (t and F) distributions are appropriate in large samples for inference on the lagged differences. carefully deciding on the number of lagged differences is important.Chapter 3: The General ARIMA Model 123 In fact the plot actually contains forecasts throughout the historic series from both models but they overlay the data so closely as to be hardly distinguishable from it. that is. and Miller (1986) in their appendix show that the addition of seasonal dummy variables to a model does not change the large sample (limit) behavior of the unit root tests discussed here. In fact. produces very wide forecast intervals on the original scale. the IACF of W dies off very slowly. unfortunately. 3. Note that p-values produced under the assumption of stationarity can be quite misleading when unit roots are in fact present as shown in the silver and stock closing price examples. The situation is different if the error series et is not white noise but is instead a nonstationary time series whose difference 1− te 1− te e+ − e+β= Y− Y= t t t β+α= β+α − e t t W W t t Y . Note that if Yt has a linear trend then the differenced series 1− t t involves only the constant. This is discussed next. while it makes the transformed series behave nicely statistically. Both of these show inappropriately small p-values when the p-values are computed from the t rather than from the Dickey-Fuller distributions. and lagged differences. You can detect overdifferencing this way.9 Differencing to Remove a Linear Trend Occasionally. such differencing may or may not be appropriate. Bell. This mixed signaling by the diagnostic functions simply tells you that the data do not fit an ARMA model on the original levels scale or on the differences scale. and then the IACF of the differenced series indicates that you have overdifferenced. You can obtain the correct analysis in this particular case by regressing Y on t using PROC REG or PROC GLM. while careful modeling of unit roots and deterministic trends can lead to quite reasonable and informative forecasts. Then which does not have a trend but. it might nevertheless be a reasonable assessment of uncertainty. given that 95% confidence is required and that this is a volatile series. the data have been overdifferenced. In summary. suppose t where et is white noise. Now the IACF of W looks like the ACF of a time series with a unit root nonstationarity. To get tests with the proper behavior. This was illustrated in the silver example and was done for all examples here. practitioners difference data to remove a linear trend. The linear trend plus white noise model presented above is interesting. Some practitioners are under the false impression that differencing is justified anytime data appear to have a trend. Note also that the combination of logs and differencing. For example. Dickey. While this may disappoint the analyst. Thus. lagged level. ignorance of unit roots and deterministic trends in time series can lead to clearly inappropriate mean reverting forecasts. You respond by differencing. is a noninvertible moving average. The ACF of the original data dies off slowly because of the trend.4. In the regression of differences on trend terms.

TITLE 'PUBLISHING AND PRINTING NONPRODUCTION WORKERS'. RUN. ESTIMATE Q=1.S. IDENTIFY VAR=NONPUB(1) NOPRINT. IDENTIFY VAR=NONPUB(1) NLAG=10. you do that fitting by specifying these statements: PROC ARIMA DATA=WORKERS.24 is obtained by specifying the following statements: PROC ARIMA DATA=WORKERS. FORECAST LEAD=10.124 SAS for Forecasting Time Series Output 3. . Bureau of Labor 1977) shown in Output 3. β . The data are the percentages of nonproduction workers in the industry over several years. In that case.23 Plotting the Original Series The ACF shown in Output 3. a model in the differences is appropriate and has an intercept estimating This scenario seems to hold in the publishing and printing data that produce the plot (U. RUN.23. TITLE2 '1944-1977'. Because the ACF looks like that of an MA(1) and because it is very common to fit an MA(1) term when a first difference is taken. is stationary.

0 870471. in fact. ESTIMATE.0 582091.1 noitalerroC 3736100. *| | . .0807420.0 44131.74601.0 00000.0 68690.0 565520.3033) estimate is statistically significant and is roughly the slope in the plot of the data.0 626491. . and FORECAST Statements: PROC ARIMA The output shows a good fit based on the Q statistics the parameter estimates. Note that the MU (0. Chapter 3: The General ARIMA Model 125 . The number 0.0 196430.0783280.0294410. Also. and their t statistics . .0 84860. . | | .0101820. |* | . |** | . .0 719191. |* | .******| |********************| . it is a negative number. . look at the two standard error marks on the ACF). *| | .0146010. the MA coefficient is not near 1. | | | | | | | | | | | 02600.19450.3033 is sometimes called drift.0 890791.61213.0 470810. With only 33 observations. . you have a lot of sampling variability (for example.0 718791.0 90030.0 477191.0 743591. . **| | .0 039362.26390.0 30303. |** | . .0 1 gnicnereffid yb detanimile )s(noitavresbO snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM gnicnereffiD fo )s(doireP BUPNON = elbairaV fo emaN erudecorP AMIRA ehT 7791-4491 SREKROW NOITCUDORPNON GNITNIRP DNA GNIHSILBUP Output 3.24 Modeling and Forecasting with the IDENTIFY.0 0 rorrE dtS | .0 ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 1 33 147315.0 978491.0 2249700. ***| | .23040.551991. you have little evidence of overdifferencing. Thus.

and FORECAST Statements: PROC ARIMA (continued) 126 SAS for Forecasting Time Series .0 131.003690. .0 790.061213.0 94651. . |** .079230.24 Modeling and Forecasting with the IDENTIFY. ***| . | | | | | | | | | | 85001.079900. ***| . . | . **| . . |** .0 6175. .0- 040. |*** .0 qSihC > rP 6 FD 97. *| . .0noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI Output 3. ESTIMATE.089830.0 44934.066622. . *| . |* .0- 213.0 030.072841. |* .0 68910. |** . . **| . .0 37551. .0 83720.074221.0 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | . | . |**** . . |* . |********* | | | | | | | | | | 59670. . .0 20160. . . . *****| .550.061180.0 82512. |* .******| .091250. .4 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | . .0 95340.

1 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.7 08.1 600.3 10.1 3303.0 020.0 1.0 9169.15 CBS 91472.0980.0270.1AM 600.0300.0751.0 qSihC > rP 32 71 11 5 FD 70.0 571.0 580.0700.0 |t| > rP xorppA 98.0 460.0100.0720.0 000.0 etamitsE 1. ESTIMATE.0 etamitsE ecnairaV 3303.0 3910.274.0801.0 230.0321.0911.0 4579.24 Modeling and Forecasting with the IDENTIFY.09099.1 UM 1.0 etamitsE rorrE dtS 224832.003303.0 rorrE dradnatS 62664.0 gnicnereffiD fo )s(doireP naeM detamitsE BUPNON elbairaV rof ledoM 750.1AM UM retemaraP noitamitsE serauqS tsaeL lanoitidnoC erudecorP AMIRA ehT 7791-4491 SREKROW NOITCUDORPNON GNITNIRP DNA GNIHSILBUP Output 3. and FORECAST Statements: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 127 .0390.tnanimreted gol edulcni ton od CBS dna CIA * 33 slaudiseR fo rebmuN 2762.84 CIA 482884.0 etamitsE tnatsnoC 1 0 gaL 0700.0 320.01 14.0630.0 450.2 eulaV t 84161.0 411.0 6779.0 49221.0 760.0 750.0330.1AM UM retemaraP setamitsE retemaraP fo snoitalerroC .

ESTIMATE.74 3373.44 4374.1 7233. SCAN.128 SAS for Forecasting Time Series Output 3.1 = )0 (ρ Z . and FORECAST Statements: PROC ARIMA (continued) srotcaF egarevA gnivoM 3. or “projecting” onto the space spanned by a theoretical regression” of .14 6997. You look at the table entries to find the row and column whose labels give the correct p and q.1 6668.34 5365. and Z . 2− t )2 − k (ρ )1 − k(ρ 1 )1(ρ Z } ) k − tZ kk )1( 2 1− t ρ Z φ− t Z 1 − 2 − tZ 2 kφ − 1− tZ1kφ − k − tZ . and columns MA 0.1 9215. This is sometimes referred to as “performing on .4. are 4016. For ESACF and SCAN should give 3 as the autoregressive order.24 5606.0 − ) 2 − tY − Z sbO 44 34 24 14 04 93 83 73 63 53 … . IACF.54 7677.1 1421. Suppose you have the where is the deviation from the mean at time t. The key to showing their results is that standard estimation techniques give consistent estimators of the autoregressive operator coefficients even in the presence of unit roots.14 9669.2 1380.64 4565.44 8668. AR 1. It is accomplished by solving the matrix system of equations kk ) k (ρ φ 1 )2(ρ = 2 kφ )2 − k (ρ )1(ρ 1kφ )1 − k (ρ t Z jk φ k − tZ .44 stimiL ecnedifnoC %59 ) α − β( + α − 1[/ ])βα − 1()β − α([ = )1(ρ . These consist of tables with rows labeled AR 0.94 3159. .05 6025.0 3884. in which case rather than p is found. .1 4028.14 4518. MA 1. three methods called ESACF. The ARMA(1.2 2659.14 2709.1) process )1 is minimized.14 3168.14 6258. Tsay and Tiao (1984.44 1071.14 3861.84 5063.74 5580. These methods can be understood through an ARMA(1.24 Modeling and Forecasting with the IDENTIFY.0 :1 rotcaF t t tsaceroF 2392.0 + 1 BUPNON elbairav rof stsaceroF d+p t rorrE dtS 7202. and MINIC are available for simultaneously identifying both the autoregressive and moving average orders. 1− t … Z based on t .14 6118.34 t t t e = ) 3− tY − 1− tY (7.54 3383.54 6025. etc. 2− t 1> j Z Z ({E 1− t t Y( . … .1) example.84 9147.10 Other Identification Techniques In addition to the ACF. 1985) develop the ESACF and SCAN methods and show they even work when the autoregressive operator has roots on the unit circle. k − tZ .54 0080. etc.64 9989.24 )1(**B 62664.05 7270.54 6686.1 7376. you want to find coefficients for which t Z The partial autocorrelations are motivated by the problem of finding the best linear predictor of − j (ρα = ) j (ρ ] 2 2 )j ( ρ autocorrelations for . That is. 1− eβ − e = 1− Z α − 1679. and PACF.

you note that k Chapter 3: The General ARIMA Model 129 which does not in general equal Therefore Z – 11Z –1 is not and thus does not equal The autocorrelations of would not drop to 0 beyond the moving average order. is which is a 1− t .) for … produces the sequence of partial autocorrelations. You are looking for a linear combination whose autocorrelation is 0 for j exceeding the moving average j or 1 − 121φ α 1 11 φ − α = 1 1 − 11φ 2 α α 22C 11 − φ 11 = φ 1 12C 1 .2 . Increasing k beyond 1 will not solve the problem. 2 − tZ 22 φ+ 1 − tZ12φ =) 2 − tZ11 − 1− tZ ( 22C φ + 1 − tZ12C = 1 − t. (See Section . The trick is to discover p and the s from the data.3. 22 C 12 C coefficients. 1− t Z t Z . 22 C11φ− = 22φ and In matrix form you have . 1= k kk φ = kπ Letting 3. it is clear that there is some linear combination of and namely whose autocorrelations theoretically identify the order of the moving average part of your model.1R 22C + 1 − tZ12 C That is. say and which give the same fit.3.α . Still. 2−t Z 1− t Z linear combination of and so regressing on and produces regression on and .1R 1− t Z t Z The lagged residual from the theoretical regression of on C order q (1 in our example). the coefficients satisfy 22 11 C φ− 12C 1 0 22φ = 12φ 1 . as regressing 1 − t.1 R 1− t Z t Z . In general neither the sequence nor any sequence contains the autoregressive coefficients unless the process is a pure autoregression. or projection.F T AM E Y L in the ARMA(1. 22 Thus it must be that 1− t Z t Z .2.] ) 2 1− Z α − Z φ α − β( + α − 1[/ ])βα − 1()β − α([ = )1(ρ = 1π = 11φ j k φ 2 p −t Z p C − − 2− Z2C − 1− Z1C − Z t k π t t C + 12C = 12φ t t 1= k At π .1− t eβ − te .1) example. 2− t t t Z . 2 − tZ11 φ− 1 − tZ = 1 − t. 11 φ 11 − 11 11 22 φ )1 − 121φ( φ = C φ 12C 0 = )1(ρ Relating this to the Cs and noting that 11 φ 22 α )1(ρ = φ 1 1 12φ )1(ρ 0 1 1 11φ )1( 1 ρ 1 j 2 φ )1( ρα = )2(ρ Noting that . 1− t Z11φ − Z Zα − Z t t .

1− t … Z t Z (1) Regress on with residual k C regression has at least q lagged residuals.1) with “X” for nonzero numbers: . once your coefficients and the filtered series will be a MA(q).2 R .3C . The next step is to regress on and In this regression. 1− t . j (and ) Second-round coefficients: Record in MA 0 column. . The lag 2 autocorrelation of which is 0.) q . Notice the use of the lagged value of 3 … −t Z φ− −Z = 1− t 11 Z t t Z coefficient of will again be but its estimate may differ somewhat from the one obtained and the second lag of the first round residual will be the p autoregressive . the theoretical . 2 R R . Finding that row and the first 0 entry in it puts you in row p column q of the ESACF. you lag all residuals that were previously included as regressors and add the lag of the most recent residual to your regression. 2 − tZ . 1− t Zα − Z t . Here is a theoretical ESACF table for an ARMA(1. Let the residual from this regression be denoted . 12 k . 1 X X 0 0 X 2 AM − t. the first p theoretical ) q . 1− t Z . 2 − tZ . The model is now identified. . 2 R previously.1 R . 3 R with residual t. 13 C C X X X *0 X 1 AM … . Its lag 1 autocorrelation (it is nonzero) will appear in the AR 1 row and MA 0 column of the ESACF table.2 R . 1− t t t X X X X X 0 AM Z Z t t Z (2) Regress on k1C . k2 C . will be written in the MA 1 column of the AR 1 row.3 (and Third-round coefficients: Record in MA 1 column the lag 2 autocorrelation of ) t. k − tZ .α Z t 2 4 RA 3 RA 2 RA 1 RA 0 RA t t t 2 − t. k3C . 2 − tZ .1R . 2 R + k.1R . k−t k−t … Z 2C − − 2− Z 22C − 1− Z12C − Z Z 3C − − 2− Z 23C − 1− Z13C − Z … k . Looking down the ESACF table of an AR be the first row in which a string of 0s appears and it should start at the MA q column. 1+ k. so its autocorrelations will be 0 beyond lag q.α = 12C .p ( . 1− tZ12 C − Z t . 21C . the lag 1 autocorrelation of (3) Regress on 1 etc. .1− t. For the ESACF of a general ARMA in the AR p row. Notice that at each step. The estimated C coefficients and resulting filtered theoretically row p should series differ at each step.2 X 0 0 0 X 3 AM C C 1 − t. k− tZ . you compute which is just and this in turn is a moving average of order 1. 2 − t. 2 − t. … .1 t. The entries in the AR k row of the ESACF table are computed as follows: t.130 SAS for Forecasting Time Series You now “filter” Z using only that is. 11 C Coefficients: with residual 1 R k − tZ .p ( 0 0 0 0 X 5 AM 0 0 0 0 X 4 AM 2 + k. 1− t Zα − Z t t.

Its eigenvalues are called squared . tY ( = )2( γ . It is computed using canonical correlations. so there appears a combination. 2 − tY( 22 1− CA ′ ′ ) 3− tY . The number This is true for . triangular array of 0s whose “point” 0* is at the correct In practice.0 ( = HA see that so that is. Using . . for a square matrix M. See Tsay and Tiao (1984) for further details. has an eigenvalue 0. 2 − tY ( ′ ) 1− tY .. Tsay and Tiao (1985) suggest a second table called SCAN. 2 − tY ( 2 α = )3( γ . if a column vector H exists such that you an eigenvector and the scalar b is the corresponding eigenvalue of matrix M. 1− tY .) 1− tY .)1( γα 22 C ) 1− tY . 2 A12−C A11−1C ′ 22 11 . recall that the autocovariances are 5− tY .)0( γ )0(γ )1( γ )1( γα )1(γ 2 α )0(γ )1(γ 11C )1( γ )1( γ )1( γα )0( γ )1( γ )1( γ 3 2 )0( )1( γ = 22C = 11C α 2 α )1(γ = A 1 α γ α α ) q . tY ( then H is called Recall that. For the ARMA(1.H0 = HA 1−C′A1−C .Chapter 3: The General ARIMA Model 131 The string of 0s slides to the right as the AR row number moves beyond p. t The entries in square brackets form the submatrix of covariances between the vectors and That submatrix A. A12−2C A − 11C ′ error variance matrix 2 A12−C A11−1C ′ Because matrix represents the variance of ′ ) 3− tY .) 3− tY . A recursive algorithm is used to quickly compute the needed coefficients without having to compute so many actual regressions.p ( is )1( γ )1( γα )1( γα )0(γ )1(γ )1(γ 2 α )1( γ )1( γα )1( γα )0( γ )1( γ )1( γ 2 α 2×2 .)1( γ . 2 − tY ( 2 R is analogous to a regression matrix and canonical correlations between ′ ) 1− tY .)1( γ ])1( γα[ )1( γ )1( γ ])1( γ [ )0( γ )1( γ 3 α = )4( γ 2 3 α α )1( γ α 4 )1( γ α 3 ])1( γ α[ 2 =Γ ])1( γα[ )1( γ )0( γ . Hb = HM . ) ′ α − . the variance matrix of and the variance of are matrix . tY ( statistic.′ ) 3− tY . PROC ARIMA will also use asymptotically valid standard errors based on Bartlett’s formula to deliver a table of approximate p-values for the ESACF entries and will suggest values of p and q as a tentative identification. so the covariance matrix of )1( γ α 3 )1(γ α 4 with prediction the … . tY ( The best linear predictor of based on is Y etc.1( = H .)1( γ . tY ( 11 C . so the ESACF table will only have numbers near 0 where the theoretical ESACF table has 0s.) 1− tY .′ )0 . the theoretical regressions are replaced by least squares regressions. A CA C 22 1− ′ 11 1− of 0 eigenvalues of A is the same as the number of 0 eigenvalues of general time series covariance matrices. 2 − tY ( ) 3− tY .1) model.

column 1 of the original matrix. Similarly. have at least one squared canonical correlation that is 0.1( = H 2 2 .3 . the A with square bracketed elements is denoted and the bottom left matrix of m . 1− tY . Again you have a method of finding a linear combination whose autocorrelation sequence is 0 beyond the moving average lag q. which implies these equivalent statements: 3− t Yα − 2− Y m×m t and let be the Γ . 3. 2 A notation. matrix whose upper-left element is in row Again there is a full-rank )1( γ 2 α .3 3. tY ( (4) The vectors 2 A12−C A11−1C and ′ 2×2 (3) The 2×2 (2) The 2×2 (1) The matrix A is not of full rank (its rank is 1).3 A corresponding eigenvectors. The linear combinations and its second lag have correlation 0 because each is an MA(1).j A . tY ( ) 3− tY . The smallest canonical correlation is and and finding the pair with obtained by taking linear combinations of correlation closest to 0. matrix has at least one eigenvalue 0. 2 − tY ( ) 1− tY . . 0 )1(γ α α− )1( γα 1 )1( γ 2 )1( γ α )1( γ α )1( γα 2×3 2 3 )1( γ α )1( γ α = 3 4 H A 3. construct an arbitrarily large covariance matrix of 1− t Yα − … t Y ) 3− tY .3 A is matrix H for which 3×3 2. 3 A showing that matrix has (at least) 2 eigenvalues that are 0 with the columns of H being the and 0 α− 0 = 1 0 0 H 3A 3. 2 − tY ( 1+ j ) 1− tY . 2 − tY . the smallest canonical correlation must be 0. matrix A has at least one eigenvalue 0. α The matrix A has first column that is times the second. In this has all 0 elements. using )1(γ )1( γ α = α 2 3 H A 2 . Since there exist linear combinations in the two sets that are uncorrelated.132 SAS for Forecasting Time Series The fourth of these statements is easily seen. t Y In general. namely 0 0 0 0 α− )1( γ α = 0 1 )1(γ α ) α − .

Chapter 3: The General ARIMA Model 133 with and have at least one 0 eigenvalue. all 1> j m. 3 1> m A so has (at least) one 0 eigenvalue. j 4=m 3=p A X X 0 0 0 0 0 0 3=m 2=p 6×6 X X 0 0 0 0 0 0 htm 2=m 1= p X X 0 0 0 0 0 0 p >m 1= m 0=p q>j p >m α− . α coefficients are you notice from the Yule-Walker equations that Γ In PROC ARIMA. in the variance covariance matrix for such a process. is available and PROC ARIMA displays a table of the resulting p-values. For general ARIMA htj models. If row. column entry is the smallest canonical correlation derived you make a table whose from you have this table for the current example: where the Xs represent nonzero numbers.p ( is zero for Therefore.0 . p . j A .p ( have at least one 0 eigenvalue for this example.2 . again making use of Bartlett's formula. any submatrix with whose upper-left element is at row j. p >m . entries of the variance-covariance matrix estimated autocovariances.q >j m×m − j ( γ p α − − )2 − j ( γ 2 α − )1 − j ( γ1α − ) j ( γ )p . It has a rectangular array of 0s whose upper-left corner is at the p and q corresponding to the correct model. ARMA(1. An asymptotically valid test.1α− . 1> j 2.i α− . This provides the key to the SCAN table. To see why the 0s appear for an ARMA above would be replaced by whose autoregressive m.1( X X X X X X X X … . … . Approximate standard errors are obtained by applying Bartlett's formula to the series filtered by the autoregressive coefficients. m. ) q .0 . as does for all In fact all with and .q >j ′ )0 .1) for the current example. column 1 of the original matrix will have at least one 0 eigenvalue with eigenvector if Hence 0 will appear in the theoretical table whenever and . The first column of the SCAN table consists of the autocorrelations and the first row consists of the partial autocorrelations. j q>j 1− m = p 4=j 3=j 2=j 1= j 3=q 2=q 1= q 0=q A 2. j A 1− j = q ) q . which in turn can be extracted from the H matrix (eigenvectors). Relabeling the rows and columns with and gives the SCAN (smallest canonical correlation) table.

e . For the ARMA(1. for a candidate model be times the error sum of series can be t e … j −t Y … k − tY k b ˆ − − 2 − Y 2ˆ − 1− Y1ˆ − b b b . 1− tˆ .1) with analyzed. as BIC. The fitting of models in computing MINIC follows a clever algorithm suggested by Hannan and Rissanen (1982) using ideas dating back to Durbin (1960). using the Yule-Walker equations. 1− tY t Y + p ( + ) qp σ(nl n = CBS ˆ 2 .p of order regress on Letting e that is close to the actual series. Next. a long autoregressive model is fit to the data. 4. = β 8. q − tˆ . 1000 observations on an ARMA(1. p − tY . perhaps normalized by n. The Schwartz Bayesian Information Criterion is where p and q are the autoregressive and moving average orders of the candidate model and is an estimate of the innovations variance. pick p and q to minimize the SBC criterion The length of the autoregressive model for the .)n (nl )q t 2 s + p ( + ) 2 s (nl n = CBS t t Y = t e ˆ . the Yule-Walker equations for a length k (k large) autoregression can be solved to of the coefficients of the terms and a residual series give estimates.25: and are generated and t e ˆ squares for this regression.1) example of this section it is seen that t truncated version of this infinite autoregression will approximate the process well. NLAG=1 MINIC P=(0:5) Q=(0:5). jˆ t . PROC I I I RUN. Sawa’s BIC. It is possible. say t selected by minimizing the AIC criterion. NLAG=1 ESACF P=(0:5) Q=(0:5).)n (nl )q n /1 qp ˆ 2 σ . The MINIC technique chooses p and q giving the smallest SBC. 1< β and as long as the coefficients on lagged Y will die off quite quickly. Here. The following code generates Output 3. q . and records the SBC information criterion for each fit in a table. To the extent that this is true. ARIMA VAR=Y VAR=Y VAR=Y DATA=A. NLAG=1 SCAN P=(0:5) Q=(0:5). e e . the symbol SBC is used so that Schwartz’s criterion will not be confused with the BIC criterion of Sawa (1978). Some sources refer to Schwartz’s criterion. = α To illustrate. 2 − tˆ .134 SAS for Forecasting Time Series The MINIC method simply attempts to fit models over a grid of p and q choices. of course. is for a full regression model with n observations and k parameters. First. that the fitting will fail due to singularities in which case the SBC is set to missing. used as a model selection tool in PROC REG. indicating that a ] ) k −n ( 2 e+] n − k− n + 3− Y2β + 2− Yβ + 1− Y[)β − α( = Y n )2 t + k ([2 + ) 2 s (nl n t t .

0 1000.05100.0 5 AM 67110.0 1000.035740.0 1 AM 6384.0 6110.07021.25 ESACF.0165711.086140.027320.02530.0 7120.0 1000.0 7043.0 2 AM 54130.0751820.069630.0 1000.0 3 AM 16420.0 6810.0 4 AM 6330.0 1 AM 1000.012140.085930. SCAN and MINIC Displays Chapter 3: The General ARIMA Model 135 .0 4704.035110.0 3 AM 3370.0 0 AM 5 4 3 2 1 0 RA RA RA RA RA RA sgaL noiretirC noitamrofnI muminiM Output 3.073840.0 2969.0 1000.065482.0 8959.3(CIB :eulaV elbaT muminiM )9(RA :ledom seires rorrE 79400.0205771.0 0465.0 4367.0 1000.040440.029710.0 3622.0 0630.0 1000.0 5447.0353950.0 9110.03040.066320.d+p(AMRA 1588.0 0 AM 5 4 3 2 1 0 RA RA RA RA RA RA sgaL seulaV ytilibaborP FCASE 1500.0 2310.0 5 AM 8830.05752.06233.0 4 AM 7710.0 4789.074030.= )0.056530.0 3006.0 1000.068340.0 4 AM 9873.045820.0 1000.0 1 AM 33830.0 3 AM 1380.0778300.0 1594.0 2 AM 7771.0 7910.0 2 AM 1000.04493.0 5401.0 2091.0 4812.020540.2 3 1 q 5 4 1 d+p FCASE )leveL ecnacifingiS %5( stseT noitceleS redrO evitatneT )q.0 5 AM 0882.072030.00200.0 0100.0 4650.07651.0 1000.0 9213.082420.0 6000.0 0 AM 5 4 3 2 1 0 RA RA RA RA RA RA sgaL noitcnuF noitalerrocotuA elpmaS dednetxE 73840.02491.0 1000.07532.0 1000.0 3975.03992.073530.0 0857.0 3106.011710.0 7140.08800.02420.0 9841.0 1000.04150.0 1000.05505.082030.0 4810.04754.0 3571.0.

.0 0824.0 .0 2000. 1 AM 1 AM 1000.0 1119.3.0 7676.0 8100. the results are saved.0 1417. and the estimated p and q are extracted for each method. .0 7430.35740.0 1200. )0 .0 2000.0 3000. − + t e+ 4 AM 4 AM 2000.0 5395.0 7646. size being the number of elements in the triangle or rectangle.0 3651. Asterisks indicate the correct model.0 1000.0 6676.0 1000.0 8000.0 2000.0 3153.0 1366. These are listed in descending order of size (below the tables). The whole experiment is repeated with series of length 50. The MINIC criterion uses estimated white noise series. SCAN and MINIC Display (continued) The tentative order selections in ESACF and SCAN simply look at all triangles (rectangles) for which every element is insignificant at the specified level (0. the ESACF.0 8786.d+p(AMRA setamitsE noitalerroC lacinonaC derauqS seulaV ytilibaborP ]1[erauqS-ihC NACS = α t Y 3 AM 3 AM 1000.1( 05 = n }9. and MINIC methods are used. to create the the top of the list.1) series each of length 500 are pairs obtained by choosing and from such generated for each of the 12 that This gives 600 series.0 2293. 50 ARMA(1.0 0100.0 3622. p ( 9= k − 2 AM 2 AM 2000.0 0227.0 2000.25 ESACF.0 0711.136 SAS for Forecasting Time Series Output 3.0 0410. . )leveL ecnacifingiS %5( stseT noitceleS redrO evitatneT )q.05 by default).β ≠ α sgaL sgaL 5 4 3 2 1 0 5 4 3 2 1 0 RA RA RA RA RA RA RA RA RA RA RA RA . .0 3394. For each.9.)1.1) order at a preliminary AR(9) model.0 . A final set of 600 runs for using gives the last three columns.0 β 4 − tY 5.0 2000.0 β α( 0 AM 0 AM 5000.0 3200.p ( 5 AM 5 AM 4000.0 1000.0 5491. occurs at the correct As a check on the relative merits of these methods.0 1000.0 7000.0 7904.0 2000. . { = )q .0 1473.0 1000.0 0100.0 7652.0 0766.0 5976.0 2000.0 2000.0 1000.3.0 − 1− te3.0 0760.0 3147.0 1000.0 9420.0 8000. In our example ESACF (previous page) and SCAN (above) list the correct (1.0 0807.0 8558.0 4006.0 1100.0 2000. then selects as the order.0 2000.0 1379.0 5543.0 7789. SCAN. The second smallest SBC.0 0 1 q 3 1 d+p NACS ) .0 1000. this also being one choice given by the SCAN option.0 0100.0 1337.0 9481.3( = ) q .0 3840.0 2000.

Thus the appearance of a significant bottom-rightcorner element in the SCAN table. for some cases. By analogy. it appears that SCAN does slightly better than ESACF.(006 NACS FCASE CIB NACS 995 0 0 0 1 2 0 0 1 0 2 5 0 0 0 31 1 11 9 1 2 1 23 52 21 0 3 8 8 164 *** 0 0 0 0 0 0 1 FCASE 595 0 1 2 0 1 0 0 4 3 4 0 0 0 2 51 6 3 2 0 0 0 64 6 6 6 5 81 32 144 *** 0 0 0 0 0 0 1 CIB 006 slatot 6 55 6 45 9 35 3 25 0 15 5 05 6 54 1 44 5 34 2 24 3 14 5 04 4 53 5 43 3 33 3 23 5 13 53 03 01 52 4 42 1 32 42 22 9 12 59 02 35 51 71 41 31 31 31 21 252 * 11 1 01 0 50 0 40 0 30 0 20 0 10 2 00 1 2 qp χ .1) with parameters in this range.05=n )1.03 006 0 0 0 0 0 5 0 0 0 0 * 0 *** 89 0 0 2 7 72 12 0 0 8 121 52 91 0 0 3 03 87 83 2 53 2 11 33 53 |>. happens rarely—not the 30 times you would expect from .4(AMRA -<| |>.1(AMRA -<| |>. The SCAN and ESACF columns do not always add to 600 because. no rectangle or triangle can be found with all elements insignificant. finding a random sample of 10 men whose shortest member exceeds 6 feet in height would be extremely rare. even if 5% of men exceed 6 feet in height. it is also very conservative.05=n )1.1(AMRA -<| NACS FCASE 995 0 0 0 6 31 6 0 0 22 42 25 *** 66 0 0 61 12 32 9 0 1 2 26 24 61 0 0 1 01 74 51 0 02 6 9 64 46 CIB 006 795 006 006 0 0 0 0 1 0 1 2 5 0 0 2 2 0 0 2 81 0 1 01 611 2 3 23 1 0 0 5 0 0 0 1 0 0 0 0 4 0 2 1 01 * 0 4 3 071 6 6 16 0 0 0 2 0 0 0 1 1 0 2 0 3 0 4 3 3 3 01 1 03 8 6 05 0 0 0 6 2 1 0 3 1 1 2 1 3 7 8 4 2 41 22 9 62 81 14 19 4 0 0 5 3 1 0 2 0 2 0 21 1 9 7 61 5 * 302 ** 561 ** 35 *** 82 541 101 211 41 0 1 6 14 2 3 7 4 61 4 7 5 8 12 71 82 621 641 84 96 52 04 52 = )50. For the ARMA(1.005=n )1. Because SCAN compares the smallest normalized squared canonical correlation to a distribution ( ) that is appropriate for a randomly selected one. with both being superior to MINIC. which would imply no rectangle of insignificant values.Chapter 3: The General ARIMA Model 137 It is reassuring that the methods almost never underestimate p or q when n is 500.

26 shows monthly interbank loans in billions of dollars. Output 3. As a real data example.138 SAS for Forecasting Time Series The conservatism of the test also implies that for moderately large p and q there is a fairly good chance that a rectangle (triangle) of “insignificant” terms will appear by chance having p or q too using we see that small.26 Loans . The data require differencing and the right-side graphs seem to indicate the need for logarithms to stabilize the variance. Output 3. = t Y )1. Indeed for 600 replicates of the model is rarely chosen by any technique with SCAN giving no correct choices. The data were downloaded from the Federal Reserve Web site.4 ( = )q .p ( .05 =n 1− te3. + t e+ 4 − tY 5. Also shown are the differences (upper-right corner) and the corresponding log scale graphs. There does not seem to be a universally preferable choice among the three.

Chapter 3: The General ARIMA Model 139 PROC ARIMA DATA=IBL.0 7300. IDENTIFY VAR=LOANS SCAN P=(0:5) Q=(0:5). .0 2000.0 8162.0 8857.0 9030.< 2200.0 1327.0 9989.27 SCAN Table for Interbank Loans setamitsE noitalerroC lacinonaC derauqS Output 3.0 1 AM 8500.< 0 AM 5 4 3 2 1 0 RA RA RA RA RA RA sgaL seulaV ytilibaborP ]1[erauqS-ihC NACS 8700. use this code to get the SCAN table.0 1000.< 1 AM 3161.0 1880.0 1000.d+p(AMRA erudecorP AMIRA ehT 6381.0 7647. RUN.0 0200.0 4720.0 5219.0 1000.0 9144.< 4 AM 9074.27 shows the SCAN results.0 5 AM 1000.0 4000.0 8689.0 2 AM 3000.0 6580.0 9100.0 7930.0 3500.0 3562.0 3574.0 8030.0 4 AM 2200.< 5 AM 8079.0 0 AM 5 4 3 2 1 0 RA RA RA RA RA RA sgaL Output 3.0 2491.0 5210.0 2031.< 2 AM 8767.0 4800.0 7040.0 7130.0 7000.)leveL ecnacifingiS %5( 3 0 2 4 q d+p ---NACS---stseT noitceleS redrO evitatneT )q.0 4000.< 3 AM 1091.0 1000.< 4200.0 1399.0 6310.0 3400.0 1000.0 6393.0 2651. They indicate several possible models.0 3 AM 7600.0 1000.0 7229.0 0490.< 6799.0 4746.0 6700.0 9851.0 7300.0 1000. called LOANS in the data set.0 1000. To identify the log transformed variable.0 3000.0 3000.0 5389.0 3300.0 2599.0 3310.0 6210.0 4310.

1).3). difference again by specifying VAR=Y(1. If the ACF drops to 0 after q lags. 3. 3. specify the model you picked (or several candidate models). IDENTIFY VAR=LOANS(1) NOPRINT. PROB is fairly large) and if the first few autocorrelations are small. the listed number represents and SCAN suggests ARIMA(3. difference the series using VAR=Y(1) in the IDENTIFY statement and repeat step 1. and PACF to identify a model. If the IACF or PACF drops to 0 after p lags. one or two MA lags are likely to be indicated. If necessary. this indicates an AR(p) model. If you have differenced the series once or twice. Using the ESTIMATE statement.1. If Q is small (in other words.)elpmaxe revlis( ytiranoitats rof tset relluF dna yekciD )elpmaxe gnitnirp dna gnihsilbup ro MBI( yaced wols yrev rotinom ot FCA )elpmaxe MBI ni sa( atad eht ni stfihs level wols rotinom ot tolp atad e) B 1θ − 1( = ) 1− tY − tY( 1+ p d+p . Check the Q statistic (CHI SQUARE) at the bottom of the printout. IACF. Check for nonstationarity using If any of these tests indicate nonstationarity. For example. Check the ACF. indicating both models fit well.5 Summary The steps for analyzing nonseasonal univariate series are outlined below. undifferenced data.1. 4. ESACF. 5. Therefore. RUN. . ESTIMATE Q=1 NOCONSTANT. The chi-square checks for both of these models are insignificant at all lags. Both models have some insignificant parameters and could be refined by omitting some lags if desired (output not shown). ESTIMATE P=3 ML. 1. 2. ESTIMATE P=1 Q=3 ML. you may want to assume that your (possibly differenced) series is just white noise. this indicates an MA(q) model. RUN. IDENTIFY VAR=Y(1). You can use the SCAN. and MINIC tables to determine initial starting models to try in an ESTIMATE statement. you fit the model t by specifying these statements: PROC ARIMA DATA=SASDS.0) or ARIMA(1.140 SAS for Forecasting Time Series The SCAN table was computed on log transformed.

This is generally more advisable than plotting the ACF of the residuals from this misspecified model. Otherwise. Examine plots of residuals and possibly use PROC UNIVARIATE to examine the distribution and PROC SPECTRA to test the white noise assumption further. 7. It is used only as a diagnostic tool. You omit the BACK= option on your final forecast. your model fits reasonably well according to this criterion.) . but not always (publishing and printing data). If you note a large discrepancy. the mean is often (IBM data). Check the Q statistic (CHI SQUARE) at the bottom of the ESTIMATE printout. Use the FORECAST statement with LEAD=k to produce forecasts from the fitted model. (See Chapter 7. 8. in fact. Overfitting on one side at a time to check the model is no problem. 0. the estimation algorithm converges). You can then compare the last b forecasts to data values at the end of the series.” for more information. If it is insignificant. you may want to adjust your forecasts. return to the original ACF. “Spectral Analysis. It is a good idea to specify BACK=b to start the forecast b steps before the end of the series. and PACF of your (possibly differenced) data to determine if you have missed something. If you have differenced.Chapter 3: The General ARIMA Model 141 6. Use the NOCONSTANT option to suppress the fitting of a constant. IACF. Correlations of parameter estimates are extremely high in this case (if. Fitting extra lags and excluding insignificant lags in an attempt to bypass identification causes unstable parameter estimates and possible convergence problems if you overfit on both sides (AR and MA) at once.

142 .

8j (20). Consider the model t where et is white noise.4 µ − −Y α = µ − Y 322 selpmaxE rehtruF 4.4.3. This model is applied to monthly data and expresses this December’s Y.4 1.1 Introduction to Seasonal Modeling The first priority in seasonal modeling is to specify correct differencing and appropriate transformations.2.4. The forecast for the next December’s Y is 100+. The potential behavior of autocorrelation functions (ACFs) for seasonal models is not easy to characterize. You should find a pattern that matches your data among these diagnostic plots.001 =µ . This topic is discussed first.2.4 461 selbairaV yrotanalpxE htiw sledoM 2. the model forecasts this December’s Y as 100+.1 Seasonal Time Series 4. but ACFs are given for a few seasonal models.µ 312 noitnevretnI :B3 esaC 381 snoitcnuF refsnarT lareneG :3 esaC 971 snoitcnuF refsnarT elpmiS :2 esaC 761 srorrE seireS emiT htiw noissergeR :1 esaC 761 noitnevretnI :B3 esaC 661 srotacidnI gnidaeL :A3 esaC 661 noitcnuF refsnarT lareneG :3 esaC 561 noitcnuF refsnarT elpmiS :2 esaC 561 noitnevretnI :A1 esaC 461 srorrE seireS emiT htiw noissergeR :1 esaC 541 noitacifitnedI ledoM 2.2.4 732 kcattA tsirorreT 332 )noitnevretnI( eracS kliM 132 detisiveR seireS noitcurtsnoC 322 selaS liateR aniloraC htroN 761 elpmaxE dna ygolodohteM 3.4 4.4 1.3.4 2.4 3.4 1.1.2.1.2.4.4 341 gniledoM lanosaeS ot noitcudortnI 1.4.4 The ARIMA Model: Introductory Applications 4.4 3. =α .64(20).3.1. . for example.2.4 4.4 3.4 retpahC .3. followed by model identification.4 e+) 341 seireS emiT lanosaeS 1.4 21 t ( µ t 4. as plus a proportion of last December’s deviation from If and last December’s Y=120.8.8(20)=116.4 2.4 6.4 2. and the forecast for j Decembers ahead is 100+.4 5.

For the autoregressive (AR) seasonal model above. This is called a span 12 difference. namely ). the further into the Suppose you allow to be 1 in the future you forecast. When you encounter a span 12 difference. Thus. e5.” where the average of all December values goes into the forecast for this December. The forecast does not tend to return to the historical series mean. µ ) 6 3− te5. often the differenced series is not white noise but is instead a moving average of the form 21− t For example. + 63− t Y − + 42 − t 42 − tY5. . by specifying the PROC ARIMA statement IDENTIFY VAR=Y(1). you can express Yt as et plus an infinite weighted sum of past Y values. if 21− t you see that 4 2− t If you continue in this fashion. . 36.12). with weights decreasing exponentially as you move further into the past. you want to take a span 12 difference in addition to the first difference. which dies off slowly at all lags. considering only seasonal lags (12. “Overview of Time Series. The difference 21− t is stationary (white noise. Often this behavior is masked in the original ACF. If these ACF values die off very slowly. Although the forecast involves many past Decembers. Your model is nonstationary and reduces to This model uses last December’s Y as the forecast for next December (and for any other future December). the forecast for any future December is a weighted sum of past December values. + 4 2− Y − − e= + 4 2− t 21− tY(5. the decreasing weights make it respond to recent changes. as evidenced by the lack of a term in the model. as the ACF seems to indicate. the closer your forecast is to the mean AR seasonal model. Now look at the ACF of the differenced series. µ Y ( 5. 24. You accomplish this by specifying IDENTIFY VAR=Y(1. + e5.144 SAS for Forecasting Time Series The model responds to change in the series because it uses only the most recent December to forecast the future. t t Y t e+ − 2 1− t 2 1− t 2 1− t 21− t Y Y + e= eβ Y Y= Y Y− Y t = = − − e 2 1−t t t t t Y Y t e . Differencing over seasonal spans is indicated when the ACF at the seasonal lags dies off very slowly. In that case you should difference. and so on). This approach contrasts with the indicator variables in the regression approach discussed in Chapter 1. α . in this case) and is specified using the PROC ARIMA statement IDENTIFY VAR=Y(12).

For example.1. you forecast this December’s Yt as the November value (Yt–1) plus last year’s November-to-December change (Yt–12– Yt–13). specifies a second difference 2− t whereas the specification IDENTIFY VAR=Y(2). the model becomes t Thus.2 Model Identification If Vt appears to be white noise. and check to see if the third estimated moving average (MA) coefficient is approximately the negative of the product of the other two ( ). issue the PROC ARIMA statement ESTIMATE Q=(1)(12). δ 2 θ1θ . creates the span 2 difference 2− t Calling the span 1 and span 12 differenced series Vt. To specify the multiplicative structure. 4. you create ) 31− t and consider models for Vt.12. you can specify Y + 1− Y2 − t t Y = ) 2− Y − e + ) 31− tY 21 t Y − 21− Y( − ) 1− Y − Y( = V δ − 21− e 2θ − 1− e1θ − e = e ) B 2 θ − 1( )B1θ − 1( = tV t t − 1− tY( 21− t ( Y t t − ) 1− Y − Y( + 1− Y = t t t Y− Y t t t t t t V Y . you find that the differenced series Vt satisfies t This is called a seasonal multiplicative moving average. IDENTIFY VAR=Y(1. More commonly. The meaning of a product of backshift factors like this is simply 31− te ESTIMATE Q=(1.1).2 1 θ θ− = δ where If you are not sure about the multiplicative structure.Chapter 4: The ARIMA Model: Introductory Applications 145 Note how the differencing specification works. with data through this November.13).

IDENTIFY VAR=CONSTRCT(1) NLAG=36.1 Plotting the Original Data e = tV) 21B 3 α − 1) 2 B 2 α − B 1α − 1 ( ( .12) differenced variable indicate that no AR or MA terms are needed. The plot is shown in Output 4.12) NLAG=36. TITLE2 'CONSTRUCTION WORKERS IN THOUSANDS'. Bureau of Census 1982).2. For example. indicating a span 12 difference. TITLE 'CONSTRUCTION REVIEW'.S. Output 4. so you can use the NOCONSTANT option.1. You can fit seasonal multiplicative factors on the AR side also.2)(12) NOCONSTANT. first differenced series. and first and seasonally differenced series: PROC GPLOT DATA=CONST. indicating a first differencing. the intercept is probably 0.146 SAS for Forecasting Time Series After differencing. You issue the following SAS statements to plot the data and compute the ACF for the original series. masonry and electrical construction workers in thousands (U. causes the model t to be fit to the data. RUN. The Q statistics on the CONSTRCT(1. The ACFs are shown in Output 4. specifying ESTIMATE P=(1. SYMBOL1 L=1 I=JOIN C=BLACK V=NONE. IDENTIFY VAR=CONSTRCT NLAG=36. The plot of the data displays nonstationary behavior (nonconstant mean). IDENTIFY VAR=CONSTRCT(1. PROC ARIMA DATA=CONST. The original ACF shows slow decay. PLOT CONSTRCT*DATE/HMINOR=0 VMINOR=0.S. The ACF of the first differenced series shows slow decay at the seasonal lags. Consider the monthly number of U. RUN.

|* . ***| | .895 000.0 34132. . | | | | | | | | | | | | | | | | 87030. .0 18271. ****| | . .0 791652.0 76772.0 32934.0 09520. | .002201.0noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI . . | . .0 92300. . . *********| | .0 788252. ******| | .0 66843.0 066942. *******| | **********| | **************| | *****************| |********************| .145 603.0 68410.709 639. .814 983. | .0 54870. . *| .0 40361. |***** **| . | .4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 147 .3122 547.0 78081. ****| | .0 05353.5652 ecnairavoC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 76 81356.6211 038. *| . |********** | | | | | | | | | | | | | | | 02730. | .229 344.1 noitalerroC 402089.217 051.0 84505.0 581362. *******| | .0 961221. . .1021 469. .0 446452.068220. ***| | . .0 470242.0 927291. 550003.007384.6471 295. . .0 11332.0 677852.0 48000. .015440. *******| | .0 31810. .498 100.0 26086.0 224072.6921 392. | . .0 0 rorrE dtS | . .0 324892.464 775.585 snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM TCRTSNOC = elbairaV fo emaN erudecorP AMIRA ehT SDNASUOHT NI SREKROW NOITCURTSNOC WEIVER NOITCURTSNOC AMIRA CORP :tnemetatS YFITNEDI eht htiw FCA eht gnitupmoC 2. *| | .| | | | | | | | | | | | | | | . .0 082292. **| .0 48240. . *********| | . .0 868082. | . .344 011.0 19012. .0 00000. *****| | .0 177522. .87 950.0 71320.0 76953.05 9414. . *| . .023410.0 57268.0 90864.

***| .< 1000.0870.991 45.0130. **| .0 186.571 30. |********* .0111. **| . .0590.0 32111. .0 371.692 13. .< 1000.0 364.91 636311. |* . | .0 89671.0 361.0162. .0 noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP )deunitnoc( AMIRA CORP :tnemetatS YFITNEDI eht htiw FCA eht gnitupmoC 2.024450. *| . .060364.0040.0 332. .034750.0181. *| .0934.< 1000.0 1000.0842.062311.< qSihC > rP 63 03 42 81 21 6 FD 88. **| .4 tuptuO 148 SAS for Forecasting Time Series . .0 453.911 erauqS -ihC 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | | | | | | . | | | | | | | | | | | | | | | 41130.0482.0943. .0 75460.0 952.1 66 23165. . . .2 1 gnicnereffid yb detanimile )s(noitavresbO snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM gnicnereffiD fo )s(doireP TCRTSNOC = elbairaV fo emaN 280.025230.0864.0863.****| .< 1000.0691. |* .0 19811. |** .0 414.0864.0 872.0 26480.0771. |* .0722.0 943.0391.0634.022942.0 112.0400.0063. |***** *****************| . .0 368.057268.0 83931.0 751.512 50.673 81.0 01600.0 505.< 1000.

|** . |****. . |****. . ********| .852 647.025341. | | | | | | | | | | | | | | | 67700. *| . .0 213151. .0 478571.0 72293.0 19860. |** .82980. | . | *************| . **| . |*****.74131. |** .401954. *| .0 72744.0 86992.0 24970. **| . |** . |*** .072293. .0 87932. . .4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 149 .283 ecnairavoC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA )deunitnoc( AMIRA CORP :tnemetatS YFITNEDI eht htiw FCA eht gnitupmoC 2. *| . | | | | | | | | | | | | | | | 34640.20380.401087703. **| . .0 47372. .63372.0 0 rorrE dtS | . . | .15692. |****** | .044260.072065.0 noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | | | | | | . | .0 948712.0 508661. *****| .040670.311953. |* . | . .65440. | .5811361. |********* **| .0 17660. .35995.0 04510.411 862. | .069612. | .0 478951. .9594767. .43355513. *****| . |* . .057070. | .401 103298. |****.0 00000.0 638141. .098480. .049750.0 59476. . . . |* . | .0 53860.13 176. |* . |*****.| | | | | | | | | | | | | | | . |********************| | | | | | | | | | | | | | | | | 62420.0noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI 823812. | ********| .053720. | . |** . *| . | .0 955861. |* .0 426141.070711. . .0 34960.062870. . | .05887940. . |* .070530.053351. **| .051 546.035680. | . | . | .071001.1 noitalerroC 615182.43 101.0 467041. ***********| .45980.71456162. |** . .0 98720.057602.0 472961. *| . |*** . |*** .33931.085422.37272. |*** .0 51380.0 015112. |* .0 692961.0 190321.0 176341. ******| .0 38020.

0 1000.67 36.0 375041.0- 521.0 841. **| | .0 qSihC > rP 63 03 42 81 21 6 FD 32.0 0 rorrE dtS | . .0- 711.171 60.4 tuptuO 150 SAS for Forecasting Time Series .0 70170.1 noitalerroC 327220.0 688141.7 715964. |** | .< 1000.0 923141.35611.0 773631.4927926.0980.0 421. .0 792.1 278467. | | . |** | .0 824631.0510. **| | .0 746341. |** | .0 46080.77810.0472.58940.731 07.0181.0131. .0 077831.0 372.39 44.0 54260.0003.9 62907.4598012. |* |********************| .0420.0 422.< 1000. |*** | . .1 240587.0 201931.0 384441. | | .0041797.0380. *| | .0293. . .< 4000.7198397. .0 436041.0576.0610. . | | .42 erauqS -ihC 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA )deunitnoc( AMIRA CORP :tnemetatS YFITNEDI eht htiw FCA eht gnitupmoC 2.0412.0 94640.0- 041. .0190. .0- 161. |* | .28131.0 271.0090.122541.0 622.1 534603.0180.0170. .21671505.0850. .0 112. | | .6604989.< 1000.0 202.5 289144.0 892141.421 66.0 99570.0540.1 gnicnereffid yb detanimile )s(noitavresbO snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM gnicnereffiD fo )s(doireP TCRTSNOC = elbairaV fo emaN 143.0 24501. .9469716.0 75510.0244.84120.7 939830.0 380631.00000. .54500. |* | .1 150385.< 1000.04910.29 ecnairavoC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 31 45 434426.121. | | | | | | | | | | | | | | | | 28570.0 931. | | .0 048141.0 372.0220.01804837.0 234631.

071131.0- 4318. . .0 550. . **| .91 79. . |* .016410. . .0 6917.0670.082710. .0 16801. |** .0 540.0 640.0 050.0 231. . ***| .019330.0350.82 36. .0noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | | | | | | .0- 720. .0 63760.0040. | | | | | | | | | | | | | | | 67401.0 qSihC > rP 63 03 42 81 21 6 FD 83.068900.0- 480.043290. .0- 120. |* . . .3 50. . .076380.0 110.057670. **| . **| .0 150.0 39701.080360. . . |* . .0 670.0 28230.0 180. .0 41550.0 98111. .0 58440. .5 07.019231. ***| . .082880. | | | | | | | | | | | | | | | 61670.62 95.0 730. . |** . **| . **| .0 64130. .****| . . . **| *| |** |*** | *| | |** | |** |* |*** | | |* . . . .0120.0910.0910.0 4246.0 711. .0660. .0 710. .0 noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI )deunitnoc( AMIRA CORP :tnemetatS YFITNEDI eht htiw FCA eht gnitupmoC 2.0 3699.0 9419.0 93211. .0 610.0 042. .0 3889. .530.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 151 . .0480.056251.0281. *| .0 170.0090.0 08110.077300. .0 78521.0 93022.0501. . |** .0 500.0- 830.0 401.0531. .0 94640. . .0 19690.016890.2 erauqS -ihC 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | | | | | | .0 942. .0260.

12) NOPRINT.964 8419.345 0008.23 4119.993 430577. ESTIMATE NOCONSTANT METHOD=ML.755 3147.3.0 640.965 9039. RUN.0390.9 rorrE dtS 0006. Its popularity started when Box and Jenkins (1976) used it to model sales of international airline tickets on a logarithmic scale.0 7799.0270.145 5509. and FORECAST Statements: PROC ARIMA is known as the airline model.216 7850.31 0577.4 shows plots of the original and log scale data from Box and Jenkins’s text.864 7168.0450.0050.0 300.0 330.235 0005. use the following statements: PROC ARIMA DATA=CONST.706 5490. To forecast the seasonal data.7769.0840.0 130. FORECAST LEAD=12 INTERVAL=MONTH ID=DATE OUT=OUTF.0 110.0 531.2 39.0160. Output 4. ESTIMATE.1 gnicnereffiD fo )s(doireP TCRTSNOC elbairaV rof ledoM 591.03 0006.0870.59 slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV erudecorP AMIRA ehT SDNASUOHT NI SREKROW NOITCURTSNOC WEIVER NOITCURTSNOC 152 SAS for Forecasting Time Series Output 4.0902.925 97 87 77 ]senil tuptuo erom[ 9387.61 22.993 2764.0 211.61 0428.9 3155.0 0889.0 980. IDENTIFY VAR=CONSTRCT(1.0 970.0 250.0 5899.0020.695 2580.0750.095 3232. t e ) B1θ − 1( )B1θ − 1( = tY ) B − 1( )B − 1( 21 21 The model The results are shown in Output 4.5 26.774 7752. .0 201.3 Forecasting Seasonal Data with the IDENTIFY.0 qSihC > rP 42 81 21 6 FD 94.906 3243.885 tsaceroF 07 96 86 sbO stimiL ecnedifnoC %59 TCRTSNOC elbairaV rof stsaceroF .0 910.0 801.0 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 45 2764.806 1614.05968.33 1024.585 0009.ledom siht ni mret naem oN 21.475 0000.

Chapter 4: The ARIMA Model: Introductory Applications 153 Output 4.4 Plotting the Original and Log Transformed Box and Jenkins Airline Data .

Once you take the first difference. For the airline model. TITLE2 'INTERNATIONAL AIRLINES PASSENGERS'. It is hard to detect seasonality in the ACF of the original series because all the values are so near 1. Identification depends on pattern recognition in the plot of the ACF values against the lags. The model is identified from the autocorrelations. IDENTIFY VAR=LAIR(1).154 SAS for Forecasting Time Series Now analyze the logarithms. The results are shown in Output 4. and partial autocorrelation function (PACF).0 > 2θ . which have the more stable seasonal pattern. you see little decay. TITLE 'SERIES G'. Looking at the seasonal lags (12. To create the variable ) 31− t and its ACF. The nonzero ACF values are called spikes to draw to mind and the plots PROC ARIMA produces in the IDENTIFY stage.5. using these SAS statements: PROC ARIMA DATA=AIRLINE. The slow decay is much more evident here than in the construction example. if the theoretical autocorrelations of the series 0 > 1θ t should have 1 gal ta e kips ) e v itag en( a e kips 21 g al e ht fo se bol e d is d e llac 31 dna 11 sgal ta se k ips ) e v iti sop d na( lauq e 21 gal ta e kips ) e v itag en( a .0 sn o italerro c gal re h to lla Y − 21− Y( − ) 1− Y − Y( = V e ) B 2 θ − 1( )B1θ − 1( = 21 t t t t t V . you obtain the ACF .12). inverse autocorrelation function (IACF). IDENTIFY VAR=LAIR. issue the following SAS statements: PROC ARIMA DATA=AIRLINE. IDENTIFY VAR=LAIR(1. indicating you should consider a span 12 difference. RUN.24).

0 656461.0 38143.0 377172.0 147051.0 869371. | .007010. . .0 566831.067920.078305.0 389141. | . . .0 08058.0 694752. ***| .0 035391. .0 682533.0 29898. . . | .0 593641.044351. |********** | | | | | | | | | | | | | | | 62660.0 49167.0 321202.0 09877.0 227041.0 819931.0 197792. . .099670.5 Identifying the Logarithms with the IDENTIFY Statement: PROC ARIMA Chapter 4: The ARIMA Model: Introductory Applications 155 . .0 07359.0 07900.0 31727. . .0 657543. .0 630441.5 snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM RIAL = elbairaV fo emaN erudecorP AMIRA ehT SREGNESSAP SENILRIA LANOITANRETNI G SEIRES Output 4.0 671245.0 30857.0 61041.| | | | | | | | | | | | | | | .0 62447. . 574453. *| .0 22910. .0 554651. |* . .0 00000.0 92300.0 044013. . | . . | . | .093210. | .0 02800.1 noitalerroC 276911. .0 830323.0 56337. .0 44657.081010. .0 254322.0 107641. |******* ***| . .0 06737.0 0 rorrE dtS | .0 ecnairavoC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 441 129934.0 847241.0 34808.*************| | **************| | ***************| | ***************| | ***************| | ***************| | ***************| | ***************| | ***************| | ****************| | ****************| | *****************| | ******************| | *******************| |********************| | | | | | | | | | | | | | | | | 63816.0 369482. | .0noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI .0 954741. ************| | .0 175481.0 05617. . .0 994571.0 40366.0 275142.0 913821.0 73220. .**| . .0 333380.

|******* | . | .87520.0 158.5 Identifying the Logarithms with the IDENTIFY Statement: PROC ARIMA (continued) 156 SAS for Forecasting Time Series .0 715.0 1 gnicnereffid yb detanimile )s(noitavresbO snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM gnicnereffiD fo )s(doireP RIAL = elbairaV fo emaN 025. | .040601. | *******************| . | .0 447. | . |*** . | . |** .0 44900.0 445.< 1000.0 75711. *| .01021. | ****| .0 79380.0 0232100.0 67320. | .0 34148.02252200.0 837.0 0 rorrE dtS | .0 9023200.0 32450.0 485701.0 105.961251. | .09996100.0 998. *| .0 58502. | .0 1000.0 857. | .0 73440.95511. |****** | . |********************| | | | | | | | | | | | | | | | | 00611.57991.7511 73.0 572110.0 850111. | . | .0 738980.01524200.0 727. |** .0 267.69011. | *****************| .02453100.0 811941. |* .0 798680. | . | .0 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1noitalerroC snoitalerrocotuA laitraP Output 4. | .0 717.0 894.0 915.**| . *| . ****| .1251 26.0 875790.0 00000.0 30830.0 217601. *| .0 28511. | ****| .**| . *| .0 280890.03136300. *| .0 272151.02303100.77051. | . |** . | .0 300990.05697300.0 977. |********** | .074240.5871 49.55931. | .90512.0 031890.0 437.0 26990.0 050880. | . | ****| .04375100.70223.0 605.27633.0 675. |***.0 366.< 1000.0 53430.836 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | .0 816.< qSihC > rP 42 81 21 6 FD 23. | .1 noitalerroC 8703100.0 01402.0 19360. |** .**| .0 72901. | | | | | | | | | | | | | | | 22240.0 8649000. | .034584.0 0784900.0 ecnairavoC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 1 341 381601. |**.0 753801.0 657.0 094.0 459.007359.0 426380.0 808.056092000. |* . | . |** .01152100.< 1000. |**.

0 26043. *| . | | | | | | | | | | | | | | | 40021.0 22331.092291.056661. ***| .055470.057991. |**** . . |**.5 Identifying the Logarithms with the IDENTIFY Statement: PROC ARIMA (continued) Chapter 4: The ARIMA Model: Introductory Applications 157 .067494.045051.0 91181. . ************| .0 62590. *******| .0 noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | | | | | | . |* .0 24091.0 40685.0 noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI Output 4. |*** ****| .**| . .0 26372. | . | | | | | | | | | | | | | | | 72830. . . . . |****** .026301.0 26020. |********** . ****| . |***** .089520. ****| .088135. | .088590.**| . .**| .| | | | | | | | | | | | | | | .0 98013.**| .0 96740. ***| . .0 92203.0 46382. |* . |*********** . |****** . . ******| .082012. .0 57950. |**** .0 40142.0 05671.003911. |* . *| . |**** .087700. *****| .

0611. |**** | .85550.0 240101.< 1000.06151.0 078790.0 975101.< 1000.031912000.0002.0 620.0602.0 991.0 ecnairavoC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 31 131 376540.83460. | .0 65440000.72 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA Output 4.0 7124000.0611.00000.013431000.0 126401.0 3951000. | .0 572101. *| .0 16750. ***| .019763000.0 110511. | .0 250. | . | .0021.0 625611.< qSihC > rP 42 81 21 6 FD 35. | .0 813401. | ****| .0733. | . |* . **| .961 59. |* .0 198301.591 98.0041.0 21.0 41202. | .1 gnicnereffid yb detanimile )s(noitavresbO snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM gnicnereffiD fo )s(doireP RIAL = elbairaV fo emaN erudecorP AMIRA ehT SREGNESSAP SENILRIA LANOITANRETNI G SEIRES 737.0 1000. |******* |********************| | | | | | | | | | | | | | | | | 75941.0972. *| .0 5608000.0- 733.0 600790.0512. |******** | . |** .1 noitalerroC 00213000.08030. | .73671.0 0 rorrE dtS | .0 6-E7685.0 192000.0 480. *| .0223.00680200.0 210.0 56550.< 1000.042613000.0151.0 63120.0- 701.0 21143. | . | .0 743101.0 63670. | .0 01611000.0- 411.0 148. | .0 111.0- 570.0 6117000.0 700101.0 16683.0901. ***| .5 Identifying the Logarithms with the IDENTIFY Statement: PROC ARIMA (continued) 158 SAS for Forecasting Time Series .0 073780.0 67000.123 57.0 975101.0 2021000.50501.062460000.19511000.447611.

. . . |**.0931. | | | | | | | | | | | | | | | 44150. .0 23623. . .010661.0 30521. .0 783.0251. .096833.0 29990.0 70340. |**. |*** . . |*** .**| . *| . *| .091060.0 08480.t e = tV ) B 2 θ − 1( )B1θ − 1( 21 t e ) B 2 θ − 1( )B1θ − 1( = 21 810.0 930.0100. |**.**| .018210. *| .081901.021143. *| .0610.0 322.< 1000. ********| .0130.0 460. | .0 55650.0noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | | | | | | .< 7000.0120.086430.0 051.0 85522. *| .0 22020. .095640. |* . | .0- 1000.0 97950.**| . .094920. |******* | | | | | | | | | | | | | | | 57120.26 74.0 90330. . | .15 72.**| .32 erauqS -ihC 42 81 21 6 gaL oT 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL Chapter 4: The ARIMA Model: Introductory Applications 159 .0 650. .0850.0 58973.0 110. *| .0501. . . .0 070.0- 711. .0 671. |******* . .072121.0 49590.098801.0 31410. *| .< 1000. |**.0 650.5 Identifying the Logarithms with the IDENTIFY Statement: PROC ARIMA (continued) or the IACF of t V The pattern that follows represents the ACF of 72.0 202.0143.0 qSihC > rP 42 81 21 6 FD --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | | | | | | .048670.0 noitalerroC 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI Output 4.47 44. | .0670.0 80501. |* . |**** . *****| . .**| . .066291.0 190. . *******| .0 64421.

PROC SPECTRA P WHITETEST DATA=FORE OUT=RESID.0-9-8-7-6-5. you find reasonable agreement. RUN. If the model is changed to t the spike and side lobes are visible at the seasonal lag (for example. SYMBOL4 V=U C=BLACK I=NONE. DATA FORE. IF RESIDUAL NE . Note that if the multiplicative factor is on the AR side. PLOT P_01*FREQ/HMINOR=0. the IACF and PACF behave differently and the IACF is easier to interpret.9-8-7-6-5-4-3-2-1-+ t e ) B α − 1( = tV ) B 2 θ − 1( )B1θ − 1( e ) B 2θ − 1( )B1θ − 1( = 21 21 * * * * * * * 21 2 1− t Vα − V t * * * * * * * * * | 1 . PROC GPLOT DATA=FORE(FIRSTOBS=120). RUN. RUN. SYMBOL1 V=A L=1 I=JOIN C=BLACK. and If the so on). α .12) NOPRINT. RUN. SYMBOL3 V=L C=BLACK I=NONE. 12) and its multiples (24. RUN.4-3-2-1-0. 36. the following model is indicated: . IDENTIFY VAR=LAIR(1. SET FORE. In that case. SYMBOL2 V=F L=2 I=JOIN C=BLACK.6-5-4-3-2-1. ESTIMATE Q=(1)(12) NOCONSTANT. PROC GPLOT DATA=RESID. VAR RESIDUAL. The spike and side lobes at the seasonal lag are characteristic of seasonal multiplicative models. If the signs of the parameters are changed. FORECAST LEAD=12 OUT=FORE ID=DATE INTERVAL=MONTH.. PLOT (LAIR FORECAST L95 U95)*DATE / OVERLAY HMINOR=0.160 SAS for Forecasting Time Series When you compare this pattern to the ACF of the LAIR(1. SYMBOL1 F=TRIPLEX V=* I=JOIN C=BLACK. the spikes and side lobes have different signs but remain at the same lags.) 1 = α( gaL >--. but the magnitudes of the spikes at the multiples decrease exponentially at rate decay is extremely slow. The SAS code for the airline data is PROC ARIMA DATA=AIRLINE.12) variable. an additional seasonal difference is needed If the pattern appears in the IACF. this pattern appears in the IACF instead of in the ACF.

0210.4 eulaV t 20870.0770.01.0 etamitsE ecnairaV 21 1 gaL 1000.ledom siht ni mret naem oN 21.0 etamitsE rorrE dtS 14100.< 1000.0 2547.0630.0 411.084CBS 331.0010.5 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.684CIA 455730.0 890.2AM 1.0 rorrE dradnatS 63275.0690.0540.1 190.2AM 190.0 520.0 550.22 89.1AM retemaraP setamitsE retemaraP fo snoitalerroC .)21(**B 63275. Chapter 4: The ARIMA Model: Introductory Applications 161 .0001.7.0 etamitsE 1.0 69180.6 Fitting the Airline Model: PROC ARIMA The results are shown in Output 4.0 72773.7 51.< |t| > rP xorppA 43.1AM retemaraP noitamitsE serauqS tsaeL lanoitidnoC erudecorP AMIRA ehT SREGNESSAP SENILRIA LANOITANRETNI G SEIRES Output 4.0000.0 120.0 .1 )1(**B 72773.0 0046.0 3272.0 qSihC > rP 22 61 01 4 FD 65.0820.0 180.0 110.0 412.0130.2AM 1.0 .6 and Output 4.tnanimreted gol edulcni ton od CBS dna CIA * 131 slaudiseR fo rebmuN 383.1 1.0460.0 320.0 911.0 2724.1 gnicnereffiD fo )s(doireP RIAL elbairaV rof ledoM 310.7 06.1 :2 rotcaF :1 rotcaF srotcaF egarevA gnivoM .0631.1AM 1.0 320.11 98.0 940.

0 6730.6 1802.6 651 551 451 ]senil tuptuo erom[ 9072.5 1250.6 1463.6 1360.3 appaK ))*(P(MUS/))*(P(XAM*M :appaK s'rehsiF 204181.0(mrofinu a fo FDC eht dna margodoirep eht fo smus laitrap dezidradnats eht fo ecnereffid etulosba mumixaM :citsitatS vonrimS-vorogomloK s'tteltraB 930556.6 9669.6 9899.6 2680.0 2010.6186.6 7470.6 6350.0 56 = ))*(P(muS ))*(P(xaM M LAUDISER elbairaV rof esioN etihW rof tseT erudecorP ARTCEPS ehT SREGNESSAP SENILRIA LANOITANRETNI G SEIRES 7633.6 0050.0 eulaV-P etamixorppA citsitatS tseT .5 5009.0 rorrE dtS 8271.0 910980.6 1381.6 6522.0 9280.6 Fitting the Airline Model: PROC ARIMA (continued) 162 SAS for Forecasting Time Series .elbairav modnar )1.5 9530.6 4041.6 5901.0 2440.6 tsaceroF 741 641 541 sbO stimiL ecnedifnoC %59 RIAL elbairaV rof stsaceroF erudecorP AMIRA ehT SREGNESSAP SENILRIA LANOITANRETNI G SEIRES Output 4.0 6970.0 8761.

Chapter 4: The ARIMA Model: Introductory Applications 163 Output 4.7 Plotting the Forecasts and the Periodogram: PROC ARIMA and PROC SPECTRA .

they are deterministic. “Simple Models: Autoregression. If the error series is purely autoregressive of order p. presented in order of increasing complexity.tnemetats TUPTUO eht ni =59L . Three cases are delineated below.” for more information on PROC SPECTRA. “Spectral Analysis. Refer to Chapter 7. Xkt satisfies the usual regression model assumptions t t where et is white noise. This is a typical regression except that you allow for autocorrelation in the error term Z. + 2 X 2 β + l X1β + 0β = Y t t t where Zt is an ARIMA time series. Obviously. . Seasonal indicator variables and time t are deterministic. . you can forecast with appropriate prediction intervals by This chapter combines regression with time series errors to provide a richer class of forecasting models. and special cases are highlighted. 4. The following methods are appropriate when the Durbin-Watson statistic from PROC REG or PROC GLM shows significant autocorrelation. The Durbin-Watson statistic is used in Chapter 2 to detect departures from the assumptions on et. The nature of the explanatory variables and of the model relating them to the target series determines the optimal forecasting method. meaning that their future values are determined without error. . . . Examples are included. Explanatory variables like interest rates and unemployment are not deterministic because their future values are unknown. The Y series does not depend on lagged values of the Xs. 4. No periodicities are indicated in the periodogram plot or in the white noise tests produced by PROC SPECTRA. Explanatory variables are addressed in Chapter 2.( seulav gnissim dna sX erutuf gniylppus e+ tk X k β +. Recall that if the regression analysis from PROC REG or PROC GLM shows no autocorrelation and if known future values (as opposed to forecasts) are available for all Xs. forecasting in such situations requires knowledge (or at least forecasts) of future values of such variables.=59U sdrowyek eht ro tnemetats LEDOM eht ni noitpo ILC eht htiw sX eht no Y gnisserger sY erutuf rof ). Chapter 2 assumes that the relationship between the target series Yt and the explanatory series X1t. MODEL Y=X1 X2 X3 / NLAG=P. the SAS code PROC AUTOREG DATA=EXAMP. X2t. ..2 Models with Explanatory Variables Sometimes you can improve forecasts by relating the series of interest to other explanatory variables..2. + t1 X 1 β + 0β = t Y . .1 Case 1: Regression with Time Series Errors The model is Z + tk X kβ + .164 SAS for Forecasting Time Series PROC SPECTRA is also used to search for hidden periodicities in the airline residuals.” There. RUN.

this t test is not valid. if the speed limit reverts to 65 mph on day 70.3 Case 2: Simple Transfer Function In this case. you can produce forecasts and associated intervals easily. Because PROC ARIMA can do this and can also accommodate mixed models and differencing. You can avoid these problems with the indicator variable approach. you set X back to 0 starting on day 70. The algorithm allows you to compute forecast error variances for these future Xs. you can accomplish this entire procedure within PROC ARIMA. designate Xt as 0 before day 50 and as 1 on and following day 50. Suppose that on day 50 the speed limit is reduced from 65 mph to 55 mph. Deleting the point results in a missing value (. Thus. such as strikes. the Y forecast intervals are too narrow. and war. For example. Once you have identified and fit models for X and Z. 4. First.0 = 1β : 0 H 1 β . and PACF of residuals from a regression of Y on X. If these future Xs are user-supplied forecasts. The model t explains Y in terms of two means (plus the error term). and its statistical significance can be judged based on the t test for If the model is fit by ordinary regression but the Zs are autocorrelated. power outages. IACF. suppose Y is the daily death rate from automobile accidents in the United States. In case 1. Before day 50 the mean is 0 and on and following day 50 the mean is Thus. you can use an indicator variable that is 1 only for that data point in order to eliminate its influence on the ARMA parameter estimates. forecasts of Y and forecast intervals are produced whenever future values of the Xs are supplied. Because X is an ARIMA process. You accomplish this by studying the ACF.) in the series. In that case. Using PROC ARIMA to fit the model allows a valid test.1β + 0 β Z+ X β t t Z + X1β + 0 β = Y β = )0 ( ) 1β ( + 0β 1 + 0β = t t Y . you must identify a model and fit it to the Z series. The 1s and 0s can occur in any meaningful place in X. it is used instead of PROC AUTOREG in the analyses below. the modeling above is called intervention analysis. .Chapter 4: The ARIMA Model: Introductory Applications 165 properly fits a model to k=3 explanatory variables. PROC ARIMA also provides an outlier detection routine. Suppose you have another 100 days of data after this intervention. you can estimate a model for X in PROC ARIMA and use it to forecast future Xs. For example. The reason for this term is that X usually changes from 0 to 1 during periods of expected change in the level of Y. however. supplying future values of the deterministic X produces forecasts with valid forecast intervals.2 Case 1A: Intervention If one of the X variables is an indicator variable (each value 1 or 0). which are automatically incorporated later into the Y forecast intervals. the model is t where Xt and Zt are independent ARIMA processes. Valid intervals are produced when you supply future values of deterministic Xs or when PROC ARIMA forecasts the Xs in a transfer function setting as in cases 2 and 3. If a data point is considered an outlier. the procedure cannot incorporate the uncertainty of these future Xs into the intervals around the forecasts of Y.2. closing the gap with a DELETE statement makes the lags across the gap incorrect. In fact.2. is the effect of a lower speed limit. 4.

Instead of inspecting autocorrelations. X is called a leading indicator for Y because its movements allow you to predict movements in Y two periods ahead. you inspect cross-correlations. use the STATESPACE procedure. but you are looking for the same patterns as in univariate ARIMA modeling.4 Case 3: General Transfer Function In case 3. Because it is impossible to fit an infinite number of unrestricted to a finite data set. you restrict the to have certain functional forms depending on only a few parameters. The are called transfer function weights or impulse-response weights. You can use PROC STATESPACE to model a series with arbitrary forms of feedback and crosscorrelated inputs.0 = 1β = 0β t .5 Case 3A: Leading Indicators Suppose in the model above you find that 0 Then Y responds two periods later to movements in X. you allow the target series Yt to depend on current and past values of the explanatory variable X. Because you need forecasts of explanatory variables to forecast the target series. The model is t where X and Z are independent ARIMA time series. The appropriate form for a given data set is determined by an identification process for the that is very similar to the usual identification process with the ACFs. Strictly AR models.2. sβ sβ β Z + − X β 0=∞Σ + α = Y j t j ≠ 2β j sβ sβ . .s 4. including feedback.2. You can use several explanatory Xs. 4.166 SAS for Forecasting Time Series You can use several explanatory variables. it is crucial that X does not depend on past values of Y. The lead of two periods is also called a shift or a pure delay in the response of Y to X. correlation among explanatory variables causes incorrect forecast intervals because the procedure assumes independence when it computes forecast error variances. which takes advantage of these correlations to produce forecast intervals. Such models are highly desirable for forecasting. Feedback puts you in a circular situation where you need forecasts of X to forecast Y and forecasts of Y to forecast X. but for proper forecasting they should be independent of one another. A general approach to AR modeling by nonlinear regression is also given by Fuller (1986). If the explanatory variables contain arbitrary correlations. can be fit by multiple regression as proved by Fuller (1996). but they should be independent of one another for proper forecasting and identification of the Even if you can identify the model properly. Such a dependency is called feedback.

3 Methodology and Example 4. and mortgage rates (M). Each series has a fairly slowly decaying ACF. you identify the pattern of the differently than in case 3. but in case 3B cross-correlations are virtually useless. sβ 4. Each first differenced series has an ACF consistent with the assumption of stationarity. Plots of the four series are given in Output 4. you are using it just as an explanatory variable.1 Case 1: Regression with Time Series Errors In this example. as was suggested in case 1A.Chapter 4: The ARIMA Model: Introductory Applications 167 4. However. you get 1− t When you subtract. a manufacturer of building supplies monitors sales (S) for one of his product lines in terms of disposable income (D).8. upward trend.2. The fact that you differenced all the series (including sales) implies an assumption about the error term. Currently. Your model in the original levels of the variable is t When you lag by 1. In case 3 cross-correlations are the key to identifying the pattern. The data are obtained quarterly. The first task is to determine the differencing desired.S. The D series has differences that display a slight.3. and you decide to use a differenced series. you get t η∇ + M∇3 β + H∇ 2β + D∇1β + 0 = S∇ η + 1− M 3 β + 1− H 2 β + 1− D1β + 0 β = 1− S t η + M 3β + H 2β + D1β + 0β = S t t t t t t t t β t t t . This trend is not of concern unless you plan to model D. U. housing starts (H).6 Case 3B: Intervention You can use an indicator variable as input in case 3B.

8 Plotting Building.and ManufacturingRelated Quarterly Data .168 SAS for Forecasting Time Series Output 4.

Chapter 4: The ARIMA Model: Introductory Applications 169 Output 4.8 Plotting Building.and ManufacturingRelated Quarterly Data (continued) .

To run a regression of SALES(1) on MORT(1). you choose a time series model for the error structure must modify your IDENTIFY and ESTIMATE statements. If you do not want to make this assumption. in the development above. you need to model the explanatory series to perform prewhitening. η∇ 0 t β t η t ψ + 0β . Because you assume a contemporaneous relationship between sales and the explanatory variables. The INPUT= option denotes which variables in the CROSSCOR= list are to be used in the regression. is present. differencing implies that had a unit root nonstationarity. The IDENTIFY statement is used to call in all explanatory variables of interest and to declare the degree of differencing for each. Assuming differencing is appropriate. . a trend model in the original levels and to allow only AR error structures. The PLOT option creates and plots the ACF. DPIC(1). you assume a simple intercept that canceled out of the differenced model. The order of differencing in the CROSSCOR= list is the order used. you can model the series in the original levels.170 SAS for Forecasting Time Series Thus. The results are shown in Output 4. The NOPRINT option eliminates the printing of the cross-correlation function. If. add the following statement to your PROC ARIMA code: ESTIMATE INPUT=(MORT DPIC STARTS) PLOT METHOD=ML. and STARTS(1). This is the only way you can get clear information from the cross-correlations. RUN. RUN. PROC AUTOREG or Fuller's PROC NLIN method (1986) would have been an appropriate tool for the fitting. IDENTIFY VAR=SALES(1) CROSSCOR=(MORT(1) DPIC(1) STARTS(1)) NOPRINT. unlike assumptions about the explanatory series. Also. You specify the following SAS statements: PROC ARIMA DATA=HOUSING. and PACF of the residuals. is crucial. This assumption. The CROSSCOR= option accomplishes this goal. Specifying differencing in the INPUT= option is not allowed. the differenced series has intercept If you had decided to fit the in fact. TITLE 'MODEL IN FIRST DIFFERENCES'. IACF. so the differenced error series is stationary. ψ . If you want to check for lagged dependencies. your next task is to output the residuals from regression and to To accomplish this in PROC ARIMA. you do not check the cross-correlation function for dependence of sales on lagged values of the explanatory variables.9.

181 rorrE dradnatS 90039.0 854181.0 610.0 930. |** . | .688881.61 72. | .4 21200.0 823181.0 330.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 171 .0619.1 noitalerroC 815. | .0 3971. | .0 2943.0210.0 |t| > rP xorppA slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC 73. | . |* . |** .08791666.0000.0 55780.053.0981.2865521.0820.0330.89693.45721.< 5218.4 60521. ***| .0 975881.3732374.0 eulaV t 25893.1 UM SELAS 3MUN 2MUN 1MUN UM STRATS CIPD TROM SELAS retemaraP elbairaV setamitsE retemaraP fo snoitalerroC 04 2634. ***| .0530.1 930.506 5089.29430.01MUN TROM 610.0 820.0340. |******** |********************| | | | | | | | | | | | 51990.1 170.79891466.0 0 rorrE dtS | .23820.0 38110.32 89.0821.8 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.0 147881. | .0 170.0 651.0221. | . |* .0000.0 834181.0 5425.0990.69552 345.071 0 0 0 0 tfihS STRATS CIPD TROM SELAS elbairaV 0 0 0 0 gaL 1000.0 3MUN STRATS 930.0943.0793.0990.149.071 etamitsE 3MUN 2MUN 1MUN UM retemaraP noitamitsE doohilekiL mumixaM erudecorP AMIRA ehT AMIRA CORP :noissergeR a nuR ot tnemetatS ETAMITSE eht fo noitpO =TUPNI eht gnisU 9.7007 225.02MUN CIPD 943.0 qSihC > rP 42 81 21 6 FD 73.01 09.00000. | .0 880.686002 6830.0 341.0466933.1 820.100470.15175830. | .0110.0 782781.0 831.0 350.211 44736.07571265. *| .0 620.0961.0 411851.0 65890.0 98422.90330. |** .0 619.96697786002 ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1- slaudiseR fo tolP noitalerrocotuA erudecorP AMIRA ehT 390.0 527481.0 586381.216 6086.40831.0 3295.30772 334.0410.0 471.01894.0000. | .744 5.21 42.0 9771.

0 04205.047202. |**** . |* . .0 53000. ***| . .4 1 STRATS rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 3 rebmuN tupnI 21200.11 CIPD rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 2 rebmuN tupnI 470. . . **| .000420.0 84651. |**** . . . .096022. *| .0 12141.099650.0noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | .038270.089693. . . ****| . *| . ***| . . **********| . *| .0 73211.0 33530. | | | | | | | | | | 46631. .030132.002720.4 tuptuO 172 SAS for Forecasting Time Series .1511 TROM rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 1 rebmuN tupnI 1 6830. . | . |******** | | | | | | | | | | 57402.0 17461. | . *| . |*** . . .0 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI )deunitnoc( AMIRA CORP :noissergeR a nuR ot tnemetatS ETAMITSE eht fo noitpO =TUPNI eht gnisU 9.049381. |*** .0 03430. ***| . .0 93651. . .071 gnicnereffiD fo )s(doireP tpecretnI detamitsE SELAS elbairaV rof ledoM erudecorP AMIRA ehT | | | | | | | | | | . |*****.490039. |**** .

Based on the ACF of the differenced series. Residuals from the model may not resemble the true errors in the series because the estimate of is inconsistent. In terms of significance. the IACF dies off very slowly.39698) at lag 1 and a near-zero value at the other lags. RUN. is to fit the regression model with an MA error term. you decide to model the SALES series in differences also and then to check for overdifferencing with the PLOT option. You interpret the ACF of the differenced series as having a nonzero value ( 0. Overdifferencing also results in an MA coefficient that is an estimate of 1. You use the same procedure here as in regression settings. you fit an MA(1) model to the errors. only the t statistic for housing starts exceeds 2. which you have not yet done. For the moment. If you have.Chapter 4: The ARIMA Model: Introductory Applications 173 Output from the ESTIMATE statement for the sales data indicates that sales are positively related to housing starts but negatively related to mortgage rates and disposable personal income . Thus. regression of Y on X produces an inconsistent estimate of This makes it impossible for you to use the PLOT option in a model in the original levels of the series to determine if you should difference. The correct model includes specifying the error structure. the t statistics are meaningless. you fit a model to the error series and wait to judge the significance of your t statistics until all important variables (including lagged error values) have been incorporated into the model. where you do not use the t statistic for a variable in a model with an important explanatory variable omitted. the influence of a reasonably large correlation at lag 1 may be lessened to such an extent by the other five small correlations that significance is lost. because the first chi-square statistic uses six correlations. The results are shown in Output 4. Look separately at the first few autocorrelations. However. The next step. check the IACF to see if you have overdifferenced the series.10. ignore these t statistics. You may argue based on the chi-square checks that the residuals are not autocorrelated. and remember that differencing is often accompanied by an MA term. However.β − β η + Xβ + α = Y η . unless you fit the correct model. You can accomplish this in PROC ARIMA by replacing the ESTIMATE statement above with ESTIMATE INPUT=(MORT DPIC STARTS) Q=1 METHOD=ML. . Suppose you decide the IACF dies off rapidly enough and that you were correct to difference. Note that if where X and are unit root processes. then. Because the explanatory series seems to require differencing. Also.

1 66936.0 413.0000.< 7534.534511 94183.5 66598.19 slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC 0 0 0 0 0 tfihS STRATS CIPD TROM SELAS SELAS elbairaV 0 0 0 1 0 gaL 1000.0 156.0 8379.0 94183.1 250.74 rorrE dradnatS 45031.1 063.0 01941.1 754.0 4350.02MUN CIPD 156.1 951.0859.0 39.982doohilekiL naissuaG goL 872351.19 etamitsE 3MUN 2MUN 1MUN 1.000.0912.695 3531.20237999.0204.1 UM SELAS 3MUN 2MUN 1MUN 1.0 04262.4 tuptuO 174 SAS for Forecasting Time Series .330.1AM UM retemaraP noitamitsE doohilekiL mumixaM .933 7.01MUN TROM 413.0 setamitsE ni egnahC evitaleR mumixaM 5 doohilekiL mumixaM egasseM gninraW snoitaretI atleD noitabrutreP evitavireD laciremuN tneiciffeoC adbmaL s'tdrauqraM eulaV noitcnuF evitcejbO noitcnuF evitcejbO noitaretI tsaL morf egnahC erauqS-R tneidarG fo eulaV etulosbA mumixaM eulaV airetirC eulaV gnippotS noitaretI airetirC noitanimreT detamitsE sretemaraP dohteM noitamitsE SECNEREFFID TSRIF NI LEDOM erudecorP AMIRA ehT AMIRA CORP :mreT rorrE AM na htiw ledoM noissergeR eht gnittiF 01.0951.03 82603.03MUN STRATS 754.0 43.0 000.0859.0216.1AM UM STRATS CIPD TROM SELAS SELAS retemaraP elbairaV setamitsE retemaraP fo snoitalerroC 04 7975.0063.885 2857.1AM SELAS 216.0 1.0 1.452432 39715.0 912.0 8-E1 860.0 250.0 |t| > rP xorppA 72.72 100.06 94184.degrevnoc evah ton yam setamitsE 31 100.0 000.1 eulaV t 38082.0204.0 000.81 87.0 9000.

99973 is not significant (p-value >.0 )deunitnoc( AMIRA CORP :mreT rorrE AM na htiw ledoM noissergeR eht gnittiF 01.0 6338.0 441.6 80.Chapter 4: The ARIMA Model: Introductory Applications 175 You have used the generally more accurate maximum-likelihood (ML) method of estimation on the differenced series.2021 TROM 956598.0681.0 420.19 262.0 .0660.0350.0 1 CIPD 345031.2 gaL oT 42 81 21 6 . Further inspection of the printout.0 FD 32 71 11 5 erauqS -ihC 56.4 tuptuO 370.11 05. A moving average parameter of 1 is exactly what would be expected if the original regression model in series levels had a white noise error term. The calculated t statistics on the explanatory variables have changed from the values they had in the regression with no model for the error series.0381. Remember that the IDENTIFY statement determines the degree of differencing used.0670.0021.0821. reveals that this number may in fact not be a --------------------snoitalerrocotuA-------------------- 880.0 1 94183.0 )1(**B 37999.5 1 STRATS slaudiseR fo kcehC noitalerrocotuA 801.0 440. another SAS procedure for regression with time series errors.0 :1 rotcaF qSihC > rP 7609.0 2838.0970. You should note that the MA parameter 0.41 34. Also note that PROC AUTOREG.0 470. however.0741. This in turn indicates that just an ordinary regression would suffice to fit the model without any differencing being required. Something has happened here that can happen in practice and is worth noting.0710.0080. cannot be used here because it does not allow for differencing (a problem that can be alleviated in the DATA step but could be very cumbersome for handling the forecasts and standard errors) and because it works only with AR error terms.1 SELAS elbairaV rof ledoM srotcaF egarevA gnivoM 3 rebmuN tupnI gnicnereffiD fo )s(doireP tpecretnI detamitsE 1 rebmuN tupnI rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 2 rebmuN tupnI rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 540.0 730.0731. The moving average parameter estimate is almost 1.0970.0 3838.0040.05).0 370.

independent and dependent.1 raen saw etamitse sti taht ni citamelborp saw mret sihT . a test for cointegration could also be used to make a more informed decision as to whether the differencing was appropriate.176 SAS for Forecasting Time Series good estimate of the true moving average parameter. in which the example first appeared. Similarly.sdrow rehto ni( elbitrevni ylbanosaer dna yranoitats demees slaudiser ehT . Eliminating a single insignificant regressor.)1(AM saw taht ledom mret rorre na yfitnedi ot noitpo TOLP eht desu uoY . MU takes over if DPIC is removed.CIPD decnereffid no SELAS decnereffid fo noisserger a morf slaudiser eht dekcehc uoY . Decisions made on the basis of this number can thus not be supported. When DPIC is removed from the INPUT= list in your ESTIMATE statement.2. and this is the route that will be taken here. However. If a regression model with stationary errors is appropriate for data in which the variables themselves appear to be nonstationary. Section 5. like DPIC. what happens then to the t test for MU? Omitting the insignificant DPIC results in a t statistic 3. A nonzero MU in the differenced model also corresponds to drift in the original levels. If you do.degrevnoc evah ton yam erudecorp noitamitse eht dna . The variables. A final modeling step is to delete insignificant explanatory variables. this coming from the message about estimates not converging. It will be seen that elimination of some seemingly unimportant input variables in the example results in a model that does not show this problem. The only advantage of PROC AUTOREG in this setting is its automatic selection of an AR model and. The t statistic on MU is currently insignificant because DPIC takes over as the explainer of drift if MU is removed.rorre dradnats eguh a dah ti . starting with Version 8 of SAS. then these errors are a stationary linear combination of nonstationary variables. it is not acceptable. if you remove both terms from the model.TROM dna . Review the progression of your modeling thus far: where St niatbo dna smret tnacifingisni evomer yllaitneuqes ot scitsitats t desu uoY . Removing the mortgage rates from the INPUT= list results in a fairly simple model. Also note that the other t statistics change but that the mortgage rates are still not statistically significant. It is worth noting that since the first edition of this book.86 (not shown) on MU. some relevant developments have taken place. its ability to handle strings of missing data.)tsaf ylbanosaer nwod deid FCAI eht . Is it acceptable to eliminate simultaneously all variables with insignificant t statistics? No. DPIC and MU have the lowest t statistics.STRATS . Any model that can be fit in PROC AUTOREG can also be fit in PROC ARIMA.yranoitatsnon erew SELAS elbairav tnedneped eht dna stupni eht taht deciton uoY indicates a first difference is sales at time t 1− te β − e + ψ + H∇ = S∇ t t t ∇ . the forecast error variance is unnecessarily large because the forecast then responds to fluctuations in irrelevant variables. Remove DPIC and leave MU in the model because it is much easier to forecast than DPIC. Tests for cointegration are available in PROC VARMAX. are then said to be cointegrated. discussed in Chapter 5. which makes PROC ARIMA more generally applicable than PROC AUTOREG. can change the t statistics on all remaining parameters. the fit deteriorates significantly. In the example above DPIC drifts upward. along with SALES. Do not calculate SALES forecasts based on forecasts of unrelated series. However.

S.0 30251.3 slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC rorrE dradnatS 42306.'. provides an example of a case 2 problem.1AM UM .S.F T AM E Y L Ht Chapter 4: The ARIMA Model: Introductory Applications 177 is U. then. Consider two scenarios for forecasting this series. First. 1+ t The results are shown in Output 4. giving you an opportunity to see the effect of treating forecasts as perfectly known values).5 79306. FORECAST LEAD=8 ID=DATE INTERVAL=QTR OUT=FOR1. tfihS 0 0 0 elbairaV STRATS SELAS SELAS seulaV selaS erutuF gnissiM dna seulaV tupnI erutuF htiw gnitsaceroF . housing starts (the values are actually those that would be forecast from PROC ARIMA. This. ESTIMATE Q=1 INPUT=(STARTS) METHOD=ML. and you call for a forecast.< 1000. It simply treats these futures as known values.0 H ψ retemaraP 11.< 04 6391. For the first scenario.19 noitamitsE doohilekiL mumixaM erudecorP AMIRA ehT eulaV t 95.240251 96699. No convergence problems remain at this point. Use the following SAS statements: PROC ARIMA DATA=COMB. suppose you are supplied with future values of housing starts from some source. giving you some confidence that you have not overdifferenced. You do not supply information about the forecast accuracy of future housing start values.19 00154. housing starts at time t is a constant (drift) that corresponds to the slope in a plot of the undifferenced series against time. imagine you have been given future values of U. RUN.11). This data set is then concatenated to the original data set. nor can the procedure use such information.=SELAS DNA DEDNEPPA STRATS FO STSACEROF HTIW ATAD gaL 0 0 1 |t| > rP xorppA 3000.4 tuptuO 1MUN 1.983 2.495 9529. (See Output 4. You incorporate these into your data set along with missing values for the unknown future values of SALES.0 1000.60397 is not particularly close to 1.11. In the second scenario. IDENTIFY VAR=SALES(1) CROSSCOR=(STARTS(1)) NOPRINT.52 58062. The final MA estimate 0. you model housing starts and then forecast them from within PROC ARIMA.02 79.3 09.995 9621. TITLE 'DATA WITH FORECASTS OF STARTS APPENDED AND SALES=.0 etamitsE 96699. The first step is to create a data set with future values for DATE and STARTS and missing values for SALES. The combined data set COMB has eight values of future STARTS.

0870.1 UM SELAS UM retemaraP SELAS elbairaV setamitsE retemaraP fo snoitalerroC .1AM SELAS 000.2 displays a plot of the forecasts from this procedure and also displays a similar plot in which PROC ARIMA is used to forecast the input variable.914 9529. but forecast intervals differ considerably.1 :1 rotcaF srotcaF egarevA gnivoM 1 96699.0 511.025 7224.51802 5398.0 0418.75891 0273.0 1MUN STRATS slaudiseR fo 860.0440.178 SAS for Forecasting Time Series The estimation is exactly the same as in the original data set because SALES has missing values for all future quarters.0030.17681 4365.29781 9045. Predicted SALES are the same (recall that future values of STARTS in this example are the same as those produced in PROC ARIMA).01.0 700.0001.0 qSihC > rP 32 71 11 5 FD 92. See Output 4.0 520.97691 5617.0 920.0922.983 rorrE dtS 9066.94991 2466. Because future values are available for all inputs. Otherwise.0 8838.0 010.0110.1 860.1 071.13. Note that future values were supplied to and not generated by the procedure.345 7148.0431.0 150.644 2193.48491 3144.274 1819. Section 4.22391 tsaceroF 94 84 74 64 54 44 34 24 sbO stimiL ecnedifnoC %59 SELAS elbairaV rof stsaceroF )1(**B 79306.0 270. A request of LEAD=10 also gives only eight forecasts because only eight future STARTS are supplied.51302 7440.30502 1366.0 290. Note that the general increase in predicted SALES is caused by including the drift term 6795.465 1252.2 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------000.94681 4677.85581 0477. Forecast intervals are valid if you can guarantee the future values supplied for housing starts.50781 0759.37781 4230.91 77.0211.ψ )deunitnoc( seulaV selaS erutuF gnissiM dna seulaV tupnI erutuF htiw gnitsaceroF 11.11 18.0 .0781.22902 0302.06302 9234.3.4 tuptuO .0 031.65012 9814.49791 9269.24881 6909.80681 6944.04486.67591 8917.0950.0 160.794 2548. they are too small.78002 2427.0 000.39491 1408.6 70.45602 9574.0 812.0010.01.0750.19 gnicnereffiD fo )s(doireP tpecretnI detamitsE SELAS elbairaV rof ledoM 551. forecasts are generated.1AM SELAS kcehC noitalerrocotuA 010.0 1MUN STRATS 071. and thus these points cannot be used in the estimation.0 0418.0241.

PROC ARIMA correctly incorporates the uncertainty of future housing start values into the sales forecast. you supplied future values of Ht to PROC ARIMA and obtained forecasts and forecast intervals. but the intervals were not large enough because future values of housing starts were forecasts. RUN. an input series is used in an input option to identify and estimate a model for the target series St. in this case). you obtain the model t t In case 1. The forecasts were valid. You do not need to request forecasts of your inputs (explanatory series) if your goal is only to forecast target series (SALES. The procedure automatically generates forecasts of inputs that it needs. housing starts Ht are used as an explanatory variable for a company's sales. Also.S. U. FORECAST LEAD=8 ID=DATE INTERVAL=QTR OUT=FOR2 NOPRINT. you have the problem of obtaining these future values for housing starts. The entire set of code is shown below and some of the output is shown in Output 4. Step 1 in this methodology identifies and estimates a model for the explanatory variable Ht.2 Case 2: Simple Transfer Functions In case 2.12. FORECAST LEAD=8. Use an AR factor to handle the seasonality of this series. IDENTIFY VAR=STARTS(1) NOPRINT. This made it impossible to incorporate forecast errors for Ht into the forecast of St. The data are quarterly and. Some of the output has been suppressed (it was displayed earlier). The model t fits well. ESTIMATE P=(4) Q=(3) METHOD=ML NOCONSTANT. housing starts. based on the usual criteria. In addition.3. In step 2. the series should be differenced. the series was forecast eight periods ahead to obtain future values. but you do not see them unless you request them. ESTIMATE Q=1 INPUT=(STARTS) METHOD=ML NOPRINT. The differenced series shows some correlation at lag 4 but not enough to warrant a span 4 difference. This part of the SAS code is the same as that in the previous example. where forecasts of Ht were taken from this run and concatenated to the end of the data set instead of being forecast by the procedure. The two steps must be together in a single PROC ARIMA segment. IDENTIFY VAR=SALES(1) CROSSCOR=(STARTS(1)) NOPRINT.1. TITLE 'FORECASTING STARTS AND SALES'. H∇ e) B 3 θ − 1 = H∇ ( t 1− te θ− e= η ) 4 B α − 1( t η t where η + H∇β + ψ = S∇ t t is the moving average . Using fitting and diagnostic checking. In Section 4.3. forecast intervals are wider than in case 1. The SAS code follows: PROC ARIMA DATA=HOUSING.Chapter 4: The ARIMA Model: Introductory Applications 179 4. Diagnostic checking was done on the STARTS series Ht.

0060.0 6500.0400.0 38251.0 690.1AM 1.1RA 1.0761.0910.2 eulaV t slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV 28551.0791.1RA 1.0 850.471 5.0 rorrE dradnatS 00582.0 8555.0232.235 922.0120.1AM retemaraP setamitsE retemaraP fo snoitalerroC 04 8606.0330.0 411.1RA 391.0430.0360.0351.2 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.0 611.0 1536.0 1.0 23324.0 qSihC > rP 22 61 01 4 FD 26.0802.0 etamitsE 1.9 55.925 6242.740.06303 4 3 gaL 4760.1AM retemaraP noitamitsE doohilekiL mumixaM erudecorP AMIRA ehT SELAS DNA STRATS GNITSACEROF AMIRA CORP :doohilekiL mumixaM gnisU gnitamitsE 21.1 391.0601.81 85.41 09.0 6866.0 000.0 901.0 860.1 77.0350.1 1.0 711.0 811.0 |t| > rP xorppA 38.4 tuptuO 180 SAS for Forecasting Time Series .0 6944.0- 660.

3731 sbO 94 84 74 64 54 44 34 24 21.0602 4826.4122 9173.1731 7291.014 4344.4 tuptuO .186 9657.471 :1 rotcaF :1 rotcaF tsaceroF 6201.465 0397.526 2068. The narrower interval is questionable in light of the downturn in SALES at the end of the series. This is illustrated in Output 4.0731 6201.0731 3863.9631 3966. where the same future values for housing starts are read into the data set rather than being forecast by PROC ARIMA.2991 1407.13 to indicate the difference in interval widths for these data.034 3958. The second plot gives these forecast intervals as a solid line along with intervals from the previous analysis (broken line).0781 9157.Chapter 4: The ARIMA Model: Introductory Applications 181 You can now merge the data sets FOR1 and FOR2 from the previous two examples and plot the forecasts and intervals on the same graph.7831 6242.642 6242.813 1797.ledom siht ni mret naem oN )4(**B 582.1 STRATS elbairav rof stsaceroF .283 4937.1301 1 )3(**B 23324.1 STRATS elbairaV rof ledoM srotcaF egarevA gnivoM srotcaF evissergerotuA gnicnereffiD fo )s(doireP rorrE dtS 7076. Note how the broken line drastically underestimates the uncertainty in the forecasts. The first graph gives forecast intervals that arose from using PROC ARIMA to forecast housing starts.625 2338.153 3580.5731 8652. 6102.777 2207.9631 7291.0 .409 3337.4212 4356.547 2186.4171 stimiL ecnedifnoC %59 )deunitnoc( AMIRA CORP :doohilekiL mumixaM gnisU gnitamitsE 5300.0 .5712 7349.103 3614.0691 4636.

13 Plotting Forecast Intervals .182 SAS for Forecasting Time Series Output 4.

.1) model 1− te as t or as t or. as .2) followed by exponential decay at the rate . + − 4 − te51. − 1(3 = 1− te . the weights are 1. . suppose you write t You then obtain t e) B6. if . For example. − 1( / )B7. e ) Bα − 1( / ) Bθ − 1( = e ) Bθ − 1( . why not apply one to an observable input? This is exactly what you do in case 3.5)(1.4 You have specified the ARMA model with backshift operators.075. The exponential decay tells you to put a factor (1 . + 1( + 1− t X)B4. . you see that if you can estimate the sequence of weights on the ets.5)(. For example..Chapter 4: The ARIMA Model: Introductory Applications 183 4. 6 t Y) B8.5 (. . t θ − e = 1− Yα − Y + =α 1− te2. . finally.7. t t 2 The pattern of the weights (coefficients on the ets) determines that the process has one AR and one MA parameter in the same way the ACF does.6.1 Because t you see that + 3 − e )θ − α ( 2 α + The model. 1.3. ). then. is + 5− te570.6= (. Next. you see that you can write any ARMA model by setting Yt equal to a ratio of polynomial factors in the backshift operator B operating on et. .2). + e= η t − 1( t t η where is the moving average − =θ η + ) 2− t X 4. For example. Finally.2. ..3. The pattern is characterized by one arbitrary change (from 1 to 1.3.5B) in the denominator of the expression multiplying et (in other words. you see that the numerator polynomial corresponds to MA factors and the denominator corresponds to AR factors.θ − α = 2. . . you can write the ARMA(1. t + e= t t t − t t t t t Y Y Y Y Y .)5.3=(. . − + e ) θ − α ( α + 1− e )θ − α ( + e = 3− te3. If you can apply a ratio of backshift polynomials to an unobserved error series et.. .15. + 2− te6. .6). in this representation. you can determine how many AR and MA lags you need. t e) B5. What have you learned from this exercise? First..3. + 1( = − 1− t X(3 .1 t = = Y ) Bα − 1( 1− tY8. .3 Case 3: General Transfer Functions noitacifitnedI ledoM 1.

+ 1( + 1− t X) B8. Define the cross-covariance as ) j + t X . how will you know the form of the backshift expression that multiplies Xt–1? The answer is in the cross-correlations. .η t )Y t ))0( YY γ)0( XX γ( / ) j ( YX γ η+ − t Y t 2− t X2. Estimate this by 5. To illustrate the theoretical cross-covariances for a transfer function. − 1( − ( XYγ = ) tY .1 2− t X(E = ) 2 + tY t X(E = ) 2( YX γ j XX γ69. assume that Xt is a white noise process independent of the error series The cross-covariances are computed below and are direct multiples of . j − t X ( voc = / ) B 6. tY ( v oc and )j Define the cross-correlation as 5.1 + 1− X3 = XX γ3 = ) Y1− X(E = ) 1+ Y X(E = )1( YX γ / ))0( YY C) 0( XX C( / ) j ( YX C t . + 2− X2. Usually. ) j + tY − 1( / ) B4. 1. 2. although for simplicity 0 is used in the preceding example. . ) 0( ) 0( XX γ2. + 3− X69. t X ( voc = = = )j ( = ) j ( YX ρ t )j ( )j ( − XY γ YX γ YX t t t Y Y Y r . E = )3( YX γ ) j ( YX γ Estimate by e )B8. and computing expected values gives 0 = ) Y X(E = )0( YX γ t t and ) 0( +.184 SAS for Forecasting Time Series or t This is called a transfer function. but how is it used? With real data. = ) 3+ Y +t t Y ( )X t − − 1− t X3 t t t X( t t t ) ( X( = 0 XX γ Σ = ) j ( YX C 1− tY8. You now have a potentially useful model.1 = ) n + 4− X867. Yt is modeled as a function of lagged values of the input series Xt and current and lagged values of the shocks et. 3. − 1(3 + 0 = . the variance of X (this holds only when X is white noise): and esion Multiplying both sides by Xt–j. the intercept is not 0. j=0.

the 0 on Xt indicates a pure delay. The reason for this name is clear You have . − 1(3 + 0 = + + 2 − t X 2. = 9 X2.. .()2.. which you can then analyze by the same rules used for the ACFs. are two (independent) white noise . indicates that the multiplier on Xt–1 has one numerator (MA) lag and one denominator (AR) lag..1 + )0(3 = 3− t X 69.1 3 1 + 1− t X3 0 0 + t X0 0 1– = 1− t X) B8. 1 = . )0 ( XX γ When you divide each term in the cross-covariance sequence by you obtain the weights 2. so 0 and 69.. that is. 8 X 69. + )1(2. The crucial point is that if you can obtain the cross-correlations.j β so if X is white noise. The only problem is the requirement that Xt be white noise. AR-type operator (1–. j β THGIEW J GAL − 1( / ) B4.1 = ..()2. . + + 1− t X) B8. followed by exponential decay at rate .8.. In the example above.1( 4 69. but Xt is AR(1) with parameter t e)B8. − 1( / ) B 6. The pulse is delayed by one period. if you ignore the error term in the model and let Xt be a pulse. Xt=0 except at t=10 where X10=1. 3 + . the cross-covariances are proportional to the transfer function weights : 3 j )8. Its effect continues to be felt starting with t=11 but diminishes quickly because of the stationary denominator (in other words. = 01Y − 1( / ) B4. you have . you have the impulse-response weight pattern.8B) –1 on Xt–1).2.1 2 3− t X69. The arbitrary jump from 3 to 1. which is addressed below.1 ε + 1− t α = 2Y + + j 01 X3 β These weights are also known as the impulse-response function.α Suppose you have the same transfer function. + )0(69. and t t ε where the Xts are independent of the ets and where et and sequences.Chapter 4: The ARIMA Model: Introductory Applications 185 Note that the model involves .1( 5 β 2 )8. The weights are the expected responses to a pulse input. − 1(3 1− t X3 = X 1Y = = = = 11Y 21Y 31Y 0Y t t t Y X Y . + 1( + 3 2. = .. + 2− t X2.. Ignoring the white noise term.

so the expression above becomes ′N + . IDENTIFY VAR=Y CROSSCOR=(X) NLAG=10. t esion . the estimated Yt and ). ESTIMATE P=1. . . Next. A subsequent IDENTIFY statement for Y with the CROSSCOR=(X) option automatically prewhitens X and Y. t t + 2 − X2.3. using the previously estimated model for X.1 + 1− X3 = t t t t t t t t t t Y Y X X Y . IDENTIFY VAR=X. . although it really only whitens X. + ) 3− X α − 2− X ( 2. The parameter estimation in PROC ARIMA is always performed on the original variables. + t The impulse-response function is exactly what you want. + 3− Xα2. Set t α +. .14. you specify the following SAS statements: PROC ARIMA DATA=TRANSFER. You want to model X and use that model to estimate Yt and This process is known as prewhitening. RUN. + 2− t ε2. . .1 + 2 − Xα3 = 1− Yα + t t . compute the cross-correlations of the prewhitened X and Y (in other words.186 SAS for Forecasting Time Series Note that t so ) 1− t esion ( and 4− t t ′N + . . For this example. +3 -t X69.3.1 + 1− t ε3 ′ t Y ε = = 1− t 1− t 1− t X X Y α − α − α − = ′Y t ′ t t N where α − 3− X ( 69. TITLE 'FITTING A TRANSFER FUNCTION'. The results are shown in Output 4.1 + ) 2− X α − 1− X (3 = 1− Y α − is a noise term. + 4 − Xα69. tε t Use the IDENTIFY and ESTIMATE statements in PROC ARIMA to model X. .4 ε ′ ′ 3− t ε69. + ) X and note that tε = is a white noise sequence. and t is a white noise sequence. Note that the prewhitened variables are used only to compute the cross-correlations. egatS YFITNEDI eht ni gniledoM noitcnuF refsnarT rof stnemetatS 2.

**| . . |*.5 snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM X = elbairaV fo emaN erudecorP AMIRA ehT NOITCNUF REFSNART A GNITTIF AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw noitcnuF refsnarT a gnittiF 41. . | .034580.083530.1 ecnairavoC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 005 289861.94470.*| . | . |******** | | | | | | | | | | | | | | | 37930. |*.52750. | ***| .0 62562.0 808950. .1 noitalerroC 236090.*| . | .0 484263. .0 87650.0 08461. | .0 494711.0 02060.0 258950.0 21500.32960.0 018950.0921920.0 383511.0032870. .0 89580. | .0 385750.0 738950. |*.098520. | **| . | **********| .0715830.63700.047193. |*.0 127440.0 44480.0 57120. .058110. .0 004950.23120.0 62731.33870. | .0 915850.0 00000.0 285060.002110.0 50430.*| .0noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI 567060.0 0 rorrE dtS | . |*. |*.0 169950.0 86430. . . | .31211.*| . | .0 951950.0 102522. | *****| .0 15805.041820.1 951000. .0887101. . | . | **| .0260010. | . | .0 915663. . |********************| | | | | | | | | | | | | | | | | 23660. | .0332351.0 60300. |*.0 698496. |** | .| | | | | | | | | | | | | | | .4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 187 .0 965781. | .0 580550.0 846950. | ***| .0 973060.91820.0830701. |** | . . |*.0995490.*| .

142 07.0700.< 1000.45 eulaV t 85830. . .tnanimreted gol edulcni ton od CBS dna CIA * 005 slaudiseR fo rebmuN 798. .0 20840.049150.0561.0 140.< |t| > rP xorppA 81. . .0 660.0820.0 rorrE dradnatS 45805.080420. | .0 00900. **********| . .< 1000. .0120.1 etamitsE ecnairaV 490064. | . .029770.0 401.0 42610. | | | | | | | | | | | | | | | 77000.< qSihC > rP 42 81 21 6 FD 24.0 330. |*. | .0 150.0 94190.31 17.0 110.702 61.058400.0 511.9241 CIA 75800. .712 14. |*.2 etamitsE tnatsnoC 1 0 gaL 1000..0 1000.0 18530.0 870.4 tuptuO 188 SAS for Forecasting Time Series .*| .*| .003950.5 etamitsE 1. | .0680. .691 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | | | | | | . .< 1000.0 noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP )deunitnoc( AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw noitcnuF refsnarT a gnittiF 41.1 etamitsE rorrE dtS 312710. | . | .0 66470.0960.0 96500.060920.0 211. |** .0480.096200.1RA UM retemaraP noitamitsE serauqS tsaeL lanoitidnoC 660.0 750.0 170. |*.7341 CBS 864.0562.0 15805. | .*| .< 1000.087000.0 470.0 905. .0 001.0731.

0 500.0 .0100.5 naeM detamitsE X elbairaV rof ledoM 170.0 020.0610.0 450.0 4417.0210.0 270.43 76.0 050.0340.1RA 500.0 600.0820.0 0217.0 6425.0 qSihC > rP 74 14 53 92 32 71 11 5 FD 73.0 7214.1RA UM retemaraP setamitsE retemaraP fo snoitalerroC )deunitnoc( AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw noitcnuF refsnarT a gnittiF 41.0050.2 erauqS -ihC 84 24 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.0 900.0 5509.0400.0 720.0 210.0550.0 8726.0- 420.0 6058.0500.0- 520.02 99.0 1.1 :1 rotcaF srotcaF evissergerotuA 196500.01 snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM Y = elbairaV fo emaN )1(**B 45805.0140.0540.0 410.005 165141.0 800.0 320.0 120.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 189 .0220.1 500.0 110.62 92.11 29.0 710.0110.0010.0360.0 810.0 500.0640.0- 8419.0 940.42 32.0140.0 550.0 260.0240.0 700.0 830.0 030.92 44.0790.0 330.0 000.1 UM 1.51 73.0 800.6 51950.0 310.

23 377817.0 00000.0 552101.4 tuptuO 190 SAS for Forecasting Time Series .0 888501.5 747414. | | | | | | | | | | 51910. | .0 22270. |** .017640.0 127440.0 53731.091600.0 66124.076100.73 ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA )deunitnoc( AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw noitcnuF refsnarT a gnittiF 41.0 417380.3 605081.074240. | *******| . | . *****************| . | .0 29972. . | ****| . .0 12490. .7 451855.0 532070.| | | | | | | | | | . | . | . .*| .22 193761. . | **********| . **| . . |*.31 334409.*| . .0 62027. . | . |** . | ************| .0 086790. |********** | | | | | | | | | | 04010. | .0 0 rorrE dtS | . .51 805393.*| .099960.1 noitalerroC 949137.0 34180.91 619119.0 44910. .72 813892. .*| . |*.***| .0 94125.0 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | . .0 79570.0 55150.0 901290. | **************| . | ********| .0 73130.0 46840.098420.050900. | ******| .0 61415. |********************| | | | | | | | | | | | 49890.01 778322. .0 556301. | *****************| .0 92658. |*. | . | .092658.0noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI 442601.0 44706.0 651501. .0 85691. |** .0 95053.0 87800.

****| .0 19460. | . . ****| .0539792.0 31600. |** | | | | | | | | | | | | | | | | | | | | | 41660. .0 08800.0 85320.0 027.*| .0 24131.0 140265. ***| .22830.noitalerroC 285452.0 438505.< qSihC > rP 6 FD 30.0 16902.0 045775. | .0 1000. *****| . . *******| . |*.0411541. | . ***| .0ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 12345678901gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1- snoitalerrocssorC .0 20641. .| | | | | | | | | | | | | | | | | | | | | .41 005 X seires demrofsnart fo ecnairaV Y seires demrofsnart fo ecnairaV snoitavresbO fo rebmuN X dna Y fo noitalerroC 153. | .0 706.07730. .1 60326. |*.0 64133. |*.*| . . .0 02830.0 53060. .0 808608.0 920741.0 658.0 415. | .0 13320.0 72397.0 024777.0 585320.0 483531.1 143350.04770. . ***| .0 60932.0991660.0 437980.0 347090.0 89102. .0 658942.0 803232.0 50051.0 671029.*| . .02710. .0321741.0 224.0 71530.*| .denetihwerp neeb evah seires htoB 251310.3 788330. ****************| .4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 191 .3011 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA )deunitnoc( AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw noitcnuF refsnarT a gnittiF 41.0 997572.

. ) . is the shift or pure delay (2 in the example) are written in multiplicative form is not followed by differencing numbers (this is done in CROSSCOR). L .0 . )Bα − 1( lag The form of the transfer function is then -------------------snoitalerrocssorC-------------------- 202. . . α − 1( / )B)θC( − C( = 1.3)(1)/(1)X) ALTPARM.. . .1 N srotcaF evissergerotuA + ))5 − retliF gninetihwerP 900. .( .. ) .192 SAS for Forecasting Time Series Data for this example are generated from the model t where t The cross-correlations are near 0 until you reach lag 2.0 :1 rotcaF 2− t X((3 qSihC > rP 1000. the specification for the transfer function form is ) where S lag polynomials variable j For example. The one arbitrary drop and the exponential decay to one denominator (AR) corresponds to one numerator (MA) lag Note the pure delay of two periods.814 t t Y( X( 41.0 seireS neewteB kcehC noitalerrocssorC 397. The default in PROC ARIMA is to estimate the model with the C multiplied through the numerator as shown on the right.0 3− t X(4. 2− t X) B . FD 6 − )01 − erauqS -ihC 58.0 932. = )5 − = )01 − 1− tY(8. INPUT=(2$(1.0 )deunitnoc( AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw noitcnuF refsnarT a gnittiF :retlif gniwollof eht yb denetihwerp neeb evah selbairav htoB 133.1 + k L( / ) . In INPUT=(form1 variable1 form2 variable2.33146 followed by a roughly exponential decay. . 2− t X) B α k L( . . ) Bθ − 1( − )5 − 320. .1 1.4 tuptuO gaL oT 5 .< e + )5 − 1− t X(5.1 . . . 1.0 )1(**B 45805. . You now see a spike (0. L($S − 1( / )Bθ − 1(C 2 . The ALTPARM option gives the factored C form as on the left. ). Now review the PROC ARIMA instructions needed to run this example.79327) followed by an arbitrary drop to 0. .

05). St.73). and (. Note the absence of a transfer function form in the sales and housing starts example. SYMBOL1 V=L I=NONE C=BLACK. TITLE 'FORECASTS FOR GENERATED DATA'. (. In the autocorrelation and cross-correlation checks of residuals and input. For the current (generated data) example. − 1( 99.3.23− = t t Y Y .16: ESTIMATE P=1 INPUT=(2$(1)/(1)X) PRINTALL ALTPARM METHOD=ML. + − 1( + 2 − X )B73. noitaulavE ledoM 3.ledom noitcnuf refsnart eht fo noitacifitnedi reporpmi seilpmi tupni htiw slaudiser fo noitalerroc-ssorC . Note the AR(1) nature of the autocorrelation plot of residuals. DATA NEXT. To continue with the generated data.02). note the following facts: . FORECAST LEAD=10 OUT=OUTDATA ID=T. RUN. IF T>480. which assumes that only contemporaneous relationships exist among sales. one numerator (MA) lag (2$(1)). RUN.3.16 Standard errors are (1. and the input variables. RUN. Use the PLOT option to analyze the residuals and then estimate the transfer function with the noise model. RUN. SET OUTDATA. The code above produces Output 4.sledom AMIRA CORP dradnats rof reilrae dessucsid scitsitats Q eht ekil era AMIRA CORP yb detnirp yllacitamotua scitsitats erauqs-ihC η 1− )B97.slaudiser ni noitalerrocotua yb deinapmocca netfo si sihT .4 The estimated model is as shown in Output 4. SYMBOL2 V=U I=NONE C=BLACK. SYMBOL3 V=F L=2 I=JOIN C=BLACK.2 + 64. PROC GPLOT DATA=NEXT. (. RUN. Continue with the following code to produce Output 4. SYMBOL4 V=A L=1 I=JOIN C=BLACK. PROC PRINT DATA=NEXT. and one denominator lag (2$(1)/(1)).01).Chapter 4: The ARIMA Model: Introductory Applications 193 indicates esion t Several numerator and denominator factors can be multiplied together. the transfer function form should indicate a pure delay of two (2$). add these SAS statements to those used earlier to identify and estimate the X model and to identify the Y model: ESTIMATE INPUT=(2$(1)/(1)X) MAXIT=30 ALTPARM PLOT METHOD=ML.15. PLOT L95*T U95*T FORECAST*T Y*T / OVERLAY HMINOR=0.03). TITLE 'FORECAST OUTPUT DATA SET'. − 1( 2 − t X))Bδ t − 1( / )Bα − 1() 3 B 2 θ − B 1θ − 1 C( + 0 θ = ( 1− )B87. (.

34eulaV t 0339700. . from . .1MUN 1ELACS UM retemaraP noitamitsE doohilekiL mumixaM erudecorP AMIRA ehT NOITCNUF REFSNART A GNITTIF AMIRA CORP :noitcnuF refsnarT a gnittiF 51.34 48. future values of X must be in the original data set.2 6799.33- slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC 2 2 2 0 tfihS X X X Y elbairaV 1 1 0 0 gaL 1000.0 17260.< 1000.99 71.0 35577.8091 328346. the inputs are forecast and then used to forecast Y.4 tuptuO 194 SAS for Forecasting Time Series Neither cross-correlation check indicates any problem with the transfer specification.deifitnedi ylreporp ton si ledom esion eht taht tub thgir si noitcnuf refsnart eht taht setacidni X htiw slaudiser fo noitalerroc-ssorc yb deinapmocca ton slaudiser fo noitalerrocotuA versus Output 4.< 1000. .0 53070. In an example without prewhitening.5291 154.33etamitsE 1.3 16799. from . First.1 351207. .0 56893.794 582.61 35.0 56420.< 1000. . .1NED 1. .0 rorrE dradnatS 96097.16 See Output 4. P=1 .15 ESTIMATE ESTIMATE INPUT=(2$(1)/(1)X) .< |t| > rP xorppA 76. .

0341.0 152517. | ****************| . | *******| .0 76380.0743.0 608880.268 76.< 1000.0521.0 40102. | .0840.0570.0 350. **| .< 1000. | ************| .0 436.0 611.0611. *| .0000. | .326980.0 880.0 140.0701.298 72.0111.0 452345.319 91.0 706.0 762680.0170.0561.0840.0 65463.1NED X 128.0 810.1 128.0520.0120. | *****| .0 0 rorrE dtS | .1 noitalerroC 302921.0950. *| .0 285980.0340.1 946701.0 941744.0 92706.0680.0 090.< 1000.0 17240.0 99977.0 984.0 000.0 00000.0 601.0 000.0 986.2 ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1- slaudiseR fo tolP noitalerrocotuA 541.0 424980.0780.0130.0241.0690.1MUN 1ELACS UM X X X Y retemaraP elbairaV setamitsE retemaraP fo snoitalerroC )deunitnoc( AMIRA CORP :noitcnuF refsnarT a gnittiF 51.1 823.487 41. | **********| .0 080622.177 66.0260.01ELACS X 436.0740.0 110.0 192.0823. |********************| | | | | | | | | | | | 18740.0 658440.157 66.0720.0 11984.< 1000.01.208 08.0 901380.0380.0 1000.0200.1 UM Y 1.0 087.0910.0 563.< 1000.0741.0 587660.0390.0590.2 351207.0 001770.0141.137 erauqS -ihC 84 24 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.< qSihC > rP 84 24 63 03 42 81 21 6 FD 29.1MUN X 192.0 743.0 880.0480.1NED 1.1 289046.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 195 .0 214511.0 84561.0 688780.0 901589.< 1000. | ****| .0 366123.***| .0 562.0 07462.1 986.0 102. | .< 1000.01.0801.0690.

0 920.4 tuptuO 196 SAS for Forecasting Time Series .*| .0910.0270.0 810.0 650.0 700.0 65410.0- 100.023470.0 570.*| .0200. .*| . . **| .0 310. .0 220.0 200.0300. .0 14330.0 83941.0 230.91 53.0 400.1 75.0 9699.740.0 3479. .0 08200.51 52.0 730.0 2869.0noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI )deunitnoc( AMIRA CORP :noitcnuF refsnarT a gnittiF 51. |** .0 720. .0 530.016140.0 440.082540.0 6979. .0- 320.32 78.*| .0 37080. | .0 30020.0 27131. . .0700.0 qSihC > rP 64 04 43 82 22 61 01 4 FD 31.0 14994. ****************| .0 740. |*** .0 200.0 900.0 340. .0 erauqS -ihC 74 14 53 92 32 71 11 5 gaL oT -------------------snoitalerrocssorC-------------------- X tupnI htiw slaudiseR fo kcehC noitalerrocssorC | | | | | | | | | | .0600. | .0620.0 840. .0 240.0 300.*| .0 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | .0 0038.0610.0 200.0 400.080830.0 120.0 210. |*** .61 17.0- 910.0800.0 53800.0 850.0910.0 230.0 100. |*. |********** | | | | | | | | | | 80140.0 130.*| .0750.069050.*| .0 17480.0- 9199.7 39.099977.0910.62 98. | . . | . |*. | | | | | | | | | | 23960. .0 550.058050.0 310.*| .0 070.026960.0 3069.0 8669.

1 tsE ecnairaV esioN etihW etamitsE mreT tnatsnoC 92658.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 197 .0 .0 .01 175544.1 :1 rotcaF srotcaF rotaremuN 807260.59160.0 etamitsE 1 setamitsE evissergerotuA laitinI noitamitsE yranimilerP erudecorP AMIRA ehT NOITCNUF REFSNART A GNITTIF ataD detareneG rof stsaceroF gnittolP dna gniledoM 61.33- tpecretnI detamitsE Y elbairaV rof ledoM )deunitnoc( AMIRA CORP :noitcnuF refsnarT a gnittiF 51.3 2 X rotcaF noissergeR llarevO tfihS elbairaV tupnI 1 rebmuN tupnI 6799.1 :1 rotcaF srotcaF rotanimoneD )1(**B 56893.4 tuptuO )1(**B 96097.

0 68193.2 23399.0 1 tirC R 8-E1 7-E1 6-E1 10000.0 1.4 tuptuO 198 SAS for Forecasting Time Series .1NED noitamitsE serauqS tsaeL lanoitidnoC )deunitnoc( ataD detareneG rof stsaceroF gnittolP dna gniledoM 61.3 6-E251.7tnatsnoC 27877.235863.451950.1132 83.2 1ELACS 36297.3 1ELACS 72477.0 93967.3 noitcnuF evitcejbO ni egnahC evitaleR 842000.231554.2 17310.0 setamitsE ni egnahC evitaleR mumixaM 5 doohilekiL mumixaM tneiciffeoC adbmaL s'tdrauqraM eulaV noitcnuF evitcejbO noitcnuF evitcejbO noitaretI tsaL morf egnahC erauqS-R tneidarG fo eulaV etulosbA mumixaM eulaV airetirC etanretlA airetirC etanretlA eulaV airetirC eulaV gnippotS noitaretI airetirC noitanimreT detamitsE sretemaraP dohteM noitamitsE yrammuS noitazimitpO noitamitsE AMIRA 523000.0 759534.0 67878.0 398850.01720955.636337.0 502900.1RA 2364.1 93967.0 1.2 50100.3 05689.0 72477.9353170.0 1.0 10000.0 12118.0 35297.8093 ESS 4 3 2 1 0 noitaretI tnatsnoC 1.0 689752.0 92658.230624.117ekilgoL 3 2 1 0 retI noitamitsE doohilekiL mumixaM 749681.01 UM 13.130937.0 51497.0 25987.0 100.628476.0 6-E1 10000.0 824909.0 snoitaretI atleD noitabrutreP evitavireD laciremuN yrammuS noitazimitpO noitamitsE AMIRA 8-E1 835.453873.0 61763.0 70709.0 46628.615 32.232181.0 65054.0 1 tirC R 1000.0 33273.784576.1MUN 05299.13UM 02835.0 adbmaL 40237.1MUN 04399.1NED 85273.0 47957.0175544.0 61763.01722835.2 42387.01700163.235 21.0 1.0 00001.0 15273.0 56877.255 69.1RA 2181.3 100.0 548188.0 62593.0 adbmaL 36830.017doohilekiL naissuaG goL 523000.0 100.0 00001.0 06877.2 71499.636830.0 1.2 05299.52377.

620.0- 820.0920.0010.< 1000.1 120.85 23.0 890.91 22.0270.1341 688410.0030.0040.0483.< 1000.0 1190.01ELACS X 210.0 qSihC > rP 74 14 53 92 32 71 11 5 FD 03.0 600.82 18.0- 210.0 66527.0760.61 47.1NED X 818.0 600.0210.1 820.65 03.0 010.56 49.0040.0 68220.0 0171.1NED 1.0 000.0 401.0811.0 040.0340.0480.0360.1 UM Y 1.1 070.0 1.0 04399.0 170.0830.0520.1NED 1.0 640.93 51.01.1MUN X 510.0 700.< 1000.81eulaV t 96310.1RA UM X X X Y Y retemaraP elbairaV setamitsE retemaraP fo snoitalerroC 794 911.0 483.1MUN 1ELACS 1.0 45540.0 61364.0 110.01.0 730.0910.0200.0 4815.1 rorrE dradnatS 27877.0000.0- 540.0- 580.0882.0 000.4 erauqS -ihC 84 24 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.0820.0 250.25 18.0597.0440.0 9950.1 399920.0 710.< 1000.0 300.24 75.0 7011.0500.0882.43 51.0200.0 210.0430.1RA Y 597.0660.2541 670.6- slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC 2 2 2 0 0 tfihS X X X Y Y elbairaV 1 1 0 1 0 gaL 1000.1 818.0 8170.0 200.0 120.0 000.0630.2 36297.1RA UM retemaraP noitamitsE doohilekiL mumixaM )deunitnoc( ataD detareneG rof stsaceroF gnittolP dna gniledoM 61.0730.0710.0 300.< |t| > rP xorppA 68.0940.0 300.0810.0070.0 510.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 199 .0 93720.0 0360.62 60.0370.1MUN 1ELACS 1.0 760.23etamitsE 1.1 40237.0 85273.0- 8421.

0 320.0 020.0 200.0 300.0 810.0100.0 100.0 330.0 7449.33 41.4 tuptuO 200 SAS for Forecasting Time Series .1 :1 rotcaF srotcaF rotanimoneD )1(**B 85273.0800.0910.0 4927.0 510.0820.2 2 X rotcaF noissergeR llarevO tfihS elbairaV tupnI 1 rebmuN tupnI )1(**B 36297.0640.0 530.0- 4667.41 80.0131.0 qSihC > rP 64 04 43 82 22 61 01 4 FD 77.0 510.0 620.0 300.0500.0310.0910.11 07.0 200.6 57.0501.0510.0 120.)1(**B 27877.0 .0 650.0060.0700.83 59.0 200.0470.0 150.0 920.23- tpecretnI detamitsE Y elbairaV rof ledoM 830.0 .0420.0 6489.0 620.0 4837.82 43.1 :1 rotcaF srotcaF rotaremuN 593399.0 770.0 .1 :1 rotcaF srotcaF evissergerotuA 2364.0 020.0760.0- 110.0 3759.0 020.0 8947.0 420.0 6379.0720.0 970.0810.0 620.0 510.0 erauqS -ihC 74 14 53 92 32 71 11 5 gaL oT -------------------snoitalerrocssorC-------------------- X tupnI htiw slaudiseR fo kcehC noitalerrocssorC )deunitnoc( ataD detareneG rof stsaceroF gnittolP dna gniledoM 61.0 740.7 69.0 010.

2 5823.01 9072.02 9121.12776.12 0938.12 5765.05451.0- 21668.5 95553.159L 98410.21 tsaceroF 015 905 805 705 605 505 405 305 205 105 sbO stimiL ecnedifnoC %59 Y elbairaV rof stsaceroF )deunitnoc( ataD detareneG rof stsaceroF gnittolP dna gniledoM 61.12 0912.0 63313. .1 DTS 2216.01 5371. .5 6553.8 3876. .1 0877.16022.6 8603. .01 0634.3 0592.91 9882.4 4643.12 7044.9 8831. 015 905 805 705 605 03 92 82 72 62 )senil tuptuo erom( 87971.1 rorrE dtS 4041.1 98410.5 0727.01 . .41 9653.01 8065.5 4041.71 2405.11 8180.0 21640.5 93318.5 30727.02 6791.5 78585. .4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 201 .1 98410.12 0938.1 3171.01 1453.01 0612.4 0863.01 3243.6 8573.2 59U 0326.12 5765.01 3243.0 LAUDISER 3106.5 5149.02 9653.01 0612.8 9463.31 3817.05451.3 6947.4 6713.0 Y 584 484 384 284 184 T 5 4 3 2 1 sbO TES ATAD TUPTUO TSACEROF 8736.9 7290.0 7999.. 8736.16022.4 8724.12 0912.5 7837.01 5371.12 7044.164820. .01 1037.5 9585.1 98410.5 5089. .01 2927.1 90673.18800.01 0669.1 6932.12776.7 6301.04476.01 9072.18800.0 TSACEROF 0297.5 4318.1 98410.1 9410.01 1668.8 0047.

0 6000.0 2.1RA 748.038042.326.1RA 1. IDENTIFY VAR=LKINS(1) CROSSCOR=(LGOLD(1)).0 387.17. The differenced data should suffice here even though nonstationarity is probably caused by the 365-day seasonal periodicity in flows.41 erudecorP AMIRA ehT 1. AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw ataD wolF fo smhtiragoL gnizylanA gaL 3 2 1 1 |t| > rP xorppA 7920.0noitamitsE doohilekiL mumixaM eulaV t 71.0 24480. The goal is to relate flow rates at Kinston to those at Goldsboro.244.1AM retemaraP 3. These data include 400 daily observations.202 SAS for Forecasting Time Series In addition to generated data.0455.1 49378.0 000. Taking differences of the logarithmic observations produces ACFs that seem well behaved. IDENTIFY VAR=LGOLD(1) NOPRINT.1AM 473.0 619930. RUN.61 78.1RA 1. logarithms of flow rates for the Neuse River at Goldsboro. The results are shown in Output 4. and 30 miles downstream at Kinston.1 547.0 1.1AM 71. North Carolina.047092.1RA 1.0 87850.841197991. North Carolina.0000.0763.1RA 455.0547.1RA 2.1RA 2. You can obtain a model for the logarithms of the Goldsboro flow rates by using the following SAS statements: PROC ARIMA DATA=RIVER. Obviously.1 748.0 1000.0 763.0 473.4 tuptuO . causing the ACF to die off slowly.1 387. ESTIMATE Q=1 P=3 METHOD=ML NOCONSTANT MAXIT=100. the flow rates develop a seasonal pattern over the 365 days in a year.0000.231493.< 3. TITLE 'FLOW RATES OF NEUSE RIVER AT GOLDSBORO AND KINSTON'.1 etamitsE 42711. are analyzed.0 76470.< 1000.0 NOTSNIK DNA OROBSDLOG TA REVIR ESUEN FO SETAR WOLF setamitsE retemaraP fo snoitalerroC 993 834.0 slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV rorrE dradnatS 49350.1RA 1.1RA 000.0 retemaraP 3.

*| .0 850.0500.43 81.0 220.00160400.45402.0 517460.0 343360.0610.03613300. *| . |*** | .0320.0 740.0 7086.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 203 .0 ecnairavoC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 1 993 324251.0 7437.0 65130.0 1173.0270.0 994660.0 040.0 902170.0300.91 82.0 070560.0 7824.0 qSihC > rP 44 83 23 62 02 41 8 2 FD 12.0 470560. |*** | .0 00000.0 810.04505200.09054300.35841.0560. |*** | .08471.0660.0 170.0420.0 9186.0980.71511. | .48701.0500.0 360050.1 noitalerroC 7174100.0 470.0 erauqS -ihC 84 24 63 03 42 81 21 6 gaL oT :1 rotcaF --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA )deunitnoc( AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw ataD wolF fo smhtiragoL gnizylanA 71.**| .0 31337000.0 320.0 5242100.0 7905. | .1 :1 rotcaF srotcaF egarevA gnivoM )3(**B 42711.0140. | .0020.1 srotcaF evissergerotuA .35061. | .0 230.0 996960. |* .0420.0 540.0 920.908170.0 250.0 476170.0 84350.0910.0240.0 100.0700.05558.06927300.41 76.0 800.22 91. |**.0080.1 .ledom siht ni mret naem oN 1 gnicnereffiD fo )s(doireP DLOGL elbairaV rof ledoM 140. | .0 0 rorrE dtS | .0 477170.27021.06408200.0 590.0 371960.0 824070.0700.0120. |********************| | | | | | | | | | | | | | | | | 43360.0 500.00257400.8 77.0 2053400.07522200.0100.0 400.0 + )2(**B 47092. |**** | . |**. |*** | .0410.0 125560.0020.68010.0 520.06576200.23 81. | ***********| . |**.62 51. | .0 750860.0 600.0 + )1(**B 38042. | ****| .0 42781.04252000.0 1 gnicnereffid yb detanimile )s(noitavresbO snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM gnicnereffiD fo )s(doireP SNIKL = elbairaV fo emaN )1(**B 49378.0 537210.47241.0 41845.0 . | . | .0 5557.0 210.0 332320.0 040.0 230.0 010.0 600.0 508600.0 170.08590.

|*.041845. |*** **| .089050. .074820. . .0- 750.0 230.0845.212 98. .< 1000. . |*. |** . . . . |** **| .073360. | | | | | | | | | | | | | | | 34610.0101.083260.050. .0- 960.< qSihC > rP 42 81 21 6 FD 18. |*.0 350.0690.087062.0801.080140.0 941. |*. | .038550.132 14.0- 030.0 341. .222 04.4 tuptuO 204 SAS for Forecasting Time Series .0502.0 48161.062420.0 47400. |*.0 37040.0 670.0 93075.094701. |*.071001. | .0 470.008590. . . |*********** | | | | | | | | | | | | | | | 57271.066421.0 20550.0 360. | .0 470.0 121.0 40631. . . | . |** .< 1000.*| .< 1000. .*| .0781. .*| .006980.0 19050. .0 20100.046600.0noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI )deunitnoc( AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw ataD wolF fo smhtiragoL gnizylanA 71.0110.*| .0 62510. . |*** *****| .089830.0161.351 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | | | | | | . | .*| . .0 571.0 200.076780. . |*** ***********| .0 97950.0 noitalerroC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | | | | | | | | | .0 511. |** .0 1000. | .0 48700. . | .

0 05830. *******| .08580.93300.*| . . . | .*| .decnereffid neeb sah DLOGL elbairaV )deunitnoc( AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw ataD wolF fo smhtiragoL gnizylanA 71. .73140. .0 1092100.0 98620. .0 30029000. . .0 2892100.*| .09462400.0 00710.0 15920.0 33200. | .| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . ***| .0 95857000.0 05050.denetihwerp neeb evah seires htoB 705930.00775000. | . .034530000.0 01816000. **************| .059344000. | .0 91050. . .0 08910.0 92930.54220. |*.0 32021000.05360100. | .0 86400. |** .00351200.0 6467100.*| . . . | .0 588710. | .0 77596.77050.72710.0 97530. .0 0852000.08714000. | . | . . . | . | .0 9950000.0 30734000. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 23310.0 527610. |*. |** . | . . .0 50420.0 00163. . .*| .0ecnairavoC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 0 123456789011121314151gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1- snoitalerrocssorC . .noitalerroC 34243000. .03780000.0 1 993 1 DLOGL seires demrofsnart fo ecnairaV SNIKL seires demrofsnart fo ecnairaV gnicnereffid yb detanimile )s(noitavresbO snoitavresbO fo rebmuN gnicnereffiD fo )s(doireP DLOGL dna SNIKL fo noitalerroC .04502200.00503100.32710.0 92413000.83100.0 32210.0 5972900.*| . . .0 1010100.67380.0 9805000.0 24000. .0 56860.0 91196000. . | . |*.29561.018244000.0 10772000. | .0 58010000.0 40010.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 205 . | .0 87010.52610. |*.0 27989000. | .

0710.0 070.0150.1 srotcaF evissergerotuA srotcaF egarevA gnivoM retliF gninetihwerP 340. -------------------snoitalerrocssorC-------------------- 310.0110. but the autocorrelation check indicates that the error is not white noise.0 210.< :1 rotcaF FD 42 81 21 6 erauqS -ihC 58.206 SAS for Forecasting Time Series The output from the ESTIMATE statement shows a reasonable fit.942 93.0 050.0 631.18.662 88.0 930. Diagnostics from the PLOT option are used to identify an error model.0 130.0 163.0 680.0 720.1 .0 696.0 seireS neewteB kcehC noitalerrocssorC 910. 1− t X) Bθ − 1(C Results are shown in Output 4.0 . with little other effect. The cross-correlation check looks reasonable.0 960.0 )deunitnoc( AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw ataD wolF fo smhtiragoL gnizylanA 460. RUN. Cross-correlations from the second IDENTIFY statement show that a change in flow rates at Goldsboro affects the flow at as a transfer Kinston one and two days later.1 :retlif gniwollof eht yb denetihwerp neeb evah selbairav htoB 100.362 05.0 + )2(**B 47092.0 150. Add the following SAS statements to the code above: ESTIMATE INPUT=(1$(1)LGOLD) PLOT METHOD=ML.842 71.< 1000.0 + )1(**B 38042.4 tuptuO gaL oT 32 71 11 5 .0420.< 1000.0 )3(**B 42711.0:1 rotcaF qSihC > rP 1000. This also implies that t statistics for the model parameters are computed from improper standard errors.0500.0 )1(**B 49378.0 710.< 1000.0 310. This suggests function.

731 94.79 51.0180.0990.0 940.0370.0860.< 1000.0880.0 400.0 240.0960.1 014.0051.< 1000.1MUN 1MUN UM DLOGL DLOGL SNIKL retemaraP elbairaV setamitsE retemaraP fo snoitalerroC 793 798.0780.0 320.67 erauqS -ihC 84 24 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.0 slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC 1 1 0 tfihS DLOGL DLOGL SNIKL elbairaV 1 0 0 gaL 1000.0360.0- 650.0 eulaV t 60120.< 1000.251 81.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 207 .0450.1MUN DLOGL 014.028337580.0240.0 650.0290.0 500.0 961.0 1.0 140.< 4956.0240.450.0 898100.0- 821.< qSihC > rP 84 24 63 03 42 81 21 6 FD 42.< 1000.0- 310.0 260.0 440.1MUN 1MUN UM retemaraP noitamitsE doohilekiL mumixaM erudecorP AMIRA ehT NOTSNIK DNA OROBSDLOG TA REVIR ESUEN FO SETAR WOLF noitpO TOLP eht hguorht ledoM rorrE na gniyfitnedI :setaR wolF gniledoM 81.0 rorrE dradnatS 73822.< 1000.0 840.0 |t| > rP xorppA 48.0 53700.411 15.1 UM SNIKL 1.78 04.0010.02 44.021 79.0 310.0 350.0 591.0260.0 020.090134.0950.01MUN DLOGL 020.0130.< 1000.0 6798100.0950.808948.0 601.0 041.0- 301.0 810.131 53.0- 810.0630.0513.0164.1 810.0930.0 320.< 1000.0910.0 000.0 etamitsE 1.0 4503400.0000.0330.0 330.0 70120.0 1000.0501.< 1000.

.0 16730. ****| .0 610750.08087000.| | | | | | | | | | | | | | | | | . |****** | | | | | | | | | | | | | | | | | 25390.24041.16210.0 56182. |*.00535000.0 12160. |** | .0 ecnairavoC 42 32 22 12 02 91 81 71 61 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 0 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1- slaudiseR fo tolP noitalerrocotuA )deunitnoc( noitpO TOLP eht hguorht ledoM rorrE na gniyfitnedI :setaR wolF gniledoM 81. **| .0 269950.32601. .01546000.*| .0 1053700.*| .07290000. |********************| | | | | | | | | | | | | | | | | | | | | | | | | | 41960.0 25034000. .0 190060. | **| . .*| . *| .0 403550." 126260.*| .0 089060.015762000.10330.0noitalerroC 71 61 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI srorre dradnats owt skram ".077651. **| .21320. | . |**** | . |* .0 86850.04242000.0 42576000.0 775260. | . |** | ******| . .0 33240. ***| .0 479850. .0 688950.54500. |** | . | .0 90530.09377000. |*.0 6795000. |* .0 259450.031510. .*| . . |** | .08534100. | . .43591.0 58601.0 061060.0 82134000. | .0 489060.00040000.0 747850. **| . |*. | .0 644950.02142100.04630.68861.0 583260. | .01230100.07242000.0 55000.*| .05713200.0 4001100. | . |** ***| .059290.0 00000. |*. | .0 527950.0 480060.0 325260. | .80450.0 511060.67780.89230. |*** | .0 311060.0 61113000.*| . | . | .0 98802.0 374160.0 10430.*| . | ***| . | .0 10870.0 981050.0 78190. | .*| .0 621160.97270. |*** | . | . | .0 03180.0 55121.13513. | .03501.1 noitalerroC 2805000. | .0 1570000.053471.00071000.0 27941.0 53454000. | .0 12010.4 tuptuO 208 SAS for Forecasting Time Series .035793000.0 75850.0 92070.0 0 rorrE dtS | . **| .0 94650. | .0 28160.0 262850.

0720. |** . | .0 700.077770.0630. .*| .048702.0 2523. .0 99900.0 110.0 48320.0 49270.12 11.0 3913.0 760.0- 440.0 3955. .0 360.059190. | .0140.4 erauqS -ihC 74 14 53 92 32 71 11 5 gaL oT -------------------snoitalerrocssorC-------------------- DLOGL tupnI htiw slaudiseR fo kcehC noitalerrocssorC | | | | | | | | | | | | | | | | | | | | | | | | .086070.0410.0 020.0621. |**** ******| .0 830.0 2022.0 101. . | .0 560.0 89680.0610.0 010.068310.0550. **| . . | . . |*.0740. |*** .0 910. |** . . | .0540.0 260. . | | | | | | | 89900.0720.0 320.0 noitalerroC 42 32 22 12 02 91 81 71 61 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP | | | | | | | .0670. | .0 20400.004280.05 07.0 600.44 21.060740.42 41. . |** . |*** .068111.33 77. |*.0 84751. |*.0700.*| .0 500.0 390.0 3735.0210.0 12870. . |** .020270.0- 750.0 4104.0560. . |** .057930. |*.0360.0 55890.0 800.0 650. |** .050320. .0200.0520.0 330.0 80530.0 10330.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 209 .0110.013910. |** .0700. | .0 3035.014431.0510. |*. .0 42 32 22 12 02 91 81 )deunitnoc( noitpO TOLP eht hguorht ledoM rorrE na gniyfitnedI :setaR wolF gniledoM 81. .064070.097680. .0630.0840.*| .11 80.0170.039670.0 5434. . | | | | | | | | | | | | | | | | | | | | | | | | 70310.0 240.0041.330.0 420.074360. **| . | . .0 270.*| .72 40.013513.059710. | .0 qSihC > rP 74 14 53 92 32 71 11 5 FD 38.

0 1 1 DLOGL SNIKL elbairaV rof ledoM srotcaF rotaremuN gnicnereffiD fo )s(doireP tfihS elbairaV tupnI gnicnereffiD fo )s(doireP tpecretnI detamitsE 1 rebmuN tupnI − + 1− 1( t t e) DLOGL 2 B36974. Output 4. :1 rotcaF ∇ ) B55.4 tuptuO . − 1( / = t SNIKL ∇ 81. + B52361. )deunitnoc( noitpO TOLP eht hguorht ledoM rorrE na gniyfitnedI :setaR wolF gniledoM 1 898100. More insight into the effect of this pure delay is obtained through the cross-spectral analysis in Chapter 7.1) model fits the error term.210 SAS for Forecasting Time Series An ARMA(2. this is an example of a leading indicator. Because you encountered a pure delay. RUN.0 )1(**B 73822.1 + 1( 93594.0 + 90134. although this term is generally reserved for economic data.19 shows the results. and the model becomes ) B7788. Make the final estimation of the transfer function with noise by replacing the ESTIMATE statement (the one with the PLOT option) with ESTIMATE P=2 Q=1 INPUT=(1$(1)LGOLD) METHOD=ML NOCONSTANT ALTPARM.

1RA 1.1AM retemaraP noitamitsE doohilekiL mumixaM erudecorP AMIRA ehT NOTSNIK DNA OROBSDLOG TA REVIR ESUEN FO SETAR WOLF AMIRA CORP :noitcnuF refsnarT laniF eht gnitamitsE 91.1 121.0250.0 8649.0541.0 erauqS -ihC 84 24 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.0 1ELACS DLOGL 240.0000.0 490.0250.0 540.0 530.0 121.0 810.0100.0 530.0 630.1 874.0010.0 850.0460.01 73.1RA 1.0 5063.0210.73 03.0 231.0 0270.0 290.52 eulaV t 04540.1 095.0 801.0020.909704670.0 420.052361.< 1000.0520.0190.0- 820.1MUN 1ELACS 2.0500.1RA SNIKL 190.0621.0 700.0 200.< 1000.0 810.0 300.0 5462.0 46540.0 64050.0 240.0 000.0 320.0530.1RA SNIKL 790.0 874.0 790.0 500.0 010.0 2.1MUN 1ELACS 2.0020.1RA 1.0 400.2138.0840.32 23.0340.0 3071.0 74810.0- 111.0800.< 1000.0 slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV 1 1 0 0 0 tfihS DLOGL DLOGL SNIKL SNIKL SNIKL elbairaV 1 0 2 1 1 gaL 1000.0540.0 etamitsE 1.0 440.0 6443.0 650.0- 450.33 01.0 840.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 211 .0 000.1 1.0 030.1MUN DLOGL 095.0 621.0000.0 36974.0 60530.93 66.0 4781.0100.01.0801.13 40.74 04.0 1.62 15.0150.1AM DLOGL DLOGL SNIKL SNIKL SNIKL retemaraP elbairaV setamitsE retemaraP fo snoitalerroC 793 84.0650.0 816.1RA 1.< |t| > rP xorppA 21.0 810.093594.1 816.1 67788.0 838500.0650.1AM SNIKL 1.988993.010.0 500.0 500.0 2254.0 qSihC > rP 54 93 33 72 12 51 9 3 FD 87.0 rorrE dradnatS 62055.0 440.0 910.02 70.< 1000.

0 520.6 erauqS -ihC 74 14 53 92 32 71 11 5 gaL oT -------------------snoitalerrocssorC-------------------- DLOGL tupnI htiw slaudiseR fo kcehC noitalerrocssorC )deunitnoc( AMIRA CORP :noitcnuF refsnarT laniF eht gnitamitsE 91.0 440.)1(**B 62055.0 260.0200.0300.1 :1 rotcaF srotcaF egarevA gnivoM )2(**B 36974.0580.0 0561.0 800.0 800.0 910.0 200.33 79.0040.0- 960.0 8202.0 040.0 150.0300.0 6030.0740.0 980.0830.0 420.0100.0300.0 + 1 :1 rotcaF srotcaF rotaremuN 493594.0 001.0 840.1 .0350.0650.04 84.0540.0430.1 srotcaF evissergerotuA :1 rotcaF .ledom siht ni mret naem oN 1 gnicnereffiD fo )s(doireP SNIKL elbairaV rof ledoM 710.0780.0600.0 010.0 880.0 1 1 DLOGL rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP tfihS elbairaV tupnI 1 rebmuN tupnI )1(**B 67788.0 .0130.0 970.0440.55 06.0450.0 140.4 tuptuO 212 SAS for Forecasting Time Series .0 380.0- 4761.92 21.0401.82 59.0 031.0 620.0 qSihC > rP 64 04 43 82 22 61 01 4 FD 41.0 + )1(**B 52361.0 240.0630.0 5812.0 0431.0 2911.0830.0600.0 201.0 5071.84 85.0 230.0 810.41 14.

4. 6. you see that ratios of polynomials in the backshift operator B can provide interesting approaches to new levels.4 Case 3B: Intervention ( XY esion + Xβ + α = 1− Yρ − Y + t X) esion + Xβ + α = Y t Bρ − 1( / β + ′ α = esion + β + α = Y esion + α = Y β + ′α = t t t t t t t at time 21. to identify transfer function form (IDENTIFY). Fit transfer function with noise model (ESTIMATE). 5. . If the model is you have through time 20 and or esion At time 21. Identify and estimate model for input X (IDENTIFY. 2.Chapter 4: The ARIMA Model: Introductory Applications 213 Follow these steps in case 3 to complete your modeling: Suppose you use as an input Xt a sequence that is 0 through time 20 and 1 from time 21 onward. X21=1 and the previous Xs are 0. ESTIMATE). so At time 22 you get Yt eventually approaches ) if you ignore the noise term.4 1. You can also write ) β + α ot α morf ( after time 20. 4. Y experiences an immediate level shift the model to ygetartS gniledoM fo yrammuS 4. Prewhiten Y and X using model from item 1 (IDENTIFY). PLOT).3. Compute cross-correlations. Fit transfer function and compute and analyze residuals (ESTIMATE. + ρ − 1( / β + ′ α = ) . + 2ρ + ρ + 1( β + ′ α 2− t X 2 ρ+ esion + )ρ + 1( β + ′ α = 22Y 1− t X ρ esion + β + ′ α = 12Y + t X( ) ρ − 1(/α = ′ α where (the expected value of Y when X is 0). Thus.3. Forecast X and Y (FORECAST).3. .. (j). esion +) .. Thus. 3. Now change t Y Y .

20 Plotting Intervention Models . Therefore. Output 4. impulse-response weights are not proportional to cross-covariances.214 SAS for Forecasting Time Series When you use an indicator input. Several such response functions for Xt=1 when t>20 and 0 otherwise are shown in Output 4.20. you cannot prewhiten. You make the identification by comparing the behavior of Yt near the intervention point with a catalog of typical behaviors for various transfer function forms.

Chapter 4: The ARIMA Model: Introductory Applications 215 Output 4.20 Plotting Intervention Models (continued) .

20 Plotting Intervention Models (continued) .216 SAS for Forecasting Time Series Output 4.

Chapter 4: The ARIMA Model: Introductory Applications 217 Output 4.20 Plotting Intervention Models (continued) .

1978).218 SAS for Forecasting Time Series Output 4.20 Plotting Intervention Models (continued) Output 4. . Ohio (McSweeny.21 shows calls for directory assistance in Cincinnati.

. You check the pre-intervention data for stationarity with the code PROC ARIMA DATA=CALLS. WHERE DATE < '01FEB74'D.22.21 Plotting the Original Data Prior to March 1974 directory assistance was free. Tests with 12 and 13 lagged differences are requested in anticipation of seasonality. none of the other tests could reject a unit root either. however. RUN. With this information you see that only the unit root tests with 12 or more lags are valid.12. but from that day on a charge was imposed. which may be an anticipation effect. IDENTIFY VAR=CALLS STATIONARITY = (ADF=(2.13) ).5693 is not too close to 1.3. Below this are the chi-square checks for a seasonal AR model for the first differences. The data clearly show an upward trend. The data seem to show an initial falling off of demand starting in February. Only the trend tests are of interest since there is clearly a trend. The fit is excellent and the seasonal AR parameter 0. ESTIMATE P=(12) METHOD=ML.Chapter 4: The ARIMA Model: Introductory Applications 219 Output 4. IDENTIFY VAR=CALLS(1). Some of the results are shown in Output 4.

0 9999.369.11 70.384.22 Unit Root Tests.0 1902.0 7305.0 3868.0- F 64.0 111.0 200.0 600.4 48.61 01.077 per month.138071.0760.5 07.0 8880.0810.0 9841.1 .0510.0 7832. 0β β .0.1 280.0 920. The first time is 1.0 930.6 17.0 −t FD 32 71 11 5 sgaL 31 21 3 2 erauqS -ihC 46.0- F > rP 4690. The code is as follows: t ------------------------------------------------------------------------------- ---------------snoitalerrocotuA--------------- 940. The intervention variable IMPACT is created.0 760.0 SLLAC elbairaV rof ledoM srotcaF evissergerotuA 0 = 0β uaT 81. you try the same seasonal AR(1) error structure and check the diagnostics to see if it suffices.2- erudecorP AMIRA ehT gnicnereffiD fo )s(doireP naeM detamitsE 820.0 021.0560.1 slaudiseR fo kcehC noitalerrocotuA β − 0β )21(**B 43965.0530. Since the majority of the drop is seen in March. RUN.0 5400.4 73. so calls tend to increase by 1. ESTIMATE INPUT = ((1)IMPACT) P=(12) METHOD=ML.0580.81qSihC > rP 3628.220 SAS for Forecasting Time Series Output 4.0590.0060.0 1547. the effect is and after that both and X 1 will be 1 so that the effect is You anticipate a negative A test that is a test for an anticipation effect.0 1158. Pre-intervention Calls Data stseT tooR tinU relluF-yekciD detnemguA PROC ARIMA.0 uaT < rP 4290. t X )B1 epyT gaL oT 42 81 21 6 β − 0β( . and a larger-in-magnitude and positive Motivated by the pre-intervention analysis.0 .1 :1 rotcaF β ohR 6393.0 1 553770.0 8733. having value 1 from February 1974 onward.0- ohR < rP 9999.2 t X t X dnerT .240.0 100. you fit an intervention model of the form where is the IMPACT variable at time t.0 A first difference will reduce a linear trend to a constant.3 X 941.25 2981.0910.0030.421 6311. IDENTIFY VAR=CALLS(1) CROSSCOR= (IMPACT(1)) NOPRINT.0 2521.0 400.0760.

0 2436.0 510.qSihC > rP 501.0 420. Because the model has a unit root.0840.1RA UM gaL oT 03 42 81 21 6 erudecorP AMIRA ehT .0011.0 8156.3 retemaraP 1.0- YAD REP SLLAC EGAREVA YLHTNOM .305 496972.0880.0261.02 20593. The drop of –123 in calls the month prior to the charge is significant. It also explains why the standard error for mu is so large. that is.0 6887.0 220.Chapter 4: The ARIMA Model: Introductory Applications 221 It is seen in Output 4.22 38.0 890.0550.2 120.91 74.2 FD 92 32 71 11 5 erauqS -ihC 37.0520.0610.< 1000.11 19.91 40.7 34.0 100.23 that all terms except mu are significant. An additional drop of 400 leaves the calls at 523 below the previous levels.0 390.0 slaudiseR fo kcehC noitalerrocotuA 871 90.0 2138.0 901.0030.0 9027.0slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC 07243.0900.0- TCAPMI TCAPMI SLLAC SLLAC 620.0 120.0 610. with random walk errors it is difficult to accurately estimate the drift term.< 1000. The trend part of the fitted model is overlaid on the data in Output 4.0850.22 9297.0 640. the model seems to capture the intervention well and seems poised to offer an accurate forecast of the next few values.24.02 04760.0 36823.0600.1MUN 1MUN 1. Output 4.0620.0 910.0 etamitsE 22196.0 07. so there was an anticipation effect. Despite this.004 16881.6 18.0 260.ECNATSISSA YROTCERID 1 0 21 0 520.23 PROC ARIMA for Calls Data tfihS elbairaV gaL 0 0 0 0 ------------snoitalerrocotuA------------.0 97688.< 9914. the data can wander fairly far from this trend.0920.9161 33544.2361 363.0 860.686. and this indeed happens.32154054.1 noitamitsE doohilekiL mumixaM |t| > rP eulaV t rorrE xorppA dradnatS 1000.

Recall that even the historical data have produced some notable departures from trend. RUN. Adding other predictor variables. DATE = INTNX('MONTH'. The intervals are quite wide due to the unit root structure of the errors. FORECAST=. PROC ARIMA... The code below produces the plot in Output 4. PROC GPLOT DATA=GRAPH. might help reduce the size of these intervals. RUN. FORECAST LEAD=24 OUT=GRAPH ID=DATE INTERVAL=MONTH. SET CALLS EXTRA. THEN DO. DATA GRAPH. you extend the data set with missing values for calls and set the intervention variable to 1. ESTIMATE INPUT = ( (1) IMPACT ) P=(12) METHOD=ML NOPRINT.. IDENTIFY VAR=CALLS(1) CROSSCOR=( IMPACT(1) ) NOPRINT. like population or new phone installations.24 Effect of Charge for Directory Assistance To forecast the next few months. END. but the predictors would need to be extrapolated into the future. assuming the charge will remain in effect.25. DO T=1 TO 24.T). RUN. IMPACT=1. TITLE ``FORECASTED CALLS''. DATA ALL. OUTPUT. U95=. DATA EXTRA. SET GRAPH. Note how the forecasts and intervals for the historical data have been deleted from the plot.'01DEC76'D. IF CALLS NE . L95=. END. RUN. SYMBOL1 V=NONE I=JOIN R=4. PLOT (CALLS FORECAST U95 L95)*DATE/OVERLAY. RUN. .222 SAS for Forecasting Time Series Output 4.

t e) 21 B 1. The airline model is then there is often a good first try when seasonal data are encountered. seasonal dummy variables were fit to the first differences of quarterly sales.4. introducing double subscripts to indicate which factor and which lag within that factor is being modeled. 2 θ − 1()B θ − 1( = . This is an example in which the airline model seems a good choice at first.25 Forecasts from Intervention Model 4.4 Further Examples 4. Here the full monthly data (from which the quarterly numbers were computed as averages) will be used. The models discussed in this section potentially provide an alternative approach. 2 1. has been taken.1 = θ 1. Likewise. Recall that when a first difference is found. a multiplicative moving average structure. As in the IBM example in Section 3. The airline model just discussed will be written here as .Chapter 4: The ARIMA Model: Introductory Applications 223 Output 4.7. Now if.)21()1( =Q 31− t 21− t 1− t t . Thus the forecast is influenced somewhat by all past patterns but most substantially by those of the most recent years. You can think of these moving average terms as somewhat mitigating the impact of the rather heavy-handed differencing operator. specified by ESTIMATE often works well when the first and span 12 difference. (Y – Y ) – (Y –Y ). that is. the fitting of these moving average terms causes forecasts to be weighted averages of seasonal patterns over all past years where the weights decrease exponentially as you move further into the past. This double-subscript notation corresponds to PROC ARIMA output. but later runs into some problems.1 t Y) B − 1()B 21 − 1( . for example.1 North Carolina Retail Sales Consider again the North Carolina retail sales data investigated in Chapter 1.4. Recall that there the quarterly sales increases were modeled using seasonal dummy variables. often a moving average at lag 1 is appropriate.

PROC ARIMA DATA=NCRETAIL . Because of the autocorrelation function will have spikes at lag 12. and first and seasonally differenced series. However. first differenced series. Consider a model and has some ARIMA structure. tZ) B = t S 21 t S − 1( t t Z + S+µ = Y S . IACF. If it does. considering a model outside the ARIMA class. plots with rows representing original. TITLE2 “IN MILLIONS”.1 θ − 1( = t 21− t t Y− Y Y)B t − 1( t Z 1− t t Z S− S t . and PACF have been saved with the OUTCOV=option.224 SAS for Forecasting Time Series cancellation on both sides of the model and it reduces to Surprisingly. (1). )21. IDENTIFY VAR=SALES(1. The ACF.12) OUTCOV=SEAS NLAG=36. You issue the following SAS statements to plot the data and compute the ACF of the original series. estimates of the coefficient of will be forced toward the unless moving average boundary. this can happen even with strongly seasonal data.27 uses this with SAS/GRAPH and a template to produce a matrix of differenced data and columns representing. RUN.1( 21− tS . Note that forms an exactly repeating seasonal pattern. This overdifferencing often results in failure to converge. the ACF. PROC GPLOT DATA=NCRETAIL. and PACF. RUN. as will that of the ordinary first differences since is also periodic. and from left to right. as it will for the retail sales. perhaps even having unit roots. TITLE “NORTH CAROLINA RETAIL SALES”. IACF. as would be modeled using dummy variables. IDENTIFY VAR=SALES OUTCOV=LEVELS NLAG=36. the span 12 difference will involve and has a unit root at lag 12. te)B t 1.26. 2 1− Z t The data plot is shown in Output 4. Output 4. PLOT SALES*DATE/HMINOR=0 HREF='01DEC83'D '01DEC84'D '01DEC85'D '01DEC86'D '01DEC87'D '01DEC88'D '01DEC89'D '01DEC90'D '01DEC91'D '01DEC92'D '01DEC93'D '01DEC94'D. IDENTIFY VAR=SALES(1) OUTCOV=DIFF NLAG=36. it suggests where .

F T AM E Y L Chapter 4: The ARIMA Model: Introductory Applications 225 Output 4.27 Computing the ACF with the IDENTIFY Statement: PROC ARIMA .26 Plotting the Original Data Output 4.

28.21 34.0eulaV t slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC 99668. Such a structure also serves as a check on the differencing. with the ACF spikes at 1 and 12 indicating MA terms at lags 1 and 12.0 50956. you try a multiplicative structure even though the expected side lobes at 11 and 13 (that such a structure implies) are not evident in the ACF.0 78925. indicating a first differencing. Heeding the remarks at the beginning of this section.38 79950.0 63147.0681 81.131 508.1AM UM retemaraP noitamitsE doohilekiL mumixaM erudecorP AMIRA ehT .2581 3462.0etamitsE 1. .degrevnoc evah ton yam setamitsE :GNINRAW .degrevnoc evah ton yam setamitsE 8 100.0 10000. The Q statistics and ACF on the SALES(1.elbatsnu si setamitse wen eht yb denifed ledom ehT :GNINRAW erutcurtS AM evitacilpitluM eht gnittiF 82.12) differenced variable indicate that some MA terms are needed.< 6666.detanimret neeb sah ssecorp noitareti ehT .021 1 0 gaL 5099. The results are in Output 4.052 42.1 rorrE dradnatS 97999.0 90.0 setamitsE ni egnahC evitaleR mumixaM 3 doohilekiL mumixaM egasseM gninraW snoitaretI atleD noitabrutreP evitavireD laciremuN tneiciffeoC adbmaL s'tdrauqraM eulaV noitcnuF evitcejbO noitcnuF evitcejbO noitaretI tsaL morf egnahC erauqS-R tneidarG fo eulaV etulosbA mumixaM eulaV airetirC eulaV gnippotS noitaretI airetirC noitanimreT detamitsE sretemaraP dohteM noitamitsE yrammuS noitazimitpO noitamitsE AMIRA .2AM 1.0 |t| > rP xorppA 10.0 63.0 1000.4 tuptuO 226 SAS for Forecasting Time Series to the above code requests that maximum likelihood estimates of the multiplicative MA be fitted to the first and span 12 differenced data. as you will see. indicating a possible span 12 difference. Adding ESTIMATE Q=(1)(12) ML.645563 42872.96 100. The original ACF shows slow decay.23626 50956.0 8.329doohilekiL naissuaG goL 14931. The plot of the data displays nonstationary behavior (nonconstant mean). The ACF of the differenced series shows somewhat slow decay at the seasonal lags.

0711.Chapter 4: The ARIMA Model: Introductory Applications 227 In Output 4.0411.0300.1 50956.0 640. You interpret is 0.1 δ .0 selas elbairav rof ledoM srotcaF egarevA gnivoM 1.1 980. your model is Letting t t 1− t t Z∇ + S∇ δ + + S∇ δ + S∇ δ + ) ∇( β + α∇ = Y∇ ∇ Using to denote a first difference.1 11 570.0 740.0 1.2.000.11 S δ+ UM 711.1 )deunitnoc( erutcurtS AM evitacilpitluM eht gnittiF 470. That scenario is consistent with all that has been observed about these data.22 61.tβ + ) 1δ + α( Y is that is. the standard error on the lag 12 coefficient is extremely large.0 131.0 230.0 gnicnereffiD fo )s(doireP naeM detamitsE Z+ 620. 2 retemaraP qSihC > rP 3850.0740. 1 δ . and the estimate itself is almost 1.0 361. write the model at time t and at time t. You can think of a near 1.0 100.0- :2 rotcaF :1 rotcaF + S δ + S δ + tβ + α = Y t. a possible explanation is that the seasonality by seasonal dummy variables. indicating a possibly noninvertible model.0 2850.1AM UM t . through denote monthly indicator variables (dummy variables).4 tuptuO β+ α .0 410.0502. the expected value of 731. for December.0 260. The dummy variables can be incorporated in PROC ARIMA using techniques in Section 4.28.1 502.0511.21 t.0 2 1. you see that there seems to be a problem. questionable. at best.33 69.1AM 980.0- t. each t Z where.11 11 .0 9411. The procedure had trouble converging.2AM 1.0 650.1 1 t t j δ similar values allow shifts for the other 10 months up through November.9 t .0 511.0- 21.1 FD 22 61 01 4 S 1 erauqS -ihC 62.0410.0- setamitsE retemaraP fo snoitalerroC slaudiseR fo kcehC noitalerrocotuA S )21(**B 97999. from your previous modeling. Of course.0 900. is a shift in the trend line that is included for all January data and tj S as a “December line” in that.s δ sales are always relatively high.1 S t gaL oT 42 81 21 6 82. you anticipate that all these t.00 moving average coefficient at lag 12 as trying to undo the span 12 differencing.0 .61 21.0112. Because Christmas and especially will be negative. Returning to the discussion at the opening is regular enough to be accounted for of this section.0 021.0 000. t ---------------snoitalerrocotuA--------------- seems to have a (nonseasonal) unit root. trying to make inferences when convergence has not been verified is. The first difference plus dummy variable model of section 1 did seem to fit the data pretty well.0 . 2 2 t.1 )1(**B 63147. For January.2AM 000.0 780. then subtract to get .0 0590.0 571.

IDENTIFY VAR=SALES(1) CROSSCOR = (S1(1) S2(1) S3(1) S4(1) S5(1) S6(1) S7(1) S8(1) S9(1) S10(1) S11(1) ) NOPRINT.0 1500.0 3000.0 1000.< 1000.30.59 42521.433.228 SAS for Forecasting Time Series Now is stationary if has a unit root.524.1RA 1.46263549.587.< 6200. The following code produces Output 4.04411756.28 91463.24669197.206.42477203.29 92450. SYMBOL2 V=NONE I=JOIN C=BLACK L=2 R=2 W=1.208.< 1000.09 36049.67454284.69326606. the model will be specified in first differences as .410.1AM UM t Z∇ .1) and plots forecasts. Note that the seasonal indicator variables can be generated without error and so are valid deterministic inputs.39 13763.49 41068.383.1RA 1.88 06135.29014.29 and Output 4.0 41328.1 The parameters have the same interpretations as before. SYMBOL3 V=NONE I=JOIN C=BLACK L=1 R=1 W=2.5 + t. FORECAST LEAD=24 OUT=OUT1 ID=DATE INTERVAL= MONTH.62 t.18 77329.< 3710.4 11 rorrE dradnatS 50216.17346136. This code fits the model with specified as ARMA(2. RUN.1 1 92. 2 S∇ δ + S∇ δ + β = Y∇ tj S 2 t Z etamitsE 81845. The data set had 24 missing values for sales at the end with seasonal indicator variables nonmissing. PROC ARIMA DATA=NCRETAIL.0 1000. and Since errors should be stationary for proper modeling in PROC ARIMA. PROC GPLOT DATA=OUT1. t Z∇ tfihS 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 = )1 − ( − = ∇ elbairaV t 11S 01S 9S 8S 7S 6S 5S 4S 3S 2S 1S selas selas selas selas t t gaL 0 0 0 0 0 0 0 0 0 0 0 2 1 1 0 selaS liateR aniloraC htroN rof ledoM lanosaeS noitamitsE doohilekiL mumixaM |t| > rP xorppA 1000.78 20495.< 1000.1161.1183.429.0 55141.0 48041.< 1000.039605.< 1000.76421805.0 09098. RUN.< 1000.860111892.1102.< 1000.09 46154.0 = α − α = α∇ t t.644.4 tuptuO retemaraP t 11MUN 01MUN 9MUN 8MUN 7MUN 6MUN 5MUN 4MUN 3MUN 2MUN 1MUN 2.98 51363.066693. ESTIMATE INPUT=(S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11) p=2 q=1 ml. PLOT (SALES L95 U95 FORECAST)*DATE/ OVERLAY HREF ='01DEC94'D.707.401.< .< 1000. WHERE DATE> '01JAN90'D.3 55.11 STSACEROF FO SRAEY 2 SELAS LIATER CN erudecorP AMIRA ehT Z∇ + S∇ δ + eulaV t 49. SYMBOL1 V=NONE I=JOIN C=BLACK L=1 R=1 W=1.

0 030.72 80.0 410.0 750.0310.0801.0 .0 1085.1161 3S 31.0 3795.0 861.29011 2S 14.6741 4S 284.932 26.0 040.0 690.0 0773.0 qSihC > rP 12 51 9 3 FD 48.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 229 .0 670.0 120.0 100.06441.0 310.0 020.79375 29854.0 + 1 srotcaF evissergerotuA 1 41328.7 88.2302 100.0 800.8891 875.0 610.0 + )1(**B 66693.1 srotcaF egarevA gnivoM )2(**B 11892.0 430.62 gnicnereffiD fo )s(doireP tpecretnI detamitsE :1 rotcaF SELAS elbairaV rof ledoM 961.0730.6931 5S 706.0 801.86011 1S rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 5 rebmuN tupnI rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 4 rebmuN tupnI rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 3 rebmuN tupnI rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 2 rebmuN tupnI rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 1 rebmuN tupnI :1 rotcaF )1(**B 39605.54 slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC )deunitnoc( selaS liateR aniloraC htroN rof ledoM lanosaeS 92.0 900.0222.0420.0030.0 911.1 erauqS -ihC 42 81 21 6 gaL oT ---------------snoitalerrocotuA--------------- slaudiseR fo kcehC noitalerrocotuA 341 344.549.61 55.

4 tuptuO 230 SAS for Forecasting Time Series .0441 9S 756.4387 1376.772 1528.1497 2137.0996 5173.0218 4069.263 5133.183 8182.4488 1689.2767 8684.1338 2012.7857 3148.9676 tsaceroF 861 761 661 561 461 361 261 161 061 951 851 751 651 551 451 351 251 151 051 941 841 741 641 541 sbO stimiL ecnedifnoC %59 SELAS elbairaV rof stsaceroF 845.2867 9631.7187 1214.843 6193.433 1048.2461 01S 297.9057 2238.3657 8101.2478 1110.9077 9882.8986 0407.6188 2593.7728 5399.9417 0233.7641 11S 805.0208 4403.6428 7839.6507 3504.4107 5686.7257 2331.2617 3718.4338 1800.1408 9975.143 2781.4387 9739.5197 2812.9287 6326.0036 9953.7737 2964.932 rorrE dtS 6688.6877 7204.782 4468.5026 4302.7807 2082.0568 2861.7766 7767.6578 3640.113 4246.4241 8S 303.883 1007.3807 7965.4427 7028.573 6257.1731 7S 236.8118 4772.4733.7628 2712.3028 9340.162 7995.1417 8800.5617 3876.6946 5386.7667 9758.5427 3339.4621 6S rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 11 rebmuN tupnI rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 01 rebmuN tupnI rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 9 rebmuN tupnI rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 8 rebmuN tupnI rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 7 rebmuN tupnI rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 6 rebmuN tupnI )deunitnoc( selaS liateR aniloraC htroN rof ledoM lanosaeS 92.9277 2968.2068 3311.3288 2698.004 8222.8317 2720.7056 5222.3997 2274.072 0269.2239 9261.0018 7281.4077 0316.9327 9534.342 9886.4827 6265.2427 2595.042 0875.863 4501.604 4733.6427 1070.592 4192.4008 3939.5678 8750.1358 5848.8347 6674.7507 8331.5538 1206.493 1210.623 1463.7807 1777.1308 6237.303 7058.5258 1615.0696 0537.913 1795.553 2034.1327 2492.

1. OUTDUM and OUTDIF.Chapter 4: The ARIMA Model: Introductory Applications 231 Output 4. Output 4.2. FORECAST LEAD=24 INTERVAL=MONTH ID=DATE OUT=OUTDIF NOPRINT. you can fit two models both having a first difference. FORECAST LEAD=24 ID=DATE INTERVAL=MONTH OUT=OUTDUM. that have 24 forecasts from the two models. Let one incorporate a seasonal difference and the other incorporate seasonal dummy variables S1 through S12 to model the seasonal pattern. RUN. An equally valid approach is to drop the intercept (NOCONSTANT) and retain all 12 seasonal indicators. ESTIMATE NOCONSTANT METHOD=ML NOPRINT.3) DLAG=12).12) NOPRINT. IDENTIFY VAR=CONSTRCT(1) STATIONARITY=(ADF=(1. This code produces two forecast data sets. ESTIMATE INPUT = (S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 ) NOCONSTANT METHOD=ML NOPRINT. IDENTIFY VAR=CONSTRCT(1) NOPRINT CROSSCOR = (S1(1) S2(1) S3(1) S4(1) S5(1) S6(1) S7(1) S8(1) S9(1) S10(1) S11(1) S12(1) ).2 Construction Series Revisited Returning to the construction worker series at the beginning of Section 4.30 Forecasts from Seasonal Model 4. The data set ALL has the original construction data along with seasonal dummy variables S1 through S12 that extend 24 periods into the future. That approach is used here. .4.30 shows the resulting graph. In Section 4. PROC ARIMA DATA=ALL.2. IDENTIFY VAR=CONSTRCT NLAG=36 NOPRINT.4. IDENTIFY VAR=CONSTRCT(1.1 the December indicator S12 was dropped to avoid a collinearity problem involving the intercept.

The seasonally differenced series gives much wider intervals and a general pattern of decline. The forecasts are quite different.32 shows the results. Hasza. The forecasts and intervals for the span 12 differenced series are shown as darker lines labeled “D. This DLAG=12 option requests a seasonal unit root test. Note the code STATIONARITY=(ADF=(1. The seasonal dummy variables produce forecast intervals that are less pessimistic and. Dickey.31 the forecast data sets have been merged and forecasts 24 periods ahead have been plotted. 24 periods into the future.” and those for the dummy variable model are shown as lighter lines with a dot label on the far right. and the tau statistics give some evidence against the null hypothesis of a seasonal unit root.3) DLAG=12) for the first differenced series.4 tuptuO . Of course. are about half the width of the others. Is there a way to see which model is more appropriate? The chi-square statistics for both models show no problems with the models. wide intervals are expected with differencing.232 SAS for Forecasting Time Series In Output 4.2. stsaceroF ecnereffiD lanosaeS dna ymmuD lanosaeS 13. and Fuller (1984) develop this and other seasonal unit root tests. Output 4.

50657. It appears that.64557. during a time period in which the discovery of high pesticide levels in milk was publicized. although some tainted milk was found in March.4 tuptuO . The second drop suggests a numerator lag and the exponential increase suggests a denominator lag in the transfer function operator.0 1450. the so the forecast for this first and span 12 difference model has forecast August is just this July’s value with last year’s July-to-August change added in. (1998) discuss milk sales in Oahu.34 show the results. IDENTIFY VAR=SALES NOPRINT CROSSCOR=(X). and does more averaging of past seasonal behavior. Output 4. A seasonal pattern was detected. The data indicate April 1982 as the month of first impact.4. Ultimately eight recalls were issued and publicized.290.33 shows a graph with March. with the multiple recalls and escalating publicity. PROC ARIMA DATA=LIU.6- = t Y ˆ sgaL 3 2 1 3 2 1 naeM elgniS naeM oreZ epyT ataD noitcurtsnoC rof stseT tooR tinU lanosaeS 23. Output 4. In fact. and May 1982 indicated by dots.0 1520. Liu (personal communication) provided the data here. The following code produces an intervention model with this pattern.259.Chapter 4: The ARIMA Model: Introductory Applications 233 The seasonal dummy variable model does not lose as much data to differencing. in fact another drop.74999.1. April.71012.0 8910. Without moving average terms. so Q=(2) was added and the resulting model fit the pre-intervention data nicely.0 9831. It might be reasonable to expect a resulting drop in milk sales that may or may not have a long-term effect.0 1921.0 ohR 4063. X is a variable that is 1 for April 1982 and 0 otherwise. A P=(1)(12) specification left a somewhat large correlation at lag 2. followed by exponential increase upward. Hawaii. last year’s pattern alone gives the forecast. but no ordinary or seasonal differencing seemed necessary.277.0 9940. The forecast effectively makes a copy of last year’s seasonal pattern and attaches it to the end of the series as a forecast. has narrower intervals.0 stseT tooR tinU relluF-yekciD detnemguA lanosaeS uaT 70.102.116.) 31− tY − 21− tY ( + 1− tY ohR < rP 0391. RUN. these comments along with the fact that the data themselves reject the seasonal difference suggest the use of the dummy variable model.77624. 4. Initially a model was fit to the data before the intervention. For these data. with over 36 million pounds of contaminated milk found.0 6062. uaT < rP 8240. after which recovery began.33 and Output 4. is a little easier to understand. ESTIMATE INPUT=( (1) /(1) X ) P=(1)(12) Q=(2) METHOD=ML. the full impact was not realized until May 1982.3 Milk Scare (Intervention) Liu et al.0 0181.0 1990.0 8602. The intervention response seemed to show an arbitrary value after the first drop.

1RA 1.2 90238.81 37.< 1000.5 29.0 43955.1NED 1.61 90.< 1000.0 1000.11 60.4133.005510.0 0 0 0 0 0 0 x x x selas selas selas selas 1 1 0 21 1 2 0 1000.< 5300.< 65.0 08911.34 Model for Milk Sales Intervention Output 4.< 1000.268.1AM UM retemaraP tfihS elbairaV gaL |t| > rP eulaV t rorrE xorppA dradnatS noitamitsE doohilekiL mumixaM erudecorP AMIRA ehT selaS kliM no )noitanimatnoC( yticilbuP evitageN fo tceffE Output 4.0 85269.< 1000.1MUN 1MUN 1.0 66501.0 71435.02 98230.2RA 1.33 Effect of Tainted Milk 234 SAS for Forecasting Time Series .3 15016.9392987.2 46960.38 etamitsE 1.0 01089.94 14698.0 92943.

32 69.47− ( 216. the estimated effect is The next month.0 X)B1α − 1(/ )B1β − 0β( − 1(/ )B05 − 04− ( gaL oT 42 81 21 6 t X .0081.34 give no warning signs of any problems.0 600.0 slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC 811.4. The importance of plotting cannot be overemphasized.0941.664 9095.33 a horizontal line at the intercept 83 has been drawn and the intervention effects and so on.0 250.04 qSihC > rP 4343. Again one might think of the autoregressive structure as compensating for some lack of fit. you add a level shift variable. then a permanent decrease in sales is suggested by the model.0- 1− t t X − 460. this failure of the mean structure in the model might not have been noticed.0 532. If the shift (coefficient) is significantly larger than 0.3 X)B16.054 804589. have been added in.0 t 710.0t Output 4.Chapter 4: The ARIMA Model: Introductory Applications 235 By specifying INPUT=( (1)/(1) X).0 + 1()B05 − 04− ( = 010. is 1 and the effect is as recovery begins.47− (16.04 t − FD 12 51 9 3 t erauqS -ihC 10. This model Two months after the intervention the estimated effect is forces a return to the original level.0 720.0 6362. Might there be some permanent effect of this incident? The model now under consideration does not allow it.0 510.47 ---------------snoitalerrocotuA--------------- 131. Notice how the intercept line underestimates the pre-intervention level. To investigate this.0 331. This will add a constant. you are fitting an intervention model whose form is t Filling in the estimates. If the coefficient happens to be negative.47 − X04− = + 2B 216.0 451.34 Model for Milk Sales Intervention (continued) .0360.51 624841. including the autoregressive components. where X is 1 for April 1982 and 0 otherwise. Note also that the statistics in Output 4. Define the variable LEVEL1 to be 1 prior to April 1982 and 0 otherwise.3 84388. then the preintervention level is less than the level toward which the data are now moving.0 7512. the coefficient of the column. then the model shows no permanent effect.0 4011.0 + 2 − X)4. and how the estimated recovery seems faster than the data suggest.47 . It represents the difference between the pre-intervention mean and the level to which the post-intervention trend is moving—that is.0640. You issue the following code to fit a model with both temporary effects (X) and a permanent level shift (LEVEL1): .0 000.0 500. you have so when is 1.47 (16.0 530.0 + B16. It is a critical component of data analysis.0 + 1− X4. Had you plotted the forecasts.0 611.8 X) )4. In Output 4.0 030. for the pre-intervention period.41 89.0 141.0 − + 3− X )4.0 slaudiseR fo kcehC noitalerrocotuA t 77 5799.0 011.81 53.0 910. If this shift is not significantly different from 0.0 − − . the level attained long after the intervention.4.

4 78.< slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC 58.0 43611.0 63021. .2 06.0 15717.1RA 1.01 56565.61 77.11 0 0 0 0 0 0 0 0 1level x x x selas selas selas selas 0 1 1 0 21 1 2 0 1000.77 8779.754 3722.1NED 1.1AM UM retemaraP tfihS elbairaV gaL |t| > rP eulaV t rorrE xorppA dradnatS Output 4.0 4900.< 1000.920.< 1000.2RA 1. IDENTIFY VAR=SALES NOPRINT CROSSCOR=(X LEVEL1).1MUN 1MUN 1.36 Intervention Model with Permanent Shift Output 4.11 35.< 1000.0 16213.35 and Output 4.< 1000.0 45455.61 22.35 Model Allowing Permanent Effect noitamitsE doohilekiL mumixaM 236 SAS for Forecasting Time Series Output 4.57 etamitsE 2MUN 1.079459.0 07299.259.72 77622.0 24492.934 920607. ESTIMATE INPUT=((1)/(1)X LEVEL1) P=(1)(12) Q=(2) METHOD=ML.84 77676.1343677.< 4110.3 56437.2 69097.2 35330. RUN.31 36689.3 24070.2 33342. PROC ARIMA.0 1000.36 show the results.

95.1 coefficient 0.0 010.0005 and those for the chi-square check of residuals were all larger than 0.2 gaL oT 42 81 21 6 Output 4. an American Airlines jet crashed on November 12. Of course. terrorists used commercial airliners as weapons to attack targets in the United States.0- 080.29 is quite a bit smaller than 0.0 521.0990. but it is not statistically significant.0 881.48)/(1–. A simple linear trend gives a mild negative slope.0 9493. as it did not include LEVEL1. so there is not a lot of information about the nature of the response to the second incident. the inclusion of this lag ---------------snoitalerrocotuA--------------- 691.0411. The geometric rate of approach to the new level is 0.0490.2268) from 10.4 Terrorist Attack On September 11. are significant.81 72. according to the model.0 090.36 Intervention Model with Permanent Shift (continued) .49/(1–. The numerator lag for X allows a single arbitrary change from the initial shock (followed by an exponential approach at rate 0.0 190.0 qSihC > rP 0136. All estimates.52B)/(1–.56565. This model allows for a permanent effect of the terrorist attack of September 11 but forces the effect of the second incident to decline exponentially to 0 over time. but j days later.4.58–2. in Queens.0030.76) = 0.79 to get an approximate 95% confidence interval for the permanent component of the sales loss due to the contamination scare. The second incident sparked a j log(volume) increase 1.96(2. 97. Seasonal dummy variables might be tried in place of the seasonal AR factor. The AR1.0860. according to this model.0 760.46 according to the model.0 010. Data through November 19 are used here.Chapter 4: The ARIMA Model: Introductory Applications 237 It appears that the pre-intervention level is about and the ultimate level to which sales will return is 75.0960.76B)Xt + 1. New York. defined similarly to those of the milk example in Section 4.0- slaudiseR fo kcehC noitalerrocotuA 840.84B) et where Xt is a level shift variable that is 1 after September 11 and 0 before. The stock market was closed following this incident and reopened September 17.57 920.0210.53 from the first model. That is consistent with the idea that the autoregressive structure there was in part compensating for the poor fit of the mean function.0- + 59.0380.01 4.4. The estimated permanent level shift is about the same and still significant in its presence.0 2856. including the estimated 10.21 74.9 64.80B) Pt + (1–. is log(Volume) = 0.0 FD 12 51 9 3 erauqS -ihC 82.76 to the eventual new level).0011. In that sense. log(volume) is (0.3. An intervention analysis of American Airlines stock trading volume (in millions) is now done incorporating a pulse and level shift intervention for each of these events. Liu et al. 2001. You can add and subtract 1. In a second incident.80) (1. suggest that some sort of trend might be added to account for a decline in consumer preference for milk. resulting in the collapse of the World Trade Center in New York City.59–2. The p-values for all estimates except the intercept were less than 0. American Airlines flights were among those involved.48B)/(1–.0 270.0330. indicating an excellent fit for the 275 log transformed volume values in the data set.49 on the day it happened.0110. Other models can be tried. A model that seems to fit the data reasonably well.05 + (2.49) above what it would have otherwise been. while Pt is a pulse variable that is 1 only on the day of the second incident.79 permanent loss in sales. at this point it is clear that the old model was misspecified. with parameters estimated from PROC ARIMA. indicating a faster approach to the new level than that from the first model. The permanent effect of the events of September 11 on log volume would be (2. 2001.0 1384.0 020.35.

48)/(1–.05 and one at the ultimate level exp(0.76)) = 1.37 shows a graph of the data and a forecast from this model. Two horizontal lines.05 + (2. the existence of a permanent effect remains in question.59–2.76) in log transformed volume.66. but with so little data after November 12. The permanent effect of the event of September 11 is an increase of (2. but the option BACK=42 was used in the FORECAST statement so that the data following September 11 were not used to adjust the forecasts. That becomes a multiplicative increase of exp((2. a 58% increase in volume.48)/(1–. The level shift variable for the second incident did not seem to be needed either.37 American Airlines Stock Volume Calculations from the log model were exponentiated to produce the graph. It is also interesting how similar the decay rates (denominator terms) are for the two incidents.238 SAS for Forecasting Time Series acts like a pulse variable and likely explains why the pulse variable for September 11 was not needed in the model. Output 4.48)/(1–. Output 4.59–2. according to the model. . With that in mind—that is.59–2.51) = 1.05) = 1. only the X and P parts of the model are used in the post-September 11 forecasts. that is. The model was fit to the full data set.76)) = exp(0.58. with no adjustments based on recent residuals—it is striking how closely these forecasts mimic the behavior of the data after this incident. are drawn. one at the pre-intervention level exp(0.

1. With a response related to a single input and with an AR(1) error.1. Such a model can be written in two steps.5 942 secnairaV lauqenU rof HCRAGI dna .5 562 elpmaxE evitartsullI nA 6. The variance of t Z is ) with obvious extensions to multiple regression and . you can write t X Y t 972 stsaceroF dna scitsongaiD 11.2.5 772 setamitsE eht gniterpretnI 01.2.2.5 3.2.5 1.HCRA 542 secnairaV lauqenU 142 ytisrevinU a ta dnameD ygrenE :elpmaxE 932 srorrE evissergerotuA 932 secnairaV lauqenU dna srorrE seireS emiT htiw noissergeR 1.5 072 rotceV gnitargetnioC eht gnitamitsE 7.2.5 062 sledoM redrO-rehgiH ni stooR 4.2.2.5 062 noitcnuF esnopseR eslupmI 3.5 372 sgaL eroM dna stpecretnI 8.2.2.5 362 stooR tinU dna noitargetnioC 5.5 where | |<1 for stationarity and t t Z + X1β + 0 β = Y t t 652 noitargetnioC 2.1.5 2.1.HCRAG .5 4.2.5 652 noitcudortnI 1. ) α − 1(/ 2σ σ t e AR(p) series. from which the normal density function of α t e + 1− tZα = Z retpahC .5 and 5.2 2 5.5 572 XAMRAV CORP 9.5 852 seulavnegiE dna noitargetnioC 2.1 Regression with Time Series Errors and Unequal Variances SAS PROC AUTOREG provides a tool to fit a regression model with autoregressive time series errors.2.1 Autoregressive Errors 5 The ARIMA Model: Special Applications ~N(0.1.

the product of these n normal t=2.” and that maximize it being referred to as “maximum likelihood with the values of . the estimated autocorrelation function computed from the residuals. under rather general assumptions on X. substitution of and its lag into ) 1− X1β − 0β − 1− Y(α − ) X1β − 0β − Y( = e 2 t 1 1− Zα − Z = e X1β − 0β − 1Y = 1Z t 1 β 0β α t t t t . less used approach to estimation of the parameters is much less computer intensive. ). as will the p-values and any inference you do with them. However. and and this resulting function L( . the standard errors reported in this regression. . ) is called the “likelihood function. Writing. Thus ordinary least squares residuals can be used to estimate the error autocorrelation structure.α t e t e+) − e + ) 1− . the simultaneous iteration on all parameters done by maximum likelihood would generally be preferred. . . It is called the CochraneOrcutt method and consists of (1) running a least squares regression of Y on X. 0 β α . In PROC AUTOREG. the normal density of this expression can also be written down for t X1β − 0β − Y = t t Z can be derived. they will converge to their true values as the sample size increases. If the observed data values Y and X are plugged into this function. (2) fitting an autoregressive model to the residuals. The Cochrane-Orcutt method can be modified to include an equation for the first observation as well. Furthermore.2 e 1 σ Z .) 1− X α − X( t t Xα − X( 1β + )α − 1( 0 β + 1− Yα = Y Xα − X( 1β + )α − 1( 0 β + 1− Yα = Y t Z t t t α α e From the expression for t t you can see that 2 σ 1β 0β α 2 ne σ . estimates.240 SAS for Forecasting Time Series shows that t t t …. the estimated slope and intercept will be unbiased and will. The method can be iterated. 2σ t t e and because ~N(0. and the resulting estimates of the parameters would be unbiased. variable t 1 on transformed variables (1– ) and Because satisfies the usual regression properties. be consistent—that is. A third. When is replaced by an estimate from a model for the residuals.n. satisfies all of the usual conditions for inference. 1β . the only unknowns remaining in the function are the parameters . the statements above are approximately true. however. Because . If the error autocorrelation is ignored and a regression of Y on X is done. − Yα − t Y . the user sees the initial OLS regression. done with ordinary least squares (OLS).…. but the OLS t tests and associated p-values for the intercept and slope(s) cannot be trusted. as above.” This is the best way to estimate the model parameters. . unlike those for the filtered variable regression. will be wrong. are independent of each other. this regression. but it does not make quite as efficient use of the data as maximum likelihood.. with proper standard errors and valid t tests being given by the ordinary least squares formulas applied to these transformed variables. t This suggests that you could use some form of nonlinear least squares to estimate the coefficients. t t 1 you observe the equation for a regression of the transformed. using the new regression estimates to produce new estimates of and hence new estimates of etc. Other methods described below have evolved as less computationally burdensome approximations. densities constitutes the so-called joint density function of the Y values. and (3) using that model to “filter” the data.3 e . and then the final estimation of parameters including standard errors and tests that are valid based on large sample theory.3. the autoregressive parameter estimates (with insignificant ones being omitted if BACKSTEP is specified). or filtered.

Output 5. demand increases at an increasing rate.g.2 Example: Energy Demand at a University Output 5. A similar 0-1 variable called TEACH has coefficient 1011. A model without these modifications will be used.. Also. As temperatures rise. indicating that 1(2919) is to be added to every prediction for a workday. which indicates that 1(1011) should be added to teaching days.Chapter 5: The ARIMA Model: Special Applications 241 5. day-of-week dummy variables can be added. and teaching days (+).1. Workdays that are not teaching days have demand 2919 higher than nonworkdays for a given temperature. Three plot symbols are used to indicate non-workdays (*). e. The three curves on the graph come from a model to be discussed. Data were collected at North Carolina State University during the 1979–1980 academic year.1 dnameD ygrenE USCN . teaching day demand is 2919+1011 = 3930 higher than non-workdays for any given temperature. The coefficient of variable WORK will be seen to be 2919. workdays with no classes (dots). The variable WORK is 0 for non-workdays and 1 for workdays. as you might expect. The plot of demand against date shows that there were a couple of workdays during class break periods. Since all teaching days are workdays. where demand was more like that for non-workdays. You might want to group these with the non-workdays.1 shows energy demand plotted against temperature and against date. The goal is to relate demand for energy to temperature and type of day. December 31.

PROC AUTOREG DATA=ENERGY. teaching day indicator TEACH. Future values of such inputs need to be provided (along with missing values for the response) in the data set in order to forecast. but future values of the temperature variables would have to be estimated in order to forecast energy demand into the future. RUN. )deunitnoc( dnameD ygrenE USCN . yesterday's temperature TEMP1. No accounting for forecast inaccuracy in future values of the inputs is done by PROC AUTOREG.2 contains the ordinary least squares regression portion of the PROC AUTOREG output. To fit the model issue this code.1 The model illustrated here has today's temperature TEMP. Output 5. Future values of TEACH and WORK would be known. its square TEMPSQ. and workday indicator WORK as explanatory variables.242 SAS for Forecasting Time Series Output 5. MODEL DEMAND = TEMP TEMPSQ TEACH WORK TEMP1 / NLAG= 15 BACKSTEP METHOD=ML DWPROB.

< 1000.< 1000. If and be near 0.71 eulaV t 3297.0 8397. The Durbin-Watson statistic.01 84.2 OLS Regression = 0.< 1000.0 262763.0 4978. Extensions of DW to lags of more than 1 are available in PROC AUTOREG.61 02.5 19.< 4978.0001) indicating nonzero lag 1 Chapter 5: The ARIMA Model: Special Applications 243 .5331.0 988423.0 362092. indicating some sort of weekly 1− t r −r t 1− t r t r 1 2 2 n 2 n This regression displays strongly autocorrelated residuals .43 5862 3351 8897.were alike (strong positive correlation).0 73826.1 1335.0 067954.0 486134.5 27. The autocorrelation plot shows strong autocorrelations.0 000000.5 2728.851 0472.0 690874.051 8541.0 2153. The correction for autocorrelation reveals that lags 7 and 14 are present.0 960035.0 266875.0 188394.5 2928.< 1000.3295 98982.202 rorrE dradnatS 3380. then would autocorrelation in the errors.0 860755. | *******| | ********| | ******| | ******| | ******| | *******| | *********| | **********| | ***********| | ***********| | **********| | *********| | **********| | ************| | ***************| |********************| | | | | | | | | | | | | | | | | 130353.7495 966346 691770132 WD > rP nostaW-nibruD erauqS-R ssergeR CBS ESM ESS setamitsE serauqS tsaeL yranidrO DNAMED elbairaV tnednepeD erudecorP GEROTUA ehT t r DW= t r ∑ / )1− t r − r( t ∑ Output 5. thus showing that the DW statistic tends to be less than 2 under positive autocorrelation.1 noitalerroC 994322 083442 486502 267381 275302 015232 492372 776203 376253 085533 185113 860192 076213 443663 603364 880336 ecnairavoC 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 0 gaL 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA fo setamitsE 1000. is significantly less than 2 (p<0.0 918137. The DW is expected to be near 2 for uncorrelated data.208 953 WD < rP erauqS-R latoT CIA ESM tooR EFD 0000.0 57720.0 555123.0 161294.4 17.72 3953 etamitsE 1 1 1 1 1 1 FD 1PMET KROW HCAET QSPMET PMET tpecretnI elbairaV .noitalerrocotua evitagen gnitset rof eulav-p eht si WD>rP dna .< |t| > rP xorppA 88.0 210683.noitalerrocotua evitisop gnitset rof eulav-p eht si WD<rP :ETON 1000.< 1000.

< ± eulaV t 44.8 73.0 8740. Therefore the AR(14) error model in Output 5.32 8364 t t Z In PROC AUTOREG. on energy demand.3 0034.6 83.< 1000.7.0 − 7 − Z 61.383.14) showed no lack of fit in Output 5.6 36. |t| > rP xorppA 1510. a model with p=(1)..0 997540.4 Final Estimates Using OLS from Output 5.0 8131.3 8115.0 4050. producing the final estimates with correct (justified by large sample theory) standard errors in Output 5. the likelihood function is computed and maximized.0 1040.0 + 21− Z 31.08141. the model for the error is written with plus rather than minus signs—that eulaV t 06.00241.< 1000. All others of the 15 lags you started with are eliminated automatically by the BACKSTEP option. q=(1.2 or from PROC REG.41- sretemaraP evissergerotuA fo setamitsE rorrE dradnatS 718440.0 128040.11 e+ rorrE dradnatS 9640.< 1000.0 1385.3 Autoregressive Parameter Estimates gaL is.208.52 9192 1101 5047.0911085.0 + 5− Z 51. whereas the correct interval is 1011 1. as it does not include the unusual lags 5 and 12.0 9835.< 1000.6 72.6199.0 tneiciffeoC 096611.511 4782.0t FD 1 1 1 1 1 1 1 1 1 1 1 ..96(150).2 62. a 95% confidence interval for the effect.< 1000.4.259.5.3 is t Using this AR(14) structure and these estimates as initial values. but lags 5 and 12 are a little harder to justify with intuition. This error model is a bit more aesthetically pleasing than that of AUTOREG. Output 5. of teaching classes would have been incorrectly computed as 1533 1.0 786540.0 044840. Note that AUTOREG cannot fit moving average terms. Using the same regression inputs in PROC ARIMA.244 SAS for Forecasting Time Series effect.279.96(114). + 2B 2 α + B1α + 1( ± 41 21 7 5 1 t 41RA 21RA 7RA 5RA 1RA 1PMET KROW HCAET QSPMET PMET tpecretnI elbairaV t t Z .0 387751.0 3900.312.0 1000.< 1000.0277721.00550.0 + 1− Z 85. Lag 1 is also sensible.0 = etamitsE 5411.0 1840.0 2300.2 26.0 1174. Output 5.281. te = tZ) p B p α + .52 48.411 2611.0 3300.00946.0749451.704 41− tZ 21.

1920 with = =log( ).0 04481.0 rorrE dradnatS 37944.0050. 1 Y tfihS 0 0 0 0 0 0 0 0 0 0 ---------------snoitalerrocotuA--------------- 610.075691.0 910.Chapter 5: The ARIMA Model: Special Applications 245 Output 5.6 83. somewhat different from PROC AUTOREG and quite different from the OLS estimates. and =log( ) –log( ).1RA 3.02 17.0 200.0eulaV t 43.0 7847.7 96. In Output 5.0- gaL 0 0 0 0 0 1 41 7 1 0 slaudiseR fo kcehC noitalerrocotuA noitamitsE doohilekiL mumixaM |t| > rP xorppA 1000. while acceptable in both.3 retemaraP t Y 5MUN 4MUN 3MUN 2MUN 1MUN 1.7 93.8644 FD 44 83 23 62 02 41 8 2 t D erauqS -ihC 09. that are assumed to have constant variance.0 410.< 5000.< 330. 1949 with t =200.41 40.0 601.5803 95880.4 03. have higher (better) p-values for the mixed ARMA error structure.0 340.< 1000.0 erudecorP AMIRA ehT Y etamitsE 31923.52 92748.0940.0101.0470. The purely autoregressive model from PROC AUTOREG and the mixed ARMA error model can both be estimated in PROC ARIMA.1.83 89.0 310. Clearly the log transformation improves the statistical properties and gives a clearer idea of the long-term increase than does the untransformed series.< 1000.1AM UM gaL oT 84 24 63 03 42 81 21 6 t L .7 58.0 1000.3 40209.0 98250.1AM 1.0 23803. For long data sets.0 19350.0 17794.0700.0 1PMET KROW HCAET QSPMET PMET DNAMED DNAMED DNAMED DNAMED DNAMED 120.1AM 2.0240.0 200.111 37111.76 to December 31.< 1000.363 qSihC > rP 5986.0 250.0711.0 040.13) of = the Dow Jones Industrial Average.52 4.0 1.0 570.0 510. Doing so (not shown here) will show the AIC and SBC criteria to be smaller (better) for the model with the mixed ARMA error.21 410.838 42747.0 010.6 you see graphs of 8892 daily values (from January 1.0480.0250.0630. PROC AUTOREG provides methods for handling such situations.0 5991.0 370.0 elbairaV 220.0 200.0640.51 56.0 520.3 Unequal Variances The models discussed thus far involve white noise innovations. it can be quite apparent just from a graph that this constant variance assumption is unreasonable.0 3000. The chi-square white noise tests.0 300.32 94.3 22630.0810.5 PROC ARIMA for Energy Data The effect on energy demand of teaching classes is estimated from PROC ARIMA as 838 with standard error 112.0 2204.0240.0 500. or shocks.032752.0 110.62 05.356.0000.411 83496.0770.0220.11 58.0 710.0 75260.0810. 5. Many macroeconomic time series are better understood on the logarithmic scale over long periods of 1− t t Y 2988 Y Y 108.0210.0 7437.0170.82 78.0 1641.0 700.0 3615.< 1000.63 42.311.0 120.0 24654.0 800.< 1000.0 5756.< 1000.0 700.0 240.

and the end of World War II. )) 1Y(gol the increase in the series over the entire time period. the reduction of each month's still leaves a relatively long time series of 360 monthly numbers. For the data at hand. Since can be approximated by is essentially the overnight return on a $1 investment. and so on. the inauguration of President Franklin D.))X *X(/1 − ( t t Y(( n =∆ To demonstrate how this works. Again a logarithmic transform is used to produce a monthly series =log(standard deviation) that has a more symmetric distribution. 1B t = log( / ). .246 SAS for Forecasting Time Series the This also shows that . when the stock market crashed). Thus measures the volatility in the series. 1− tY/) 1− tY 1B expansion of log(X) at X=1. 1 /n Y values is = = so that .13/108. the start of World War II. You decide to take a look at the variability of the series.6. known as the Great Depression. Note especially the era from Black Thursday until a bit after FDR assumed office. so the series did not quite double over this 30-year period. you can represent .0 The graph of shows some periods of high volatility. from left to right. the ratio of the last to first data point is 200.. that is. numbers to a standard deviation Because there is so much data. + ∆) 2/ 2 2B = )1(gol . t t D S − ) nY(gol( 1− n t D )) 1− tY(gol − ) tY(gol( ∑ 2=t t 1− S n D t D The mean of the . Roosevelt (FDR). By the properties of logarithms. The five vertical graph lines represent. Black Thursday (October 24. let X/1 = )X(gol)X∂/∂( Using a Taylor series since t D 1B t Y Y t 1B t Y Y t t D D t time. These standard deviations have a histogram with a long tail to the right. You might argue that subperiods like the depression in which extreme volatility is present are not typical and should be ignored or at least downweighted in computing a rate of return that has some relevance for future periods. the bombing of Pearl Harbor. 100 is approximately ( – Jones average. and if / is near 1 then represents the daily percentage change in the Dow = )X/1()X∂/∂( Y 1B t Y Y t ) 1− tY/ tY( g ol t D = ) ∆ + 1(gol ) 1B tY/ tY( g ol t Y = Dne S .76 = 1. note that )/ . 1929. and a plot of versus time is the fourth graph in Output 5.. 1− tY/ tY 1( − ∆ 1 + )1(gol = ) ∆ + 1(gol = ∆ + 1 os ) 1− Y/) 1− Y − − t Y( = ∆ +0 t .84.

6 Dow Jones Industrial Average on Several Scales .Chapter 5: The ARIMA Model: Special Applications 247 Output 5.

no further differencing seems to be needed. Output 5.1RA 1.16 1− t S− S t |t| > rP xorppA 1000.0 . the S series appears to be well modeled as an ARIMA(1.0001) when six lagged differences are used.0 9999.1) model: PROC ARIMA DATA=OUT1.223 6 1252.1170.< 1000.< 1000.1160. using LSTD as the variable name for seems to provide a reasonable ARMA(1. The following code. At this point you are ready to model You have seen that a lag 6 autoregressive model for seems to provide an adequate fit.0 50. tS 7910. RUN.0 41.11- rorrE dradnatS 83370. Perhaps this long autoregression is an approximation of a mixed model.223 6 2279. The reason for choosing six lags is that the partial is near 0 after lag 6 and.1AM 1− t S− S t 1− t S . and so a model in first differences is suggested for the log transformed standard deviation series The above results are not displayed. .0 31440.0 56328.0 9999. E P=1 Q=1 ML NOCONSTANT.16 0100.1.248 SAS for Forecasting Time Series Now apply a time series model to the series.7 ARIMA Model for S dnerT naeM elgniS naeM oreZ epyT gaL 1 1 F > rP F 0100.223 6 etamitsE 82323.81 50.< 1− t S stseT tooR tinU relluF-yekciD detnemguA uaT < rP uaT 1000. furthermore. I VAR=LSTD(1) STATIONARITY=(ADF=(6)).4 66. The tau test for unit roots suggests stationarity of the differenced series (p=0.t S noitamitsE doohilekiL mumixaM eulaV t 14. a regression of on autocorrelation function for and 20 lagged differences ( for j=1 to 20) in PROC REG gave an insignificant F test for lags 7 through 20.7. tS The constant was suppressed (NOCONSTANT) after an initial check showed it to be insignificant. Dickey and Fuller show that such t tests on lagged differences are valid in large samples—only the test for the coefficient on the lagged level has a nonstandard distribution.< 1000.0 1− j − t t S S− sgaL j −t S t retemaraP S 1.0 ohR < rP ohR 9999.1) series with parameters as shown in Output 5. In summary. Said and Dickey (1984) show that even for mixed models.< . A similar regression using six lagged differences showed all six to be significant according to their t tests. these stationarity tests are valid as long as sufficient lagged differences are included in the model. That test cannot reject the unit root hypothesis. The tau test for stationarity suggests a unit root process when six augmenting lags are used. That is.

0 310.0810.0431.0 3356. and second.0810. GARCH.0 4943.14 38.4 ARCH.0710.qSihC FD erauqS > rP -ihC Exponentiation of gives a conditional 030. so the use of log transformed standard deviations as data does not necessarily invalidate this approach. Bolerslev (1986) introduced a more general structure in which the variance model looks more like an ARMA than an AR and called this a GARCH (generalized ARCH) process.73 73.0 500.0 070.0350.0010.0180.0 420.0610.0560.0510.0 070.Chapter 5: The ARIMA Model: Special Applications 249 The model suggests the predicting equation 1− tˆ 56328.0 350.0 440.43 69.0700.0810.0 6322.0 0981.91 59. However. The discussion thus far has been presented as a review of unit root test methodology as well as a motivation for fitting a nonconstant variance model that might involve a unit root. The theory underlying ARIMA models is based on large sample arguments and does not require normality.0 720.0270. the use of a month as a period for computing a standard deviation is quite arbitrary.32 29.0 131. An analyst likely would use the more sophisticated approach shown in the next section.0 010.0220.0050.0010. you will not often have so much data to start with.0060.0510.0 540. 1− tS ˆ − 1B S S t t D 1B tˆ e where would be replaced by the residual ------------snoitalerrocotuA------------.0 + 1− S = gaL oT 84 24 63 03 42 81 21 6 t Output 5.0 0327. The purpose of the monthly standard deviation approach was to illustrate the idea of an ARMA type of structure for standard deviations or variances.0 400. First.0540.0 610. the resulting standard t S ˆ . tS ˆ t S ˆ standard deviation for month t.0410.0750.0 610.0 870.0 550. Engle (1982) introduced a model in which the variance at time t is modeled as a linear combination of past squared residuals and called it an ARCH (autoregressive conditionally heteroscedastic) process.2 t t − ) 2 − S − 1− S(3323.0410. e deviations will all be positive regardless of the sign of This allows the variance to change over time in a way that can be predicted from the most recent few variances.1.0 64 04 43 82 22 61 01 4 96.0650.0 1436.7 ARIMA Model for S (continued) t S ˆ .0080.7 70. and IGARCH for Unequal Variances The series whose variability is measured by has nonconstant conditional variance. there are at least two major problems with approaching heterogeneous variation in the manner just used with the Dow Jones series. A more statistically rigorous approach is now presented.0- slaudiseR fo kcehC noitalerrocotuA 820. t . 5.0010.83 83.0 7225.0 4613.0 610.0200.0 220.0500. Notice that because is a logarithm. Thus the usual approach to modeling ARCH or GARCH processes improves on the method just shown in substantial ways.0510.

here there is no apparent time trend or seasonality and no other regressors are readily available. Because is the variance rather than its example.t t PROC AUTOREG DATA=MORE. PROC AUTOREG allows the use of regression inputs. For this reason. however. Note the way in which the sequence.1) as = where satisfies the type of recursion used in an ARMA model: to ensure positive variances. The model statement DDOW = (with no inputs) specifies that the regression part of your model is only a mean. mean reversion is no longer a property of so forecasts of will tend to reflect the most recent variation rather than the average historical variation. then the resulting model is referred to as integrated GARCH or IGARCH. Nelson and Cao (1992) give constraints on the and values that ensure nonnegative estimates of These are the default in PROC AUTOREG. t h Y To investigate models of the daily percentage change in the Dow Jones Industrial Average Calling this variable DDOW. RUN. OUTPUT OUT=OUT2 HT=HT P=F LCLI=L UCLI=U.t h t h ) th ( ω t h . If it appears. you issue this code: will use . MODEL DDOW = / NLAG=2 GARCH=(P=2.Q=1. forecasts of will revert to a long-run mean. . predicted values.) 1− tY ( g ol you h α t h t h . if these are all restricted to be positive. and default upper and lower forecast limits have been requested in the data set called OUT2. More details are given in the PROC AUTOREG documentation and in Hamilton (1994). that the process describing the error variances is a unit root process. certain restrictions must be placed on the and t h . the error term has a conditional variance that is a function of the magnitudes of past errors. If the usual stationarity conditions are satisfied.NOINT). Recall that PROC AUTOREG will fit a regression model with autoregressive errors using the maximum likelihood method based on a normal distribution. as suggested by your analysis of the Dow Jones standard deviations. Engle's original ARCH structure has =0.t h j γ t h j −h t j γ ∑ 1= j t eh p t +2−εα i − ) Y(gol = t t ε i t ∑+ω = h 1= i t q D t t e noise ~ N(0.α i logarithm.250 SAS for Forecasting Time Series In this way. In an IGARCH model. j γ . Nelson (1991) suggested replacing with log and an additional modification. These approaches allow the standard deviation to change with each observation.TYPE=INTEG.q) models is to model an error term in terms of a standard white t h γ . For t ε The usual approach to GARCH(p.q) process. which is a quite detailed reference for time series. then positive initial values of will ensure all are positive. In place of the white noise shocks in the autoregressive error model you can specify a GARCH(p. You would expect the variation during the Great Depression to have little effect on future values in an IGARCH model of the Dow Jones data. he called the resulting process EGARCH. then for a GARCH process.

and toward the end of WWII. after FDR assumed office.8. A method that accounts for different variances tends to downweight observations with high variability.87. a mean is interpreted as a drift in the data. such as in the periods leading up to the Great Depression. the estimate of the mean is seen to be 0. The numerators are sums of approximately independent terms and thus satisfy a central limit theorem.0( n / 4tr e r∑ = ∑ 1= t n ) 19 8 8()3 63 0 00 . the number = 25 represents a 25-fold increase. indicating 87% growth for the full 30-year period. This is a general test of normality based on a measurement of skewness and one of using residuals where kurtosis 1 36 3 00 0. 02 311. Odd and even powers of normal errors are uncorrelated.3% yearly growth rate! This is not remotely like the rate of growth seen. the number = 1. Both have. This gives = 1. 0 t and fourth moments scaled by the sample variance. except for rounding error it is Note also the strong rejection of normality. The model indicates. mean 0 when the true errors are normally distributed. approximately.0000702 from Output 5. large variability during periods when there were steep drops in the Dow Jones average. The normality test used here is the that of Jarque and Bera (1980). roughly an 11.3% annual rate required for a 25-fold increase ( =25) was actually exceeded.1 / n Y e Y 2 /3 n / tr )n / t 1= t 3 n 2 r∑ = b ∑ 1 =t n 1 3 − 2b =t n ( 1 . With 8892 days in the study period. follows a chi-square distribution with two degrees of freedom under the normality null hypothesis. Approximate variances of the skewness and kurtosis are 6/n and 24/n.0( . In fact there are some periods in which the 11. PROC AUTOREG starts with OLS estimates so that the average DDOW over the period is the OLS intercept 0. but it is still not quite enough to explain the results. The extremely large variances associated with periods of decrease or slow growth give them low weight. Since DDOW is a difference.1 htj 42 / )3 − 2b( + 6 / 21b n/ r ∑ The expression j is sometimes called the (raw) 3 − 2 )n / t 2 1= t n ( 3 − 2b and moment of r. except in certain portions of the graph.000363. This has to be more in line with the graph because. and since the data are log differences. and that would tend to increase the estimated growth rate.t r . and the data display.Chapter 5: The ARIMA Model: Special Applications 251 In Output 5. so squaring each of these approximately normal variates and dividing by its variance produces a pair of squares of approximately independent N(0. Why is the IGARCH model giving a 25-fold increase? It seems unreasonable.0003631 is an estimate of the long-run daily growth over this time period. therefore.1) variates. The sum of these squared variates. The fractions involve third b e ) 19 8 8() 2 07 00 00 .8. as you saw earlier. The JarqueBera test JB = n( 2 ) has (approximately) a chi-square distribution with two degrees of freedom under the null hypothesis.

1 0000.22965.0 eulaV t 041000.3 29.0 8960.788655332.1671571310.3 97.0 8470000.0 |t| > rP xorppA 05.1 tseT ytilamroN CBS doohilekiL goL ESM ESS setamitsE HCRAG detargetnI .0 995010.0 1988 erauqS-R latoT CIA ESM tooR EFD 7249.0 369300.858.0 rorrE dradnatS 421730.66482 8371000.< 8000.6883 300.0 rorrE dradnatS 2070000.< 1000.0 137900.71 73.0 130.1 nostaW-nibruD erauqS-R ssergeR CBS ESM ESS setamitsE serauqS tsaeL yranidrO wodd elbairaV tnednepeD Output 5.8 IGARCH Model for Dow Jones 252 SAS for Forecasting Time Series erudecorP GEROTUA ehT .0 8707.degrevnoc mhtiroglA 05.1000.0 1000.0 etamitsE 1 FD tpecretnI elbairaV 0000.0 675900.< 764.< 1000.0 1000.0tneiciffeoC 2 1 gaL sretemaraP evissergerotuA fo setamitsE 5516.0363000.0 8680.2eulaV t 995010.< |t| > rP xorppA 88.0 189245.457155371000.11 06.0 9060. 2988 qSihC > rP CIA erauqS-R latoT raV dnocnU snoitavresbO 9920. .0 95873545.0 etamitsE 1 1 1 1 1 1 FD 2HCRAG 1HCRAG 1HCRA 2RA 1RA tpecretnI elbairaV 1000.0 421.4 eulaV t 3750.3 36.0 3230.0 rorrE dradnatS 4222.0 126920.

recalling that subtract from your forecast to produce forecast intervals that incorporate the changing variance. will have a Using type=integ specifies an IGARCH model for linearly changing forecast if an intercept is present.1) and again for innovations ( )/ so this second set of innovations used the same normal variables in a way that gave a skewed distribution still having mean 0 and variance 1. PROC AUTOREG uses a constant variance to compute prediction limits. IGARCH models were fit for each of the two generated series and the estimated means were output to a data set. good estimates of the true value. future values of all inputs need to be included for this to work.t t D 1 − 2e srorrE dewekS srorrE lamroN t t β ˆ t 1B h h t t t t h h 57 9. which. In contrast to OLS. would have resulted. your ht model has the form 1− t ε8960. Using p=2 and q=1. t t h h 6941000. The mean was set at 0.0 170000. You thus use NOINT to suppress the intercept.0 naeM h t .9 has the historical data and 500 PROC AUTOREG will produce values and additional days with dates but no values of default prediction limits for these. but here the only input is the intercept. known in the simulation to be 0. causing biases in the standard errors for but not in the estimates of themselves. like any unit root model. In general. GARCH and IGARCH models are fit by maximum likelihood assuming a normal distribution. These features only affect the variance of the estimates. it does not matter if the variances are unequal or even if there is correlation among the errors.00007. computed by adding to the previous ) a weighted average of the two most recent changes in these smoothed values smoothed value ( and the square of the most recent shock.8 and Output 5. In regard to bias.0 2 . however. t As a check to see if bias can be induced by nonnormal errors. The overall mean and standard deviation of each set of 50 means were as follows: Thus it seems that finding a factor of 5 bias in the estimate of the mean (of the differenced logs) could be simply a result of error skewness. where the more or less horizontal bands are the AUTOREG defaults and the bands based on form what looks like a border to the data. The data set MORE used for Output 5. Failure to meet this assumption could produce bias in parameter estimates such as the estimated mean. Both kinds of prediction intervals are shown in Output 5. in fact the factor of 5 is almost exactly what the simulation shows. the model is Y=X +e and the estimated is unbiased whenever the random vector e parameter vector has mean 0. add and can output the values in a data set as shown and then.0 7090000.t You can look at as a smoothed local estimate of the variance. For each data set. the rejection of normality by the Jarque-Bera test introduces the possibility of bias in the estimated mean. data from a model having the same sequence as that estimated for the Dow Jones log differences data were generated for innovations ~ N(0. In an ordinary least squares (OLS) regression of a column Y of responses in a matrix X of explanatory variables.0 + 1− h = h β )e′X ( 1B )X′X( + β = )Y′X ( 1B )X′X( = β ˆ 853000.Chapter 5: The ARIMA Model: Special Applications 253 Perhaps more importantly. 0 t t t t e . By default.0 noitaiveD dradnatS β h t h + ) 3− hB 2 − h(4222. you is a local variance.9.00007 for the simulation and 50 such data sets were created. The simulation results also show that if the errors had been normal.0 + ) 2 − h − 1− h(8707.2 .

0 = h t Z eh t = t ε h . they are small.000363 is unacceptable in light of the nonnormality.0 − 1− tZ8680. The ordinary mean 0.9 Default and ht-Based Intervals The default prediction intervals completely miss the local features of the data and come off the end of the data with a fairly wide spread.t h h 2 t ε 2−t h − 1− h t 1+ n h 1− t h− h t 1+ t t ε + 2 − tZ3230. They are almost.00007 is an unbiased estimate and exactly reproduces the observed growth. The . The forecast intervals coming off the end of the series thus have about the same width as the last forecast interval in the historical data. The autoregressive error model is seen to be 2 . so their contribution to forecasts and to the width of prediction intervals into the future is imperceptible in the graph. contributing very little to so that is approximately as are all n+ j for j>0. It appears that ( ).254 SAS for Forecasting Time Series Output 5. the resulting danger of bias. the -based intervals are appropriately narrower. but not exactly. and its failure to represent the observed growth over the period.n t where Although the lag Z coefficients are statistically significant. Clearly the IGARCH estimated mean 0. two horizontal lines. and were fairly small at the end of the series. Since the last few data periods were relatively stable. ( ).

0 which is not significant at any reasonable level. Additional care would be required. However. ignoring all of the variance structure. and despite the comments above. for example. A little thought shows that this could be anticipated for the special case of this model. gives about the same t. − n(/ 2 )D − α t D( ∑n 1= t 1B the usual OLS formula. the average of divided by n is To the extent that the squared a reasonable approximation of the variance of and thus of provide approximate estimates of the corresponding conditional variances residuals . might be reasonable for these particular data. Proceeding on that basis.0 t h = Z and that of is thus n t eh t = ∑ ) α − α − 1( 1= t n 5841000. in fact a GARCH(2. − 1( .0 t 2 ε )D 2 2 − t D( 1 . gives an estimate of the standard error of the . such as consideration of the assumed unit root structure for and the error introduced by ignoring the s. D α Z t h 1B 2988 as t h .5841000. but more will be said about this shortly. Because the s are small here. Interestingly. There is no reason to expect the naive approach to work well in general.Chapter 5: The ARIMA Model: Special Applications 255 usual conditions leading to the (OLS) formula for the standard error of a mean do not hold here.0 + 8680.0 t D = 64855. The AR(2) error series maximum likelihood estimates of are reasonable under rather mild assumptions for ARCH models even when the errors are not normal. Also the graphical evidence indicates that the estimated series has captured the variability in the data nicely.1 2− )3230. The problem is not with IGARCH versus GARCH.t h h . this line of reasoning does suggest that the naive t test. you sum the estimated series and use estimated autoregressive coefficients to estimate the standard deviation of the mean In this way you get 70000. 663) indicates that Z) 2 α − 1 α − 1( Z) 2 α − 1 α − 1( can be summed from 1 to n on both sides and divided by n to get n approximately is e t h ∑ 1= t 2B n t ε t ε+ 2− t Z 2 α + 1− Z1α = Z t .1) model also fits the series quite nicely but still gives an unacceptable estimate of the t mean 0 and variance 1. to make this into a rigorous argument. produced by PROC MEANS. a simple t test on the data.h t ∑ 1= t 2− 2 B n ) 2 α − 1α − 1( t h n 5. The summing of and division by n yields what might be thought of as an average variance over the period.t D t mean of Note that the average of n independent values of has variance n if has =t h ∑ 1= t 2B 1B t t n n h h . p. )1 t mean.ε equal to t From it follows that the (approximate) variance of Hamilton (1994.

the upper-left panel of Output 5.2.” of dimension k and order has a multivariate normal distribution with k dimensional mean vector 0.256 SAS for Forecasting Time Series This example serves to illustrate several important points. Careful thinking and a knowledge of statistical principles are crucial here. For example. Computational software is not a replacement for knowledge.10 shows the logarithms of some high and low prices for stock of the electronic retailer Amazon.com. Σ t e k× k . The naive use of statistical methods without understanding the underlying assumptions and limitations can lead to ridiculous claims. Another is that failure to meet assumptions is sometimes not so important but at other times can render estimates meaningless. a vector of 0s. and that variance matrix The element of is the time series so the deviation of each series from its mean is expressed by the model as a linear function of previous deviations of all series from their means. extracted by the Internet search engine Yahoo! t e + 2− V2 A + 1− V1A = V t t t .i 2=p µ− ti Y t t V V hti .1 Introduction In this section you study a dimension k vector of time series. 5. It is assumed is called a vector autoregression. This would typically involve some graphics. One is that careful checking of model implications against what happens in the data is a crucial component of proper analysis. The model (2 lags). a “VAR.2 Cointegration 5.

5 tuptuO .nozamA 01.Chapter 5: The ARIMA Model: Special Applications 257 enalP gnitargetnioC htiw ataD moc.

0 Y 2 etamitsE retemaraP 38511.0 |t| > rP 1000.< 7130.0 etamitsE retemaraP 90245.2 hgih :elbairaV tnednepeD wol :elbairaV tnednepeD Y FD 1 1 1 FD 1 1 1 1wol 1hgih tpecretnI 1wol 1hgih tpecretnI elbairaV 1488. and denotes a determinant.2 Cointegration and Eigenvalues . elbairaV µ− 3254.2 eulaV t 69.7 14. ti where high1 and low1 are lagged values of the log transformed high and low prices. The eigenvalues of A are defined to be the roots of the polynomial k× k t e ?t e + 1− VA = V t t t Y j −e t j α 0= j ∑= Y t that the expression for in terms of past shocks would “converge”—that is.1 39. Using just one lag you specify PROC REG DATA=AMAZON.0 11488. 11. For the A − Im Any matrix has k complex numbers called eigenvalues or roots that determine certain properties of the matrix. RUN. ∞ the requirement was imposed so |t| > rP 3350.0 09950.< 1000.< 0951.0 eulaV t 49.1- rorrE dradnatS 97950.0 rorrE dradnatS 74060.11 shows the estimates. MODEL HIGH LOW = HIGH1 LOW1.0 03700.0 22950.t e + 1− t Yα = Y t Recall that in a univariate AR(1) process. + t e µ − − t 1 8511. you find fitted k× k identity. = µ− 2 1 2×2 t1 t2 ataD moc.0 93700.0 37510. 5. it 1< α . 1 1 1 . I is a where A is the matrix above. What The answer lies in the is the analogous requirement for the vector process “eigenvalues” of the coefficient matrix A.5 tuptuO The estimated model becomes t e µ − − t Y 1245.0 24010.0 1000.nozamA no GER CORP Y Y .8 55. k× k coefficient matrix.2.258 SAS for Forecasting Time Series One way of fitting a vector model is to simply regress each on lags of itself and the other Ys thereby getting estimates of row i of the A coefficient matrices.02 1 . would have weights on past shocks that decay exponentially as you move further into the past. The partial output Output 5.0 13254.41 51.

A matrix with unique eigenvalues can be expressed as where D is a matrix with the eigenvalues of A on the main diagonal and 0 everywhere else and Z is the matrix of eigenvectors of A. L L 4724.esnopseR eslupmI 0 1− 1 m ZDZ = A L is the last A .( − 2m 4724.0 0 1245. 8511. 1 − 0 8899. − .)4724. Note that By the same reasoning as in the univariate case.5 tuptuO all converge to 0. − m ( = 9624.0 0 1488. 1− Z L − m ()8899.n V LA = L +nV ˆ )8511. ledoM 1 gaL .Chapter 5: The ARIMA Model: Special Applications 259 which becomes so the roots of this matrix are the real numbers 0. + m)1245. For the . 1245. ) 1− 3254. L 1488. ZDZ()1− ZDZ( = L A Z= = .()3254. 1− 2×2 Z LDZ = ) 1− ZDZ( Z = Z 1− 1− Z DZ = L 8511. + 1488. V where predicted deviations from the means L steps into the future are matrix currently under study you have observed vector of deviations.42740.0 0 . the n A so that the elements of 21. − m( = 8899.9988 and 0. 3254.( − )1245.0 0 L m()1488.

and increased to about 0.2. )0 .2 t 1 Y 1= t 41460. hence the requirement that these roots be less than 1.1 Y t V t 2 Y 70136.0− is found. Series satisfying this requirement are said to be stationary. .e. process satisfies the stationarity condition. this estimated model V 72931.11 1 11 = t Y =t To illustrate. to about 0. certain conditions on the initial observations are also required to ensure constant mean and covariances that depend only on the time separation of observations (this being the mathematical definition of stationarity).0 68489.0− + 1− t 54532. that is. The sequence so computed is called an impulse response function. it would not be at all surprising to find that the true A matrix has a unit root. if A has any unit roots. nonstandard distributions of estimates will arise just as in the univariate case.2. Note is uncomfortably close to 1.45 while Continuing through time.88. From then on.0 2− t . It is seen that at time responded to the jump in decreased. where the matrix entries are estimates coming from two PROC REG outputs: 1< m and if all values of m that make this determinant 0 satisfy then the vector .8899. in other words traces out the path that would be followed with increasing lead L in absence of further shocks. L 000. Similarly.1( t 85256. following the initial jump. The roots here are analogous to the reciprocals of the roots you found for univariate series. not converge) if the eigenvalues or roots of the coefficient matrix A are one—that is. although technically.t Regressing as above on lag 1 and 2 terms in the Amazon. When all the eigenvalues of A are less than 1. if it were exactly 1.0− =ρ ˆ e + 2− V2 A + 1− V1A = V .3 Impulse Response Function .4 Roots in Higher-Order Models The requirement that the roots are all less than 1 in magnitude is called the stationarity condition. the two series come close together then descend very slowly toward 0. In an order 2 VAR. or VAR(1). 2 A − m1A − I2m = . At time is shifted to 1 with remaining at 0.. following the terminology from univariate processes. thus representing a shock to the high price. then converge to the mean (0). 2 Y .9988 being so close to 1. is stationary. would not decrease at all and the forecasts would not Clearly.0 . we say that the vector autoregressive process of order 1. 0 deviations of both series from their mean. The equilibrium. L +11 t 2 Y V ˆ t. When the true A has unit roots. Output 5.12 shows a bivariate series with both and being 0 up to time mimicking constant high and low stock price (log transformed and mean corrected).1( = 11 V Y ′ t V ˆ t 1 . and that the largest eigenvalue of the estimated matrix here.0 L A = 11V LA = L+11V ˆ t 1 t.260 SAS for Forecasting Time Series 5. not greater in magnitude.0− 37180. 5. it is still the roots of a determinantal equation that determine the characteristic polynomial is stationarity.′ )0 .0 41522.com high and low price series. In higher-order vector processes. is approached slowly due to the eigenvalue 0. This demonstrates the effect of a unit shock to the log of high price.000. t. any attempt to represent the vector of deviations from the mean in terms of an infinite weighted sum of past error vectors will fail (i.

0 70136. and the AR(2) used to extrapolate into the future. a prerequisite for validity of any statistical test. whose roots determine stationarity.0 1000. + m()76762.0 1000.0 etamitsE retemaraP 41460. Comparing to the 5% critical value the unit root hypothesis is not rejected. no diagnostics have been performed to check the model adequacy.041522.0 41522.0 59760. and it would not be at all using the true coefficient |t| > rP 7530. normalized as univariate AR(1) case.0 =ρ ˆ Note that again.085256.0 − m ( = 37180.2 eulaV t 79. then the largest estimated root.0 |t| > rP 2133.241.0 81170.061.0 26800. is matrices has a unit root.)1 − ρ(n ˆ .41 30. is very close to 1. the lag 2 model will be discussed here.0 − m()47945. is generated.0 0 1 2 31.0 33700. Fountis and Dickey (1989) show that if a vector AR process has a single unit has the same limit distribution as in the root. 11− .0− 85256.0 rorrE dradnatS 59560.9 81.0 etamitsE retemaraP 72931.< 6832.054532.< 1000.0 m − 0 68489.0 eulaV t 11.1 0= − = )1 − 78799.0 77860.3.5 tuptuO fo ssecorP m 2 redrO .78799. then Using this vector AR(2) model.0 78410.1- rorrE dradnatS 41660.0 69860.0 − 54532. the characteristic equation.0(905 = )1 − ρ(n ˆ 2 A − 1Am − I2m surprising to find that the characteristic equation .306.0 68489. Also.0- − FD 1 1 1 1 1 FD 1 1 1 1 1 2wol 2hgih 1wol 1hgih tpecretnI 2wol 2hgih 1wol 1hgih tpecretnI elbairaV elbairaV 1 70136.0 7100.0− 72931. a bivariate vector of 0 deviations up to time a unit shock is imposed on the first component. but for simplicity of exposition. the one corresponding to the high price.0 6000. the largest eigenvalue.3 82.0 − m()78799.0 8252.Chapter 5: The ARIMA Model: Special Applications 261 Inclusion of lag 3 terms seems to improve the model even further.037180.0− wol :elbairaV tnednepeD )48771.< 0340.9 81.0 hgih :elbairaV tnednepeD 41460.0 41860. This provides a test for one versus no unit roots and hence is not as general as tests to be discussed later. Keeping all the coefficient estimates.0 13700.164. The code is as follows: 11 = t 80.0 83170.

262 SAS for Forecasting Time Series

DATA SHOCK; Y12=0; Y22=0; Y11=0; Y21=0; DO T=1 TO 100; Y1 = .98486*Y11 + .23545*Y21 - .08173*Y12 - .13927*Y22; Y2 = .63107*Y11 + .65258*Y21 - .22514*Y12 - .06414*Y22; IF T=11 THEN Y1=1; OUTPUT; Y22=Y21; Y21=Y2; Y12=Y11; Y11=Y1; END; RUN; PROC GPLOT DATA=SHOCK; PLOT (Y1 Y2)*T/OVERLAY HREF=11; SYMBOL1 V=DOT I=JOIN C=RED; SYMBOL2 V=DOT I=JOIN C=GREEN; RUN; QUIT;

**The graph of this impulse response function is shown in Output 5.14.
**

41.5 tuptuO

ledoM 2 gaL ,esnopseR eslupmI

Chapter 5: The ARIMA Model: Special Applications

263

The addition of the second lag produces a more interesting pattern immediately following the shock to the high price logarithm series, but in the long run the series again approach each other and equilibrium deviation from the mean. descend in tandem to the The forecasts might not have returned to the equilibrium point if the true coefficient matrices rather than estimates had been used. The behavior in the estimated model could simply be the result of the highest estimated root 0.99787 being a slight underestimate of a root that is really 1. Notice that a number even slightly smaller than 1 will reduce to nearly 0 when raised to a large exponent, as happens when the impulse response is extrapolated into the future. Models that allow exact unit roots in vector processes will be discussed next.

)0 ,0 ( )0 ,0 (

**5.2.5 Cointegration and Unit Roots
**

An interesting class of models with exact unit roots is the class of cointegrated vector processes that can be represented in a type of model called the error correction model. Cointegration refers to a case in which a vector process, like the one with logarithms of high and low prices currently under discussion, has individually nonstationary components but there is some linear combination of them that is stationary. To make things a little clearer, suppose it is hypothesized that the ratio of high to low prices is stable; specifically, the daily price ratio series log(high/low) = log(high) – log(low) is stationary even though the log(high) and log(low) series each have unit roots. In this case, a shock to the high price series will result in an impulse response in which both series move as before, but they will not move back toward any historical mean values. Rather they will move toward some equilibrium pair of values for which log(high) – log(low) equals its long-term mean. You can check spread = log(high) – log(low) for stationarity with no new tools—simply create the daily spread series and perform a unit root test on it. Here is some code to do the test and to check to see if 3 autoregressive lags (and hence 2 lagged differences) are sufficient to reduce the errors to white noise.

PROC ARIMA DATA=AMAZON; I VAR=SPREAD STATIONARITY = (ADF=(2)); E P=3; RUN;

As shown in Output 5.15, the tests strongly reject the unit root null hypothesis and thus indicate stationarity. The zero mean test would be useful only if one is willing to assume a zero mean for log(high) – log(low), and since high > low always, such an assumption is untenable for these data. Also shown are the chi-square tests for a lag 3 autoregression. They indicate that lagged differences beyond the second, are unnecessary and the fit appears to be excellent. This also suggests that an increase in the bivariate system to 3 lags might be helpful, as has previously been mentioned.

, 3− t

Y − 2− Y

t

.90.

1=

) 783400.0 ()69.1( 25670.0

+

e e

70.

1=

) 783400.0 () 69.1( 25670.0

−

e

80.

1=

25670.

0

205 = n

Output 5.15 Stationary Test for High-Low Spread

264 SAS for Forecasting Time Series

is stationary according to the unit roots tests. That It appears that means standard distribution theory should provide accurate tests since the sample size is not too small. In that light, notice that the mean estimate 0.07652 for spread is significantly different from 0. An estimate of the number toward which the ratio of high to low prices tends to return is with a 95% confidence interval extending from to You conclude that the high tends to be 7% to 9% higher than the low in the long run.

) w ol( g ol

− ) hgih (gol = daerps

400.0300.0 540.0360.0 830.0 250.0 850.0 330.0-

600.0 930.0 610.0 600.0950.0 610.0 920.0 270.0

830.0010.0 320.0210.0470.0410.0520.0 740.0-

050.0320.0 940.0 410.0 760.0520.0 530.0 900.0-

530.0550.0 830.0 940.0 320.0 640.0140.0 810.0-

030.0 940.0 310.0 620.0 710.0 810.0730.0 100.0-

5218.0 2737.0 4376.0 9665.0 6054.0 8426.0 8893.0 3102.0 qSihC > rP

54 93 33 72 12 51 9 3 FD

15.63 50.33 68.82 31.52 41.12 17.21 34.9 36.4

84 24 63 03 42 81 21 6

---------------snoitalerrocotuA---------------

erauqS gaL -ihC oT

slaudiseR fo kcehC noitalerrocotuA 3 2 1 0 gaL 1000.< 3923.0 1000.< 1000.< |t| > rP xorppA 13.4 89.0 19.8 44.71 eulaV t 87340.0 20740.0 07340.0 0783400.0 rorrE dradnatS 88881.0 29540.0 71983.0 25670.0 etamitsE 3,1RA 2,1RA 1,1RA UM retemaraP

noitamitsE serauqS tsaeL lanoitidnoC 0100.0 0100.0 F > rP 14.23 42.92 F 1000.< 1000.< 8200.0 uaT < rP 50.856.700.3uaT 1000.0 1000.0 6200.0 ohR < rP 885.941092.3314453.81ohR 2 2 2 dnerT naeM elgniS naeM oreZ epyT

sgaL

stseT tooR tinU relluF-yekciD detnemguA

Chapter 5: The ARIMA Model: Special Applications

265

You see that testing for cointegration is easy if you can prespecify the linear combination—e.g., Often one only suspects that some linear combination is a bivariate time series, so the problem involves estimating as well is stationary, where as testing the resulting linear combination for stationarity. Engle and Granger (1987) argue that if you use regression to estimate your method is somewhat like sorting through all linear combinations of log(high) and log(low) to find the most stationary-looking linear combination. Therefore if you use the standard critical values for this test as though you knew from some external source, your nominal level 0.05 would understate the true probability of falsely rejecting the from a least squares unit root null hypothesis. Their solution was to compute residuals regression of on and run a unit root test on these residuals, but then to compare the test statistic to special critical values that they supplied. This is a relatively easy and intuitively pleasing approach; however, it is not clear which of two or more series to use as the dependent variable in such a regression. More symmetric approaches were suggested by Stock and Watson (1988) and Johansen (1988, 1991). Stock and Watson base their approach on a principal components decomposition of the vector time series, and Johansen’s method involves calculating standard quantities, canonical correlations, from a multivariate multiple regression and then figuring out what distributions these would have in the vector time series case with multiple unit roots. Both strategies allow testing for multiple unit roots. For further comparisons among these approaches and an application to a macroeconomic vector series, see Dickey, Janssen, and Thornton (1991).

t

5.2.6 An Illustrative Example

To get a little better feeling for cointegration, consider this system with known coefficients:

t,1

Suppose and up to time 11, where a shock takes place. What happens after time 11 if no further shocks come along? That is, what does the impulse response function look like?

2

Yβ − 1Y

t

β

t,2

e 51 −

e 01 − − t +

β

t

2

Yβ − 1Y = r ˆ

2

2

− t,1 Y

,2

76.0− Y

t

82.0

t

88.0

70.0

−

01 − − t Y 66.1 + 51 − − t 1 42.0−

1

1

,2

,

Y

.) w ol( go l

,β

01 =

01 − 60.0− = 51 −

48.1

) t2Y , t1Y (

t

2

− ) hgih(gol = daerps = S

Y

t

2

Y

51 =

t

1

Y

t2

t1

Y

Y

t

1

Y

t

266 SAS for Forecasting Time Series

sesnopseR eslupmI

61.5 tuptuO

Chapter 5: The ARIMA Model: Special Applications

267

The left panels of Output 5.16 show the results of setting the pair to and It is seen that a change in either coordinate at time 11 results in the ultimate shifting of both coordinates. Also it is seen that there can be a lot of wiggling as the new levels are approached or there can be a relatively monotone approach of each coordinate to its new level. An insight into this behavior is given by the plots of these three impulse response functions and several others in the three-dimensional plots in the right column of the graph. The axes represent and time t. All series set up to time thus forming a “means axis.” The top-right panel shows eight possible shocks at time fanning out in an asterisk-shaped pattern. The middle plot on the right adds in the eight resulting impulse response curves, and the bottom-right plot is just a rotated view of the middle plot, with time measured by depth into the plot. In the first and second plots, time increases with movement to the right, the height of a point is and its depth back into the plot is The plots include a 0 shock case that forms a continuation of the means axis. For a while after the shock at time 11, there can be substantial wiggling or relatively smooth movement. What is striking is that as time passes, the points all seem to align in a plane. This plane is interpreted as a long-term relationship that will be approached over time after a shock bumps the point off of it (the plane). This gives rise to the term “error correction,” meaning that movement off the plane is an “error,” and in the long run in the absence of shocks, the points will move back to the equilibrium represented by the plane—an error “correction.” A single shock can send the system into fairly wild fluctuations that, depending on what the series represent, might frighten investors, but these are temporary and the vector ultimately will settle near the plane of equilibrium. This equilibrium plane is interpreted as a relationship that cannot be dramatically violated for long periods of time by the system. Envision the plane as an “attractor,” exerting a force like gravity on the points to settle them down after a shock. Further insights are given by a bit of mathematics. Note that a vector VAR(2) model of dimension k, can be algebraically written in terms of differenced vectors and a lagged vector as where

,

becomes

.′

βα = )1−

1(

so that

t,2

t,1

e 51 −

e 01 − − t +

Π

− − +) − − − − e + ∇ − e − ∇ − − − − ) e ∇ + − − − e + − ∇ − − − − − e ∇ + − − 1Y − e + − ∇ −

t ,2

t,1

t, 2

t,1

t ,2

t,1

1

1

2

2

− t,1 Y

k× k

t, 2

t,1

1

1

,2

Y

Y

t, 2

76.0− Y

t ,1

1

1

r× k

less than full rank) then the time series has a unit root Any can be written as where and are full-rank currently under discussion, the model

82.0

Y

Y

t, 2

t,1

Y

Y

82.0

76.0

82.0

76.0

.1

82.0

76.0

=m

88.0

70.0

70.0

88.0

70.0

88.0

.

is

evaluated at

So if

(that is, if this matrix is

matrix that has rank matrices. Using the A matrices

,)31,51( ,) 7 ,51(

11 = t

,11

,t

1= m 0 = 2 A − 1A − I e + 1− V∇2A − 1− V) 2A − 1A − I(− = V∇

=t

t

) 2Y , 1Y (

.2

)01,51(

Y

t

= ) 2Y , 1Y(

−

70.0

88.0

01 − − t Y 66.1 + 51 − − t 1 42.0−

β

t

01

51

01

51

α

1

1

5

1− t

1

1

10.0 10.0 = 40.0− 40.0−

,2

,

Y

t,2

t,

1

V

1

1

Y

t ,2

t ,1

t, 2

Y

Y

Y

40.0

2 A − m1A − mI ) 2 A − 1A − I ( 2 1− V − V = V∇ e + 2− V2 A + 1− V1A = V

,′

,1

10.0

1

βα = Π

Y

1

t,1

Y

1(

, 2Y , 1

01 − 60.0− = 51 −

,t

(

48.1

10.0

40.0

40.0

40.0

10.0

10.0

Y

= − = − − ∇ − = ∇

10.0− − = Π

40.

t

0

t

t2

t1

Y

Y

t2

t1

t

Y

Y

t

.)21,71(

k<r

t

t

268 SAS for Forecasting Time Series

The interpretation here is that is stationary—that is, it tends to be near 0 so that the tends to be near 5. This algebraic form of the model is known as the “error difference correction model,” or ECM. The plane satisfying at every t is the attractor toward which all the impulse response functions are moving in the three-dimensional plots. A vector such that is stationary is called a cointegrating vector, so in this case is and any nonzero vector of the form The set of such a vector, as are constitutes the set of all possible cointegrating vectors in all linear combinations of the rows of the general case.

. ) t2Y

That is, in fact does not involve the lag levels of the variables at all. It is strictly expressible in terms of differences, so is a unit root process. Also, because the only constant in the model, is captured in the term and is thus annihilated in the equation, it follows that

**from which you see that
**

5 + tS 2.− t N 8.0

2.0

.

0 = αp′ α

k × ) r − k(

p ′

α

,′

β

above

where

is a

matrix such that

p ′

α

Thus it becomes clear exactly how the nonstationary common trend is part of both Y series. For with and both matrices, the matrix T can always be constructed by stacking

t

,5

−

t

2Y

−

t

1Y

.t

= S

N

t

**has no drift. is a stochastic common trend shared by and combinations, the nonstationary and the stationary as
**

t

The two interesting linear can be written

,5

−

′

N∇ ∇ , 1Y∇()4 ,1( = N∇

t

t

Next consider and note that the vector equation on both sides by the row vector it is seen that only through the term

t

Multiplying involves lagged levels

)b ,a(

)1,1− (

.)1,1− (φ = )φ ,φ − ( = ′β

t

2Y N∇

1Y

5+

t

2Y = 1Y

,)4 ,1(

5− t2Y + 0 t1Y

t

t

5 − 2Y − 1Y = S

2

Y4 + 1Y =

′ ) t2Y , t1 ()4 ,1( = t2Y 4 + t1 Y Y

t

0

t

′

T=

β

10.0 )4 ,1( = )5 − − t Y − − t 1Y( 40.0−

5−

t

,)1 ,1( ,)2 ,2 (

5− 2Y 1− 1 S + = 0 1Y 4 1 N

1

t

r× k

N

− t,2

−

5 + tS 2.0 = tN 1−

1

t

Y − − 1Y N

,2

1

t

t

t

t,

1

′ ) t2Y , t1 () Y

β

−

,

=

t

t

2

N

Y − 1Y

t

α

N

T=

b ,a(

t

t

N∇

t t

2Y

1

t

t

Y

,′

βα = Π

t

N

Chapter 5: The ARIMA Model: Special Applications

269

As a final insight, multiply both sides of the VAR in error correction form by the transformation matrix T to get

where the z white noise errors are linear combinations of the e errors. The coefficient matrix for the lagged differences of N and S is diagonal, which would not be the case in general. Nevertheless there contains does always exist a transformation matrix T such that the vector 1. as many unit root processes as the series has unit roots, followed by 2. stationary processes (provided none of the original Y series requires second differencing to achieve stationarity). The period of the sinusoidal waves follows from the mathematical model. With the diagonal coefficient matrix in this example, it is easy to describe the stationary component as or with characteristic polynomial Here the representation of a complex number as to show that

29.21

t

to and determines the orientation of this sinusoidal fluctuation in the The relationship of three-dimensional plots. For the cases with equal shocks to and no fluctuations were seen. is no different after the shocks than before, so the That is because for these cases shocked points are still in the cointegrating plane. With describing the component of motion in the cointegrating plane, one expects an exponential increase, in the equal shock cases, to a new horizontal line contained in the cointegrating plane. That indeed is what happens. The cases with unequal shocks to the two Y components force the point off the cointegrating plane, initiating a ripple-like fluctuation about the plane as the new levels are approached. In the bottom-right plot of Output 5.16, where passing time moves you toward the back of the plot, it is seen that the cointegrating plane slopes from the upper left to the lower right while the sinusoidal fluctuations seem to move from lower left to upper right and back again repeatedly as time passes.

, t2

59.

shock. This is precisely what the graphs in Output 5.16 show, with damping factor L periods after the shock.

t

L

1− t N

Y

∇ = N∇

06.

t

1

Y

t

4

= )063 / 29.21(011

degrees. In the graphs one expects

cycles in the 110 observations after the

giving the amplitude

= ) 59.

2 / 09.1( s occra

=θ

θ

must equal 1.9 so that the angle

)θ ( nis −

= )θ− (nis

can be used with the fact that

is

t e t e

,2 ,1

T+

− t Y∇ − t Y∇

1 1 ,2 ,1

t e t e

,2

,1

T −T

VT

1

T+

76.0

82.0−

1 1 ,2 ,

− tS∇

t z − tS∇ 59.0 + t 1z − tN∇ 0

− t N∇ 1−

t, 2

z

+

70.0−

2

88.0

1 1

− tS59.

T

76.0

82.0−

5 − 2Y − 1Y = S

T + )5 −

.)

θi−

t t

− 1− S9.1 = S

e 59. − m() e 59. − m ( = 59. + m9.1 − 2m

70.0−

88.0

1

− t,2Y − 1− t,1Y(

t

06.0

2

t

50.0− 0 + − tS = 0

Y

T+

t

t, 2

) (soc 59. 2

θi

1

1

θ

− tS

z

t

1

Y

+ 1− ∇ + 1−

50.0− =

50.0− =

]) (nis i

t

tS∇ t Y∇ = t N t1

S

0

0

θ

t

∇

S

59.

= ) θ − e + θ e( 59.

+ )θ(soc[r = θ er

2

i

Y∇

t

S50.

T

− = S∇

i

t

i

It can capture some fairly complicated shortformula and common trends term dynamics.0 + 1− tS = 5814. t L . and . 9240.0765.7 Estimating the Cointegrating Vector In the Amazon. A simple unit root test on sufficed as a cointegration test. in which case the graph will.com data. 5.0 + ) wol(gol . This is the cointegrating plane.0 ∇ t H 24.) h g i h ( g ol = H − ) hgih (gol t versus t in the floor and versus t in the back wall. This made the analysis pretty straightforward. the data may not be so nice and the nature of the cointegrating plane might not be easily anticipated as it was here.− 0 .) w ol ( g ol ) w ol ( g ol .0765 is the Thus is the common trend unit root process.) t H .10. It can be estimated mean of divided by 0.com stocks it appeared that the relationship was stationary with average value about 0. It is a weighted average of things that are almost the same as each other. of course. tL H − t L t H t L t t t − ) hgih (gol H∇ L H ∇ t H t N . one would expect the points to stay close to a plane having over time. it was easy to guess that log(high/low) would be stationary and hence that is the cointegrating relationship between these two series. and to its left the rotation continues so you are now looking directly down the edge of the cointegrating plane. a line. or in more detail from the mathematical analysis. These are projections into the floor and back wall of the points which are seen moving from the lower left to upper right while staying quite close to a sloping plane. You have seen from the graphs. In other cases.− 1− tL 7872. plane. as suggested by Engle and Granger (1987). You now look for cointegrating relationships like the in the Amazon. toward which forecasts gravitate.5670. The lower-right panel shows this same output rotated so that points move out toward the observer as time passes.2.0 + t L81. This is also the graph of versus and motivates the estimation of the cointegrating plane by regression. The high and low prices are so tightly cointegrated that it is clear from the outset the data will produce a nice example.6 to make the weights sum to 1. In a three-dimensional plot of and time t.com data.− 9971. That plane and the data were seen in Output 5.270 SAS for Forecasting Time Series You have learned some of the terminology and seen some geometric implications of cointegration in a hypothetical model with known parameters. In the upper-left panel both series are plotted against time and it is seen that they almost overlay each other. t( t where and are log transformed high and low prices. = ) hg ih(gol − t S L − ) hgih (gol − t t H = S t 1− t H∇ 4431. like For the Amazon. look like those of the original series that were so similar to each other in this example. The complete cointegration ) w ol ( g ol ) w ol ( g ol t L = t L . or hyperplane. The upper-right panel plots 5670.0 0714. that the error correction model defines a simple linear attractor. Using ordinary least squares regression you estimate an error correction model of the form .

Π .− 2. 1C ) t3Y . Y − t 2Y5. − Π Π t H − = S t 1 Y t .− 5. That is.10. The number of cointegrating relations in a process with known parameters is the rank of the on the lagged levels in the error correction representation.0 = 40. cointegrating relationships. In fact. t2Y . there is one dimension.com example. no graph analogous to the plane in the Amazon. If you estimate that in you might want to test to see if b is an estimate of 1. if 6. –. This factoring of the matrix not only shows that there is one cointegrating relationship. A vector time series of dimension 3 could move around anywhere in three-dimensional space as time passes. Because time added to dimension.0 8. − t 2Y2. 40.− 1 SAS/ETS software provides PROC VARMAX to do this kind of modeling as well as allowing exogenous variables and moving average terms (hence the X and MA in VARMAX). but no check has yet been provided as to whether 2 lags are sufficient. but also reveals its nature: from the vector it is seen that the difference in the bivariate vector’s elements is the linear combination that is stable—that is.5670.− 2.com data. t1Y ( then the points will stay near the line formed by the intersection of two planes: and . –.− 5. 10.− 1( 3.Chapter 5: The ARIMA Model: Special Applications 271 machinery includes tests that several series are cointegrated and methods for estimating the is stationary in the Amazon.0− 40. You can think of these as two dimensions in which the series is free to float without experiencing a “gravitational pull” back toward the plane.10 runs obliquely through two-dimensional space. along which points are free to float. if its lag level coefficient matrix is ) then the points will stay near the plane for some constant C as time passes. Note that a lag 1 and a lag 2 bivariate autoregression have been fit to the Amazon. This is a plane running obliquely through three-dimensional space just as the line in the lower-left corner of Output 5.0 10.5) and thus two common trends. t1Y ( 1. t1 1− 1( C = t 3Y5. + t 1 Y ) t3Y . t2Y .com example is possible.0 1 5. In the previous coefficient matrix. it stays close to a constant.0 = 2. t 3Y5. This happens to be the same cointegrating relationship that seemed to apply to the Amazon. t2Y .10. t2Y . However.5. A popular method by 2C = t 3Y 6.0 .com case and was displayed in the lower-left corner of Output 5. 0 1. a regression of the log transformed high and low stock prices on their lags indicates that 3 lags may in fact be needed.0− − = Π = 2. just as our bivariate series was free to float up and down along the diagonal introduces a fourth line in the lower-left corner of Output 5.0− ) 5. In this last example.00 to justify the coefficient of The techniques include tests of such hypotheses about the cointegrating parameters. hypothetical known parameter example you saw that this matrix was ′βα = )1− 1( t which is clearly a rank-one matrix. − 0 − t L t 2Y5.− = 1.− 5. t1Y ( L t 3Y . ) t3Y . there are two cointegrating vectors and one common trend. In this case there is one cointegrating vector (1. − t t 1 Lb − H Y t 10. As a second example. the line of intersection of the planes.

or Johansen’s method (1988.t e + 1− V)A − I(− = V∇ ) t A − I( − ′ β fo swor ro . there λ j γ uncorrelated. YYΣ WY Σ WWΣ WYΣ ′ 1− j For these you can solve the eigenvalue equation using 0= λ γ j 1− V∇ . The solutions are the squared canonical correlations between Y and W. where the rows of are the cointegrating vectors and the following three numbers are all the same: t . Π and since the rank of j j is r.srotcev gnitargetnioc fo rebmun eht t r− k t 1− V V∇ e + 1− VA = V t t ′ β t t t t A I fo knar eht = r − . linearly independent vectors such that . Let which j or equivalently eigenvalues equal to 0. that is. and e. r− k 0 = γ′Π WW Σ = γ WY Σ ′ ′ . Pick a linear combination of elements of W and one of Y in such a way as to maximize the correlation. 1− t YY Σ for V = = = r . that is. It involves squared canonical correlations. Let W and Y be two random vectors. and assume W and e are rank r. W. Begin with a lag 1 model on . That's the second highest canonical correlation.272 SAS for Forecasting Time Series Johansen will be described next. Let The problem of finding vectors and scalars k× k Π .1− V fo esoht dna V∇ fo stnemele eht neewteb snoitalerroc lacinonac derauqs oreznon fo rebmun eht = r .′ βα Π )A − I( . For a lag 1 model. there must be j λ is an eigenvalue problem. pick the linear combination from each set that produces the most highly correlated pair. and similarly for Y. That correlation is the highest canonical correlation. etc. It is seen that finding the number of cointegrating vectors r is are equivalent to finding the number of nonzero eigenvalues for the matrix Johansen’s test involves estimating these variance and covariance matrices and testing the resulting estimated eigenvalues. Using only the linear combinations of W that are not correlated with the first. each element of is regressed on all the 1991) consists of a regression of elements in to produce the rows of the estimated coefficient matrix. Let W and Y be two random mean 0 vectors related by where is a matrix of and denote the variance matrices of Y. e + WΠ = Y . WW ΣΠ = }′ WY{E = WY Σ WW Σ j j j j 0 = γ)I λ − Y1YΣ WY′Σ W1WΣ WYΣ( − − 0 = γ) YYΣ λ − WY′Σ W1WΣ WYΣ( − Σ .

Given that there is one cointegrating vector. Suppose now that where is a vector of means. As with the univariate unit root tests. a matrix of known constants. some comments about higher-order processes and was assumed to have been centered so that the role of the intercept are needed. The equations become p ′ α t p e ′α + 0 + λ p′α = tV∇ p′α dna t p e ′α + 0 = tV∇ p′ α α dimensions as such that . the distributions of tests based on the squared canonical correlation coefficients are nonstandard for unit root processes. the test that its form is is the one involving comparison of two eigenvalues and. Subtracting from both sides of the first equation and subtracting from both sides of the second gives 1− V µ)A − I( = λ t “common trends” in the vector process. just as an ordinary regression program will deliver the test statistics for a univariate unit root test but not the right p-values. vector no intercept was needed in the model.com data.com data. Up to now.t .0 = ′βα p α = )I − A ( p α ′ ′ 0 = αp′ α α .φH = β V)1 t e + )µ − 1− V(A = µ − V −. interestingly.1( = ′ H e + ) 1− V′ H(′ φα = V∇ .F T AM E Y L Chapter 5: The ARIMA Model: Special Applications 273 Johansen suggested studying the estimated squared canonical correlation coefficients to decide how many of them are significantly different from 0 and thereby estimate r.com data. such as those found in the error correction model.com data. Standard procedures such as PROC CANCORR will deliver the desired estimates. the number of cointegrating vectors. as in the case of the Amazon. ( 1 t t = 1− V′ H = daerps = S t t t e + 1− V′ βα = t .1− t 1− t V V t )1 .1( − t t t ′ V∇ V∇ β d na dna ′ β t e + )µ − 1− V()I − A( = V∇ ) µ − 1− V ( . Before using PROC VARMAX on the Amazon. could be taken as any multiple of the vector In the Amazon. the “intercept restriction” must hold. is shown by Johansen to have a standard chi-square distribution under the null hypothesis in large samples. If and you can easily see that which motivates the test. In the Amazon. Johansen tabulated the required distributions. The test essentially compares the squared canonical correlations between and to those between and . thus enabling a test for r. The left-hand equation will be referred to as the “deviations form” for the model. if is some multiple of one would expect the two and to consist of one number near 0 and squared canonical correlations between . recall that with representing a matrix of the same Multiplying by displays the V∇ another number nearly equal to the squared canonical correlation between ) w ol ( g ol − ) h g i h ( g ol = 1− t and 1− t VH ′ .1( t t µ = ′H t t V∇ .8 Intercepts and More Lags PROC VARMAX gives these tests and a lot of additional information for this type of model. In order for these two equations to be equivalent.)1− . t 5.φH = β t V∇ t e + 1− V)I − A( + λ = V∇ t t t e + 1− VA + λ = V t t t V . ′ βα = I − A and so p In the cointegration case. The test that the first number is near 0 is a test for the cointegrating rank and involves nonstandard distributions. it appeared that Johansen also provides a test of the null hypothesis that where H is.2.)1− .

1− t. once you remember the practitioners are interested in the possibility of an unrestricted (nonzero) drift in such data. The reader familiar with Johansen’s method may note that he uses a slightly different parameterization that places the lag levels at the furthest lag rather than lag 1. 2 R t t 2. Subtracting from both sides of t gives model are given by t p ′ Further discussion about the role of the intercept in cointegration can be found in Johansen (1994). you can simply replace and with and and follow the same steps as described earlier for a lag 1 model. For example. 1+p − t t t. Johansen shows that seasonal dummy variables can regressors be added as regressors without altering the limit distributions of his tests. or In the case of higher-order models such as the estimate of that would be obtained by mutivariate multiple regression can be obtained in three stages as follows: .” as it is called. steps 1 and 2 would have and furthermore. t 3.2 R t t 1 R t 1− t V t V∇ .274 SAS for Forecasting Time Series their first differences are white noise processes. t1 In higher-order models. t t t t the common trends for this t .t e + 1− V∇2A − 1− V)I − 2A + 1A( = V∇ t e α + 0 + λ p′ α = tV∇ p′ α t p ′ α Multiplying by on both sides and remembering that . The procedure has been described here in a manner that emphasizes its similarity to univariate unit root testing. some t . As in the case of univariate unit root tests. 0 = µ)A − I( p α ) I − 2 A + 1A ( e + 2− V2 A + 1− V1A = V t t ′ t t . Regress on getting residuals R 1− t − 2R 1− V∇ V∇ t 1R 1− V V∇ 1. you might prefer to associate the unrestricted drift case with a deviations form that allows for such trends. t 1 e + 2− V2 A + 1− V1A = V t − t. The right-hand equation appears to describe random walks with drift terms given by the elements of vector Of course. becomes The same “impact matrix. Such data will display rather regular upward or downward trends. λ p′ α − t( λ − µ − 1− V t t Vp α ′ t The elements of vector are seen to be driftless random walks in the left-hand equation since Nevertheless. t . appears in either format.1 . and inferences about its rank are the same either way. Regress on getting residual matrix . In a lag p model. then. V∇ … 1− V∇ . 0 µ)A I( p α = λ p α = − ′ ′ t e + ))1 − (λ − µ − 1− V()A − I(− = λ − V∇ e + ))1 − (λ − µ − 1− V(A = λ − µ − V t )1 t µ)A − I( = λ “intercept restriction” you see that . Regress on .t I − 2A + 1A = Π e + 2− V)I − 2 A + 1A( + 1− V∇)I − 1A( = V∇ t .

Here and represent the VAR coefficient matrices.2. RUN.9 PROC VARMAX Returning to the Amazon. The COINTTEST option asks for a test of the cointegrating rank. VAR(3).0 905 905 NssiMoN α r>knaR :1_H 1 0 r>knaR :1_H 1 0 ′ β ′ βα Π I A + A + A r=knaR :0_H 1 0 r=knaR :0_H 1 0 = = ′ β − 3 .0 4021.6 51. ECM. OUTPUT OUT=OUT1 LEAD=50. They are the log transformed high and low prices for Amazon.5 xaM tnatsnoC ssecorP nItfirD ssecorP nItfirD raeniL A 1A .56 ecarT 62. 80569. MODEL HIGH LOW/P=3 LAGMAX=5 ECM=(RANK=1 NORMALIZE=HIGH) COINTTEST. Part 1 PED PED epyT wol hgih elbairaV . COINTEG RANK=1 H=(1 .17.)1− .1 42632.9 99.0 eulavnegiE 3210.3 43. meaning that the impact matrix is such that and are column vectors (rank 1). Output 5.com stock.5 = xamgal 2 3 1 A .5 92993.1( 0 905 t Vβ ′ = ′H 48.91 erudecorP XAMRAV ehT gnissiM esiwriaP fo rebmuN snoitavresbO fo rebmuN ecarT 66.t β V eulavnegiE 3100.51 16422.3 naeM .17 VARMAX on Amazon. PROC VARMAX is used to produce some of the cointegration computations that have just been discussed.3 56621.1 veDdtS tseT knaR noitargetnioC eulaV lacitirC eulaV lacitirC 31.2 21813.0 62360. Recall that if is a stationary linear combination of elements of the random vector then so is any multiple of it. on variables high and low.17 76050.0 05. This requests a vector autoregressive model of order 3. ID T INTERVAL=DAY. The normalize option asks PROC VARMAX to report the multiple of that has 1 as the coefficient of high.1 niM tnatsnoC noitcirtseR eht rednu tseT knaR noitargetnioC tnatsnoC MCEnI tfirD MCEnI tfirD .0 3021. PROC VARMAX DATA=AMAZON. while the COINTEG statement tests the hypothesis that the cointegrating vector can be expressed as a multiple of Only a few of the many items produced by PROC VARMAX are shown in Output 5.com Data.Chapter 5: The ARIMA Model: Special Applications 275 5.com data. Diagnostics of fit will be given up to The error correction model. is assigned a rank 1. -1 ).

Thus Johansen’s test indicates a single cointegrating vector. For this data the rank 1 and rank 2 versions of are and 433353.0 1> r 0− ′βα = Π 0=r 1= r .0 11460. Note that the tests are based on eigenvalues. as might be anticipated from the earlier discussion linking squared canonical correlations to eigenvalues. the hypothesis − elbairaV elbairaV = ) 63010.34 .com Data.0 2660.0− 382560.0 1 ymmuD 63010.0- − eulavnegiE 3100.0 4021. From the graph.0 These are almost the same.17a VARMAX on Amazon.0 11460.0− 00000. though both tests agree that anyway.1( 31053. Output 5. in the unrestricted case.0− 8460.0 FD 1 2 2 ymmuD 44342.0 = 63010.0− 11460. so is rejected.0 p ′ α Whether or not the intercept restriction (that anihilates the intercept) is imposed. exceeding the critical value 15.0 1 = 1− 2 = r − k 460. 1= r = r( qSihC >borP 9710.1 setamitsE AHPLA tneiciffeoC tnemtsujdA 2 ymmuD 47100.0− 90200. so the test without the restriction seems appropriate. and hence a single ( ) common trend.50. For example. The test for versus does not reject the null hypothesis. Part 2 knaR 1 0 )1 The long-run parameter estimates in Output 5.1 47100. it would seem that a drift or linear trend term would be appropriate here.0 3950.1 1 ymmuD 31053. In this computation.17a allow the user to estimate impact matrices of various ranks.10.0 wol hgih wol hgih 00000.1 1= r 1= r 00000.1− tcirtseR nO eulavnegiE 3210.60 with 1 degree of freedom. Assuming a rank . 31053. In light of the plot.0- Π r=knaR nehw noitcirtseR eht fo tseT setamitsE ATEB retemaraP nuR-gnoL erauqS -ihC 06. The null hypothesis that the intercept restriction holds is rejected using the chi-square test 5.100000.1− α 8453. Output 5. the null hypothesis that anihilates the intercept is tested by comparing eigenvalues of certain matrices with and without this intercept restriction.0− 93843. it is not surprising to find a drift in the common trend.090200. no restriction is made on the intercept. as might be expected since there was very little evidence from the test that the rank is greater than 1.000000. Johansen’s “trace test” has value 65.0 3021.276 SAS for Forecasting Time Series of cointegrating vectors is rejected.5 56.0 053.5 0=r p ′ 44342.

0 440.t ′ 5. you are not really interested in these results that assume the restriction.0− 860. te p α = tep α + 1− t ′ ′ W +βα p′α = tV p′α∇ ′ α p ′ ′ β .0− + = 75800.Chapter 5: The ARIMA Model: Special Applications 277 Now suppose is an augmented version of namely a vector whose last entry is 1 and For simplicity consider the lag 1 model. 1− t V . they might be of interest and hence are shown for completeness.000000.961-E36494. Output 5.0- 1− tL∇ 310.0- 790. They satisfy The get multiplied by 1. These are the first .0 .1 t2e 2− tL∇ 231.0− 1− t 560.0 00000. Part 3 .com Data. Write the whose first entries are the same as those of model as where is the same as except for its last column. The result is the same in higher-order models.0 L 460.0− 053.0− + t1e 2− tH∇ 930. they elements in the last column of represent the intercepts for the stationary linear combinations. 1− tL 453.1 3 ymmuD 61-E4520.1− t W t dnerT detcirtseR eht no desab ATEB tneiciffeoC nuR-gnoL dnerT detcirtseR eht no desab AHPLA tneiciffeoC tnemtsujdA 2 ymmuD 02484.093010.10 Interpreting the Estimates A list of estimates follows (Output 5.′ β r− k .1 2 ymmuD 41600. Recall the previously mentioned transformation matrix T constructed by stacking above where is a elements of are driftless unit root processes.17c) that shows that the fitted rank 1 model for the log and is transformed high and low prices.0 1− t V t + 1− t W Vp α ′ t V∇ t t H∇ L∇ k × ) r − k( .t e β + 1− W + βα′ β = V′ β∇ ′ VT t 3 ymmuD 33308. PROC VARMAX gives “dummy variables” for this case as well.0 77850. This shows how the addition of an extra element. a 1. to forces a model in which the unit root components do not drift.133497.0 1 wol hgih wol hgih .0 H 1 ymmuD 67240.0 + 1− t H∇ 191. In another data set.044700. the last entry of In other words.100000. Having previously rejected the restriction of no drift in the common trends.t e + 1− W + βα = ′ 492.17b VARMAX on Amazon.2.0 + ′ 0 = αp′ α matrix such that t Because it follows that the The elements of p ′ α .1 1 ymmuD 35453.0 . last r elements are the stationary linear combinations. the “Dummy 3” columns could be omitted as you might expect from the preceding discussion.247930.t .1− t V +β ′ t H βα′ β elbairaV elbairaV 91010. Because the last column of ALPHA is 0.

0 hgih wol hgih wol hgih elbairaV 2 1 gaL_FID setamitsE tneiciffeoC RA 67353.0 wol 31053.0 27210. Part 4 278 SAS for Forecasting Time Series 1 = KNAR nevig setamitsE ATEB retemaraP nuR-gnoL indicating a correlation 0. 92.0 19340.087460.0 hgih wol hgih elbairaV noitavonnI eht rof xirtaM ecnairavoC 90231.0 30790.0 92200.0 89200.075800.59200.057392.17c VARMAX on Amazon.77 between the errors.0hgih wol hgih elbairaV setamitsE 'ATEB * AHPLA retemaraP 91010.0 11460.com Data.0 11460.2 0001 = 2 1 Σ Output 5.2 92.014930.0 87091.2 89.1 1 ymmuD wol hgih elbairaV 59. and error variance matrix .0 wol 39760.01 ymmuD wol hgih elbairaV 1 = KNAR nevig setamitsE AHPLA tneiciffeoC tnemtsujdA 63010.0 wol 92200.0 tnatsnoC wol hgih elbairaV setamitsE tnatsnoC 31053.100000.

0(605 = ])3021.< 1000.17d VARMAX on Amazon. tL10. However.0 veDdtS F>borP eulaV F 2-1RA 5617.0 6450. so rather small and practically insignificant departures from the null hypotheses might still be statistically significant.0 4929.< 1000.< = )85810.1203 by comparing to a chi square with 1 degree of freedom .4 skcehC citsongaiD ledoM etairavinU eulaV F skcehC citsongaiD ledoM etairavinU skcehC citsongaiD ledoM etairavinU 04. it is a bit surprising that the test that rejects that hypothesis.0 6662.0 70. The DurbinWatson DW(1) statistics are near 2 for both residual series.28 .0 33.1 89.964 39.9 qSihC >borP 1000.0 8550.441 60.com Data. the sample size is somewhat large. (See Output 5.11 Diagnostics and Forecasts There follows a series of diagnostics.17d. The test that is referred to as a test of the restriction matrix H.0 52.0 7504. These tests indicate uncorrelated residuals.0 )1(WD 89. In a similar vein.0 − 1(gol − )8301.0 − 1(gol[)3 − n( 3450. type.1 F>borP 1000.< 1000.1 erauqs-R 0081.0 H∇ qSihC ytilamroN 54. Both of these departures from assumptions are found.1 elbairaV t wol hgih L∇ t L− H elbairaV elbairaV t )1− .0 00.2. The test compares eigenvalues 0.0 79.0 56.0 − t H F>borP eulaV F 1RA 1789. one might look at plots of residual histograms to see if they are approximately bell shaped before worrying too much about the rejection of normality.0 9478.) F>borP eulaV F 4-1RA 2815.0 20.81 19.91 F>borP eulaV F 3-1RA 7485. Output 5.0558 .17e. The regression of on the lagged levels and two lagged differences of both H and L is seen to have a model F test 4.0 13.< 905 = n eulaV F 1HCRA 74.1038 and 0.1(φ wol hgih wol hgih = ′β )1− . or ARCH. and autoregressive models fit to these residuals up to 4 lags show no significance. Part 5 t was found to be stationary using a standard unit root test. and a regression is found just below this.1(φ = ′β .Chapter 5: The ARIMA Model: Special Applications 279 5.< F>borP 1000. and that the Recall that the spread estimated cointegrating relationship was Given these findings.)The residuals similar line describing the from these models are checked for normality and unequal variance of the autoregressive conditional heteroscedastic.0 18. (See Output 5.91 and R square 0.

0 40795.9 1DTS 55801.4 48018.0 64770.100000.4 hgih .4 50169.4 22218. The last bit of code requests forecasts using the VAR(3) in rank 1 error correction form.0079910.4 02436.4 08507.0 16450. .02SER elbairaV elbairaV elbairaV 40708.com Data.4 1ICL ATEB tneiciffeoC nuR-gnoL detcirtseR rof tseT 88205.0 16450.0 .4 86288. Part 6 .4 2ROF . .5 04669.4 20458.4 56819.4 73578.4 60835.1 1 ymmuD 68782.4 47568. 09217. These are put into an output data set.0 03450.4 2ICL FD 1 51701.4 52197.02DTS 1SER ATEB no sisehtopyH ot tcepser htiw AHPLA tneiciffeoC tnemtsujdA ATEB ot tcepser htiw H xirtaM noitcirtseR ATEB no sisehtopyH ot tcepser htiw ATEB tneiciffeoC nuR-gnoL .4 99795. thus making the produced. . An additional complication with these data is that the market is closed on the weekends.4 24407.4 56577.0 46517.17f.4 27268. . Output 5.0 03450.0 57480. .com Data.4 92898.0eulavnegiE 3021.0436850.4 22486.4 03008.1 1 ymmuD 00000.0 50680.4 1ICU 04829. . A portion of these data.4 2ICU qSihC >borP 2200.0 16450.4 13957.4 88256.4 27989.280 SAS for Forecasting Time Series The fitted model implies one common trend that is a unit root with drift process and one cointegrating vector. Last Part noitavresbo = t 40710.100000.4 17607. including standard errors and upper and lower 95% confidence limits. is shown. An easy fix here is to use implicit assumption that the correlation between a Monday and the previous Friday is the same as between adjacent days. . 28697. a few observations from which are shown in Output 5.4 wol xednI 1 215 115 015 905 805 t sbO 215 115 015 905 805 sbO 215 115 015 905 805 Output 5.17e VARMAX on Amazon. 604640. .17f VARMAX on Amazon.4 wol hgih wol hgih wol hgih 1ROF tcirtseRnO eulavnegiE 8301.0 03450.0 erauqS -ihC 04. so the use of the actual dates as ID variables causes a missing data message to be number as an ID variable.0 1 ymmuD 00000.4 89647. 391750.4 95357.

18 Forecasts Using Cointegration . or common trend. The drift in the underlying unit root process. The fact that the unit root is in some sense shared between the two series does not do much to narrow the intervals. is apparent in the forecasts.) Output 5. suggesting that the last few observations were quite near the cointegrating plane. The short-term dynamics do not seem to contribute much to the forecasts.18.Chapter 5: The ARIMA Model: Special Applications 281 You can observe the quick spreading of confidence intervals. typical of data whose logarithms contain a unit root. (See Output 5.

282 .

1.3.1(AMRA 2.6 retpahC .6 103 2 noisnemiD fo )1.6 503 secnairavoC morf denimreteD srotceV etatS 1. L +t Y t L + tY ˆ 703 elpmaxE detalumiS 3. In model discussions in this section. In other words. This procedure also handles multiple series and.6 382 selpmaxE etairavinU elpmiS emoS 1.6 582 elpmaxE etairavitluM elpmiS A 2. and. PROC VARMAX. unlike STATESPACE. can perform cointegration analysis. they must satisfy some restrictive conditions in order to justify the kind of transfer function modeling that is available in PROC ARIMA. 6.2. and their forecasting equations. no matter how far away.1.1 Introduction In ARIMA modeling. There must be no feedback. PROC STATESPACE allows estimation under less restrictive conditions and provides some automatic model specification ability.6 203 ECAPSETATS CORP 3.6 6. the transformation to stationarity is not just differencing.3. The basic idea in state space modeling is to discover the “state vector.2. was discussed. here are some models. In Chapter 5.1 Some Simple Univariate Examples To get started. Also.1. one of the difficult tasks is to select a model. another procedure.6 892 selpmaxE eroM 2. As is customary in discussing state space models. although the user is still responsible for making the series stationary.6 State Space Modeling 492 sledoM AMRA rotceV dna ecapS etatS fo ecnelaviuqE 3.” The state vector consists of the current values of all series under investigation plus enough forecasts into the future so that all forecasts. if you have several related time series. the symbol denotes a forecast of using information available at time t.1. all with mean 0.6 892 selpmaxE etairavinU emoS 1.3.6 382 noitcudortnI 1. multiple inputs must be independent of each other and enough differencing must be specified to render the series stationary. for proper identification and forecast intervals. which is appropriate when your series display unit root nonstationarity but some linear combination of the series is stationary. the default assumption is that the mean has already been subtracted. are linear combinations of these.6 503 snoitalerroC lacinonaC 2.

must be linear combinations of state vector elements from that point on. For the AR(1) model all t complicated. tY ( ˆ ˆ to be constants. but by the “linear combination of linear combinations” argument it is clear that all forecasts are linear combinations of and You can see that for an AR(p) the state vector will have p elements. it is clear from the MA(2) example that for an MA(q) model. the mission control engineers were heard to say. Y2α + t t 1+ t Y1α t 2 + tY ˆ . forecasts more than q steps ahead are trivial linear combinations (0) of state vector elements.) t k + tY . The expressions get more . The state vector contains all the information needed to forecast into the infinite future.1 One-. and from them. and so forth were being taken. Acting as though s that have already occurred are known. ˆ . Y .1 3 + tY ˆ 0 =L t Y2α + ) eβ + Yα(α t t L + tY ˆ t 1+ t t t t Y1α ˆ Y2α t 2 + tY e2 β .t Y determined from However. For example. t 1+ tY ˆ t 1+ t Y1α( 1α ˆ t Y … t 3 + tY ˆ and is a linear combination. tY ( ˆ state vector is It can’t be just because involves whose value cannot be of state vector entries. ˆ .) 1+ t 1+ k + tY . . the state vector is defined to be with t where k is the smallest value such that all remaining forecasts are linear combinations of the state vector elements. 1− t Y t |1+ tY ˆ t Y . by the linear combination of linear combinations argument.1(AMRA )2(AM )2(RA L + tY ˆ t e )1(RA emaN . MA models need to be invertible. For the AR(2) the 0 = Y0 + X0 t 1+ t Y2α + ˆ t ) eβ + Yα( α t t 2+ t … t Y1α ˆ Y 3α 2 . then a state vector that “looked good” would be one whose projections forecast a landing on the runway.t Y forecasts are linear combinations (multiples) of so the state vector is just ( ). like . During an early space shuttle mission in which the landing was broadcast.2. Finally. and Three-Step-Ahead Prediction for Different Models t Numerical examples and further discussion of models like these appear in Section 6. that is. A “linear combination” of a set of variables is a sum of constant coefficients times variables. At time the state vector will STATESPACE and it is the thing that you are trying to estimate from the data. for mixed models the forecasts are eventually determined through autoregressive type recursions and.2 . linear combinations of linear combinations are themselves also linear combinations. Of course these state vector entries were being updated quickly and state space forecasting is based on this updating idea. “Your state vector is looking good. Two-. 1+ tY ( ˆ ˆ t be updated to The updating equation is the model in PROC . t 1+ tY.) t 1+ tY . In the space shuttle example. For moving averages it is assumed that current and past s can be well approximated from the observed data—that is.1 +t e . velocity. 1+ t 2 + tY .” What did that mean? Numerical measurements of height. of them too. if the elements of the state vector included height. Note that and for to be the is also a valid linear combination of X and Y. t 2 + tY . and are linear combinations of X and Y. Lα ˆ t Y 1− Y 2 α + Y1α = 1+ Y ˆ Yα t 1− te2 t t eβ + Yα β + e1β t t 1+ tY t t t t t ˆ e+ 2 − te2 Y2 − X5 1− e β + e + 1− Yα = β + 1− e1β + e = … 2− t t Y 2 α + 1− Y1α = ) Y2 t t t t t t e + 1− tYα = − X5(4 − ) Y3 + X2(6 alumroF Y3 + X2 k >L t t t t Y Y Y Y )1. deceleration. forecasts of the flight path into the future were being computed. t 1+ t Y2 α + ) Y2α + ˆ t . Notice that is automatically also a linear combination of X and Y. and location information. is a linear combination. Considering variables and considering functions of model parameters. deceleration.284 SAS for Forecasting Time Series Table 6. 1+ t 3 + tY .

1Y ˆ 2 .2Y9.1Y Y ˆ ˆ + 1 + t.2e9.1 1 + t. The state vector is t +t Y ˆ t = t1 To see why this is the case.0 1 1 . then the forecast will differ from only by .1 .0 EG + ZF = 1+ Z 1 + t.1 3.0 + − t 1 9.0 − t1Y94.0 + t1Y1.0 + t1Y1.0 + t1 1.t which is the error term that.1+ t Z t +t Y 3.0 0 − t2 − t Y 7. 1 1 Y + t.1 ˆ 0 + t Y 0 7.1 t1 Y4.0− Y7. The same is true for you thus have t2 9.0− 3.1 Y Y .2Y + t.1 1 + t.1Y3. first note from the bottom row in the model equation that the one-stepahead predictor is clearly a linear combination of state vector elements and thus does not need to be included in the state vector.1e + Y + 1 t1 .2 .1.1e3.2 A Simple Multivariate Example Now suppose a vector process is of interest.1 + t. An easy case to consider is t e −t + t e −t 1 2 2 .1Y3. at time t.1 and e .0 = +t Y +t 1 0 to You have .0− + 1+ t t2 Y7.0 t 0 Y 1 1 t Z These three equations show how to update from + t +t Y 94.2 .1e t1 + t. of dimension 2 (2 elements) and of order 2 (maximum lag is 2).0− ˆ 1.2Y ˆ 1.1 Y t2 Y 7.0 = − 2 + t.0 − ) 1+ t. has yet to be realized.1 = 1+ t 2 + t. 2 + t.1 Y Y t Z . 1+ t.2 .Chapter 6: State Space Modeling 285 6.0(9.0 = 1 2 3.0 + t1Y1. Y = t1 + t.1Y = = ˆ 1 = 1 1 = = t 2 t1 .1 .2 Y 0 Y 0 4.0− +t e 1 +t e 0 1 1 .1Y(3.0 t1 − Y4.2 . Next.1 2Y Y t1 + t.2Y9.1 36.2e t2 Y36.1 t2 t1 .1 + ˆ t t1 mrof eht sah hcihw + t.0 Noting from the top row of the model equation that seen that forecasting one step ahead using information available up through time − 1 + t.2e + 1 + t.1 e+ t1 1+ t Y4.0 Y 7.1 Y + t.0 − ) 1+ t.0 − 1+ t.0 − 1+ t.2Y ˆ using it is would produce 1 + t. note that if the best predictor is used and the coefficients are known as is assumed here.1 This is a vector autoregressive model. VAR.

corresponding to Y2t and Y1t .43 16.0 332730.1+T(Y 86443.3(G )1.0630386. Prior to discussing this new problem.286 SAS for Forecasting Time Series This looks quite a bit like a vector autoregressive model.0888211.T(X etamitsE 40858.0 0 )T.0630386. respectively.3(F )1.T(Y EG + Z F = 1+ Z )2.2(F t t .0 147223.0 setamitsE retemaraP rotceV etatS 4675.0 0 retemaraP )T. it introduces a new problem—namely.1.0 469820.01 0 7179.1 PROC STATESPACE on Generated Data eulaV t 50. The code PROC STATESPACE DATA=TEST.0 975830.0 908120.2(F )2.61 40.1 2810.0 347040.01 xirtaM noitisnarT fo etamitsE noitavonnI rof xirtaM ecnairaV noitavonnI rof xirtaM tupnI 40858.3(F )3.1 57525. RUN.8356.2(F )1.1 04675.0 564810.3(F )2.1+ t is all that is needed to produce the results in Output 6.057525.0 888211.4136. a simulation of 2000 values from this bivariate VAR model is used to produce some state space output.3(G )3.06 68. VAR Y X.1 086443.002810.4 ledoM dettiF dna mroF ecapsetatS detceleS erudecorP ECAPSETATS ehT )T. because it happens that every possible vector ARMA process of any dimension can be cast While this eliminates the problem of identifying the into the state space form autoregressive and moving average orders.0 rorrE dradnatS 055220.0 869720.0 053450.0121. The data set TEST contains the variables Y and X. deciding from the observed data what elements are needed to construct the state vector.1 0 1 564810. and you might think of the state space approach as an attempt to put all vector ARMA processes in a canonical form that looks like an AR(1). .0147223.0 814830. Output 6.067.

0 ˆ 68.1Y ˆ . Doing so produces the results in Output 6.T(X )T.0B 1 0 0 − = t( 23.0 0 9.1 = 1 0 0 G F .Chapter 6: State Space Modeling 287 to force a one-step-ahead Y predictor and no predictions of future X to enter the state vector. which it is You might want to drop that term from your model by forcing its coefficient to 0. the . t1 Y The state vector has been correctly identified as containing and as is seen in the 1 X 2 Y MROF 3. 43.0 in the PROC STATESPACE step to restrict that row 2.1+T(Y )T.02 is in fact an estimate of 0.0− = 1. t 1+ t. Of course this assumes the unlikely scenario that the user has some prior knowledge of the state vector’s true form. No elements of F or G are more than 2 standard errors away from the true values. column 3 element to 0.0− 1 0 94. They are structural parameters that do not require estimation. The matrix F is referred to as the transition matrix and G as the input matrix in the output.2.0− 7.1 0 1 G 36.1 = 0 dna ˆ )T.T(Y 1 dna notation user could specify using the X Y variable names. Knowing that the estimate –0. )36. t2Y .3)=0. and all estimates are quite close to the true values both numerically and statistically.0 0 35. . Comparing the true and estimated F matrices you see that and for the input matrix G Entries of 0 or 1 are known once the state vector has been determined. Had this not been the case.0− =F 11.0− 1 85. using the statement RESTRICT F(2.0 3.1 20.0− 86. you would expect its t statistic to be smaller than 2 in magnitude.

7170.75 15.1 0 1 62895.0 0 xirtaM noitisnarT fo etamitsE )T.T(X rotceV etatS ledoM dettiF dna mroF ecapsetatS detceleS erudecorP ECAPSETATS ehT )T.01 0 406223.0 714830.8326.44 18.0 799820.0 964300.0 rorrE dradnatS 25758.0 etamitsE )2.0 244810.3(F )1.0324707.2(F )1. 30.3106. Plots of both series and their forecasts are seen in Output 6.1 0 1 noitavonnI rof xirtaM tupnI 525823.2(F retemaraP setamitsE retemaraP 288179.1 noitavonnI rof xirtaM ecnairaV 25758.T(Y .06 74.0324707.0 244810.3(F )2.1 62895.1 525823.2 RESTRICT Statement in PROC STATESPACE 288 SAS for Forecasting Time Series The estimated elements of F and G are again close to their true values.0 0 82015.0 944590.0 678920.0 618120.3.Output 6.082015.0 593210.1+T(Y )T.0 223340.3(F )2.0406223.3(G )3.72 eulaV t 255220.0944590.3(G )1.

Chapter 6: State Space Modeling 289 Output 6. For these might be the time t deviations of GDP. and interest rates from their long-term means.3 Forecasts for Generated Data The forecasts seem to have a little more interesting structure than some you have previously seen. The characteristic equation involves the determinant p Y k× k E + p − tYp A + j A A− − 2 A 2 − p m − 1A1− p m − I p m + 2 − Y 2A + 1− Y1A = t 3= k t t Y t E . As in a univariate series. unemployment. is a vector of random normal variables that can be contemporaneously correlated in any Here arbitrary way. This has to do with the nature of the roots of the characteristic equation. and each is a matrix of parameters to be estimated. the behavior of a VAR of the form t t is determined by the roots of a “characteristic equation. is a dimension k vector of deviations from means. but must be uncorrelated across time.” and the same is true for a vector ARMA.

0 4. That second row produces the trivial identity which.1 4.0− −t Y 1 − t.0 − m ( m = 2 t e te + 0 0 m 2 1 0 = 0 A t 2 2 1 1 2 m90.t which looks somewhat similar to the state space representation. It would differ from the process used in PROC STATESPACE in that current and lagged Ys. however. / 7893.2 .0 damped sinusoidal component with damping rate and period time periods as you forecast L periods ahead.0 E + 2− Y2 A + 1− Y1A = Y 3. is true whether you put it in the system 2 = 5. Each low is about or about 1/3 of what it was then.0− 0 p )82. and the above representation would be another type of state space representation of the vector process. namely.) ) 53948.1 − 2 A 2 m − 1Am − I t 0 Y 4.0 − m 2 m9.0 whose roots are 0. In a VAR of order 2 you have t which is sometimes written in a matrix form like this: I 1− Y 1A 2 A Y = E 0 + 2− Y I 0 1− Y t t This simply says that and so it consists of a trivial identity and the original AR(2).( natA = θ .1 Y = 1− Y Y 0 1 t m4.0 − 2m ( )4. All of these roots are less than 1 in magnitude. rather than current Ys and predictions. m 7.0 − 9. This seems consistent with the graph.0 0 t Y .41 whose roots they then require to all be greater than 1 in magnitude for stationarity. In the VAR example currently under study.0 m − 0 0 0 0 0 t t 3.2 .1 − m1.0 + + m3.52 = )71538.32966 and the complex pair representation so . + m3.0− t m6633076. you have .0 − Ap m − 1 − t.i7893. 0.52 / 063 5. Some sources write the characteristic equation in ascending powers of m. implying a .0 t = 1 2 0 1 1 41 2 1 .0 Y m t The complex pair of roots has degrees.290 SAS for Forecasting Time Series and the values of m that make this 0 are the roots. the state vector would have had dimension 4. not 3 as you had previously. the system would have had full 4. this system has dimension been of full rank. If you substitute the A matrices of the current example. constitute the state vector elements.0 Y= 7.41 =L . this being the stationarity condition.0− tY = −t 0 Y −t 0 .2 t . 1− t.1 − 2m ( = − t Y 7. As it stands. At a lead of around the forecasts hit local low points as they did at the end of the data.0 + ) m7.0 E + 1− Y1A + 2− Y2A = Y L 53948.1 . Had the matrix rank. the system is not full rank and can be reduced by simply eliminating the second row and second column of the coefficient matrix.1 − 2m ( )28787324366923.2 0= t − θ nis i ± θ soc ( 53948.1 + 2m2 − 3m ( m = 1 1.0 ± 71538.0 − t Y 9. 1.23.1 53948. of course.2 1− t 1.

for any e sequence and any given initial values. This system is observationally equivalent to the system in that. 0>j for For you find )2 + j −( Γ2A + )1 + j −( Γ1A = } − ′ j t Y 2− t Y { E2A + } − ′ j t Y j −t ′ Y Multiplying the AR(2) on both sides by 1− t and taking expected values. the two systems will produce exactly the same sequence of Ys. you see that t Y } j +t ′ Y Y{E = )j (Γ t defined as an expected value.1 Y .2 Y . The resulting reduction gives t −t e t −t e + 0 −t 2 . For example might contain and predictors up to two steps ahead.t Z Every state vector 4×4 2 1 .1 again having a familiar form The first row gives a trivial identity.1 Y 7.Chapter 6: State Space Modeling 291 or not. but it is needed to make the system square. as has been demonstrated. that arises from a vector ARMA satisfies a recursive relationship of the form In PROC STATESPACE the state vector always consists of the current and if you have 3 observed series at each time t—along with observations—say. if the two-step-ahead predictor is included. t1 + t. t2 t Z . it is possible from the model to compute the autocorrelation between any and for the same or different vector elements at the same or different times. so leaving out the second row and column makes no real change in the system. The size of the state vector Z and the general form of the updating recursion is the same for all ways of writing a state vector. you define (assuming has mean 0). )s t1 + t.) j ( Γ .1 = t( Y 3Y .2 . Y ti t Y . Σ + )2(Γ2A + )1(Γ1A = )0(Γ 0=j . namely. The entries of Z and of the matrices F and G depend on the particular formulation.t t Z Y { E1A t 3 Y )j = = i( . that is.t EG + 1− Z F = Z 1 1 .0− Y t Y 3×3 0 t 1.1 1 t 0 Y t 4. In the theoretical research on STATESPACE methods there are several ways to formulate the state vector.t + 1Y Y 1Y .0− = Y −t 1 0 t . t How do you decide what to put in the state vector? Returning to the bivariate VAR of order 2 that is being used as an example. t2 t.0 9. t2 } −t ′ j Y 1Y Y Y{E 0 2e = raV = Σ 1 1e .1+ t t t EG + Z F = 1+ Z = )j 1 sj 1 2 − (Γ t Y . The second column is all 0s. . predictions into the future. so must be the . j +t ′ Y t Y The covariance matrix between column vector and row vector Σ The data were generated using the innovations variance matrix 1 0 defined as symbolized as is 1 Y There will be no “gaps”. t2 + t.0 3.

The size of the state vector 2.0 45.8− .2 40. and then to use the fitted model as though it were the true structure to construct an estimate of M. The rank of the covariance matrix M 3.7 24. rather than a model with known coefficients. Returning to the order 2 VAR with known coefficient matrices. the following numbers are all the same: 1. constitute the multivariate Yule-Walker equations that can be solved to give all the covariances from the known A coefficient matrices and the innovations variance matrix Thus it covariance matrix M between the vector would be possible to compute. the covariances must be estimated. State space researchers describe M as the covariance matrix between a set of current and lagged Ys and a set of current and future Ys.1Y ( Γ Γ Γ Γ 1A)1 23. That matrix would have what is known as a block Hankel form: )4( )3( )2( .2Y 2 ′ Α)2 Γ Γ 0>j − j 2 2 − t.) 2 + t. The number of nonzero canonical correlations between the set of current and lagged Ys and the set of current and future Ys.3 85. you can see that these matrices satisfy the multivariate Yule-Walker equations.1Y Now so for you have Γ = ) j (Γ = )0( = )3( t2 t2 Y Y Γ Γ t t1 1Y( Y( .5 37. Items 2 and 3 are always the same for any covariance matrix.2− = )1( 74. say.292 SAS for Forecasting Time Series These. the these identifying the columns of M.52 Γ 26.1 70. then.1Y + t.0− 18.93 60.31 85.6 73.) j (′ − j 92. (See the PROC CANCOR documentation for more information on canonical correlations.2Y . For such a matrix M.2Y 64. and the vector these identifying the rows. The strategy used is to fit a long vector autoregression whose length is determined by some information criterion.) 2 − t. by substitution.7 71. With only data.0− 85. The initial autoregressive approximation provides an upper bound for the size of M.) Thus the size of the state vector and the nature of the corresponding state space equations can be deduced by studying the covariance matrix M. namely.6− = )2( 68.8− = )4 ( 41.53 6×6 . matrices in the block Hankel Γ Σ 83.1Y + t.1 )2(Γ )1(Γ = M Γ )0( 1 1 ( Γ = ) j − (Γ − t. )j ( Γ These in turn lead to a matrix M formed by stacking together the form previously suggested.1 + ′ 1 1 )3(Γ )2 (Γ Γ )1( − t.2Y + t.

Regression reveals that (column 5)= –0. 2. t2 t that show dependencies. 0. thus far considered are the first columns associated with series 1 .53 − t 1 .2. t1 + t.6− 92. 2.7 .8− 24. so the same regression that displayed the dependency gives the corresponding row of F.52 85.3(column 3) with 0 error sum of squares. )3 nmuloc ( 0 + )2 nmuloc ( 7.6 23.1 70. indicating that columns 1. possibly with some small but nonzero canonical correlations.2 Y Y The dependent and with series . A perfectly fitting regression corresponds to a canonical correlation 0 in matrix M.1 40.8− 60.53 )2 ( 68.63(column 2)+1. you find nonzero error sums of squares.0 = )4 nmuloc ( Y 83. that matrix. and 3 gives a perfect fit and so shows that the rank of matrix M is 3. Regressing column 2 of M on column 1 and column 3 on columns 1 and 2. You get a positive error mean square when regressing column 3 on columns 1 and 2.0− 64. ˆ t2 2 Y M + t.8− 24.7 73. Column 6 is automatically a linear combination of columns 1. 2 + t.93 Γ Γ Γ )3(Γ )2 (Γ Γ )1( )0( )2(Γ )1(Γ = M Γ .Chapter 6: State Space Modeling 293 You can diagnose the column dependencies and rank of matrix M using a clever trick.0 Y 37.7 83.1.6 41.1 70.31 68. What is is consistent with the needed is a statistic to decide if a small estimated canonical correlation in .49(column 1)–0. but not before. Once the first dependency in each variable has been discovered.2 60. and 3 form a linearly independent set. you can build a sequence of matrices by sequentially appending columns of M. Column 5 is associated with so even though you columns. 2. When estimated covariances are used to get an estimated M matrix.31 64. For example. will almost certainly be of full rank.2 + t. and 5 of M. On the other hand.0 45.2 70. the addition of column 5 also produces a 0 canonical correlation.1 Y M ˆ . and hence is redundant information.1 Y needed in the state vector.0 45. Regressing any other column on columns 1. Therefore. and any future Y is the same as that between and that same future Y. then a regression of that first column on those others (no intercept) will fit perfectly. 23.3 )4 ( 18. and 3 at this point. Linear forecasts such as we are considering are functions only of the covariances. then (associated with column 5) would have been included in the state vector.7. 4 and 5. Note that the second row of the state space transition matrix F is 0. 0. you need not look any further. adding to a set of predictors that already contains and does not add any more prediction accuracy.7 83. + )1 nmuloc (1.6− 68. Leave out that redundant fourth column and consider a matrix consisting of column 1.2 Y t1 + t.5 73. column 3 is not a perfect linear combination of columns 1 and 2.1 24.52 + − t 1Y1. the state vector has been completely determined and no further investigation is needed. In particular. If that matrix had no 0 canonical correlations. there is nothing to be gained by including 26. When you use the first four columns of M you will get a 0 canonical correlation.52 74. Again note that the coefficients give a row of F.2 71.1 Y Y t1 + t.5 85. but in this example.1 2Y 7. you find by regression that so that the covariance between the column 4 variable. That tells you the fourth column.0− 85. 3. These dependencies reveal the number of forecasts of each series that appear in the state vector (one less than the lag number associated with the dependent column) and the row of the F matrix associated with the last occurrence of that series in the state vector. If any column of a matrix is a linear combination of some others.1 40.2− = )3( 74.7 0 t 2 Y 18. 1+ t. Since dependencies for both series have been discovered.

under the name “Markovian representation. the DIC is not infallible and other tests.3. estimates of the elements of G are also needed. ˆ t 6. Like any statistical criterion. as is the case here. Then the appending would continue.1 has provided enough background may wish to move directly to Section 6. mean 0 normal variables with variance matrix The ARMA process is so substituting in the original expression gives ) q −1− t . The following section is for those interested in a more general theoretical discussion. Such estimates are approximate and are often used. as would all columns to that correspond to lagged values of that series. based on the derivatives of the likelihood function. can be computed.p ( − 1− tE1B − t E + p − tY p A + + 1− Y1A = t M ˆ ) q . But if you have followed the example. A criterion DIC to do so has been proposed by Akaike. 1− t which involves current and lagged E vectors and Y vectors prior to time q −1− t q − tE q B − − 1− tE1B − tE + p − tY p A + EqB − − 2− tE1B − 1− tE + p −1− tY p A + E qB − − 2 − tE1B − 1− tE + p −1− tY p A + + 2 − Y1A ( 1A = + 2− tY 2 A + + 2 − Y1A = 1− Y t t 1− t At time . Additional numerical examples and discussion are given in Section 6. Examples of these standard errors and t tests were seen in Output 6. Repeated back E M . Now. ψ 0= ∞ . . Thus the initial estimates of F and G fall into the “method of moments” category of estimates.p ( t t t Y Y t Y . That column would then be omitted from the matrix being built.2.3 Equivalence of State Space and Vector ARMA Models A general discussion of the state space model. Some ideas are reiterated there and some details filled in. such as Bartlett's test for canonical correlations. The following summarizes a main idea from that paper. as starting values for more accurate methods such as maximum likelihood. of course. If you build matrices as described above by appending columns of then the DIC criterion is expected to be negative when the column just added introduces an approximate dependency. the estimated M matrix is computed from it. −E j t j j ∑= Y t substitution produces a convergent expression only in terms of the E vectors. Σ q− t E qB − ) q . the rank is diagnosed. its right in using only columns of the other series. say. you have the idea of how the STATESPACE procedure starts.1. The long autoregression is run.294 SAS for Forecasting Time Series hypothesis that M has corresponding true canonical correlation 0.2. until dependencies have been discovered in each of the series. and let be an Let uncorrelated sequence of multivariate. things become a little more complicated and. and initial elements of F and G are computed by treating estimated covariances as though they were the true ones. if there are moving average components in the series.” is given by Akaike (1974). Another nice feature of the maximum-likelihood method is that large sample approximate standard errors. represent a dimension k vector ARMA process with mean vector 0. could also be used to test the hypothesis that the newly added column has introduced a dependency in the system. The reader who feels that Section 6.1 and Output 6.

you have In particular. At time q−L +t For leads L exceeding the moving average length q. p >j 2− M A 1− M A MA 0 0 I 0 0= j 0 I 0 A coefficient matrices with 1+ t E1−Mψ + 0 0 t M +t 1+ t M + t 1+ t 1−M + t 1+ t 2 + t 1+ t Y = 1+ M+ Y Y Y t Y Y t with gives the full set of equations. which combined .p (xam . what should you use as the subscript M? To the model becomes answer that. using a . t L+t Y t Z So if the state vector contains then it will also contain the predecessor Thus . t . the forecast of t 1− L + t would be . 0<j j +t > L rof( … t p − L+ t Yp A + 0>j + t 1− L + tY1A = t| j t L+t +t E where is 0 for and is the vector of one-step-ahead forecast errors at time t q−L+ t EqB − L +t − Y If there were only information up to time t. t t . namely.)1 + q . where M is then every . This establishes M. The forecast of any E ψ 0=∞ ∑ = L+ Y using information up to and Y t L+t L+t Y Y Y . ψ L= ∞ j −L + t j j t provided the series is stationary.Chapter 6: State Space Modeling 295 What should be the size of the state vector—that is. j −L+ t E j j ∑= t L+t Y time t would just be the part of this sum that is known at time t. note that M>L t L+t Y forecast with will be a linear combination of these. this becomes )q 1+ t E 1− M 2− M 1 I ψ ψ ψ t 1− M + t t 2− M + t + t 1+ t 1+ t Y Y Y A Y I 1 0 0 .1+ t 1+ Z E1− Lψ + t L+t 1− L + Y Y = 1+ L+ Y t t 1+ t the forecast of the same thing at time just adds one more term so that . to replace the “?” in F and G. t p −M+ t Yp A + + t 1−M + tY1A = t M+t Y Finally. t EqB − t t 1-M + tY ? ? 2− M ψ t 2− M + tY I 1+ t E + 1 t 1+ t ψ Y 0 I t 0 − 1− L + tE1B − L + tE + p − L + tY p A + t (the dimension of Y) rows of the state space equation question mark (?) for items not yet discussed. will provide k if t . t M+ Y . Expanding the set of autoregressive when you have the complete set of equations . 1+ t 1+ EG + 1+ Z F = 1+ Z E1− Lψ + L+ Y = 1+ L+ Y t t t t E1B − t L+tE + t p −L+ tY p A + L+t Y I 0 0 0 I 0 0 0 ? ? + t 1− L + tY1A = + 1− L + Y1A = ? 1+ t M + tY 0 1+ t 1−M + tY = 1+ t 2 + t Y 1+ t . you look for dependencies. 1+ t L + t t Y will contain and the relationship between these. t 1+ t Y Y t t Z and so if the state vector contains .

1 85.2 1 .2 +t e )1. 0 2 85. t +t Y 2.2 example Consider the state space representation From row 2 1 850.0 t Y 850. ultimately producing a state space representation with dimension 3. It had a linear dependency.− ( = 440.0 + 1− t 9. 0 1 2 1 . 0 4. 1. 0 1 92.− 85. 44. unlike the Section 6. + t X85. tY 1 1 +t + t 440.0 t2e 2 − t X 0 + t1e 2 − t 0 Y This would be the final state space form if the system were of full rank. 27. −= t 1+ tX where the system arising from the current discussion was not block identifiable.− )8.− X 1+ t 0 Y 1 . 0 1 2 1 t +t 8. 6. X 0 t +t 8. Y 27.− +t e 1 + t 1e 0 Inserting this extra line into the state space equations you get 1 1 .1 Y . 44.2 1 1 2 1 . t Y 1 1 296 SAS for Forecasting Time Series Suppose you want to find the equivalent bivariate ARMA representation for you have so that .− 85.− +t e 1 +t e 0 1 . 0 )8.1 8.0 22.− 85. and a reduction in the size of the system was called for.− + t 1e 1 0 t +t 2. 1+ t Y 85. 1 92.( + tX )06. t +t Y 27. Such a full-rank system is called “block identifiable.0 = t 3. 44.′ ) tY t X( 1 . Y = 1+ t 44. 44. 850.0− Y tX 1.− ( = 1+ t 2 + tX t 1+ tY8.” In this case the link between the ARIMA representation and the state space representation is relatively easy to see. + t Y44. Y 0 + 0 0 t X t 0 1 Y + t + tX 22.−( + tX 8. Y + tX 44. 0 + t X 8.2. 8. + t 1e 1 .− = 1+ t 0 Y 4×4 − 1− tX 7.2 6.1 6. + t e 6.− ( = +t +t Y 1+ t X )8.− +t +t 440.

0 −= t t t 1+ tY8.0 2. Y 1. 1. 850. + t e 6. It can be expressed as .0 1.− 8. Y 0 + 1 0 t X t 0 1 Y t Now anytime you see you can replace it with . you can re-express that Chapter 6: State Space Modeling so row 2 of F can be and 297 . 0 = 1 B 1 B− 5.− + 1 0 t X t 0 1 Y t 1+ tY8. 4. + t Y44.1 000 and row 4 is .0 + t 1+ tX1. 1. 1.− X + t + tY 440. (1. 8. 0 = 6.− + t 1e 1 0 t +t 2.0 = 1 B− A = 1 1.1 6. 2. t 1+ tY2.0 t t t E1B − E + 1− Y1A = Y 1 2 1 1 .1) with with . 0 = 2A 2. 5.1) model.0 = 1+ 2 + X t t Y and setting .− 0 0 1 . X 0 t +t 8.− 0 5. 8. − 1. + t e 6. 0 1 0 0 0 0 1 2 0 + t +t 0 X 0 + t + tY = 1+ t 0 X 1+ t Y + t 1+ t X5. 1− t 5. − 1 1 + t +t 22.− 8. t 1+ tX 1+ tY8. while that is not so clear from the state space representation. t +t 8.1) as the leading term in a row. 2. = 0 1+ t X 1+ t 2 2 0 . + t X85. + t X85. 1 = A 1.2 1 1 . + 3− E3ψ + 2− E2ψ + 1− E) 1B − 1A ( + E = Y t t t t t ) tX you find that t Y( = t Y The result is This system results: in other words it is the vector ARMA(1. X 5. it is clear from the ARMA model that lagged shocks to Y do not have any effect on Y or X. + t Y44.− = 1ψ 1. 6. t 1+ t X t X85. 27. 2. 1 = ψ dna 6.2 1 1 . + t Y 44. for example.0 − − = 1+ 2 + Y .− + t 1e 1 0 t +t 2. 8.− 8.0 2.0 It is seen to be an ARMA(2. 0 1 92. 8.0 +) t 1+ tY8.− 2. A useful feature of such a structure is that it sometimes gives a nice interpretation. − replaced by Anytime you see a multiple of row using Row 3 gives So you have recovered the original ARMA(1.

change to .011 = 201Y ˆ = 301Y . Knowing Y100 is not enough to forecast Y101. Y2. . Recall that Yt+k|t denotes the forecast of Yt+k given the data Y1. . Y100. ..2 More Examples 6. Yn to forecast as far into the future as you like.1 t |1+ tY 1− tY(2.. You can forecast Y101. . Y2. ′ 4. or Y100=150 and Either pair of numbers allows you to forecast the series as far into the future as you like. . . . . The point is that given the model. the forecasts of Y102. suppose you know Y1. . The forecasts are updated as new information is obtained.941 In this example. .8.421 ˆ .411 = 301Y . − )05(2.001 − + 001 = 001 − t Y( = . . . . .651 and . and doing so provides some insights. then 4. Y3. . . the only . . you need to know two pieces of information: Y99=110 and Y100=150. .4. Yt. Y2.1 + 001 = e + )001 − 1− tY(6. You need more information. Y102. If you value you need to know is Y100. . . .1 .1 Some Univariate Examples Univariate models can also be expressed in state space form.2. Y104. . . Y100 with Y100=150.86. = 001 − − )001 − − )001 − ) 4. = )01(63. . The vector with the information you need is the state vector Zt. If Y100=150. Consider the AR(2) model t Again. For the AR(2) model. you need to know only the last Y. . . Y103. 2− tY(63.65 ( 2. In fact.031 = 101Y ˆ e + )001 − = ) 05 ( 63.811 = 201Y ˆ ˆ . the state vector is ′ where the prime symbol ( ) indicates the transpose of the row vector. Y103. If you know Y99=110. Consider the AR(1) model where t Suppose you are given Y1. then observe Y101=140 at time 101.651 = 101Y ˆ 201 Y t t t Y Y Z ˆ = 101Y ˆ . .298 SAS for Forecasting Time Series 6.

When the data at time t+1 become available.1 . the state vector was and Two examples have been discussed thus far. − )001 − 1+ tY ( 2. − = − = 001 − 1+ t |2 + tY 1+ te + )001 − 1− tY(63. − )001 − t Y(2.001 − 1+ tY ( = )001 − 1+ t|2 + tY . Y(63.1 + 1 Z 63.001 − Y( = 1+ t Z 1+ te + t Z = 1+ Z 6. t t t 001 − Y = Z Y 001 − 1+ t Y= 1+ t e + 001 − t |1 + t t t 1+ te2. the state vector changes to Now Chapter 6: State Space Modeling 299 . the state vector was because The last line of the matrix equation becomes or The first line of the matrix equation is simply you can write Because for the AR(2) model.1 1+ Y(2.1+ t EG + ZF = 1+ Z t t t ′ )001 − t |1+ tY .1 1 2.001 − 1+ t ′ Y( = 1+ t Z )001 − 1− tY(63. − = 1+ t 0 Z 1+ te + )001 − t |1+ tY( = 001 − 1+ tY ) )001 − ′ t Y ( 63.1 )001 − + )001 − t |1+ tY(2. − )001 − t Y(2. an AR(1) model.1 = 001 − t |1+ tY and In the second example. an AR(2) model.1 = 001 − 1+ tY 1+ te + 001 − t |1+ tY = 001 − 1+ tY 1+ te t 2.1 + )001 − + )001 − t Y(63. In the first.

One more univariate example follows. the state vector has the following form: − t Y ( 63. for j>1.1 1 = | t Yα= 001 0 63. . that is. you find that Yt+k+1|t is a linear combination of the previous sequence of elements Yt. consider the sequence Yt. t| k + tY k In the AR(2) example. . t + − | t|1+ t G t |1+ tY ( 2. Yt+2|t. . . . At some point. .2 shows how this can be accomplished using canonical correlations.− = e8. = 1+ t 1+ t 0= 1 α = 0α te8. + t Then.1 Yα dna 1 + 2. . Yt+1|t. such as k+1. )001 ) t k + tY . . stop expanding Zt. any prediction of Yt+R|t with R>k is also a linear combination of state vector elements. . ) 001 so k=1. . . . Section 6. Yt+1|t. α + − . Suppose 1–te8.300 SAS for Forecasting Time Series where 2. t 1+ tY = = tY tY t| 1+ t Y 1α + Y 0 α Y | t (which is with ). = t|1+tY 0 Y( = Z − t|1+ k + t e = tY t |2 + tY 1 +t + tY t t Y Z Z F Z . . because t and.1. At that point. Think of constructing the state vector by sequentially including forecasts Yt+j|t into Zt until you reach the first forecast that is linearly dependent on forecasts already in Zt. This determines the state vector as ′ Furthermore. 0= t| j and 1+ te8. t 1+ tY .1 = 1 Every ARMA model has an associated state vector Zt and an updating equation of the form 1+t EG + tZF = To determine the state vector for a univariate ARMA time series Yt. Yt+k|t.

8. 8. you forecast each element of the process. 0 t 3.1 t.2 ARMA(1. + 1+ te = 1+ tY + + t t X3. Xt+2|t.1ε2. 3. . t Y5. consider the sequence Xt. = 1 for the moving average (MA) model. t Y3. Thus. = t| t| 1+ tX 1+ tY t t X Y F . . Yt).1) is shown next. do not include that forecast or any future forecasts of that variable in the state vector. 1 0 = = = 0 0 = = 1+ te8. When you first reach a forecast of X (or Y) that is a linear combination of elements currently in the state vector.1. 1− tX5. . G dna + + e8.2 1 − t.1) of Dimension 2 Consider the model 1 or 1 and t. 1ε ε + + 1 − 1 − tX − tY 5. For the bivariate process (Xt. te8. = Y tX 5. The truly useful fact is that all multivariate ARMA models have state space equations.2 − .2. Yt+2|t. 0 = 1+ tY 1− t X3. . X5. 6.1ε ε 0 1. Yt+1|t. 1− tY3. You have seen an AR(2) of dimension 2 in Section 6. − t.2 ε1. t 0 − ε + t 1ε 1 − t. for example. − t .2 from which t . Yt.2. 1− tY5. 0 + 1 tY 1 ε2. A bivariate ARMA(1. Continue including forecasts of the other variable in Zt until you reach a point of linear dependence in that variable. 1+ te8.2 − t. − 2. To construct the state vector for a multivariate process. . Xt+1|t.Chapter 6: State Space Modeling 301 Note that 1+ te which is equivalent to the equation t along with the identity 1+ te8. ε1.

wor yb wor siht od nac uoY 1 .noitcnuf doohilekil eht ni esaercni na ro sretemarap ledom fo rebmun eht ni esaerced a yb rellams edam si CIA taht etoN )ledom eht ni sretemarap fo rebmun(2 + )doohilekil dezimixam(GOL2– = CIA . –t X . . 1 + t 1ε 0 1 .3 2 .k redro fo noissergerotua rotcev a yb detamixorppa ylbanosaer eb nac taht sledom AMRA rotcev lla fo ssalc eht hcraes .suhT .2 .secirtam A eht fo swor driht dna dnoces eht secudorp noisserger eht ni selbairav tnedneped sa t X dna t X gnisU .k redro fo noissergerotua rotcev a dellac won si ledom ehT .3 1 .3 . – X no . 1X( = X . –t X .erusaem a evah uoy dna . .sdrow rehto nI . A . 0 1 |2 302 SAS for Forecasting Time Series The general outline of PROC STATESPACE is as follows: 5. the state space form is ′ ) t 1+ t X . . 1X fo noisserger eht . t 0 + Y tX 1 t Y51. 5. . –t X . .CIA eziminim ot k tceleS . + –tX A + – X A = X 2 2 1 t 1 t ledom RA etairavitlum a tif ′) X .secirtam A eht fo stne mele eht fo emos 0 ot gnittes dna smret AM gniwolla yb devorpmi eb nac tif eht rehtehw semoceb noitseuq ehT .elpmaxe rof . 2 t. 1 t. t E+ k–t XkA + ..CIA . 3 t.3 2 .2 + t ε 2. .kA . Finally.ECAPSETATS CORP ni enod si tahw yllaitnesse si sihT . Y = 1+ t X 0 = t |1+ tY3. + t |1+ tX5. .si tahT . 6. A secirtam fo swor pot eht secudorp k–t X . = t |2 + tX and ..k no ediced oT . X . t X( | = t Z so + t |1+ tX5.)CIA( noiretirc noitamrofni s’ekiakA fo noisrev a esu uoy . .2 1 t.2 . . +t 3. t | 1 1 .tif taht niatbo ot desu sretemarap fo rebmun eht tsniaga tif fo noisicerp ffo sedart ti . –t X . tY . 0 1 1 + t + tX 90. A . –t X .1 t.tif sti fo .2 2 si noiretirc sihT .seires rotcev ro etairavitlum a roF . t + tX 3.noissergerotua rotcev yranimilerp eht fo tif eht tsniaga ledom hcae fo tif eht ssessa ot desu si noitalerroc lacinonac tsellams ehT . + t X90.1 3 2 1 .3 PROC STATESPACE 51.

t. 1. but continue to consider forecasts of X2 and X3 (unless X2.t. X2. each with nine parameters. X2.t+1|t or X3. 0 0 XA = X t. If X1. 1.t+2|t is not included in the state vector.t+1|t to see if it is a linear combination of X1. for example.t+1|t have been tested.t. t.t. If it is. Suppose X1. If the vector ARMA(1.3 . if a forecast X1.1) smaller than for the vector AR(4). the state vector is augmented to (X1. X2. consider testing X1. The next question is whether X2.3e 1− t. pioneering work by Akaike shows that X1. Next. An information criterion for model selection based on this idea is called DIC in PROC STATESPACE. a vector ARMA(1.2e 1− t. 0 Check to see if this model fits as well as the original vector autoregression.1e 4. 0 t EG 6.t+1|t should be included in the state vector.t+2|t for inclusion in the state vector. 4.t. t The key to this decision is an organized sequential formulation of the state vector.t+1|t). Thus. comparing state space models and determining the best model is equivalent to finding the dimension of the best model's state vector Zt. The state vector is formulated sequentially in this fashion. 3.t+1|t was found earlier to be a linear combination of elements already in the state vector) and continue in this fashion .t.3 X = t. That is. The comparison in step 2 is easier than it first appears.t+1|t and X3. X1. 2. and X3.t+1|t is included and both X2.1) fits about as well as the vector AR(4) in likelihood.t.1X ZF Z = t t ro . because all state space models have the same basic form. If k=4. X3.1X 1− t EB − E + 8. All vector ARMA models can be expressed in state space form. it provides no new information and is not added to the state vector. and X3.3e 1− t.t+j|t is not included for any j>2. the original autoregression contains four A matrices. 4. 0 4.t+j|t also is such a linear combination for any j>k.3 X 0 − t.2 X t. check X1.1) of dimension 3 can be 1− t.t.t+k|t is a linear combination of elements already in the state vector.Chapter 6: State Space Modeling 303 For example.2e + 1− t. and thus the difference will be negative. Start by including X1. X1. the inherent penalty in the information criterion for a large number of parameters can make the information criterion for the vector ARMA(1. Include it only if it cannot be written as a linear combination of elements already in the state vector. stop considering the forecast of X1. At this point. Otherwise.t. Next.2 X t. 0 + 1 –t 1− t 27.1e 1− t.

1 . t| 1 + t .1X stsacerof eht .tniop siht ot pu taht etoN . X . 3 X dna .rotcev etats eht X . t| 1 + t .6 noitceS ees( hcaorppa noitalerroc lacinonac eht esu tsum uoy dna .enod eb nac siht woh dewohs )6791( ekiakA . Σ tnanimreted ˆ sti si Σ fo ezis eht fo erusaem lareneg A .Σ xirtam ecnairavoc-ecnairav dna 0 naem htiw srotcev modnar lamron tnednepedni fo ecneuqes a si E gnimussA .6 t t t t .ECAPSETATS CORP ni tuo detnirp eb nac hcihw .rorre-noitciderp eht sniatnoc sesehtnerap ni ytitnauq eht fo xirtam ecnairavoc-ecnairav ehT . 3 X. 2 eb yam rotcev etats eht . 1 X.redisnoC .) Σ fo stnemele lanogaid eht era eseht( secnairav ˆ rorre lareves sah gnittes etairavitlum a hcuS .etamitse na niatbo nac uoY ˆ . X .seires etairavitlum eht fo stsacerof eht era esehT .3X dna .daeha sdoirep eerht gnitsacerof .srorre dradnats tsacerof .noitcnuf doohilekil eht tuo etirw nac uoy .setamitse laitini eht htiw tratS .3+ .2X . 2 X. . 3 t.srorre dradnats dilav yllacitotpmysa rieht dna sretemarap eht fo setamitse )LM( doohilekil-mumixam eht dnif ot enituor hcraes raenilnon a esu dna .rotcev etats eht etupmoc ot )2.noitidda nI .tsacerof eb ot seires etairavitlum eht pu ekam rotcev etats eht fo stnemele wef tsrif eht esuaceB . t ) t| 2 + t .3.Σ .4 t 1 +t ni tneserp ydaerla stnemele fo snoitanibmoc raenil era ′ t| 2 + t .3 pets hsilpmocca ot snoitalerroc lacinonac fo esu eht si lacitcarp eb ot ssecorp siht swolla taht tluser laciteroeht ehT . Z3F fo stne mele eerht tsrif eht era 3+ . 1X( = Z t.mrof ledom AMRA rotcev eht wonk ton od uoy .ecitcarp nI .2X .sledom nwonk rof ylno devired neeb evah srotcev etats .G . 1 t| 1 + t .ECAPSETATS CORP nI .ledom AMRA rotcev etairavitlum gniylrednu yna rof t 1 +t EG + ZF = Z t 1 +t si .Σ dna .ecnairav rorre noitciderp fo erusaem lareneg a si ti esuaceb deziminim eb dluohs tnanimreted sihT .1X stne mele eerht eht sah ssecorp rotcev lanigiro eht fI t t t t t t t 3+tEG )3+ EG + 2+ EGF + 1+ EG2F( + Z3F = + 2+ EGF + 1+ Z2F = 3+ EG + 2+ ZF = 3+ Z t t t t t woN .3+ .ledom eht taht llaceR .slavretni tsacerof gniyalpsid rof lufesu noitamrofni rehto dna .esac siht nI t.G dna F fo stnemele eht fo setamitse laitini etupmoc ot snoitauqe reklaW-eluY eht ot ralimis rennam a ni eseht sesu tI .stsacerof sniatnoc taht detaerc si tes atad tuptuo na .elpmaxe rof .erofeb deredisnoc . X .5 +t ..3X dna . .seires hcae fo srorre tsacerof daeha-pets -eno eht fo stcudorpssorc dna serauqs fo smus eht morf Σ fo .F fo se tam itse m orf d e tam itse eb nac tI . Z dna Z fo stnemele eht neewteb secnairavoc etamitse ot noitamixorppa )k(RA rotcev laitini eht sesu ECAPSETATS CORP .secnairav rorre noitciderp eht sdleiy noitauqe ecaps etats eht .stnemele tsrif eht tcartxe neht dna k Z seulav erutuf tsacerof ot noitauqe ecaps etats eht esu .elpmaxe siht roF 304 SAS for Forecasting Time Series .xirtam ecnairavoc-ecnairav .mrof ecaps etats ni . t| 3 + t .

4 2 1 2 = 4 8 M . Yt+1. Yt–1. consider linear combinations that are uncorrelated with the canonical variables found thus far. . Yt–2) and second vector (Yt. In this case. .2 Canonical Correlations Suppose the covariance matrix between the set of current and past values Yt. 2. Yt+2 for a univariate series is given by 5. zero. Akaike uses these facts to show that analyzing the covariances in the matrix M is equivalent to determining the form of the state vector. Yt–2) and (1. . 10 (or ARMAX) and selects the model that gives the minimum. the two most highly correlated give the secondhighest canonical correlation.3. . and the linear combinations are called canonical variables. . 6. with maximum cross-correlation. Yt+2). where for practical purposes this list can be truncated at Yt–k. as determined by the initial vector autoregression. Yt–1. Pick the two (one for each vector being analyzed) with the highest crosscorrelation. 2. . 1 2 ′ ′ Note that there are no zero correlations. Yt+1. so (1. This vector AR model for the time series is used to compute a variance-covariance matrix M between the set of current and past values and between the set of current and future values. 0.Chapter 6: State Space Modeling 305 6. The covariance between a prediction Yt+j|t and a current or past value Yt–i is the same as that between Yt+j and Yt–i. Yt–1. that some canonical correlations are zero. Of these.3. 0)(Yt. 2. Yt and Yt are perfectly correlated. Yt–2 and the set of current and future values Yt. This canonical correlation is the largest. 0)( Yt. Yt+1. Now consider all linear combinations of elements in the original vectors that are not correlated with the first canonical variables. (You will find. Find the linear combination of elements in the first vector (Yt. Yt–1. All predictions are linear combinations of the observations of Yt. . Canonical correlations are used in this case. At each stage. however. Yt–2. In the example.1 State Vectors Determined from Covariances PROC STATESPACE computes the sequence of information criterion values for k = 1. 3. you can show that the next-highest canonical correlation is. 0.) Canonical correlation analysis proceeds as follows: 1. and the elements of M are replaced by their sample values. Yt+2) are the canonical variables. in fact. These two facts are relevant: 1.

Yt. (You have seen several cases where F and G contain zeros. Yt+1|t) is next. the analysis proceeds as follows (illustration for bivariate series (Xt. Xt+j|t and Yt+s|t. Then Xt+j–1|t and Yt+s–1|t are the last predictions of X and Y to be included in the state vector. do a canonical correlation analysis of (Xt. exclude from consideration Xt+1|t and all Xt+j|t for j>1.) . 4. PROC STATESPACE executes this procedure automatically. DIC is used as the default criterion. 5. Yt. Yt) with current and past values. Continue until you have determined the first predictions. you see that the covariance between Yt–k and Yt+j is always j+k 8(. 2.0. All rows of M are direct multiples of the first. include Xt +1|t in the state vector and analyze (Xt. but the user is responsible for any transformation necessary to produce stationarity and approximate normality. Xt +1|t. PROC STATESPACE uses the estimated covariance matrix and the identified state vector to compute initial estimates of matrices F and G in the state space representation. the analysis of (Xt. Robinson (1973) suggests potential problems with Bartlett’s test for MA models. Determine the number of lags into the past (Xt. Yt +1|t). A chi-square test statistic attributed to Bartlett (1947) is computed. the canonical correlations computed from M are 1. Thus. . You may want to use the RESTRICT statement to set certain elements of F and G to zero. a) If the smallest canonical correlation is not close to zero. When the general sample covariance matrix M is used. Next. Yt) ): 1. .rotcev etats eht fo noisnemid eht snoitalerroc lacinonac oreznon fo rebmun eht M etairporppa na fo knar eht ′ ≥ . Xt +1|t) with current and past values of Xt.5 ) for j. Yt–k ). The sample canonical correlations are judged by the aforementioned DIC. that introduce zero canonical correlations. Use the NOEST option to view the preliminary model before fine-tuning the parameter estimates through nonlinear iterative least squares (LS) or ML estimation. In this case. The significance of Bartlett’s statistic indicates a nonzero canonical correlation. .1. b) If the smallest canonical correlation is close to zero.k 0. Thus. . so M has rank 1. Xt–1. This produces correlations 1. Yt–1. Also note that the STATESPACE theory does not include deterministic components like polynomials in time.0.306 SAS for Forecasting Time Series Akaike establishes that the following numbers are all the same for general vector ARMA models: When you look at the example matrix M. 3. The advantage of PROC STATESPACE is its automatic identification of a model and preliminary parameter estimation. Yt from step 1. Yt. Finally. M is the covariance matrix of an AR(1) process. Do a canonical correlation of (Xt. Yt.

+ You also would expect the estimated PACF to drop within two standard errors of 0 after a few lags. . .4542 is not an estimate of 0. Yt+1) and the set of variables (Yt. Use the following SAS statements for the analysis: PROC STATESPACE CANCORR ITPRINT DATA=TEST2. Bartlett’s test. A plus sign (+) indicates a value more than two standard errors above 0. + 5 . − − − − − Y − − − + − − − . This implies that the portion of Yt+1 that cannot be predicted from Yt is correlated with the past of the time series and.” you would expect the following sequences of + and .8) Yt–3 3 (.64698 .Chapter 6: State Space Modeling 307 6. DIC=15. thus.8Yt–1 . so 0. .24Yt–4 + et This corresponds reasonably well with the theoretical results.994428 . 4 . is an estimate of the second-largest canonical correlation between the set of variables (Yt.4542 is an estimate of 0. Note the canonical correlation analysis .58Yt–2 + . The estimated functions correspond fairly well with the theoretical functions. which occurs at lag 4. The ITPRINT option shows the iterative steps of the likelihood maximization. Yt–4). + 3 . Based on results from Chapter 3. that Yt+1|t should be included in the state vector.454239 . The question is whether 0. Yt–3. Yt–1. .4.4096.8et–1 Note that the model can be re-expressed as Yt = (. Thus. The null hypothesis is that the second-highest canonical correlation is 0 and the test statistic is to be compared to a chi-squared table with four degrees of freedom 11 . consideration is given to adding Yt+1|t to the state vector containing Yt.31Yt–3 .) indicates a value within two standard errors of 0. the CANCORR option displays the sequential construction of the state vector.79Yt–1 .signs in the theoretical ACF and PACF plots. . for up to ten AR lags. . . Yt–2. . In this case. . PROC STATESPACE concludes that a correlation is 0 if DIC<0. and a minus sign (-) indicates a value more than two standard errors below 0. Another test statistic.3.10916 . + 7 . + 9 . . RUN. Initially. and Bartlett’s test agrees with DIC to include Yt+1|t in the state vector. As shown in Output 6.4. observe the sample mean. 0. the initial AR approximation involves four lags and is given by Yt = . The smallest AIC in the list is 9. 10 . Schematic representations of the autocorrelation function (ACF) and partial autocorrelation function (PACF) are also given. The first canonical correlation is always 1 because both sets of variables contain Yt. 6 . is calculated as 22. consider 100 observations from an MA(1) model Yt = et + .3 Simulated Example To see how PROC STATESPACE works with a known univariate model. 8 .64Yt–2 (. VAR Y. The hypothesis of zero correlation is rejected. The canonical correlation.512. the initial AR approximation should have coefficients near . ) + et 4 Thus. a period (. “The General ARIMA Model. LAG ACF PACF 0 + + 1 + 2 .8.8) Yt–4.64. and standard deviation and the sequence of AICs In Output 6.

9 .21 8=gaL 7=gaL 6=gaL 12059.11 824499.< si .32932. 8 . 01 .72 78468.rorre dts*2 > si + . 7 .0Y -4=gaL-- 989803.01 2857. 5 4 . 3 .0 Y -1=gaL-- Y CIA muminiM rof setamitsE reklaW-eluY neewteb si .rorre dts*2.41 9=gaL 30746.6 tuptuO 308 SAS for Forecasting Time Series .61 01=gaL sledoM evissergerotuA rof noiretirC noitamrofnI 8155.rorre dts*2. 2 + 1 + 0 Y gaL/emaN snoitalerroC fo noitatneserpeR citamehcS 75984.21 49017.< si .9 8788.55 2=gaL 1=gaL 0=gaL sledoM evissergerotuA rof noiretirC noitamrofnI 632223.0naeM Y elbairaV 001 snoitavresbO fo rebmuN erudecorP ECAPSETATS ehT snoitpO TNIRPTI dna RROCNAC eht htiw ECAPSETATS CORP ni ataD detalumiS gniledoM 4.0 Y -3=gaL-- 52285. 3 . . 9 + 8 . 7 .0Y -2=gaL-- 270987.31 5=gaL 4=gaL 3=gaL 42725.rorre dts*2 > si + 2 + 1 Y gaL/emaN snoitalerrocotuA laitraP fo noitatneserpeR citamehcS neewteb si . 01 . 4 .1 rorrE dradnatS 99404. 6 .31 73950. . 6 . 5 .

0 65392338.0 50594102.2(F 100.T(Y 1 )T.02479261.0 81835621.0494150.0 adbmaL noitamitsE doohilekiL mumixaM :gnittiF evitaretI 441020.1 12503020.2+T(Y FD )deunitnoc( snoitpO TNIRPTI dna RROCNAC eht htiw ECAPSETATS CORP ni ataD detalumiS gniledoM Chapter 6: State Space Modeling 11 4 89646.0 49951248.51 noiretirC noitamrofnI 932454.0 58978911.0 )T.1 72542020.22 erauqS ihC 61901.0 100.1 162040.1+T(Y sisylanA snoitalerroC lacinonaC 12 13 14 15 3 19083.1 542020.02327511.4 83255.0 )1.1 )1.0 69170987.0 )T.T(Y 22 17 21 542020.0 1 noitavonnI rof xirtaM tupnI 390092.0)1.1 740520.0 )2.0 1000.0 1.0 4609048.03900750.0 10.1 503020.6 tuptuO 309 .1+T(Y )T.1- 175802.1 58640520.0 1 79261.00 xirtaM noitisnarT fo etamitsE rotceV etatS setamitsE yranimilerP dna mroF ecapsetatS detceleS FD erauqS ihC noiretirC noitamrofnI )T.1 33162040.2(G 4998911.0 25290092.1 tnanimreteD 2 0 0 0 0 flaH 4 3 2 1 0 retI 1 )T.1(amgiS 41939048.0 697984.2(F 1215150.70542020.T(Y 4.1+T(Y 16 )T.1 noitavonnI rof xirtaM ecnairaV 270987.

310 SAS for Forecasting Time Series Now consider the portion of Yt+2|t that you cannot predict from Yt and Yt+1|t.0 93.2(G )2.6 tuptuO 20 . Thus.T(Y retemaraP )1. Bartlett’s test statistic. Add Yt+2|t to the state vector unless the third-highest canonical correlation between the set (Yt. If this portion is correlated with the past of the series.2(F )1. .0 998911. .0 797231. Yt–1. you have the best predictor available.8 97. Yt+2|t is not added to the state vector.0 1 542020. The past data do not improve the forecast.55238) 13 . The estimate of the thirdhighest canonical correlation is 0. Yt–4) is 0.00 )T.2(F 4. .38091 14 .0 15150. Yt+1.0- 15150. PROC STATESPACE assumes that 0.208571 is just an estimate of 0 because DIC is negative (–1.81).0 )T.0 432151.1 etamitsE 939048. Yt–2. .0ledoM dettiF dna mroF ecapsetatS detceleS .208571 12 . This means that once you have predicted Yt+2 from Yt and Yt+1|t.1+T(Y setamitsE retemaraP rotceV etatS 939048. )deunitnoc( snoitpO TNIRPTI dna RROCNAC eht htiw ECAPSETATS CORP ni ataD detalumiS gniledoM eulaV t 24. is not significant compared to a chi-squared table with three degrees of freedom 15 (with a critical value of 7. you can produce a better predictor of the future than one that uses only Yt and Yt+1|t.degrevnoc sah noitamitse doohilekil mumixaM noitavonnI rof xirtaM tupnI 19 xirtaM noitisnarT fo etamitsE 18 noitavonnI rof xirtaM ecnairaV 998911. Yt+2) and the set (Yt. 4.0 1 rorrE dradnatS 658990.

which is a scalar in the case of a single parameter estimate. RESTRICT F(2. The theoretical analysis gives the state space representation as 1+ te PROC STATESPACE estimates these matrices to be 97. observe the nonlinear search 21 beginning with the initial values in Output 6. RUN. 0 0 0 0 = 1+ t − − =F =F Z . ′ Σ ˆ =G =G dna 8.2)=0. 361.8) . Finally. Thus.1)=0 F(2. VAR Y. you see that PROC STATESPACE has correctly identified the state vector as having two elements. as expected. Note that the t statistics 20 on F (2. + 1 dna 092. 1 21. use the RESTRICT statement: PROC STATESPACE ITPRINT COVB DATA=TEST2. namely G=(1 . (See Output 6. The RESTRICT statement may also include restrictions on the entries of G. 1 t Z 0 1 150. Yt+1|t) When you compare this to the theoretical analysis of an MA(1). the two tests agree that Yt+2|t is a linear combination of Yt and Yt+1|t.4 16 17 and then moving to the final values in Output 6. the only information you need to predict arbitrarily far into the future is in ′ Zt = (Yt.Chapter 6: State Space Modeling 311 Again. 1 initially 16 17 and 148. not significant. The COVB option requests the variance-covariance matrix of the parameter estimates .5. the bottom row of F has been set to 0 0 . The true entries of F are zeros in those positions.4 18 19 .1) and F (2. To force the correct form on the matrix F. 1 finally 18 19 . The initial G matrix and the final G matrix are close to the theoretical matrix.2) are. Note that decreases at each step 22 .) As requested.

9 + 8 . 3 .rorre dts*2 > si + 2 + 1 Y gaL/emaN snoitalerrocotuA laitraP fo noitatneserpeR citamehcS neewteb si .rorre dts*2 > si + .21 8=gaL 7=gaL 6=gaL 12059.0 Y -1=gaL-- Y CIA muminiM rof setamitsE reklaW-eluY neewteb si .< si .rorre dts*2.01 2857. .1 rorrE dradnatS 99404. 3 . 6 . 5 . 8 . 01 .0 Y -3=gaL-- 52285.0Y -4=gaL-- 989803. 7 .41 9=gaL 30746. 7 . 5 4 .31 73950.31 5=gaL 4=gaL 3=gaL 42725. 01 .21 49017. .9 8788.rorre dts*2. 6 .55 2=gaL 1=gaL 0=gaL sledoM evissergerotuA rof noiretirC noitamrofnI 632223. 9 .61 01=gaL sledoM evissergerotuA rof noiretirC noitamrofnI 8155. 4 .72 78468.0Y -2=gaL-- 270987.0naeM Y elbairaV 001 snoitavresbO fo rebmuN erudecorP ECAPSETATS ehT tnemetatS TCIRTSER eht htiw ECAPSETATS CORP ni ataD detalumiS gniledoM 5. 2 + 1 + 0 Y gaL/emaN snoitalerroC fo noitatneserpeR citamehcS 75984.11 824499.< si .6 tuptuO 312 SAS for Forecasting Time Series .32932.

0 69170987.sgnivlah pets 01 retfa tnemevorpmi oN :GNINRAW 22544620.demussa neeb sah ecnegrevnoC .1+T(Y )T.0 1.1 3084620.1+T(Y rotceV etatS ledoM dettiF dna mroF ecapsetatS detceleS .T(Y rotceV etatS setamitsE yranimilerP dna mroF ecapsetatS detceleS )deunitnoc( tnemetatS TCIRTSER eht htiw ECAPSETATS CORP ni ataD detalumiS gniledoM 5.544620.1 noitavonnI rof xirtaM ecnairaV 172087.2(G 100.1 85374620.1 84620.0 10.0 adbmaL 544620.6 tuptuO Chapter 6: State Space Modeling 313 .0 )1.0 1 noitavonnI rof xirtaM tupnI 0 1 0 0 xirtaM noitisnarT fo etamitsE )T.T(Y noitamitsE doohilekiL mumixaM :gnittiF evitaretI 441020.1 noitavonnI rof xirtaM ecnairaV 270987.1(amgiS 47072087.1 474620.1 )1.0 1 noitavonnI rof xirtaM tupnI 0 1 0 0 xirtaM noitisnarT fo etamitsE )T.1 tnanimreteD 0 0 0 flaH 2 1 0 retI )T.0 39962977.

VAR X Y. Often.12). specify the state vector as ′ Zt = (Xt. FORM X 2 Y 1. It is dangerous to ignore the autocorrelations. Bartlett's test may give a different result than DIC. For example. The logarithms are analyzed. RUN. the following SAS statements specify a first and span 12 difference to be applied to Y: PROC STATESPACE.314 SAS for Forecasting Time Series You can find other options for PROC STATESPACE in the SAS/ETS User's Guide. RUN. Differencing is specified exactly as in PROC ARIMA. This statement can be helpful if you want to specify a state vector different from what DIC automatically chooses (for example.6 tuptuO . possible nonstationarity. The data are counts of mink and muskrat pelts shipped to Europe from Canada by the Hudson's Bay Company. and both the logarithms and the original data are plotted in Output 6. )deunitnoc( tnemetatS TCIRTSER eht htiw ECAPSETATS CORP ni ataD detalumiS gniledoM eulaV t 64. For example.21 setamitsE retemaraP fo ecnairavoC setamitsE retemaraP fo noitalerroC )1.0 )1.6.0 rorrE dradnatS 546260. The FORM statement is used to specify a form for the state vector. consequently. Yt. and you may prefer Bartlett's test).1 setamitsE retemaraP etamitsE 172087. which indicates a very slow decay and. You have no guarantee of a reasonable result if you put nonstationary series into PROC STATESPACE.0 )1.2(G 00000. VAR Y(1. you see almost all plus signs in the ACF diagram. Xt+1|t) Now consider an interesting data set that cannot be modeled correctly as a transfer function because of feedback. The theory behind PROC STATESPACE assumes the input series are stationary.2(G )1. the statements PROC STATESPACE.2(G 4429300.2(G 5.2(G retemaraP )1.

6 Plotting Original and Logged Data .Chapter 6: State Space Modeling 315 Output 6.

316 SAS for Forecasting Time Series Output 6.6 Plotting Original and Logged Data (continued) .

RUN. Thus. so the signs make sense with respect to the predator–prey relationship. you can specify NOCENTER. MODEL LMINK LMUSKRAT=T. PROC REG is appropriate for detrending the data if the trend is due to increased trapping and does not reveal anything about the relationship between these two species.7. the dynamic relationship between mink (predator) and muskrat (prey) is best displayed in residuals from the trend. TITLE 'HUDSON”S BAY FUR TRAPPING RECORDS 1842-1890'. The PACF looks like that of a vector AR of dimension 2 and order 1 (one lag). The question becomes whether it is a unit root process or a time trend plus stationary error process. Another approach is to difference the two data series and analyze the resulting changes in pelt numbers. you do not need to subtract the mean. in fact. TITLE2 'RESIDUALS FROM LINEAR TREND'. If you consider a bivariate series in general as (Xt. finally. This is. T+1. Xt represents RMINK. In that case. the case here. OUTPUT OUT=RESID R=RMINK RMUSKRAT. The in the lower-left corner indicates a negative covariance between Yt and Xt–1 and. RUN. Yt) and the lag 1 matrix + + 1− t then the + in the upper-left corner indicates a positive covariance between Xt and Xt–1. the + in the lower-right corner indicates a positive covariance between Yt and Yt–1 In terms of the current example. The following SAS code detrends the logged data and submits the detrended data (residuals) to PROC STATESPACE for analysis: DATA DETREND. SET MINKMUSK.) Note that the ACF at lag 1 is represented by a matrix of plus and minus signs because you have a bivariate series. RUN. The + in the upper-right corner indicates a positive covariance between Xt and Yt–1. (However. you expect the initial AR approximation to have only one lag and to be very close to the final model chosen by PROC STATESPACE. PROC REG DATA=DETREND NOPRINT.Chapter 6: State Space Modeling 317 You have an increasing. − Y 1− X t − + t t Y X . Note that the ACF schematic plot shows several plus and minus signs but not enough to indicate nonstationarity. VAR RMINK RMUSKRAT. and Yt represents RMUSKRAT. seemingly linear trend in the data plots. Because the data are detrended. it is notoriously difficult to detect nonstationarity visually in a series that has been detrended. Thus. PROC STATESPACE NOCENTER DATA=RESID. The approach you choose depends on the true nature of the series. The results are shown in Output 6. The regression detrending approach is used here simply to display the technique and is not necessarily recommended over differencing.

6 tuptuO .877.845.542. That is.468 indicates that large mink values (predator) at time t are associated with small muskrat values (prey) at time t+1.0 147763.9228=gaL 7=gaL − 1 . for example.242.318 SAS for Forecasting Time Series The state vector is simply the vector of inputs.122- Y 726. so the vector ARMA model is easily derived from the state space model .468 is an estimate of 0.722. the number –.2 5=gaL 94.881elbairaV TARKSUMR KNIMR 3=gaL 2=gaL 1 1 t t 1=gaL 0=gaL 7.152.032- snoitavresbO fo rebmuN sledoM evissergerotuA rof noiretirC noitamrofnI 01=gaL 211. + X KNIMR 4=gaL 456.52.122. 965.721. Yt) and the model is + t e t + t + t 1e 9=gaL 198. slaudiseR eht ezylanA ot ECAPSETATS CORP dna ataD eht dnerteD ot GER CORP gnisU sledoM evissergerotuA rof noiretirC noitamrofnI erudecorP ECAPSETATS ehT DNERT RAENIL MORF SLAUDISER 0981-2481 SDROCER GNIPPART RUF YAB S'NOSDUH erudecorP ECAPSETATS ehT DNERT RAENIL MORF SLAUDISER 0981-2481 SDROCER GNIPPART RUF YAB S'NOSDUH 6=gaL 94 1 rorrE dradnatS 900793. each series is predicted by using lagged values of the other series.− + Y TARKSUMR = X 892. the state vector is simply ′ Zt = (Xt. Xt and Yt are not related by a transfer function because you can use the t statistic to reject the hypothesis that .632.426.507. When Xt=RMINK (mink residuals at time t) and Yt=RMUSKRAT (muskrat residuals at time t) are used. 864.522. Here.302.0 . The transfer function methodology in PROC ARIMA is not appropriate.

+. 4 .+ ...0 xirtaM noitisnarT fo etamitsE )T.+ -.0 93864. 8 .. . . 6 ... 5 .0 262892.T(KNIMR setamitsE yranimilerP dna mroF ecapsetatS detceleS erudecorP ECAPSETATS ehT DNERT RAENIL MORF SLAUDISER 0981-2481 SDROCER GNIPPART RUF YAB S'NOSDUH 851726.. . .6 tuptuO Chapter 6: State Space Modeling 319 ...4 . 2 +++ 1 +.. .rorre dts*2. .rorre dts*2 > si + . . 3 .0947865.rorre dts*2 > si + ...0 TARKSUMR KNIMR TARKSUMR KNIMR -------1=gaL-------CIA muminiM rof setamitsE reklaW-eluY neewteb si .. .+ 01 . -+ 9 . 7 .0947865. 2 +. 9 ..+.T(TARKSUMR rotceV etatS )T. . 8 . ..+ 1 TARKSUMR KNIMR gaL/emaN snoitalerrocotuA laitraP fo noitatneserpeR citamehcS neewteb si .+ -..5 .< si .0 262892. 3 .. ..< si . 01 ..0 93864.rorre dts*2. . . .6 . 7 .... ..1 0 0 1 noitavonnI rof xirtaM tupnI 851726.+ 0 TARKSUMR KNIMR gaL/emaN snoitalerroC fo noitatneserpeR citamehcS )deunitnoc( slaudiseR eht ezylanA ot ECAPSETATS CORP dna ataD eht dnerteD ot GER CORP gnisU 7.

0 307200.0 307200.0947865.0 947865.0 93864.0 rorrE dradnatS 851726.T(TARKSUMR rotceV etatS )T.2 12.5 eulaV t 653090.degrevnoc sah noitamitse doohilekil mumixaM 270360.0 noitavonnI rof xirtaM ecnairaV )deunitnoc( slaudiseR eht ezylanA ot ECAPSETATS CORP dna ataD eht dnerteD ot GER CORP gnisU 7.6 08.2(F )2.459.1(F )1.0 352901.0 93864.49.0 131970.0 445790.0 262892.0 307200.0 131970.0262892.6 tuptuO 320 SAS for Forecasting Time Series .0 etamitsE )2.0 302101.0 307200.0 noitavonnI rof xirtaM ecnairaV 1 0 0 1 noitavonnI rof xirtaM tupnI 851726.2(F )1.1(F retemaraP setamitsE retemaraP 270360.0 xirtaM noitisnarT fo etamitsE )T.T(KNIMR ledoM dettiF dna mroF ecapsetatS detceleS erudecorP ECAPSETATS ehT DNERT RAENIL MORF SLAUDISER 0981-2481 SDROCER GNIPPART RUF YAB S'NOSDUH .

55084.00355900. **| .0351010.8. |********** . **| . **| . *| .0 99272. .0 072010. .0 156310. . . that there are nonzero correlations at both positive and negative lags as shown in Output 6. Y L Chapter 6: State Space Modeling 321 .0 97210.)2(**B 43192.0 4239800. |** . |**** .0 noitalerroC 7747600. . . . |** . .0471040.6 tuptuO T AM E F If you had (mistakenly) decided to fit a transfer function.0 92361.1 srotcaF evissergerotuA retliF gninetihwerP :1 rotcaF :retlif gniwollof eht yb denetihwerp neeb evah selbairav htoB srorre dradnats owt skram ". ***| . ***| . | | | | | | | | | | | | | | | | | | | | | 17080.72411. You observe a somewhat subtle warning in the cross-correlations plot—namely." | | | | | | | | | | | | | | | | | | | | | . .0 228220.0 33200.0715810.0 6491000. .84820.0 4960100.0 74900.65801. . | .0 69541.*****| . |** . ****| .02183200.09719800.78410.0358330.94122.0982510.88281.03342100.0 202210. | . *| . . .0 + )1(**B 25487.54121. .86601. |******** . .72481.05570900. you could have fit an AR(2) to the mink series and computed the prewhitened cross-correlations. ****| .0 58750. .0 2638400.0 .0 58601. | .0 ecnairavoC 01 9 8 7 6 5 4 3 2 1 0 12345678901gaL 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1- snoitalerroC-ssorC erudecorP AMIRA ehT 0981-2481 SDROCER GNIPPART RUF YAB S'NOSDUH snoitalerroC-ssorC 8. |** . | . .0 8197000.0 48221.49404. .0504510.

322 .

7 t Y retpahC .7 )B (soc ) A(nis + )B(nis ) A(soc = )B + A(nis α ))δ + tω(nis(α + µ ω .75 = 2382.esahP . If an arc of length r is measured along the circumference of a circle whose radius is r.7 933 )gnidaeR lanoitpO( liateD lacitamehtaM emoS 8.7 2. t e + ) tω(nis B + ) tω(soc A + µ = .7 043 margodoireP dehtoomS ehT :murtcepS eht gnitamitsE 9. The number is called the amplitude.01.ω / π2 ))δ + tω(nis(α + µ 5. There are degrees.δ e + )) tω(nis )δ(soc + ) tω(soc )δ(nis(α + µ = te + ))δ + tω(nis( α + µ = tY α−µ 453 yaleD eruP dna .7 1. The number is called the frequency and is also measured in radians. The main tool here is the periodogram. that is.7 823 esioN etihW rof gnitseT 4.7 Spectral Analysis 7.7 533 ytisneD lartcepS ehT 7. and one radian is thus plot of versus t is a sine wave that repeats every time units.01. is called the phase shift or phase angle. the period is A sinusoid of period 12 would “go through” radians per observation. A very simple model appropriate for spectral analysis is a mean plus a sinusoidal wave plus white noise: t where the formula.01.niaG no sliateD 053 ataD reviR esueN eht fo sisylanA lartcepS-ssorC 643 stnemetatS ARTCEPS CORP 443 artcepS esahP dna edutilpmA-ssorC gniterpretnI 143 seititnauQ lartcepS-ssorC gniterpretnI 143 sisylanA lartcepS-ssorC 01.01.7 323 noitcudortnI :ataD cidoireP 1.7 3.7 423 ytivitcA emyznE tnalP :elpmaxE 2.6 / 063 = ) π2(/ 063 α+µ .0 = 21 / π 2 = ω ω / π2 3. then the angle obtained by connecting the arc’s ends to the circle center is one radian.7 433 gnisailA dna snoitautculF tsaF ylemertxE 6.)δ(soc α = B )δ(nis α = A Letting and we see that π2 25.7 623 decudortnI ARTCEPS CORP 3. A radians in a full 360-degree circle.7 4. The function oscillates between and in a smooth and exactly periodic fashion. The number in radians.1 Periodic Data: Introduction The modeling of time series data using sinusoidal components is called spectral analysis.7 033 seicneuqerF cinomraH 5. for the sine of the sum of two angles.01. has been applied.

168 308.988 303. which corresponds to 3 observations.385 251.352 310.2 Example: Plant Enzyme Activity As an example. in the Department of Genetics at North Carolina State University.160 316.363 321.998 The analysis of variance table is shown in Output 7.432 213.324 SAS for Forecasting Time Series This is a very nice expression in that. TITLE "ENZYME ACTIVITY".780 313.648 234.1. C1=COS(2*PI*T/3). if is known. collected observations on leaf enzyme activity Y every 4 hours over 5 days.696 246. INPUT Y @@. PROC REG DATA=PLANTS.096 306.744 261.099 285. CARDS. and B can be estimated by ordinary least constructed in a DATA step and the parameters squares as in PROC REG. S1=SIN(2*PI*T/3).945 290.370 283.351 283. variables and can be A. 3/ DATA PLANTS. There are 6 observations per day and 30 observations in all. 7. The researcher anticipated a 12-hour enzyme cycle. From the expressions for A and B it is seen that and so phase angle and amplitude estimates can be constructed from estimates of A and B.460 287. π2 First read in the data.348 253. 265. Each observation is an average of several harvested leaves.α = )δ( 2 nis + )δ( 2 soc α = 2B + 2 A cycles .870 314.199 341. the original data have been detrended using linear regression. RUN.µ ω .128 252. OUTPUT.909 284.886 317. and then regress Y on these two variables. MODEL Y = S1 C1/SS1. RUN.666 333. 301. Chiu-Yueh Hung. creating the sine and cosine variables for a period 3 (frequency per observation).1415926. TITLE2 "(DETRENDED)".289 307.458 296. DO T=1 TO 30.173 276. To focus this discussion on periodic components. OUTPUT OUT=OUT1 PREDICTED=P RESIDUAL=R.870 379. END. )δ(nat = A / B ) tω(soc ) tω(nis .544 . PI=3.

3 / π2 = ω =P F > rP 4300.330.6695 Y :elbairaV tnednepeD 1LEDOM :ledoM erudecorP GER ehT ecnairaV fo sisylanA setamitsE retemaraP 06. The sum of squares 11933 associated with frequency called the periodogram ordinate at that frequency.< |t| > rP . It is seen to be statistically significant based on the F test. A given set of data may have important fluctuations at several frequencies.7 16692.55 eulaV t Output 7. It appears that the sine term is significant but not the cosine term.92 35094. degrees of freedom.7 35094. Output 7.7 7592. such a splitting of the two degree of freedom sum of squares is not meaningful in that.192(03 = 2 Yn 70459. however.1 Plant Enzyme Sinusoidal Model = ) 238544.5 rorrE dradnatS serauqS fo muS 75643 42722 33911 raV ffeoC naeM tnednepeD ESM tooR 52864.Chapter 7: Spectral Analysis 325 The sum of squares for the intercept is and the sum of squares for the model. The sum of squares 11933 would not is change with any such time shift.0 3443.0 48874.027. 4300.192 etamitsE retemaraP FD 92 72 2 1 1 1 FD .7238544.148 19544.9 38544. which is the sum of squares associated with frequency is 11933 and has 2 ( ).1 latoT detcerroC rorrE ledoM 1c 1s tpecretnI elbairaV =t ecruoS .0 =F eulaV F 90.192 17010.498848.0 9000.3 / π2 = ω 8555.0 1000.992 33611 0228452 SS I epyT 90. if had been used as the first time index rather than both would have been significant.0228452 qS-R jdA erauqS-R 0=t erauqS naeM 82126.2 shows the actual and fitted values for the plant enzyme data.7 .

For each j. sum of squares. )1− ( = ) tπ (soc . that is.3 / π 2 = 03 / 01π2 m2 / jπ2 1 + m2 t . so frequencies. PROC SPECTRA calculates periodogram ordinates at all the Fourier frequencies. However.3 PROC SPECTRA Introduced Periodogram ordinates are calculated for a collection of frequencies known as the Fourier observations Y. the error sum of squares. the last Fourier frequency has only one degree of freedom associated with it. when the data are regressed on these two columns.1 π = )m2 (/ mπ2 = t . but when the frequency becomes and Thus for even n. The Fourier frequencies are where j runs from 1 to m. are run.n .2 Data and Sinusoidal Predictions 7. each with 2 degrees of freedom. PROC SPECTRA .2 . there are no degrees of freedom for error. Since the Fourier frequency for should have periodogram ordinate equal to the previously computed model sum of squares. one for each j. With that a multiple regression of Y on the sine and cosine columns fits the data perfectly. You might expect the other periodogram ordinates to add to 22724. there are m of these. the last having 1 degree of freedom and the others 2 each.0 = ) tπ (nis htj . m=j m2 = n htj . the sine and cosine run through j cycles in the time period covered by the data. With the 30 plant enzyme measurements there are 15 periodogram ordinates. It does not matter whether a multiple regression using all the Fourier sine and cosine columns or m bivariate regressions. The model periodogram ordinate. two columns and are created. The columns are all orthogonal to each other and the sums of squares (periodogram ordinates) are the same either way. If an even number.)n / jπ2 ( 01 = j … . there are still m periodogram ordinates and j still runs from 1 to m. 11933. only.326 SAS for Forecasting Time Series Output 7. is the At the Fourier frequency. arising from the cosine term.)n / tjπ 2(soc )n / tjπ 2(nis n .

71( + 2)488.1482 47.292 19.Chapter 7: Spectral Analysis 327 associates twice the correction term.9067.23911 66.1482 47.12− (()2 / 03( .6 0005. SET OUT2.71 ESS 87.3131 58.144 49.4 384. division of all ordinates by 2 becomes the same as dividing unadjusted numbers by their degrees of freedom.489 00.28850.0 9424. after doubling some. The option COEFF in PROC SPECTRA adds the regression coefficients and to the data.) 2B + 2 A()2 / n( .08597.71 882.019478.0 379.292 19. RUN.2 . IF PERIOD=3 OR PERIOD=.03 .6 3703.3 51239.0446905 10_NIS 10_SOC )dednerted( ytivitca emyznE 0000.32722 ======== 03.0654 85. RUN.3753 53.489 34. The coefficients and are those that would have been obtained if time t had been labeled as (as PROC SPECTRA Any periodogram ordinate with 2 degrees of freedom can be computed as does) instead of where A and B are its Fourier coefficients.6 0000.0 66. DATA OUT2.586 87.285 DOIREP 0000.4141 78.0 530.01 0000.9632 51.144 49. so one must divide the frequency ordinate by 2 to get its contribution to the error sum of squares from regression.2 220. PROC PRINT DATA=OUT2.17643. 95141.3.66 54. IF ROUND (FREQ. SSE = P_01.110546.1 680.1 25576.7592 31.2 72315.0 00000.2 69488.0001) = 3.4 0000.1 02740. you see the regression sum of squares which matches the regression output.2 3727.21497.3753 53.0 QERF sbO Output 7.0 10_P 06.586 87.58720.5*P_01.01083.0446905 = 2 Yn2 .2 0005.1 80664.91279. .4141 78.3 7582. 1 61 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 .) 97.2 17227.295 00.9632 51.12774.7592 31.2 7703.2 04490. … . These ideas are illustrated here for the plant enzyme data: PROC SPECTRA DATA=PLANTS OUT=OUT2 COEFF. THEN SSE=0.2 0000.0 23826. . VAR Y.3.95865.5 298. π … .0 88814.0038.3 OUT Data Set from PROC SPECTRA π )10 _ n is =B 88.10 _P = 33911 .1416 THEN SSE = .0 44902. 1 0 .33911 = ) 2 )1497. with frequency 0 and twice the sum of squares at frequency (when n is even) with that frequency.295 98.6 446.0654 85.12− = A 10 _s oc( 92 .7 0000.5488.1 46652.926 70.2 38303. This doubling is done here because.6942. You see that (See Output 7.1 67738.71116.3 0057.51 0000.6012.231 54. RUN. SUM SSE. TITLE J=CENTER "ENZYME DATA".2 9241.5 0000. The frequency 0 ordinate is replaced with 0 when the option ADJMEAN is used in PROC SPECTRA.926 70. Looking at the period 3 line of Output 7.03 .3 3333.71 0871.31 5367.1297.3131 58.

It is customary to plot the periodogram versus frequency or period. You are justified in using an F test for the single sinusoid plus white noise model when the is known in advance.4 shows the unusually large ordinate 11933 at the anticipated frequency of one cycle per 12 hours—that is. one cycle per 3 observations. Of course. researchers can always investigate any frequency using regression. Output 7. These properties lead to tests of the white noise null hypothesis. as in Section 7. omitting frequency 0. 2σ π ω . The researcher was specifically looking for such a cycle and took sufficient observations to make the frequency of interest a Fourier frequency.4 Testing for White Noise For a normal white noise series with variance the periodogram ordinates are independent and.328 SAS for Forecasting Time Series PROC SPECTRA automatically creates the column FREQ of Fourier frequencies equally spaced in the interval 0 to and the column PERIOD of corresponding periods.4 Periodogram with a Single Important Frequency Output 7. You would not be justified in testing the appropriate largest observed ordinate (just because it is the largest) with F. 2σ . by creating their own sine and cosine columns. If you test for a period 3 component . when divided by have chi-square distributions with 2 degrees of freedom (df). 7. If the important frequency is not a Fourier frequency.2. The beauty of the Fourier frequencies is the orthogonality of the resulting collection of regression columns (sine and cosine functions). the periodogram ordinates with frequencies near the important one will be large.

83 is significant at 10% but not quite at 5%. Fisher computed the distribution for the largest periodogram ordinate divided by the mean of all the 2 df ordinates under the white noise null hypothesis.) Interpolating in Fuller’s table of critical values for Fisher’s kappa with 14 ordinates gives 4. Clearly this new “F” statistic cannot have the same F distribution. resulting in a test of the white noise null hypothesis. which is designed to have some power against any departure from white noise.4 . Traditionally the Kolmogorov-Smirnov test is applied.32722 ([/ 33911 63. your evidence for a 12-hour cycle would be nowhere near as impressive. Our value 4. if you always test the largest ordinate whether or not it occurs at period 3. the F test statistic will have an F distribution.5 PeriodogramBased White Noise Tests = ]41 / )33911 + 2 / 6.23911 41 k C 286928. PROC SPECTRA DATA=PLANTS WHITETEST. This illustrates the increase in statistical power that can be obtained when you know something about your subject matter. page 363.231 − 8. for more details.877 as the 5% critical value. (See Fuller.4 ))*(P(muS ))*(P(xaM 1-M k C appaK citsitatS tseT . kC For 14 periodogram ordinates.6 gives Fisher’s kappa test statistic Fuller (1996) discusses this test along with the cumulative periodogram test.0(mrofinu a fo FDC eht dna margodoirep eht fo smus laitrap dezidradnats eht fo ecnereffid etulosba mumixaM :citsitatS vonrimS-vorogomloK s'tteltraB 489552. if you were just searching for a large ordinate rather than focusing from the start on a 12hour cycle.0 ))*(P(muS/))*(P(xaM*)1-M( :appaK s'rehsiF Y elbairaV rof esioN etihW rof tseT erudecorP ARTCEPS ehT Output 7. However.256 is not big enough. .5. tables of the Kolmogorov-Smirnov (K-S) statistic indicate that a value larger than about 0. omission of the 1 df ordinate 132.09543 98. as shown in Output 7. can be applied to these cumulative ratios. then this new F statistic will never be less than the F for period 3 and will usually be larger. like those in PROC UNIVARIATE. The latter uses which is the ratio of the sum of the first k periodogram ordinates to the sum of all the ordinates (again dropping any 1 df ordinate). Therefore. . RUN. VAR Y. The set of these should behave like an ordered sample from a uniform distribution if the data are white noise. You obtain both white noise tests using the WHITETEST option.elbairav modnar )1.385 as the 10% and 4. In the plant enzyme data. Fisher’s test is designed to detect a single sinusoid buried in white noise and so would be expected to be more powerful under the model proposed here than the K-S test.Chapter 7: Spectral Analysis 329 in multiple sets of white noise data (your null hypothesis).36 would be needed for significance at the 5% level so that 0.38. Therefore a standard distributional test.

2 = 21 / π2 j j /k 21 / )π 2(3 . For example.3 .330 SAS for Forecasting Time Series 7. is sometimes called the Nyquist frequency. Now look at Output 7.5 Harmonic Frequencies Just because a function is periodic does not necessarily mean it is a pure sinusoid.6 Fundamental and Harmonic Sinusoids 2/ 21 / )π 2(2 3 / π2 )21 / tπ 2(nis . A period of 2 is the shortest period detectable in a periodogram.2 / . Output 7. any periodic function of period k defined on the integers can be represented as the sum of sinusoids of period k. To further illustrate the idea of harmonics. imagine monthly observations where there is a fundamental frequency and possibly contributions from the harmonic frequencies plus white noise.” Harmonics affect the wave shape but period k. On the other hand. Thus the plant enzyme measurements were (period 3).3 / k . The and sine column for the fundamental frequency would have tth entry and would go through 3 cycles in 36 observations. For a fundamental for are called “harmonics. etc.π π . the is a periodic function of period k but is not sum of a sinusoid of period k and another of period expressible as a single sinusoid. To fit the model you create three sine and three cosine columns.3 / π4 k 63 = n k 2 < 2 /3 …. not taken frequently enough to investigate harmonics of the fundamental frequency Even the first harmonic has period and frequency which exceeds the Nyquist frequency .6. and its associated frequency. periods not the period.

9. They would add 6 more columns for a total of 12 waves. currently under discussion will have regression coefficients By proper choice of these. at period the sine column becomes for all t.)21 / tπ 2(soc 0 = ) tπ (nis = )2 / tπ 2(nis . .Chapter 7: Spectral Analysis 331 Output 7. seeming to contradict the fact that a period 12 function has 11.2 = 6 / 21 . Similar comments apply to the other two pairs of waves. sine and cosine terms are generated for t in increments of 0. a column of 1s. as you run your finger down for the any of these. the left-to-right oscillation is faster and thus there are more cycles: for the rightmost pair. the regression will exactly fit any sinusoid of frequency regardless of its amplitude and phase. but note that. Writing the deviations of dots from centers as numbers supplies the entries of the corresponding column of the X matrix. leaving 11 columns (11 degrees of freedom) plus an intercept column associated with the period 12 function. not 12. On the left.6 = 6 / 21 9 = 2 / 21 = 4 / 63 21 / tπ2 . For interpolation purposes. If 36 consecutive observations from any period 12 function were regressed on this 12 column X matrix. period Each sinusoid is the sum of a sine and cosine component. of course. degrees of freedom. or columns of X.1B . A perfect fit at the observation times would result even if the sequence were repeated sets of six 1s followed by six s. be omitted.3 .2 . The two waves. Such a column of 0s would. Periodograms and associated tests are useful here. The fitted values would exactly match the observed –1. at time would not be restricted to –1 or 1. There are three cycles in each of these two columns.)21 / tπ2 (nis t Y = 4 / 21 . where and are the periods middle pair and corresponding to the two harmonic frequencies. but Y exists only at integer t. with periodicities and fill out a full set of harmonics for a period 12 function measured at integer time points. thus allowing an arbitrary phase angle.1 pattern at integer values of t. but interpolated values. Just to its right is a wave that represents and to its right is another wave representing Run your finger down one of these two waves. say. a vertical column of dots represents the intercept column. This motivates the statistical problem of separating the frequencies that contribute to the true process from those that are fitting just random noise so that a good picture of the wave shape results.6 is a schematic representation of the regression X matrix just described and is interpreted as follows. However. the fit would be perfect at the observed points but would not necessarily interpolate well between them.1A . Three more pairs of columns.5 6 = 6 / 63 =t 4 = 3 / 21 21 = k 6 = 2 / 21 1− . plus another at the first The following outputs are generated from a sinusoid of period harmonic. One might envision the harmonics as fine-tuning the wave shape as you move up through the higher harmonic frequencies (shorter period fluctuations).1. Your finger cycles between one unit left and one unit right of the wave center line.5 / 21 .

6 . From PROC REG (see Output 7. The fitted values on the right side are those coming from the fundamental and all harmonic frequencies for omitting the sine at The . The following PROC SPECTRA code is used to generate Output 7.10. . and the Type I and 2 are large enough that neither the nor frequencies can be sums of squares for omitted.9). … . These fitted values do not capture the double peak in each interval of 12 time points.3 2>j =j )21 / π2 ( j )21 / π2 (2 = 2ω 1= j 21 / π2 = 1ω . so they are orthogonal to each other. The sine and cosine at the fundamental frequency are used to produce the fitted values on the left side. and they miss the low and high extremes. PROC SPECTRA DATA=COMPRESS P S ADJMEAN OUT=OUTSPECTRA. 1 6. they are treated as pairs. RUN. WEIGHTS 1 2 3 4 3 2 1. Adding all those extra parameters does minor wiggles there are due to the frequencies with not seem to have produced any useful new features in the fitted values.7 Increased Resolution Using Harmonics Output 7. VAR Y.4 . Rearrangement of terms or deletion of some terms would not affect the sums of squares here because the sine and cosine columns correspond to Fourier frequencies.53 for frequencies with is not significant.8 and Output 7. Recall that you would not eliminate just a sine or cosine.6 =j 2=j 1= j . Including the first harmonic gives a better fit and gives an idea of what the datagenerating function looks like.7 shows three sets of fitted values.2 . the F test 1. … =j .332 SAS for Forecasting Time Series Output 7.

0 52. shown in Output 7.< 1000.21 / π4 Output 7.083414.91 05.8.07 eulaV t 96341.9.0 6814.1 erauqS naeM 42 7 FD rotanimoneD rotaremuN ecruoS Y elbairaV tnednepeD rof stluseR scinomraH tseT 37405.078571.0 3711.028.472 54781.0 12302.0 12302.62 55.0 12302. The last few lines of the program deliver a smoothed version of the periodogram.071033.178. that will be discussed in Section 7. makes it quite clear that there are two dominant frequencies.9 Regression Estimates and F Test setamitsE retemaraP 21 / π2 Chapter 7: Spectral Analysis 333 . .1 20509.0 12302.011.0 08333.0 1000.3 50201.0 8909. and its first harmonic.0 1000.1 76859.160.3 02269.5 68731.0 12302.0 41323.0 rorrE dradnatS 14811.0 12302.052761.0 15305.1 27655.01 etamitsE retemaraP 1 1 1 1 1 1 1 1 1 1 1 1 FD 6c 5c 4c 3c 5s 4s 3s 2c 2s 1c 1s tpecretnI elbairaV Output 7.06 68584.0 4593.040.072048.0 47900.< |t| > rP 28.0 12302.9 22.0 12302.062320.10.0 28090.0 F > rP 35.226.0 96341.0 12302.0 48531.1 eulaV F 03347.0 24090.8 Periodogram with Two Independent Frequencies The periodogram.< 1026.< 1000.9963 SS I epyT 0814. Smoothing is not helpful in this particular example.4502.033.0 6250.0 7491. shown in Output 7.215 30549.0 12302.021172.

334 SAS for Forecasting Time Series Output 7. the dot will now be radians counterclockwise—i.e. These frequencies are all said to be aliased with where this frequency was selected because it Another alias will be seen to be as though the observer had moved to is in the interval the other side of the wheel. observer who looks at the wheel each second.. radians—from its previous position. and an radians per observation—for example.3 / π2 3/ 3/ π2 π2− . Based on the dot’s position. If the wheel rotates clockwise radians per second. and similarly for subsequent observations.6 Extremely Fast Fluctuations and Aliasing Suppose a series actually has a frequency larger (faster fluctuations) than the Nyquist frequency Imagine a wheel with a dot on its edge.π − [ . the observer only knows that the frequency of rotation is for some integer j. π > 3 / π4 .] π .10 Smoothed Periodogram 7. π 3/ π2− 3/ π4 j π 2 + 3 / π2− . at the first observation.

is the variance of the series and this will be true π2 π2 π2 σ 2 )ω( f white noise. 2σ = area of the rectangle. 7.) tω − (nis B − ) tω − (soc A = ) tω(nis B + ) tω(soc A n / j π2 j π ]π . positive.2 . + 01 = t t Y . In this book. rather than radians per observations as a unit of measure. periodogram ordinates at the Fourier frequencies Recall that the number of periodogram ordinates m is either if n is odd or if n is even. If observations are taken radians per every 15 minutes.)ω− ( f = )ω( f is the autocovariance function. te )3 / 5( + 01 = t W Consider three processes: .] π . the plot is just a rectangle of height over an interval of width π ≤ ω ≤ π− π2 σ 2 π2 σ 2 . te and is white noise. The reason that this frequency has names instead of always being called is that some people prefer radians or cycles per second. When the periodogram is plotted over and there appears to be a cycle at a bizarre frequency in ask yourself if this might be coming from a cycle beyond the Nyquist frequency. and zero. For that reason. Since for The .7 The Spectral Density variance 1. Thus it is sufficient and customary to compute frequency with so that .0( N∼ e t where . 1 2 / )1 − n ( =j ω . The function is symmetric: For the variance is )h( γ )hω(soc )h(γ ∞−=h W f The spectral density function of a process is defined as ∞ ∑ π12 = )ω( )63. Each process has mean 10 and π ≤ n / j π2 ≤ 0 . is ..0[ π π ω− + )01 − 1− Z (8. The spectral density for becomes just t .] π . the Nyquist frequency is also referred to as the folding frequency. the Nyquist frequency radians per observation would convert to hour.0[ ∑ π12 = )ω( W t 1 = 2 σ = )0( γ ω .0 . for all integers j. per hour. … . where π π4 2/ n m. radians per observation and the Nyquist frequency will be the standard.0[ t Z f . Imagine a number line with reference points at Folding that line back and forth in accordion fashion at these reference points maps the whole line into the interval The set of points that map into any are its aliases. or 2 cycles per hour. ) ec na irav = aera( .Chapter 7: Spectral Analysis 335 Because it is not possible to distinguish a cycle of from one of using the periodogram. per day. in general of a spectral density whether or not it is plotted as a rectangle. and is for a general white noise series . te + )01 − 1− Y(8. negative. etc. 2σ with variance Sometimes the spectral density is plotted over the interval t W π2 σ 2 π2 π2 ∞− =h 1 = )0(soc )0(γ 1 = )hω(soc )h(γ ∞ 0 = )h ( γ and if h is not 0. − 01 = π .

in the bottom-left corner. estimates the same thing at estimate at both each and so averaging several values gives an even better estimate.336 SAS for Forecasting Time Series Because the plot of has equal height at each it is said that all frequencies contribute This is the same idea as white light. and a flat spectrum for Two other periodograms are shown. tW W t Z Z t Y What do the spectral densities of and look like? Using a little intuition. and Z and each computed from 1000 simulated values and having each ordinate plotted at the associated its negative to show the full symmetric spectrum. The slower low frequencies. use the symmetry of and For white noise. Dividing the periodogram ordinate by thus gives an almost unbiased estimate of If the plot over is and plot the desired (so that the area under the curve is the variance).π t Z π− t Y fluctuation in should show up as longer period waves—that is. is (approximately) the periodogram ordinate’s expected value. t ω t Z − t Y ω t D . It is seen that linear filtering of this sort is a way of altering the spectral density of a process. Y. depressing the middle (near 0 too much so that instead of being level. The first. ω− )ω( W f ω π4 t D . for positive deviations tend to be followed by negative and negative by positive. the interpretation of the spectral density is the decomposition of the variance of a process into components at different frequencies. tZ t 0=ω Y . the periodogram frequency) periodogram ordinates of dips down to 0 at the middle. positively autocorrelated series to fluctuate at a slower rate around its mean than does Likewise you would expect the negatively autocorrelated series to fluctuate faster than since. tY t Y = t t D D . is for Because is a moving linear combination of values.ω )ω( fπ4 .ω )ω( f t Y . but not always. In general. higher periodogram ordinates at t . and it is left to the reader to remember that the variance is twice the area of such a plot.)ω( fπ4 )ω( f π <ω<0 . tW . then. The differencing filter has overcompensated for the autocorrelation. is referred to as a filtered version of Note that if the filter had been applied. tW . Often only the positive frequency half of the estimated spectral density is plotted. or white noise in acoustics. improves estimation. You will see that local averaging of estimates often. of course. In other words the time series is conceptualized as the sum of sinusoids at various frequencies with white noise having equal contributions for all frequencies. the filtered series would just be white noise and the spectral density just a horizontal line. you would expect the )π 2 / σ( π ≤ ω ≤ π− 2 . An interesting mathematical fact is that if the periodogram is computed for data from any ARMA model.11 show the symmetrized periodograms for W. tY . the periodogram ordinate at any Fourier frequency estimates that is. For you’d expect the opposite—large contributions to the variance from or frequencies near The three graphs at the top of Output 7. The behavior is as expected—high values near indicating low-frequency waves in high values near the extreme s for indicating high-frequency fluctuations. 1− tY8. where all frequencies of the light equally to the variance of spectrum are equally represented.)ω( f )ω( f .1− tY − .

− coefficient. tV . It is either multiplied (MA) or divided (AR) by a trigonometric function is a filtered version of If had been defined in would have is the spectral .0 t Y π2 = )ω( f σ 2 3152. Because the is nearly indistinguishable from that amplitude of the sinusoid is so small. AR(1) like Y and Z. . 1− eθ − e = X t t t 8. Note that . The low horizontal line associated with white noise has been discussed already.))ω(soc ρ2 − 2 ρ + 1(/ theoretical spectral density is where is the lag 1 autoregressive the spectral Y 0± . the periodogram in the middle of the bottom row shows a strong spike at the Fourier frequency radians. the plot of the altered of the original .11.0 = )0001 / π 2(04 = 52 / π2 π2 σ 2 π2 = )ω( X f σ t 2 Y π2 = )ω( Y f σ 2 t Y . t e t X involving the ARMA coefficients. the spectral density of t X . clearly exposing the modification to The middle graphs in the top (original ) and bottom rows are identical except for the spikes at frequency The bottom-right graph of Output 7. See Section 7. tY )1. t noise spectral density t D π2 ))ω(soc ρ2 − 2ρ + 1(/ ))ω(soc θ2 − 2θ + 1( σ = 2 )ω( Yf ))ω(soc θ2 − 2θ + 1( = )ω( D f .3152. the .))ω(soc θ2 − 2 θ + 1( density is Both the AR and MA spectral densities involve the white . a sinusoid has been added to and the first 200 observations from both the original and altered series have been plotted. if density of as has spectral density where t X . + 52 / tπ2 (nis 2. 1− Yθ − Y = D t t t and is filtered to get then the spectral density of is )ω( V f 2 ))ω(soc ρ2 − 2 ρ + 1(/ t Y V t been similarly related to that of As an example. For a moving average (MA) such as ρ .11 contains plots of three smoothed spectral density estimates along with the theoretical spectral densities that they estimate.Chapter 7: Spectral Analysis 337 In the wide middle panel of Output 7. For autoregressive order 1 series. In contrast. The same is true of the autocorrelations (not shown).))ω(soc θ2 − θ + 1()ω( Vf = )ω( Xf − V= X 1− tVθ t t t V terms of a more general time series as .8 for details about smoothing the periodogram to estimate the spectral density.8 for Y and for Z.

338 SAS for Forecasting Time Series Output 7.11 Spectral Graphics (see text) .

Replace with getting on the autoregressive and . not the standard deviation. Filtering affects different frequencies in different ways.0 )ω(nis i + )ω(soc = e ω )ω(M ) e θ − − e2θ − e1θ − 1( = )ω(M B =ω q i ω q π2 ))ω(soc 2 − 2( = )ω( D f σ 1 > niag 2 ωi 2 . Designing filters to amplify certain frequencies and reduce or eliminate others has been studied in some fields.1 = θ . The term squared gain is used because the spectral density decomposes the variance. ))ω(soc θ2 − 2 θ + 1( t 7. j ωi e ωi 1− t Y− Y = D j t t If then so i .)ω(nis i + )ω(soc = ω e . so the use of i along the way is a convenient mechanism for calculation of quantities that ultimately do not involve imaginary numbers. the model is expressed as D .Chapter 7: Spectral Analysis 339 which is seen to be 0 at frequency This gives some insight into the behavior of the periodogram displayed in the bottom-left corner of Output 7.8 Some Mathematical Detail (Optional Reading) The spectral densities for general ARMA processes can be defined in terms of complex exponentials Here i represents an imaginary number whose square is Although that concept may be hard to grasp. The spectral density for the i π2 σ 2 i replacing everywhere with Start with the spectral becomes process )ω( M * .11. is sometimes called the squared gain of the filter in that amplitudes of some waves get increased ( ) and some get reduced ( ). The multiplier associated with the filter.p ( AMRA Using the backshift operator B. When a complex expression is multiplied by its complex conjugate.1 − 1 < niag ))ω(soc ρ2 − 2 ρ + 1(/ ωi e1 α − 1( = )ω(A − B1θ − 1( = tY ) p B p α − − B1α − 1( .t e density of which is . calculations done with such terms often result ultimately in expressions not involving i. such as in the examples above. The complex polynomials ) p ωi ep α− − 2 ω e2 α − te) i q B qθ − )q .)ω(nis i − )ω(soc = ω −e )ω( A * and have corresponding complex conjugate expressions and obtained by )ω( A on the moving average side. into frequency components. the product involves only real numbers and is positive. t Y )q .p ( AMRA )ω( *A)ω( A π2 Y )ω( *M)ω(M 2σ = )ω( f . You now understand that these expressions in the backshift can be correctly referred to as filters.

WEIGHTS 1 2 3 4 3 2 1. they simply cause example of this is whose periodogram is shown in the bottom-left corner of Output 7. Output 7. will be zero for some and the theoretical expression for will be undefined there. RUN. Smoothed estimates are local weighted averages. tY ω f does not exist for unit where the .. In the PROC SPECTRA output data set.π ≤ ω ≤ π − ∞ ∑ π12 = )ω( t Z n . Modifications are needed for where m is the number of ordinates. 4<j 61 .9 Estimating the Spectrum: The Smoothed Periodogram The graph in the bottom-right corner of Output 7. The divisor is used so that the area under the spectral density curve over will be the series variance.340 SAS for Forecasting Time Series If there are unit roots on the autoregressive side. the denominator. The smoothed spectral density estimate for Y will have variable name S_03 in the data set will be computed as OUTSPEC and for divisor 16 is the sum of the numbers in the WEIGHT statement. S_02.11 and whose spectral density is 0 at 7. and the periodogram ordinates are named P_01. etc.3 −m>j ) ω( I j j n Let denote the periodogram ordinate at Fourier frequency constructed from n ω )ω( f cannot exist either. P_02.10 shows the results of smoothing the and Output 7. VAR X R Y.Y t observations on some time series Suppose you issue these statements: n / jπ2 = j ω j n 2>j j n . they also find some interesting distributional departures from the stationary case. Of course such a process does that is a function of h only.. Unit roots on the to be 0 at some values. etc.π4 π ≤ ω ≤ π− )ω( Y f . tW PROC SPECTRA P S ADJMEAN OUT=OUTSPEC. Although they find the expected overall gross behavior (extremely large ordinates near frequency 0).0 )h( γ =ω )hω(soc )h(γ ∞− =h . for variables in the order listed in the VAR statement. so the spectral density not have a covariance function root autoregressions. Despite the fact that . and in that picture a simple average of 21 ordinates centered at the frequency of interest is taken and then divided by It is seen that these are good estimates of the theoretical spectral densities that are overlaid in the plot. An moving average side are not a problem.)ω( *A)ω(A π4 )ω( Y f .11 contains theoretical spectral densities for and as well as estimates derived from the periodogram plotted symmetrically over the full interval These estimates are derived by locally smoothing the periodogram. the periodogram can still be computed. Weighted averages concentrated more on the ordinates near the one of interest can also be used. Akdi and Dickey (1997) and Evans (1998) discuss normalization and distributional properties for the periodogram in this situation.D t .8 periodogram.)π4(/ ]) 3+ ω( I + ) 2+ ω( I2 + ) 1+ ω( I3 + ) ω( I4 + ) 1− ω( I3 + ) 2− ω( I2 + ) 3− ω( I[ 1 j n j n j n j n . the spectral density estimates are named S_01. Note that much of the detail has been lost. .

0= t η − t X X j )8. as with X. and D in Output 7. assume )ω( f η+ −X j t j v ∞−=∞ Σ = j − t t t t Y Y Y .11. several graphs are made using different degrees of smoothing.( 0 = ω ( nis = X 1− tY8. suppose Xt is the sinusoid )t . Xt. This presents a dilemma for the researcher who is trying to discover the nature of the true spectrum: the best way to smooth the spectrum for inspection is not known without knowing the nature of the true spectrum. each with approximately (exactly if the data are normal white noise) a chi-square distribution with 2 degrees of freedom. The less smooth ones reveal spikes and the more smooth ones reveal the shape of the smooth regions of the spectrum.10 Cross-Spectral Analysis Interpreting Cross-Spectral Quantities 7.1 Interpreting cross-spectral quantities is closely related to the transfer function model in which an output time series. The set of weights is called a spectral window. Z. when the true spectrum is fairly smooth. To address this.Chapter 7: Spectral Analysis 341 From the graphs in Output 7. in which case inspecting its estimate is of no interest. it is seen that the sinusoids are indicated more strongly by the unsmoothed P_01 than by the smoothed spectrum S_01.10. a highly variable distribution. let Yt and Xt be related by the transfer function t Then j which is a weighted sum of current and previous inputs. For the moment. 7. and the effective number of periodogram ordinates involved in an average is called the bandwidth of the window. Dividing each periodogram ordinate by the corresponding spectral density results in a set of almost independent variables. In the example. On the other hand. Yt. The estimated spectral density approximates a weighted average of the true spectral density in an interval surrounding the target frequency rather than just at the target frequency. The weights applied to produce the spectral density lower the variance while usually introducing a bias. Xt.8 and 7. Y.10. That is because the smoothing spreads the effect of the sinusoid into neighboring frequencies where the periodogram concentrates it entirely on the true underlying Fourier frequency. the estimator should be smoothed. through the equation t For example. Cross-spectral quantities tell you what happens to sinusoidal inputs. = Σ= ∞ j t η and where is a time series independent of the input. is related to an input time series. The interval is larger for larger bandwidths and hence the resulting potential for bias increased. whereas the variance of the estimate is decreased by increasing the bandwidth.

− Y B − tω ( nis A = Y 8. − B soc A 8. Only the amplitude and phase are changed. In cross-spectral analysis. − )B − tω ( nis A ) 0 = )ω + B ( nis A8.21 / π2 = ω t t . = ) ) ω( soc )tω(nis = ) tω ( soc ) )ω + B ( nis A8. 8. you simultaneously estimate the gain and phase at all Fourier frequencies. − ) 2 / 3 (1906. = °5.1 and The transfer function produces output with amplitude 1. These results hold only for The output for any noiseless linear transfer function is a sinusoid of frequency when the input X is such a sinusoid. using arbitrary input and its associated output. ω 8289. / 1 = A { } = )3 ) 4.342 SAS for Forecasting Time Series where 21 / Using trigonometric identities shows that Yt satisfying )t must be of the form ) Solving you have and The solution is 2203.9828 times that of the input.( − 1( / 4. + )B ( nis A − ( + ) tω ( nis ) )ω + B ( soc A8. + B nis A − 1 = )ω + B ( soc A8.1 = 29. it has the same frequency and a phase shift of arctan radians. − )B ( soc A ( = ω − B − tω ( nis A8. − 1( / ) ω( nis ω ( nis = 1− Y8.25 = )2203. − 1906.1( ) 2 / 1(1397. = )B ( nat t π2 = ω . An intermediate step is the computation of quantities called cospectrum and quadrature spectrum.

− ) h ( yx γ t X = 1− tY8.) ω( xx f = ))ω( nis i8. or or From these last two equations multiply both sides by Xt–h and take the expected value. . ) h ( yx γ where ) h( xx γ so However. You obtain is the autocorrelation function (ACF) for x. ) ω(q ) h ( yx γ . and the imaginary part gives the Chapter 7: Spectral Analysis 343 is absolutely summable. − 1()ω( yx f ) ω( nis i − )ω( soc = ω − e i ) ω( xx f = ωi− e )ω ( yx f 8. − ) e ) h ( xx γ ( ∞− = h Σ ) π 2 ( = h ωi − ∞ 1− e ) h ( yx γ ( ∞− =h Σ ) π2 ( ∞ 1− h ωi − ) h ωi − e )h ( γ ( ∞− =h Σ ∞ 1− ) π2 ( = ) ω( f Now when ) h( γ ) ( xx γ h = )1 − h ( yx γ8. . .) ω( c )ω(qi − )ω(c = )ω ( yx f quadrature spectrum.) ω ( yx f The real part of where is the cospectrum. . + )ω( soc 8. − )ω ( yx f ) h ωi − e ) h ( xx γ ( ∞− =h Σ ) π 2 ( ∞ 1− h ωi− = ) ωi − e ) 1− h ( ωi − e )1 − h ( yx γ8. In the example is the Fourier transform of the cross-covariance function. − e ) h ( yx γ ( ∞− =h Σ ) π2 ( ∞ 1− ) h ωi− e )1 − h ( yx γ8. − t Y } ) tY ( E − h + tY ) t X ( E − t X { E = The theoretical cross-spectrum.

or ) .1 − 46. ) )ω(c / )ω(q− ( natcra and that of Y by X is )) ω( c / )ω( q ( natcra = )ω ( yx Ψ ) ω( yxΨ The phase spectrum of X by Y is defined as )) ω ( soc 6.1 − 46. the gain is the multiplier applied to the sinusoidal component of X at to obtain the amplitude of the frequency component of Y in a noiseless transfer )) ω( q− and the quadrature spectrum of X by Y (that of Y by X is }) ω ( soc 6.344 SAS for Forecasting Time Series obtain ) You then have the cospectrum of X by Y (that of Y by X is the same) )) In Output 7.12 (pp.1( function. − 1( )ω ( xx f = )ω ( c ω( ω( xx f 2 q+) 5. in our case .0 ≠ )ω ( xx f ω provided frequency Thus. − )ω( soc 8.1 − 46.10.0 − )) ω( ω ( soc 6.1( / ) )ω( soc 8. ω 5.1 / ) ω ( nis 8. )) ω ( nis i8.1 − 46. − 1( Multiplying and dividing the left side by the complex conjugate you ω( xx f ))ω( soc 6.{ ) ω ( xx f = ) . xx f = ) ω( A = ω( q yx yx yx t X .0 The cross-amplitude spectrum is defined as )) In this example.1( / ))ω( nis i8.1( = ) ω ( A 2 c( = ) e ω( ω ( / )ω ( A + yx f 1− t X 5. ) The gain is defined as the amplitude divided by the spectral density of X.0 − . − 1( = )ω( yx f ω ( soc 6.2 Interpreting Cross-Amplitude and Phase Spectra 5.1 − 46. − ) ω ( soc 8. 348–349) the cospectrum and quadrature spectrum of Y by X along with their estimates from PROC SPECTRA are graphed for the case t 7.

1 − 46. 347). Then .−{ natcra = ) ω ( Ψ ω( )) yy f ω( yx A( ) ω( ω( yxΨi( pxe )ω( yx A = )ω( yx f xx f (/ η + − X v ∞−=∞ Σ = Y 2 ) ω( j t e η yx f + j 1− t X5.12. The of satisfies spectrum )) x x ω ( y2 K − 1( )ω ( yy f = )ω ( yx f )ω ( 1−x f )ω ( yx f − )ω ( yy f = )ω ( ηf t The true squared coherency and its estimate from PROC SPECTRA for the example are also graphed in Output 7. and it undergoes a phase shift .η To compute the theoretical coherency for the example. so an error series is introduced into the model as t where is uncorrelated with Xt. The graphs explain the effect of the transfer function on a sinusoidal input. ω This is the phase difference between the output and input at frequency } In this example.12 (p. in analogy to the correlation coefficient. Now. Its amplitude is changed .Chapter 7: Spectral Analysis 345 These cross-amplitude and phase spectra are graphed along with their estimates from PROC SPECTRA in Output 7. The graphs show ) Transfer function relationships are not perfect (noiseless). = )ω( ) ω( η f j = xy yx K 2 t t t η Assume X . − 1 / ) ω ( nis 8.1 + 1{ = t η with var(et)=1 and ) x ω ( y2 K is white noise with variance 1. you need assumptions on X and t ω( how these changes are a function of frequency )) . ) ω ( soc 8. the squared coherency is defined as )) This measures the strength of the relationship between X and Y as a function of frequency. 1− }) ω ( soc − 52. The cross-spectrum can be expressed as )) ω( yxΨ( .1 / ) ω ( soc 6.

RUN.12. VAR Y X. WEIGHTS 1 1 1 1 1. CROSS indicates that cross-spectral analysis is to be done. CROSS produces the real part RP_01_02 and the imaginary part IP_01_02 of the cross-periodogram when used in conjunction with P. t V= Y = t t = t X V . Plots of estimated and true spectra are overlaid in Output 7. and phase spectra (CROSS must be specified also). Consider the following 512 observations Yt generated from the model and where Xt is an autoregressive (AR) process t The following SAS code produces appropriate spectral estimates: PROC SPECTRA DATA=A OUT=OOO P S CROSS A K PH. K. )mret esion a gnidda( e t X + + t η+ 1− t X5.10. RP and IP are unweighted estimates. Thus. 1− tV8. It produces the cospectrum C_01_02 and the quadrature spectrum Q_01_02 when used in conjunction with S. and PH request. t η with variance 1. respectively. and C and Q are weighted and normalized estimates of the cospectrum and quadrature spectrum. squared coherency. estimation of crossamplitude. A. VAR Y1 Y2. Weighting is necessary to obtain a valid estimate of the squared coherency.3333 and where )noitcnuf refsnart sselesion eht( is white noise with variance 1.346 SAS for Forecasting Time Series 7. RUN.3 PROC SPECTRA Statements PROC SPECTRA gives these names to estimates of the cross-spectral quantities for the first two variables in the VAR list: Cospectrum Quadrature Spectrum Cross-Amplitude Spectrum Phase Spectrum Squared Coherency CS_01_02 QS_01_02 A_01_02 PH_01_02 K_01_02 PROC SPECTRA options for cross-spectral analysis are as follows: PROC SPECTRA DATA=IN OUT=O1 COEF P S CROSS A K PH WHITETEST ADJMEAN. WEIGHTS 1 1 1 1 1 1 1 1 1 1 1.

Chapter 7: Spectral Analysis 347 Output 7.12 Plots of Estimated and True Spectra .

348 SAS for Forecasting Time Series X YB Y EDUTILPMA-SSORC Output 7.12 Plots of Estimated and True Spectra (continued) .

indicating a strong correlation between room temperature and furnace temperature at low frequencies.12 Plots of Estimated and True Spectra (continued) Although the data are artificial. ω( π ω( .Chapter 7: Spectral Analysis 349 Output 7. behaves like the cross-amplitude spectrum A_01_02 for this example. indicating that X (the furnace temperature) tends to peak slightly before room temperature at intermediate frequencies. The squared coherency becomes smaller at the higher frequencies in this example. Because of mixing in the pipe leading from the furnace to the room. The transfer function tends to smooth the high-frequency fluctuations. while high-frequency fluctuations produce low-amplitude (small variance) fluctuations at room temperature. it is not surprising that high-frequency (fast oscillation) temperature changes in the furnace are not transferred to the room. This makes sense if the furnace is connected to the room by a reasonably long pipe. A_01_02/S_02. The squared coherency is near one at low frequencies. Because of mixing as the air travels from the furnace to the room. The phase spectrum starts at zero and then decreases. This behavior shows that low-frequency fluctuations in the furnace produce high-amplitude fluctuations at room temperature. think of X and Y as representing furnace and room temperatures in a near zero) and short-term building. high-frequency oscillations in furnace temperatures tend not to be strongly associated with temperature fluctuations in the room. The estimated phase spectrum can vary at high frequencies as a result of this low correlation between furnace and room temperatures at high frequencies. The gain. The phase spectrum shows that long-term fluctuations fluctuations near ) for furnace and room temperatures are nearly in phase.

the direct estimates (no model) of the spectral quantities from PROC SPECTRA are plotted. + 1 e)B478.1 = t ε + ωi− 2 e594. = 3− t X 711.1 + B142. + )2 t − j ( XX γ372.” the differenced log flow rates of the Neuse River at Kinston (Y) and Goldsboro (X) are analyzed with the transfer function model t or 1− te478. + 2 192.1 − 1( t X) − 3 ε + 2− t X372. + 1− t X594. − ) 711. − 1( ( 2 711. the spectrum of Goldsboro is ) Note that the cross-covariance of Yt with Xt–j is the same as the cross-covariance of Xt–j with so you obtain YX γ 2−t Thus.1 )ω ( soc 2 − ωi3 e711. + ωi2 e192. 1− t X142. + 2142.[ )ω3 ( soc 2 + − e= ω ( XX f ) ω 2− e372. the model-based spectral quantities are developed. (142. }]711.1 − 1( = )ω( = )ω ( XX f = )j ( t = vσ 2 − e = 2σ YX f t t X Y . ωi2− i e192. − 1( = i ) π 2 ( / 9930. + ωi − e142. − 1( ) ωie478.10. + X372.( ) ) ω 3− e711.( 2 − 2478. − )192.1 )ω2 ( soc 2 − ) 711. Then. + )1 − j ( XX γ594.(142. + ωie142.4 Cross-Spectral Analysis of the Neuse River Data In Chapter 3. the cross-spectrum is ) 192. and vt is a white noise series with 8500.1 − 1( ( / ) ) ωi− e478. (192.350 SAS for Forecasting Time Series 7. and t where 1− t v888. + t v 2 − t X192. + 2− t ε84. = B711. with 9930.1 + 1 { / )ω ( soc )478. − 1− t ε361.1 + 142. First. + )) π 2 ( / 9930. When the models above are used. + 1− X594.( B192. “The General ARIMA Model. The spectral quantities discussed above are computed and plotted using the estimated model parameters.

the phase spectrum is When you use the ordinates in the plot of the phase spectrum as dependent variable values and frequency as the independent variable. this information appears as two spikes.34 days between Goldsboro and Kinston. This indicates a lag of 1. However.Chapter 7: Spectral Analysis 351 The real part (cospectrum) is ) and the quadrature spectrum is ) The phase spectrum is )) The spectrum of Kinston (Y) is where π2 ) ) ω 2−e84. These are overlaid on the (smooth) plots computed above from the transfer function fitted by PROC ARIMA.( = )ω ( c e594.( ) ωc ( nis i + )ωc ( soc ( β )ω ( XXf = )ω ( YX f ω( YY f )ω( XX f ( / 2 ) ω( YX f = ) ω( YX K 2 i ωc = ))ωc ( nat ( natcra = )ω ( YXΨ ωi2 ω( c / )ω ( q ( natcra = )ω ( YXΨ e372. you can show the following relationship: ) so )) Thus. − 1( ) ω e888. )) e888.34 as an estimate of c.1 − 1( ( εε = )ω( f 8500.13 the irregular plots are the cross-spectral estimates from PROC SPECTRA.( = )ω ( q XX γ( ∞− =h Σ β = ) e)h( YX γ( ∞−=h Σ = ) ω( YX f ∞ hωi ∞ ωi− ω( XX f ) )ω2 ( soc 372. − 1( ( ω− i i The squared coherency is simply )) Consider this pure delay transfer function model: c− t Using the Fourier transform. a simple linear regression using a few low frequencies gives 1. in the prewhitened cross-correlations. ) ω ( εεf + ) ω ( XX f ) ω 2− e372. Because ARIMA models contain only integer lags. In Output 7. + ω e361. you are not restricted to integer lags. at lags 1 and 2. + ω −e361. with the cross-spectral approach. i + ωi e594. + ωci e) c − h(ωi e) c − h( i i i ω ( XX f ))ω2 ( nis372.( = ) ω ( YY f Xβ = tY . + )ω ( soc 594.1 − 1( ) ω 2e84. + )ω ( nis594.

13 Overlaying the Smoothed ModelDerived Plots from PROC ARIMA and the Irregular PROC SPECTRA Plots .352 SAS for Forecasting Time Series Output 7.

13 Overlaying the Smoothed ModelDerived Plots from PROC ARIMA and the Irregular PROC SPECTRA Plots (continued) .Chapter 7: Spectral Analysis 353 Output 7.

You have seen that the idea of cross-spectral the phase of Y and the amplitude of X is analysis is to think of a general pair of series X and Y as each being composed of sinusoidal terms. END. If behind X by 1 time unit. PROC PRINT LABEL DATA=OUT1. in terms of amplitude and phase. The phase of Y is radians less than the phase of X. OUTPUT. the value of X at time t is a perfect predictor of Y at time Similarly X is ahead of Y by 1 time unit. RUN. WHERE PERIOD > 12. 7. RUN. and Pure Delay ) δ + ω − tω(nis α3 = 1− X3 = Y . X=0.)1. IF T=64 THEN X=0. From another viewpoint. *Y IS 3 TIMES PREVIOUS X*. the closeness of the PROC SPECTRA plots to the model-derived plots provides a check on the ARIMA transfer function model and estimates. VAR X Y.0 ( X N∼ e ω t . You could also say that the phase of X is that of Y. RUN. This program creates and so it is an the spectrum of X is example of a simple noiseless transfer function. . that is. then Y is With two series. Y = 3*X. With 1− t DATA A.) δ + tω(nis α = X δ + ω− 3 /1 t 2951.1 t t Y is also a perfect sine wave. to those of the corresponding sinusoidal component of X.5 t Details on Gain.0 = ) π2 (/ 1 = )ω( XX f X Suppose is a perfect sine wave Now suppose . then estimating how the sinusoidal components of Y are related. PI = 4*ATAN(1). Y and X. ID PERIOD FREQ. PROC SPECTRA DATA=A P S CROSS A K PH OUT=OUT1 COEFF. there is a phase of Y by X and a phase of X by Y.1 = )π 2(/ 9 t Y . DO T = 1 TO 64. the modelbased spectral plots provide a highly smoothed version of the PROC SPECTRA output.10. . ω at all frequencies and has spectrum +t )ω( XX f X3 = Y . Phase. and the radians more than amplitude of Y is 3 times that of X. 1− t X3 t = ω t Y t e= t .4234. X=NORMAL(1827655).354 SAS for Forecasting Time Series From one viewpoint.

the order of variables is X Y.093732.0 1 1 1 1 1 )ω( f 50873.0 12742.0 92094. for X at corresponding periodogram ordinate divided by period 64.0 25492.4 66663.0 84746. Each periodogram ordinate is times the sum of squares of the two 78231.046362.01 42000.23739sin(2 t/64) = 0.0 = )π 4(/ 78231.2 14394.0 50302.0 35090.23 0000.12 0000.0 07293. This motivates as an estimator of for both Y and X. Thus the entries in the phase column are exactly the same as the )ω( f 2090.0 57057.61 3333. In the VAR statement of PROC SPECTRA.0 92402.3 B B 34575.1 Each Y periodogram ordinate is times the corresponding X periodogram ordinate.0 71890.21 0000.0 )2 / n ( 15200. Y yb X fo Y yb X fo Y fo X fo Y fo IP ot doireP margodoireP margodoireP ytisneD ytisneD margodoireP 0 morf gamI laeR lartcepS lartcepS ycneuqerF X fo Y fo Y fo X fo X fo IP ot doireP margodoireP mrofsnarT mrofsnarT mrofsnarT mrofsnarT 0 morf eniS enisoC eniS enisoC ycneuqerF for X at period 64.1 94728.0 53691.0 53691.009751.24 9992.0 25492.10302 – 2. Output 7.084590.0 23271.0 51090.0 07293. This exact relationship would not hold if noise were added to Y.564465/0.0 82645.46 δ . not Y by X. a distribution with mean 2.7 9705.0( + 2 )31261.0 78094.12 0000.09817 radians.0 74204.0 78094.1 61431. and you see that this of Y is radians less than the phase produces the phase of X by Y. for example. X has a component 0.00486).0 07293.0 53691.0 B B ωfπ2 2 3 96623. Each spectral density estimator is the . the periodogram divided by (where the true spectral density of the process is ) has approximately a chi-square distribution with 2 degrees of freedom.21 0000.0 7657. Only a few frequencies are printed out.14 X and Y Series It is seen that at period 64.0 25492.Chapter 7: Spectral Analysis 355 Since no weights were specified.00486 = 0. no smoothing has been done.027538.1 60865.0 48811.22 0569.6 34561.5 65684. The phase of X as was shown above.16213cos(2 t/64) – 0.6 91161.0 61906.3 78087.564465sin(2 t/64 –2.41 5831.021215.1 02182.3 95348. Within the class of ARMA models.0 07293.0 51962.1 21333.46 0008.84 1973.04965.22 9591.0 54072.0 64795.0 25492.1 ω δ + ω− π4 = ] 2)84590.2 66155.46 0008.1 63118.0 15620.068773.51212cos(2 t/64) – 0.10302) and Y has a component 0.188156sin(2 t/64 + 2.61 3333. For example.12 0000.1 26395.0([)2 / 46( coefficients.0 70724.09548sin(2 t/64) = 0.0 Y yb X Y yb X fo Y yb X fo 2 Y yb X fo Y yb X fo fo esahP edutilpmA **ycnerehoC erutardauQ artcepsoC 78094.21 4478.21 0000.0 94631.0 53691.0 π 4 / )ω( n I IP ot doireP 0 morf ycneuqerF )ω( n I 78094.0 71890. where 0.23 0000.23 0000.61 3333.1 13030.188156=3 is the amplitude increase in going from X to Y.031261.0 71890.2 78231. The phase shift is 2.0 B B 0008.1 76381.7 3283.138300.065822. 64817.046435.0 78791.0 71890.

giving the negative slope. the theoretical spectral density h )h( XX γ hωi−e ∞−=∞ of X is the Fourier transform of the covariance The absolute is the cospectrum of X by Y and and ω− 0 = esahp } h +1− t X1− tX{E9 = d− t ∑ π12 = )ω( XC = Y )h( XX γ 9 = X t 1− t X3 YX f = Y t . The delay need not be an integer.)ω( qi − )ω(c Writing as the real part .)h ( XX γ If and if has an absolutely summable covariance function in the current example. and with the variables listed in the order Y X.0 i − the coefficient of is the quadrature spectrum In this example For example. you see that the sites must have been listed in the order Goldsboro Kinston in PROC SPECTRA. as was illustrated with the river data earlier. would have pure delay d for appeared as the phase spectrum estimate. The phase plot of the generated data that simulated furnace and room temperatures had a negative slope near the origin. The processes also have a cross-covariance function } h + tY t X{E whose Fourier transform is the cross-spectral density of Y by X: 4249. Had the order been X Y. since the phase slope is positive and Goldsboro (X) is upstream from Kinston (Y).)ω( XX f )ω(nis 3 = )ω(q 3585.)ω(q . Multiplying these by the estimated X spectral density gives )ω(c . Had the variables been listed in the order Y X. the phase of Y by X is produced. and this slope gives the so d=1. then Y also has a covariance function } h + tY tY{E = )h ( YY γ t which is the case summability assumption ensures the existence of the theoretical spectral densities. The plot of phase by frequency is a straight line with slope 1.)ω( XX f 9 = )ω( YY f )1 − h( γ XX )ω( f ])ω(nis i − ) ω(soc[3 = ∞− =h π2 )1 − h( γ −h ωi− e]) ω(nis i − ) ω(soc[ 3 = ∞ ∞− = h π2 ∞− =h π2 3 = )h( γ hωi−e ∞ 1 = )ω( )1 e e − h ( ωi− ωi − XX )1 ( ∑ ∞ XX YX } h +1− tX tX{E3 )h ( YX γ h ωi − e ∞− =h ∞ )1 − h( XX γ3 ∑ ∑ = )h( YX γ = = = )23 / π2 (nis 3 ∑ π12 XX f sequence: and similarly )ω( XX f By definition. For the river data. . The slope of the phase plot near the origin gives some idea of the lag relationship between Y and X in a transfer function model with or without added noise. at period 32 you find and . The room temperature Y is related to lagged furnace temperature X.2 = )23 / π 2(soc 3 )ω( XX f )ω(soc 3 = )ω(c . as long as the coherency there is reasonably strong.356 SAS for Forecasting Time Series frequencies. the plot would be reflected about the horizontal line and an initial positive slope would have been seen.

3 = )ω( 2 nis + )ω( 2 soc 3 = )50302. 2 ω− t Y . The phase shows you the lag relationship between the variables. the squared coherency is really meaningless. amplitude. like R then.8811.5974. In practice. The quantity is the spectral density for that part of Y that is exactly related to X.Chapter 7: Spectral Analysis 357 (2. the spectral density of Y should be For example. however. quantities in the case that there are R the absence of smoothing weights.) ω( 2 κ symbol is and it is called the squared coherency. The fluctuations in that object consist of the transferred energy plus independent fluctuations such as wind movements while flying. In a noiseless transfer function.)ω( XX f 3 = )ω( XX f )ω( nis + )ω( 2soc 3 = )ω( A = )ω( 2 q + )ω( 2 c )ω(q t W . Fuller (1996) gives formulas for the cross-spectral estimates and confidence intervals for these equal smoothing weights.” It represents the amplitude multiplier for the frequency to Y in a model where Y is related to X without noise. such as vibrations in an airplane engine transferred to the wing or fuselage. provides an measure as a function of frequency. but refer to relationships between X and Y—that is. The phase is usually computed as the whose tangent is If a phase angle a little less than is followed angle in by one just a bit bigger than . You can think of fluctuations in X over time as providing energy that is transferred into Y.2 / π − [ . and similarly the estimated quadrature spectrum of X by Y on the printout. The spectral density of W 2 the squared coherency between Y and X would be 1 at all frequencies because in that case. For the amplitude of the frequency component is This is called the amplitude of X by Y. at period 32 you find Recall that the quantity has been referred to earlier component in going from X as the “gain. Its )ω( WW f ω = ))ω(soc / )ω(nis(natA = ))ω( c / )ω( q(natA )ω( XX f / )ω( A ω ω t )ω(c Y . 2/π π . smoothing weights are usually applied so that more accurate estimates can be obtained. Since Y is related to X by a noiseless transfer function.0( = )50302.94728. In our case the gain is thus consists of plus an added noise A more realistic scenario is that an observed series component independent of X (and thus Y).)ω( XXf / )ω( 2 A )ω( XXf / )ω( 2 A 2 .9424)(0. The phase of X by Y is as would be expected from the previous discussion of phase diagrams. without any added noise. as has been mentioned several times.0(/ 2 )61906.)ω(c / )ω(q 1 = )ω( YYf / )ω( YYf = )ω( YYf / ])ω( XXf / )ω( A[ 1 + d2 .0( t N . and gain using W and X as data have their same interpretation. The phase and amplitude spectra are transformations of and and are often easier to and that of Y by X is interpret. Another practical problem arises with the phase. and in the printout.20305) = 0. In a system with noise. This appears in the output.0 . as would be an of 1 in a simple linear regression with only 2 points.1 . the quantity ])ω( WW f )ω( XXf [/ )ω( 2 A )ω( XXf / )ω( 2 A will no longer be but will be this plus the noise spectrum.()3585. in 2 This small example without smoothing is presented to show and interpret the cross-spectral calculations. Here the phase. between X and the part of W that is a direct transfer function of X.)ω( XX f ])ω(nis i − )ω(soc[3 = )ω( YX f . each of these entries is the corresponding spectral density of X estimate multiplied by 3. the interval restriction will cause this second angle to be reported The phase diagram can thus show phases jumping back as an angle just a little bigger than and forth between and when in fact they could be represented as not changing much at all.2 / π − 2/π 2/π 2 / π− ]2 / π . the estimated cospectrum of X by Y for period 32. 1− t X3 = . Some practitioners choose to add and subtract multiples of from the phase at selected frequencies in order to avoid excessive fluctuations in the plot.

358 .

8 3. and define the information into a data warehouse. summarize the information for detailed and historical analyses.1 Introduction This chapter deals with the process of forecasting many time series with little intervention by the user.8 1. such as damped trend exponential smoothing and Winters method. This system provides a menu-driven interface to SAS/ETS and SAS/GRAPH procedures to facilitate quick and easy analysis of time series data. Most models herein. including many that have been discussed so far. Some of these were developed in the literature without using ARIMA ideas and were later recognized as being ARIMA models.8 7. how long they stay. Results are displayed on the Web and accessed by an Internet browser. and what material or pages they are viewing. This information can then be accumulated over time to construct a set of metrics that enables you to optimize your e-business investment. are equivalent to specific ARIMA models.8 4.8 5. The examples focus on Web traffic data that accumulate very quickly over time and require a demanding warehousing and analytics strategy to automate the process. In addition. the SAS/ETS software Time Series Forecasting System (TSFS) is examined. All parameters associated with the forecast model are optimized based on the data.8 Data Mining and Forecasting 8. Analysis of such large amounts of data is often referred to as “data mining.8 8.8 .8 2.8 6. The goal is to illustrate a modern automated interface for a collection of forecasting models. 383 yrammuS 183 tnempoleveD ledoM gnikeeS-laoG 673 syalpsiD lacihparG 673 scirteM ecnamrofreP laoG ssenisuB 573 tnempoleveD dracerocS 863 erudecorP FPH 263 metsyS gnitsaceroF seireS emiT ehT 063 ledoM ataD gnitsaceroF 953 noitcudortnI retpahC 9.” In this chapter SAS Web Analytics are used to read the Web traffic data. The HPF (High Performance Forecasting) procedure is used here to provide an automated way to generate forecasts for many time series in one step. The SAS Web Analytics reports provide important details about your Web traffic—who is visiting your site.

They can receive automated alerts to early indicators of excellence or poor performance. and analyze the information enterprisewide to help make the right decisions.vermontcountrystore. the chapter uses a scorecard to integrate.com. each night we receive customer Web logs after 12:00 AM local time. See www. placed in a file directory. and analyzed using SAS Web Analytics. The Web logs are unzipped. The delivery mechanism is provided through an ASP (application service provider) infrastructure. (They provided a modified version of their data for illustration here. distribute. 8.2 Forecasting Data Model Under the ASP framework. One company using this approach is the online retailer the Vermont Country Store. The application presented here is available through the SAS IntelliVisor for Retail service.) . The data examine key metrics used to describe activity during the 24 hours of e-retailing in a given day. This interface helps business users analyze data in new and different ways to anticipate business trends and develop hypotheses. The interface enables IT (information technology) professionals to fully automate and personalize the collection and distribution of knowledge across the organization.360 SAS for Forecasting Time Series Finally.

followed by a listing of some of the data. Table 8.Chapter 8: Data Mining and Forecasting 361 The variables and their descriptions are provided in Table 8.1. Revenue (TARGET) Number of Purchasing Sessions Average Order Value Average Items per Purchasing Session %CQS Buyers Abandon Carts % Number of Sessions Number of Catalog Requests Number of Product Suggestion Pages Viewed New/Total Sessions × 100 Purchase Response Rate New/Total Buyers × 100 .1 Variables and Descriptions Variable date revenue buyer dollars_per_purch_session items_per_purch_session catalog_quick_purch_perc perc_abandon_carts num_session requestcatalog_con productsuggestion_pages new_cust_perc purch_perc new_buy_perc Description SAS Date variable formatted in DATE9.

Since revenue is the target or main response variable of interest. The TSFS automatically identifies the Time ID variable DATE and recognizes that the data are at daily intervals. select the graph button to evaluate revenue behavior over time. .3 The Time Series Forecasting System Open the TSFS and select the data set to be accessed.362 SAS for Forecasting Time Series 8.

) . Retail sales over the Web tend to show a daily cycle over time. The Revenue variable shows a decrease in variability over time with some periodic tendencies. this graph represents a display that does not reflect the true revenue at the Vermont Country Store. This is not unusual. (Again.Chapter 8: Data Mining and Forecasting 363 Select the Revenue variable and then select the Graph button.

The display below only goes up through 5 augmenting terms. B φ− 1 = φ : 0H s B φ− . This test is previously described and fails to reject the null hypothesis of nonstationarity only with four augmenting lags. The TSFS employs ordinary unit root tests (1 ) and unit root tests for the seasonal polynomial (1 ) using k lagged differences as augmenting terms. and examining the autocorrelation plots suggests the need to difference.364 SAS for Forecasting Time Series The series looks nonstationary. these are factors in an autoregressive polynomial of order k + 1 and is tested. say. with a separate mean. The user should always entertain the possibility of fitting a model outside the class of models considered here. the residuals might look more stationary. That is. had the pre-Christmas surge in sales been modeled. By selecting the p=. For example.05 button you can access the Dickey-Fuller unit root test.

.Chapter 8: Data Mining and Forecasting 365 Go back to the main window and request that the TSFS automatically fit models for every series.

The user has some control over the list of potential models and simple features of the data that are used initially to pare down the list. Notice the TSFS selects a seasonal exponential smoothing model for revenue.366 SAS for Forecasting Time Series We’re notified that 12 models will be fit for each series. . in this case. The TSFS provides an assortment of different seasonal and nonseasonal models and chooses the “best” model based on an information criterion that in this case is minimizing the root mean square error. to 12 models that might fit well.

.Chapter 8: Data Mining and Forecasting 367 Select the Graph button to see the forecasts. and then select the forecast graph button to see the forecasts and confidence intervals.

the typical fast spreading prediction intervals are seen as the forecast goes beyond one or two steps. You can use the following forecasting models: Smoothing Models: Additionally. and the fit statistics to output data sets. 8. Because exponential smoothing is analogous to fitting a unit root model. the forecast confidence limits. transformed versions of these models are provided: For intermittent time series (series where a large number of values are zero values).368 SAS for Forecasting Time Series The graph and review of the data and forecasts using the data button suggest the seasonal exponential smoothing model does not fit the larger revenue spikes very well. you can use Croston’s method (Croston 1977). The HPF procedure writes the time series with extrapolated forecasts. with the series organized into separate variables or across BY groups. )evitacilpitlum dna evitidda( dohteM sretniW lanosaeS dnerT depmaD raeniL elbuoD elpmiS xoC-xoB citsigoL tooR erauqS goL . the series summary statistics. You can also go back to the Automatic Fitting Results screen to evaluate the forecasts for each series individually. the parameter estimates. The TSFS can also be further automated by using the forecast command and the SAS/AF Forecast Application Command Builder.4 HPF Procedure The HPF procedure can forecast millions of time series at a time. although it does a reasonable job overall. All parameters associated with the forecast model are optimized based on the data.

The data represent daily values for Revenue. date. The daily variable indicator. is formatted date9. a variable describing the total number of purchasing dollars for a given day.F T AM E Y L Chapter 8: Data Mining and Forecasting 369 The HPF procedure step below examines the application of the automatic forecasting technique to the evaluation of seven different forecasting methods described above. predicted values. The program creates a Forecasts data set that contains forecasts for seven periods beyond the end of the input data set VC_DATA. . and upper and lower confidence limits overlaid on the same graph.DAILY_STATS_09AUG02. The GPLOT procedure is used to display the actual values.

.370 SAS for Forecasting Time Series The HPF procedure describes the input data set WORK. There are 268 observations in the data set and no missing observations. The descriptive statistics are also provided.DAILY_STATS_09AUG02 and the Time ID variable DATE.

The lower 95% confidence interval falls below 0 as you extend well beyond the end of the historical data. The forecasts for the next seven days are displayed below. . in addition to the standard errors and upper and lower 95% prediction intervals. and only the level weight is statistically different from 0. it is often found that the models tend to be overparameterized.Chapter 8: Data Mining and Forecasting 371 The Winters additive method seasonal exponential smoothing model fits best based on the RMSE statistic. When performing these operations in an automatic fashion on many series.

these are calculated based on the full range of data. A detailed description of these summary statistics can be found by consulting the SAS System 9 documentation.372 SAS for Forecasting Time Series The statistics of fit for the selected model are given as a reference for model comparison. . As noted.

and a sum forecast for the seven-day total is displayed at the bottom. .Chapter 8: Data Mining and Forecasting 373 A forecast summary shows values for the next seven days.

The Winters additive method of seasonal exponential smoothing does a nice job of tracking the historical data shown by the heavy middle graph line. .374 SAS for Forecasting Time Series The graph below suggests a drop in purchasing sessions in early January.

Chapter 8: Data Mining and Forecasting 375 8. the standard error and forecast estimate are independent of today’s observed value.5 Scorecard Development Each day the Vermont Country Store is provided with a report called a “scorecard” that examines its key metrics (variables of interest). The actual value for the day is removed and then forecasted using the HPF procedure. The revenue is denoted Revenue (TARGET). Standardized differences denoted “Difference” are also displayed for each metric. i y ˆ s / ) Y − Y( ˆ t t . Since the current day’s value is removed (9Aug02 in this case).

The same is true of the forecasts and bounds beyond 9Aug02. the Business performance measure is calculated as x Using this approach. When the preferred direction of the business movement is less than the prediction. the calculation is x Thus the Business performance has a minimum value of 50% (when Y is small). each metric in the table has a Business performance measure. The AUTOREG procedure is then applied by regressing the target (Revenue in this example) on the other metrics and treating 1-pvalues as weight statistics. In the following display. smaller values are preferred. it increases toward 100% as Y gets larger than the prediction. On the target day (9Aug02) the observed value is removed. and the dots connected by lines represent the predictions. 8.7 Graphical Displays You can go to the scorecard table and select each metric to display the predictions and limits in a graphical format.5 )*100 where . the forecasts and forecast bounds are based on a model developed from the full data set that includes 9Aug02. often you would like the actual values of a metric like Buyer Percent to be larger than the Forecast value so that you are doing better than expected. When Y matches the prediction. the scattered black dots represent the observed data. Throughout the other historical data.376 SAS for Forecasting Time Series 8. For each metric a directional business performance measure is computed for the day. the Business performance statistic has a value of 75%. ) ˆ s / )Y ˆ Y − Y(( = x / td 2/ t e ∫ π2 ∞− /1 (1– ( 2))*100 where ) ˆ s / )Y ˆ Y − Y(( = x td 2 − 2/ t e ∫ π2 ∞− /1 ( 2 − /2 +.6 Business Goal Performance Metrics From a retailing business perspective. For a metric like Error Page Percent. The sum of products of weight statistics and Business Performance measures gives an overall daily mean score as shown in the previous display. If the preferred direction is greater than the forecast. so we designate the forecasts and upper and lower 95% prediction intervals with plus signs.

Chapter 8: Data Mining and Forecasting 377 .

you can also see the associated history for that day over the past history of the data.378 SAS for Forecasting Time Series If the HPF procedure selects a seasonal model. By clicking on a given day of the week. as shown below. . you will see a display of the daily averages.

.Chapter 8: Data Mining and Forecasting 379 The drop in revenue is also displayed in the chart of past Sunday revenues.

you can find values of the inputs that satisfy increasing values of the target Revenue. Average Order Value. This is done using the SOLVE statement in PROC MODEL. Increasing the target by 5% would set revenue at $199.380 SAS for Forecasting Time Series The scorecard also supports the output from a regression with autocorrelation and the ability to solve for inputs one at a time when seeking input values that deliver a specified level of a target.e. .. etc. In other words. the 9Aug01 value). We restrict the explanatory variables to Purchasing Sessions. and Product Suggestions to illustrate how the back solution is obtained.905. It is interesting to note that the number of product suggestions would need to drop to 54. By simply selecting the Goal Seeking Scorecard. The increasing values for purchasing sessions and average order size provide reasonable results. An example of fitting a model and using it to later solve for values of the inputs is illustrated below. Based on the regression results.09. To achieve this goal would require 2769 purchasing sessions.5 to achieve this 5% increase. The 0 Percent column indicates the current daily settings for the metrics on 09Aug02. the number of product suggestions becomes negative (unreasonable) as revenue increases beyond 5%. fewer visitors would be suggesting alternative products to the site and would be more apt to purchase the observed products.) that describe reasonable values and set the corresponding negative values to missing. The display uses metadata (data that characterize positive and negative business directions and acceptable ranges. assuming all the other inputs remain at their 0 percent level (i.

8 Goal-Seeking Model Development The MODEL procedure analyzes models in which the relationships among the variables comprise a system of one or more nonlinear equations.Chapter 8: Data Mining and Forecasting 381 8. dollar_per_purch_session. The %AR macro can be used to specify models with autoregressive error processes similar to the AUTOREG procedure. and productsuggestion_pages. In this case we are regressing revenue on buyer. .

Lags 1. The signs of the coefficient for purchasing sessions and average order value are positive and negative for product suggestions. The output below examines the parameter estimates and test statistics. . and 7 for the autoregressive errors are statistically different from 0. The R square and significant parameters and AR terms suggest a reasonable model.382 SAS for Forecasting Time Series The SOLVE data set is created to view values of the input variables that satisfy the 5% increase for the target variable Revenue. 5.

SAS IntelliVisor for Retail through the ASP delivery channel requires the ability to construct analytic results quickly in a batch environment without user intervention.9 Summary This example illustrates how you can apply automated forecasting techniques in a data mining environment. assuming the other inputs are at their current levels. By focusing on a goal-seeking report. 8. Using the fitted model with autoregressive errors. observations 2 through 4 demonstrate the changes in each individual input required to achieve a 5% increase in revenue. The use of a daily scorecard allows the consumer to focus on what’s important and how things are changing over time. These match the Goal Seeking Scorecard results. you can set goals and determine the changes required to produce increasing returns on investment.Chapter 8: Data Mining and Forecasting 383 Observation 1 in the SOLVE data set shows the values for current values for the four variables for 09AUG2002. .

384 .

Lainiotis. “An Analysis of Transformations. “Periodograms of Unit Root Time Series: Distributions and Tests. Rinehart & Winston. P. Rev. R. 3d ed. E. 1976. G.” Annals of the Institute of Statistical Mathematics 26:363–386. Y. Box. 1984. SAS Views: SAS Applied Time Series Analysis and Forecasting.. Akaike.” Proceedings of the Ninth Annual SAS Users Group International Conference. Hollywood Beach. R. M. H. Akdi. 1986.. FL. M. and G. “Markovian Representation of Stochastic Processes and Its Application to the Analysis of Autoregressive Moving Average Processes. Brocklebank. The Statistical Analysis of Time Series.. 1974. “Multivariate Analysis. NC: SAS Institute Inc. ed... Dickey. 1971. J. 1975. 1966. New York: Holt. FL. T. E. Cambridge: Cambridge University Press. Oakland: Holden-Day.. Bartlett. An Introduction to Stochastic Processes. G. J.” Communications in Statistics 27:69–87. Tim. Time Series Analysis: Forecasting and Control. Time Series Analysis: Forecasting and Control.. and G. A.” Journal of the Royal Statistical Society B26:211. 1984. New York: Fairchild Publications. S. Cohen. A. Jenkins. G. “On the Limitations of Akaike’s Information Criterion and Its Use in PROC STATESPACE. M. ed. Cary. and D.References Akaike.” In Advances and Case Studies in System Identification. C. H. Dickey. New York: Academic Press. 1997. 1984. “Recognizing Overdifferenced Time Series. Mehra and D. P. and D. and D. Bailey. H. A.” Supplement to the Journal of the Royal Statistical Society. “Forecasting Industrial Production 1981–1984. 1964. Box. 1993. Bolerslev. “Canonical Correlations of Time Series and the Use of an Information Criterion. Brillinger. Jenkins. Metal Statistics. 1976. Chavern. . and D. 1981. 1947. Box. NJ: Prentice Hall. IX:176–197.” Proceedings of the Ninth Annual SAS Users Group International Conference. 50–57. ed. 106–111. R. 2d ed.” Journal of Econometrics 31:307–327. W.” Journal of Time Series Analysis 15:1–8. Reinsel. 1994. Anderson. Time Series: Data Analysis and Theory. D. Englewood Cliffs. T. Chang. C. M. Hollywood Beach. “Generalized Autoregressive Conditional Heteroskedasticity. G. Series B. S. Dickey. C. Cox. E. P. G. M. New York: Wiley. Bartlett.

” Ph. A. no. D. Fountis. J.” Annals of Statistics 17:419–428. 1941. “Testing for a Unit Root in Time Series with Data-Based Model Selection. 1979. 2d ed. Chicago: Principia Press. 1986.” Biometrika 69. Dickey. Fuller. D. Harvey. H. and R.. A. and Testing. 1992. Time Series Models. W. “A Primer on Cointegration with an Application to Money and Income. F. J. D. P. Janssen. Hasza. Engle. J.” Journal of the American Statistical Association 79:355–367. Robert. Engle.. W. Fuller.” Econometrica 55:251–276. New York: Wiley. 427– 431. “Distribution of the Estimators for Autoregressive Time Series with a Unit Root. A. D. N. G. W. Bell. “Unit Roots in Time Series Models: Tests and Implications. L. A. 1960. Davis.. Hamilton. Princeton. R. 1981. “Recursive Estimation of Mixed AutoregressiveMoving Average Order. Introduction to Statistical Time Series. Oxford: Philip Allan Publishers. and D. A. J.. Durbin. Fuller. 1996.A. D. 1994. B. 1981. diss. B. “Using PROC NLIN for Time Series Prediction.” Journal of Business and Economic Statistics 12:461–470. 63–68. 1976. no. New York: Wiley. and W. and W. E. Draper. The Analysis of Economic Time Series. and C.” Journal of the American Statistical Association. Applied Regression Analysis. A.” Review of the Federal Reserve Bank of St.” International Statistical Review 28:233–244. Fuller. A. “Estimation and Hypothesis Testing in Nonstationary Time Series Using Frequency Domain Methods. “Likelihood Ratio Statistics for Autoregressive Time Series with a Unit Root. Dickey. and J.. 3. N.. Fuller. Dickey. Dickey. “Cointegration and Error Correction: Representation.” Econometrica 50:987–1007. Hannan. Time Series Analysis. 1989. “The Fitting of Time Series Models. W. GA. North Carolina State University. 1998. Hall. Granger. D.” Proceedings of the Eleventh Annual SAS Users Group International Conference. Fuller. 1986. Dickey. “Forecasting and Stock Control for Intermittent Demands. “Autoregressive Conditional Heteroskedasticity with Estimates of the Variance of United Kingdom Inflation. 3d ed. J. 1982. Atlanta... “Testing for a Unit Root Nonstationarity in Multivariate Autoregressive Time Series. 1991. C. “Testing for Unit Roots in Seasonal Time Series. A. W.. D. Dickey. 1 (April): 81–94. D. 1984. Louis 73:58–78. A. 1987. 1982.386 References Croston. W. Thornton. A. Rissanen. D. Evans. and D. Smith.. 1977. T. . Introduction to Statistical Time Series. Estimation. NJ: Princeton University Press. and H. Miller. and W.D. A.” Operations Research Quarterly 23.” American Statistician 40:12–26. A. 1998. R. A.” Econometrica 49:1057–1072. New York: Wiley.

R. Box. Brown. 1992. C. Pham. “Inequality Constraints in the Univariate GARCH Model. 1991. 1973. S.” Econometric Reviews 13:205–230. H.” Biometrika 65:99–107. Brillinger and G. J. M.. B. Watts. M. 1994. D. 1978. B. 1980. B. D. 1988. and D. 1974. Ju-Chin Huang. Homoskedasticity and Serial Independence of Regression Residuals. Bera. D. NC: SAS Institute Inc. M.” In Directions in Time Series. AC-19:894–897. SAS Institute Inc. C. “On a Measure of Lack of Fit in Time Series Models.. “Testing for Unit Roots in Autoregressive Moving Average Models of Unknown Order. Johansen. E. Dickey.” Journal of Economic Dynamics and Control 12:312–254. R. G. 1980. and D. ed. P. 1978. New York: McGraw-Hill. Cary.” Journal of Multivariate Analysis 3:141–160. S. M.. Shiping. Spectral Analysis and Its Applications. Priestley. Liu. D. Johansen. E. Volume 1: Univariate Series. P. G. and C. “System Identification. Kalman Filtering.” Econometrica 59:1551–1580.. “Conditional Heteroskedasticity in Asset Returns: A New Approach. 1981. Oakland: Holden-Day. McSweeny.. 1988. Spectra Analysis and Time Series. Jenkins. 1972. 1984. Tiao. 3: 599–607. Cao. Nelson. Ljung. no. 1978. K.References 387 Jarque. “Estimation and Hypothesis Testing of Cointegrating Vectors in Gaussian Vector Autoregressive Models. New York: Academic Press. S. Jones. “Generalized Canonical Analysis for Time Series. Priestley. “Identification and Autoregressive Spectrum Estimation. Hayward CA: Institute of Mathematical Statistics. M. and G. and Stochastic Control. Econometric Methods. “Statistical Analysis of Cointegrating Vectors. 1968. “Information and Risk Perception: A Dynamic Adjustment Process. 1984.” Journal of Business and Economic Statistics 10:229–235. . and Gregory L. “On the Fitting of Multivariate Process of the Autoregressive-Moving Average Type. G.” Biometrika 65:297–303. Said. A. Q. Johansen.” Econometrica 59:347–370. “The Role of the Constant and Linear Terms in Cointegration Analysis of Non-Stationary Variables.” Economics Letters 6:255–259. “Effects of Response Cost on the Behavior of a Million Persons: Charging for Directory Assistance in Cincinnati.” IEEE Transactions on Automatic Control.” Journal of Applied Behavior Analysis 11:47–51. B. 2d ed.” Risk Analysis 18:689–699. Robinson. M. A. J. 1991. Johnston. Version 5 Edition. SAS/ETS User’s Guide. and A. “Efficient Tests for Normality.” Biometrika 71. Nelson. T. S.

“On the Fitting of Multivariate Autoregressions and the Approximate Canonical Factorization of a Spectral Density Matrix. and George C. AU-17:93–103. no.” Journal of the American Statistical Association 79. SAS Institute Inc. SAS User’s Guide: Basics. SAS Institute Inc. Version 5 Edition. SAS Introductory Guide. NC: SAS Institute Inc. SAS Institute Inc. Tsay. Ruey S. 1985. 1984. Bureau of Census.388 References SAS Institute Inc. Department of Labor. Cary. C. “An Algorithm for Computing the Mixed Radix Fast Fourier Transform. NC: SAS Institute Inc. “Testing for Common Trends. P. “Publishing and Printing Nonproduction Workers 1944–1977. Version 5 Edition. NC: SAS Institute Inc. SAS User’s Guide: Statistics. Tiao.. 3d ed. Watson.” Journal of the American Statistical Association 83:1097–1107. Tiao. 1977. “Consistent Estimates of Autoregressive Parameters and Extended Sample Autocorrelation Function for Stationary and Nonstationary ARMA Models. W.” Construction Review. Version 5 Edition. 1985. Cary. Cary. H. “Construction Workers in Thousands. 1982. no. 1969.” Biometrika 72. 1985. U. 1985. 1963. R. U. 385 (March): 84–96.” IEEE Transactions of Audio and Electroacoustics. SAS/GRAPH User’s Guide. “Use of Canonical Analysis in Time Series Model Identification..” Handbook of Labor Statistics. Stock. Ruey S. 1988. .” Biometrika 50:129–134. J. Tsay.S. and W.. NC: SAS Institute Inc.S. 1985. 2 (August): 299–315. Whittle. and George C. Singleton. Cary.

052–942 ssecorp )citsadecsoreteh yllanoitidnoc evissergerotua( HCRA 292 .noitpo MRAPTLA 533–433 gnisaila 203 )CIA( noiretirc noitamrofni s’ekiakA 461–251 )elpmaxe( ledom sregnessap enilria 203 )noiretirc noitamrofni s’ekiakA( CIA 723 erudecorp ARTCEPS .461 srorre seires emit RA htiw noisserger 86–36 FCAP htiw gniyfitnedi 84–54 erudecorp GER ni gnittif 9 tset nostaW-nibruD 182–652 .nozamA 391–291 )AMIRA( tnemetats ETAMITSE .noitpo A Index .871–761 .86–36 laitrap .362–652 .93 redro-dnoces 652–542 secnairav lauqenu dna srorre seires emit RA htiw noisserger 542–932 .tnemetats YFITNEDI osla eeS erudecorp AMIRA .671 noitargetnioc 2 sledom )evissergerotua( RA 183 orcam RA% 323 edutilpma 832–732 )elpmaxe( emulov gnidart kcots senilriA naciremA 182–572 no erudecorp XAMRAV 162 .252–942 dezilareneg 552 .FCAI .671 noitargetnioc 201–79 sdohtem noitamitse FCAP .noitpo NAEMJDA 411 stset )relluF-yekciD detnemguA( FDA 201–79 sdohtem noitamitse FCA 061 .FCA 061 .FCA 301 ytiranoitatsnon toor tinu 541–341 sledom lanosaes 061 .A 3–2 erudecorp XAMRAV 281–971 .26–65 )noitcnuf ecnairavocotua( FCA 643 erudecorp ARTCEPS .451 )elpmaxe( sregnessap enilria lanoitanretni 18 )selpmaxe seires 8Y( snoitcnuf noitalerrocotua gnitamitse 97–87 detamitse 08–87 esrevni .451 )elpmaxe( sregnessap enilria lanoitanretni 18 )selpmaxe seires 8Y( snoitcnuf noitalerrocotua gnitamitse 37–96 detamitse 08 .461 srorre seires emit ni noisserger 132–322 )elpmaxe( selas liater aniloraC htroN 321–311 rof sledom .451 )elpmaxe( sregnessap enilria lanoitanretni 18 )selpmaxe seires 8Y( snoitcnuf noitalerrocotua gnitamitse 77–37 detamitse 08 .seires yranoitatsnon 301–201 seires yranoitatsnon 761–461 selbairav yrotanalpxe htiw sledom 732–332 )elpmaxe( eracs klim 322–681 .FCA erudecorp AMIRA .661 snoitcnuf refsnart lareneg 55–25 snoitciderp erutuf 93–03 htiw gnitsacerof 79–59 fo sdohtem noitamitse 311–401 gnitsacerof no stceffe gnicnereffid 08 noitpo =ATAD 332–132 )elpmaxe( srekrow noitcurtsnoc 182–652 .561 snoitcnuf refsnart elpmis 461–341 seires emit lanosaes 6–4 serudecorp rehto htiw pihsnoitaler 652–932 secnairav lauqenu dna srorre seires emit ni noisserger 871–761 .321–711 )elpmaxe( ecirp kcots moc.tnemetats ETAMITSE osla eeS erudecorp AMIRA 652–052 dezilareneg esrevni 552 .852–652 dna erudecorp GER 372–072 rotcev gnitargetnioc gnitamitse 182–972 stsacerof dna scitsongaid 072 .24 .

FCASE 311–401 gnitsacerof no stceffe gnicnereffid 501–201 atad gnicnereffid 371 .49–29 sledom egareva gnivom gnittif 35 retemarap gnitamitse 98–18 )selpmaxe seires 8Y( snoitcnuf noitalerrocotua gnitamitse 041–821 sdohtem CINIM dna .seires yranoitatsnon 49–09 )elpmaxe( stropxe leets dna nori 49–09 )selpmaxe( snoitcnuf noitalerrocotua gnitamitse 041–821 sdohtem CINIM dna .FCASE 311–401 gnitsacerof no stceffe gnicnereffid 332–132 )elpmaxe( srekrow noitcurtsnoc 182–652 .44–14 secnairavoc rof snoitauqe reklaW-eluY 413 gniledom ecaps etats 9 .05 sledom dexim 732–332 )elpmaxe( eracs klim 49–09 )elpmaxe( stropxe leets dna nori 08–55 fo mrof gniyfitnedi 322–381 .FCAI .FCA 79–59 sdohtem noitamitse FCAP .seires yranoitatsnon 301–201 seires yranoitatsnon 761–461 selbairav yrotanalpxe htiw sledom 36 .FCA 79–59 sdohtem noitamitse FCAP .561 snoitcnuf refsnart elpmis 461–341 seires emit lanosaes 652–932 secnairav lauqenu dna srorre seires emit ni noisserger 871 –761 .FCA sledom )RAV( noissergerotua rotcev osla eeS gniyfitnedi .1 evitisop 2 evitagen 93–03 erudecorp AMIRA htiw gnitsacerof 2–1 noitalerrocotua 411 sgal gnitnemgua 411 stset relluF-yekciD detnemguA 97–65 noitacifitnedi seires emit 55 ytilibitrevni dna ytiranoitats 251–641 elpmaxe srekrow noitcurtsnoc .NACS .083–573 tnempoleved dracerocs 473–863 erudecorp FPH 083–673 syalpsid lacihparg 383–183 tnempoleved ledom gnikees-laog 383–953 seuqinhcet gnitsacerof citamotua FCA eeS noitcnuf ecnairavocotua sledom AMRA eeS ecnairavocotua 97–65 sledom AMRA noitacifitnedi seires emit 49–09 selpmaxe .seires emit lanosaes 461–251 elpmaxe sregnessap enilria .NACS .FCA 08–55 gniyfitnedi .97 slaudiser fo kcehc erauqs-ihc 201–79 )selpmaxe( sdohtem noitamitse FCAP .gnitamitse 98–18 gnitamitse snoitcnuf noitalerrocotua 292 .671 noitargetnioc 14–04 noitaton tfihskcab 05–94 dnuorgkcab 201–79 )selpmaxe( sdohtem noitamitse FCAP .sledom )egareva gnivom evissergerotua( AMRA 832–732 )elpmaxe( kcatta tsirorret 05–94 ygolonimret 55 ytiranoitats 281–971 .661 snoitcnuf refsnart lareneg 55–25 sdohtem gnitsacerof 311–011 .461 srorre seires emit ni noisserger 45–15 snoitciderp 25–15 snoitciderp daeha-pets-eno 132–322 )elpmaxe( selas liater aniloraC htroN 321–311 rof sledom .FCAI .FCAI .sledom AMRA osla eeS 141–94 sledom )egareva gnivom evissergerotua( AMRA 390 xednI .seires emit lanosaes 461–541 seires emit lanosaes 321–311 rof sledom .FCAI .

79–59 sdohtem noitamitse erudecorp AMIRA 93 ,73–53 dohtem )serauqs tsael lanoitidnoc( SLC 81 )GER( tnemetats LEDOM ,noitpo ILC 371 ,97 slaudiser fo kcehc erauqs-ihc 08 ,73 ,13 )AMIRA( tnemetats YFITNEDI ,noitpo =RETNEC 703–503 sisylana noitalerroc lacinonac 372 erudecorp RROCNAC 703 erudecorp ECAPSETATS ,noitpo RROCNAC 673 scirtem ecnamrofrep laog ssenisub 871–761 )elpmaxe( selas seilppus gnidliub 692 smetsys elbaifitnedi kcolb 292 mrof leknaH kcolb 431 noiretirc CIB 143 wodniw lartceps fo htdiwdnab 442 ,51 )GEROTUA( tnemetats LEDOM ,noitpo =PETSKCAB 312–381 snoitcnuf refsnart lareneg 15 sledom AMRA 14–04 noitaton tfihskcab sledom AMRA eeS sledom egareva gnivom evissergerotua sledom RA eeS sledom evissergerotua 652–052 dezilareneg esrevni 552 ,252–942 dezilareneg 552 ,052–942 ssecorp )HCRA( citsadecsoreteh yllanoitidnoc evissergerotua 92–72 noissergerotua 71 tnemetats TUPTUO 442 ,51 ,01 tnemetats LEDOM 71–41 ytilanosaes raluger ylhgih 542–242 )elpmaxe( srorre evissergerotua 242–932 srorre evissergerotua 652–942 sessecorp HCRAGI dna ,HCRAG ,HCRA 2 erudecorp GEROTUA 863–263 )metsys gnitsacerof seires emit( SFST

B C

923 tset margodoirep evitalumuc 681 ,071 )AMIRA( tnemetats YFITNEDI ,noitpo =ROCSSORC 653 ,453–053 )elpmaxe( rof erudecorp ARTCEPS 053–643 rof erudecorp ARTCEPS 443–143 seititnauq gniterpretni 543–443 artceps esahp dna edutilpma-ssorc gniterpretni 753–143 sisylana lartceps-ssorc 643 erudecorp ARTCEPS ,noitpo SSORC 681–481 snoitcnuf refsnart lareneg 071 snoitalerroc-ssorc 543–443 murtceps edutilpma-ssorc 113 erudecorp ECAPSETATS ,noitpo BVOC 292 ,44–14 rof snoitauqe reklaW-eluY 503 morf denimreted srotcev etats secnairavoc 332–132 ,251–641 )elpmaxe( srekrow noitcurtsnoc 45–35 sdohtem gnitsacerof ledom AMRA 79–59 sdohtem noitamitse erudecorp AMIRA 93 ,73–53 dohtem )SLC( serauqs tsael lanoitidnoc 933 setagujnoc dna slaitnenopxe xelpmoc 572 erudecorp XAMRAV ,noitpo TSETNIOC 562–362 stoor tinu 671 rof stset 472–372 noitcirtser tpecretni 062 noitcnuf esnopser eslupmi 072–562 elpmaxe 372–072 rotcev gnitargetnioc gnitamitse 952–852 seulavnegie 182–652 ,671 noitargetnioc 372–072 ,862 rotcev gnitargetnioc 572 erudecorp XAMRAV ,tnemetats GETNIOC 723 erudecorp ARTCEPS ,noitpo FFEOC 242 dohtem ttucrO-enarhcoC 45–35 sdohtem gnitsacerof ledom AMRA

xednI

391

seuqinhcet gnitsacerof citamotua osla eeS 44–92 gnitsacerof 6–4 serudecorp rehto htiw pihsnoitaler 4 ,2 noitpo =DOHTEM 2 erudecorp TSACEROF 533–433 ,033 ycneuqerf gnidlof 653 ,453–053 sisylana lartceps-ssorc 212–202 )elpmaxe( srevir aniloraC htroN fo setar wolf 923 citsitats tset appak s’rehsiF 923–823 esion etihw 511–411 secnereffid deggal rof tset F 49–09 )elpmaxe( nori dna leets ,stropxe 933 xelpmoc ,slaitnenopxe 173 ,2 )sretniW( sledom lanosaes-dnert dehtooms yllaitnenopxe 2 gnihtooms laitnenopxe 761–461 selbairav yrotanalpxe 3 seires emit yrotanalpxe 77–37 )noitcnuf ecnairavocotua laitrap( FCAP detamitse 97–87 )noitcnuf ecnairavocotua esrevni( FCAI detamitse 37–96 )noitcnuf ecnairavocotua( FCA detamitse 79 ,73 noitpo LLATNIRP 301 ,73 noitpo TNATSNOCON 071 noitpo =TUPNI 79 noitpo DIRG 681 snoitcnuf refsnart lareneg 311–011 ,49–29 sledom egareva gnivom gnittif 391–291 noitpo MRAPTLA 201–79 sdohtem noitamitse FCAP ,FCAI ,FCA 13 erudecorp AMIRA ,tnemetats ETAMITSE 131–821 dohtem FCASE 652–932 secnairav lauqenu dna srorre seires emit htiw noisserger 871–761 ,461 srorre seires emit htiw noisserger srorre 792–492 gniledom AMRA rotcev htiw ecnelaviuqe

F

623–423 )elpmaxe( stnalp ni ytivitca emyzne 052 )HCRAGE( ssecorp HCRA dezilareneg s’elgnE 542–142 )elpmaxe( ytisrevinu ta dnamed ygrene 332–132 ,251–641 )elpmaxe( srekrow noitcurtsnoc yrnosam dna lacirtcele 952–852 noitargetnioc dna seulavnegie 052 ssecorp )HCRA dezilareneg s’elgnE( HCRAGE 01 )GEROTUA( tnemetats LEDOM ,noitpo BORPWD 7 )GER( tnemetats LEDOM ,noitpo WD 542–142 srorre seires emit RA htiw noisserger 21–9 ,7 tset nostaW-nibruD 652–052 sessecorp HCRAGI dna ,HCRAG ,HCRA 942–542 )elpmaxe( egarevA lairtsudnI senoJ woD 322–912 )elpmaxe( sllac ecnatsissa yrotcerid 311–401 gnitsacerof no stceffe gnicnereffid 821–321 sdnert raenil gnivomer 311–501 )elpmaxe( seires ecirp kcots MBI 411 sgal gnitnemgua 501–201 atad gnicnereffid 123–713 atad gnidnerted 08 erudecorp AMIRA ,noitpo =ATAD 863–263 )metsys gnitsacerof seires emit( SFST 083–573 tnempoleved dracerocs 473–863 erudecorp FPH 083–673 syalpsid lacihparg 383–183 tnempoleved ledom gnikees-laog 673 scirtem ecnamrofrep laog ssenisub 383–953 gninim atad atad gnicnereffid eeS gnicnereffid atad 912 noitnevretni-erp ,sisylana atad

D E

392

xednI

732–332 )elpmaxe( eracs klim naiiawaH 433–033 seicneuqerf cinomrah 79 )AMIRA( tnemetats ETAMITSE ,noitpo DIRG 653 ,453–053 sisylana lartceps-ssorc 212–202 )elpmaxe( atad revir orobsdloG 383–183 tnempoleved ledom gnikees-laog erudecorp GER eeS erudecorp MLG 552 ,252–942 )HCRAG( ssecorp HCRA dezilareneg 212–202 )elpmaxe( setar wolf revir 391–681 stnemetats gniledom 202–391 noitaulave ledom 812–312 sisylana noitnevretni 681–381 sledom gniyfitnedi 681–481 snoitalerroc-ssorc 312–381 noitaton tfihskcab 312–381 ,661 snoitcnuf refsnart lareneg 552 ,252–942 ssecorp )HCRA dezilareneg( HCRAG 933 niag derauqs 753–453 niag

G H

832–732 kcatta tsirorret 912 sisylana atad noitnevretni-erp 732–332 eracs klim 812–312 snoitcnuf refsnart lareneg 322–912 sllac ecnatsissa yrotcerid 561 sisylana noitnevretni 461–251 )elpmaxe( sregnessap enilria lanoitanretni 472–372 noitargetnioc dna ,stpecretni 041–831 )elpmaxe( snaol knabretni 071 )AMIRA( tnemetats ETAMITSE ,noitpo =TUPNI 782 )gniledom ecaps etats( xirtam tupni noitargetnioc osla eeS 062 noitcnuf esnopser eslupmi 652–052 ssecorp )HCRA dezilareneg esrevni( HCRAGI gniyfitnedi ,sledom AMRA eeS sledom AMRA gniyfitnedi 08 noitpo =RAV 422 noitpo =VOCTUO 29 ,08 noitpo =TNIRPON 08 noitpo =GALN 49–09 )elpmaxe( stropxe leets dna nori 681 snoitcnuf refsnart lareneg 98–18 )selpmaxe seires 8Y( snoitcnuf noitalerrocotua gnitamitse 97 –65 snoitcnuf noitalerrocotua gnitamitse 681 ,071 noitpo =ROCSSORC 08 ,73 ,13 noitpo =RETNEC erudecorp AMIRA ,tnemetats YFITNEDI 311–501 )elpmaxe( seires ecirp kcots MBI 061 ,451 )elpmaxe( sregnessap enilria lanoitanretni 18 )selpmaxe seires 8Y( snoitcnuf noitalerrocotua gnitamitse 97–87 detamitse 08–87 )noitcnuf ecnairavocotua esrevni( FCAI 083–673 syalpsid lacihparg 473–863 erudecorp FPH 281–971 )elpmaxe( strats gnisuoh 02–31 ytilanosaes raluger ylhgih 362–062 sledom RAV redro-rehgih

xednI

I

393

gnitsacerof osla eeS 55–15 sledom AMRA ,snoitciderp erutuf 123–413 )elpmaxe( gnippart ruf 323 ycneuqerf 433–033 cinomrah ,seicneuqerf sisylana lartceps osla eeS 623 seicneuqerf reiruoF 413 erudecorp ECAPSETATS ,tnemetats MROF 292 ,44–14 secnairavoc rof snoitauqe reklaW-eluY 832 –332 ,322–312 ,561 sisylana noitnevretni 761–461 selbairav yrotanalpxe htiw gnivorpmi 35 sretemarap ledom AMRA gnitamitse 311–401 stceffe gnicnereffid 383–953 gninim atad 55–25 sledom AMRA 93–03 rof erudecorp AMIRA

43–33 dohtem )serauqs tsael( SL 62–12 noitamrofsnart cimhtiragol 041–831 )elpmaxe( knabretni ,snaol 821–321 gnicnereffid htiw gnivomer ,sdnert raenil 652–932 secnairav lauqenu dna srorre seires emit htiw 871–761 ,461 )elpmaxe( srorre seires emit htiw 02–31 ytilanosaes raluger yrev 62–12 atad demrofsnart yllacimhtiragol noissergerotua osla eeS 21–6 noisserger raenil 242 noitcnuf doohilekil 43–33 dohtem )SL( serauqs tsael 623–423 )elpmaxe( ytivitca emyzne fael 753–453 ,012 ,661 yaled erup dna srotacidni gnidael 923–823 esion etihw 511–411 rof tset F ,secnereffid deggal 923 tset )vonrimS–vorogomloK( S-K 643 erudecorp ARTCEPS ,noitpo K 242 noitcnuf ytisned tnioj 672 ,372–272 dohtem s’nesnahoJ 703 erudecorp ECAPSETATS ,noitpo TNIRPTI 49–09 )elpmaxe( stropxe leets dna nori 55–45 ytilibitrevni 652–052 ssecorp )HCRAGI( HCRA dezilareneg esrevni 061 ,451 )elpmaxe( sregnessap enilria lanoitanretni 18 )selpmaxe seires 8Y( snoitcnuf noitalerrocotua gnitamitse 97–87 detamitse 08–87 )FCAI( noitcnuf ecnairavocotua esrevni

394

xednI

gniledom lanosaes eeS atad ylhtnom 81 noitpo P 7 noitpo WD 81 noitpo ILC erudecorp GER ,tnemetats LEDOM 51 noitpo =GALN 51 noitpo =GAN 01 noitpo BORPWD 442 ,51 noitpo =PETSKCAB erudecorp GEROTUA ,tnemetats LEDOM 083 tnemetats EVLOS 383–083 erudecorp LEDOM 242 )setamitse doohilekil mumixam( sELM 45–35 sdohtem gnitsacerof ledom AMRA 79–59 sdohtem noitamitse erudecorp AMIRA 93 ,73 ,53–43 dohtem )doohilekil-mumixam( LM 36 FCAP htiw gniyfitnedi 05 sledom AMRA dexim 123–413 )elpmaxe( stlep tarksum dna knim gninim atad eeS atad gninim 731–431 dohtem CINIM 732–332 )elpmaxe( eracs klim 673 ecnamrofrep laog ssenisub ,scirtem 4 ,2 erudecorp TSACEROF ,noitpo =DOHTEM 31 htiw ytilanosaes gniledom ,naem 45–35 sdohtem gnitsacerof ledom AMRA 79–59 sdohtem noitamitse erudecorp AMIRA 93 ,73 ,53–43 dohtem )LM( doohilekil-mumixam 242 )sELM( setamitse doohilekil mumixam 332–132 ,251–641 )elpmaxe( srekrow noitcurtsnoc lacirtcele dna yrnosam 492 noitatneserper naivokraM

M

L K J

**162 ,852–652 )elpmaxe( ecirp kcots moc.nozamA 21–7 erudecorp GER 18 citsitats Q
**

Q R

71 erudecorp GEROTUA ,tnemetats TUPTUO 561 sreiltuo 422 )AMIRA( tnemetats YFITNEDI ,noitpo =VOCTUO 072 ,552 noisserger )SLO( serauqs tsael yranidro 25–15 sledom AMRA ,snoitciderp daeha-pets-eno 072 ,552 noisserger )serauqs tsael yranidro( SLO 533–433 ,033 ycneuqerf tsiuqyN 653 ,453–053 sisylana lartceps-ssorc 212–202 )elpmaxe( setar wolf revir aniloraC htroN 032–322 ,02–31 )elpmaxe( selas liater aniloraC htroN 29 ,08 )AMIRA( tnemetats YFITNEDI ,noitpo =TNIRPON 321–311 rof sledom 301–201 seires yranoitatsnon 821–421 )elpmaxe( gnitnirp dna gnihsilbup ni srekrow noitcudorpnon 55–45 ytilibitrevninon 603 erudecorp ECAPSETATS ,noitpo TSEON 301 ,73 )AMIRA( tnemetats ETAMITSE ,noitpo TNATSNOCON 51 )GEROTUA( tnemetats LEDOM 08 )AMIRA( tnemetats YFITNEDI noitpo =GALN 653 ,453–053 sisylana lartceps-ssorc 212–202 )elpmaxe( atad revir esueN 2 noitalerrocotua evitagen 542–142 )elpmaxe( dnamed ygrene USCN 51 )GEROTUA( tnemetats LEDOM ,noitpo =GAN

N O

753–453 ,012 ,661 )srotacidni gnidael( esnopser ni yaled erup 821–421 )elpmaxe( srekrow noitcudorpnon ,gnitnirp dna gnihsilbup 79 ,73 )AMIRA( tnemetats ETAMITSE ,noitpo LLATNIRP 25–15 daeha-pets-eno gnitsacerof osla eeS 55–15 sledom AMRA ,snoitciderp 912 sisylana atad noitnevretni-erp 9 ,1 noitalerrocotua evitisop 71 )GEROTUA( tnemetats TUPTUO ,noitpo =MP 623–423 )elpmaxe( ytivitca emyzne tnalp 753–453 ,543–443 artceps esahp 323 )elgna esahp( tfihs esahp 643 erudecorp ARTCEPS ,noitpo HP 143–043 ,433–333 dehtooms 923 tset margodoirep evitalumuc 323 smargodoirep sisylana lartceps osla eeS 623 ,523 etanidro margodoirep 061 ,451 )elpmaxe( sregnessap enilria lanoitanretni 36 htiw sledom AMRA dexim gniyfitnedi 18 )selpmaxe seires 8Y( snoitcnuf noitalerrocotua gnitamitse 77–37 detamitse 08 ,86–36 )noitcnuf ecnairavocotua laitrap( FCAP 71 )GEROTUA( tnemetats TUPTUO ,noitpo =P 81 )GER( tnemetats LEDOM ,noitpo P 71 noitpo =MP 71 noitpo =P

xednI

P

395

123–413 )elpmaxe( gnippart ruf tarksum 203–103 ,492–582 selpmaxe gniledom ecaps etats etairavitlum 571 retemarap egareva gnivom sledom AMRA eeS sledom egareva gnivom

292 ,24 secnairavoc rof snoitauqe reklaW-eluY 93 sessecorp RA redro-dnoces 2 egakcap tnemtsujda lanosaes 11-X 173 ,2 sledom lanosaes -dnert dehtooms yllaitnenopxe sretniW 02–31 ytilanosaes raluger yrev 1 denifed ,ytilanosaes 02–31 ytilanosaes raluger 3–2 rof seitilibissop 31 naem htiw gniledom 461–251 )elpmaxe( sregnessap enilria lanoitanretni 02–31 ytilanosaes raluger ylhgih 251–641 )elpmaxe( srekrow noitcurtsnoc 541–341 FCA 461–341 gniledom lanosaes 083–573 tnempoleved dracerocs 041–731 ,331–131 dohtem NACS 431 noiretirc noitamrofni CBS 6–2 erawtfos STE/SAS 653 ,453–053 sisylana lartceps-ssorc 212–202 )elpmaxe( setar wolf revir 032–322 ,02–31 )elpmaxe( selas liater 113 )detalumis( etairavinu ,elpmaxe 603 ,882–782 erudecorp ECAPSETATS ,tnemetats TCIRTSER 371 ,97 fo kcehc erauqs-ihc ,slaudiser 02–31 ytilanosaes raluger 072 ,552 )SLO( serauqs tsael yranidro ,noisserger 02–31 ytilanosaes raluger yrev 652–932 secnairav lauqenu dna srorre seires emit htiw 871–761 ,461 )elpmaxe( srorre seires emit htiw 62–12 atad demrofsnart yllacimhtiragol noissergerotua osla eeS 21–6 raenil ,noisserger 611–411 )elpmaxe( skcots revlis 62–12 atad demrofsnart htiw noisserger 81 ,7 tnemetats LEDOM 02–81 ,51 ytilanosaes raluger ylhgih 123–713 atad gnidnerted 84–54 gnittif ,sledom )RA( evissergerotua

396

xednI

753–453 ,543–443 artceps esahp 433–033 seicneuqerf cinomrah 753–453 yaled erup dna ,esahp ,niag 143–043 ,433–333 )smargodoirep dehtooms( detamitse 653 ,453–053 )elpmaxe( sisylana lartceps-ssorc 753–143 sisylana lartceps-ssorc 533–433 snoitautculf tsaf ylemertxe dna gnisaila 753–323 sisylana lartceps 923 noitpo TSETETIHW 043 tnemetats THGIEW 553 tnemetats RAV 643 noitpo HP 643 noitpo K 143–043 murtceps gnitamitse 653 ,453–053 )elpmaxe( sisylana lartceps-ssorc 053–643 sisylana lartceps-ssorc 643 noitpo SSORC 543–443 artceps esahp dna edutilpma-ssorc 723 noitpo FFEOC 723 noitpo NAEMJDA 643 noitpo A 823–623 ,3 erudecorp ARTCEPS 083 erudecorp LEDOM ,tnemetats EVLOS 173 ,2 sledom lanosaes -dnert dehtooms yllaitnenopxe sretniW 2 laitnenopxe ,gnihtooms 143–043 ,433–333 smargodoirep dehtooms sisylana lartceps eeS gniledom tnenopmoc ladiosunis 281–971 )elpmaxe( strats gnisuoh 561 snoitcnuf refsnart elpmis 711–411 atad yranoitatsnon rof sledom 84–54 )elpmaxe( skcots revlis sisylana noitnevretni eeS noitcnuf esnopser eslupmi eeS noitargetnioc eeS skcohs 413–703 gniledom ecaps etats etairavinu detalumis 753–453 ,012 ,661 )srotacidni gnidael( esnopser ni tfihs

S

63–43 )SSU( serauqs fo mus lanoitidnocnu 45–35 sdohtem gnitsacerof ledom AMRA 79–59 sdohtem noitamitse erudecorp AMIRA 93 ,53–43 dohtem )serauqs tsael lanoitidnocnu( SLU 863–263 )metsys gnitsacerof seires emit( SFST 821–321 gnicnereffid htiw gnivom ,raenil 832–332 ,322–312 ,561 sisylana noitnevretni 123–713 atad gnidnerted 1 sdnert 62–22 )elpmaxe( setar llib yrusaerT 123–413 )elpmaxe( gnippart 782 )gniledom ecaps etats( xirtam noitisnart sisylana lartceps eeS stnenopmoc ladiosunis htiw sledom seires emit 49–09 )elpmaxe( stropxe leets dna nori 98–18 )selpmaxe seires 8Y( snoitcnuf noitalerrocotua gnitamitse 97 –65 snoitcnuf noitalerrocotua gnitamitse sledom AMRA ,noitacifitnedi seires emit 863–263 )SFST( metsys gnitsacerof seires emit 542–142 )elpmaxe( dnamed ygrene ytisrevinu 652–542 secnairav lauqenu 542–932 ,871–761 ,461 htiw noisserger ,srorre seires emit 3 yrotanalpxe ,seires emit 832–732 )elpmaxe( kcatta tsirorret 832–732 )elpmaxe( senilriA naciremA ,emulov gnidart kcots 311–501 )elpmaxe( MBI ,seires ecirp kcots 49–09 )elpmaxe( stropxe nori dna leets

xednI

U T

397

321–311 rof sledom ,seires yranoitatsnon 301–201 seires yranoitatsnon 55 sledom AMRA 44 ytiranoitats 503 secnairavoc morf denimreted srotcev etats 113 ,603 ,882–782 tnemetats TCIRTSER 6–4 serudecorp rehto htiw pihsnoitaler 603 noitpo TSEON 703 noitpo TNIRPTI 123–413 )elpmaxe( gnippart ruf 413 tnemetats MROF 413–703 )detalumis( elpmaxe 113 noitpo BVOC 703–503 sisylana noitalerroc lacinonac 703 noitpo RROCNAC 123–203 ,192–092 ,682 ,3–2 erudecorp ECAPSETATS 792–492 sledom AMRA rotcev 503 secnairavoc morf denimreted gniledom ecaps etats osla eeS 482 srotcev etats 44–14 secnairavoc rof snoitauqe reklaW-eluY 413–703 )detalumis( selpmaxe etairavinu 103–892 ,482–382 selpmaxe etairavinu 782 xirtam noitisnart 123–413 ,203–103 ,492–582 selpmaxe etairavitlum 782 xirtam tupni 123–413 )elpmaxe( gnippart ruf 792–492 gniledom AMRA rotcev htiw ecnelaviuqe 703–503 sisylana noitalerroc lacinonac 692 smetsys elbaifitnedi kcolb 413 noitalerrocotua 123–382 gniledom ecaps etats 933 niag derauqs 943–643 ycnerehoc derauqs 143 wodniw lartceps 933–533 ytisned lartceps 923–823 rof gnitset ,esion etihw 933–533 ytisned lartceps 623–423 )elpmaxe( ytivitca emyzne tnalp

292 gniledom ecaps etats 44–14 secnairavoc rof snoitauqe reklaW-eluY 98–18 selpmaxe seires 8Y 3 erudecorp 21X 2 erudecorp 11X 2 egakcap tnemtsujda lanosaes 11-X 82 noitatneserper dloW 173 ,2 sledom lanosaes -dnert dehtooms yllaitnenopxe sretniW 923 erudecorp ARTCEPS ,noitpo TSETETIHW 923–823 rof gnitset 72 esion etihw 043 erudecorp ARTCEPS ,tnemetats THGIEW 02–31 ytilanosaes raluger yrev 863–263 )metsys gnitsacerof seires emit( SFST 573 tnempoleved dracerocs 673 scirtem ecnamrofrep laog ssenisub

W X Y

163–063 )elpmaxe( atad erotS yrtnuoC tnomreV srotcev etats eeS etats ,srotcev 182 –572 snoitaluclac erudecorp XAMRAV 123–203 rof erudecorp ECAPSETATS 792–492 ot ecnelaviuqe ,sledom ecaps etats 062 noitcnuf esnopser eslupmi 362–062 sledom redro-rehgih 072–562 elpmaxe 952–852 seulavnegie 562–362 stoor tinu dna noitargetnioc 182–652 sledom )RAV( noissergerotua rotcev 182–572 snoitaluclac ,sledom RAV 671 noitargetnioc rof stset 6–4 serudecorp rehto htiw pihsnoitaler 572 noitpo TSETNIOC 572 tnemetats GETNIOC 3–2 erudecorp AMIRA 182–572 )elpmaxe( ecirp kcots moc.nozamA 172 erudecorp XAMRAV 553 erudecorp ARTCEPS ,tnemetats RAV 08 )AMIRA( tnemetats YFITNEDI ,noitpo =RAV sledom noissergerotua rotcev eeS sledom RAV 63–43 )serauqs fo mus lanoitidnocnu( SSU 542–142 )elpmaxe( dnamed ygrene ytisrevinu 413–703 detalumis 123–413 )elpmaxe( gnippart ruf 103–892 ,482–382 selpmaxe gniledom ecaps etats etairavinu 62–22 )elpmaxe( setar llib yrusaerT .S.U 49–09 )elpmaxe( stropxe leets dna nori .S.U 281–971 )elpmaxe( strats gnisuoh .S.U 321–311 atad yranoitatsnon rof sledom 562–362 noitargetnioc 301 ytiranoitatsnon toor tinu 652–542 htiw noisserger ,srorre seires emit dna secnairav lauqenu

398

xednI

V

Naik A Handbook of Statistical Analyses Using SAS®. Meimei Ma Multiple Comparisons and Multiple Tests Using SAS® Text and Workbook Set (books in this set also sold separately) by Peter H. Allison Longitudinal Data and SAS®: A Programmer’s Guide by Ron Cody Maps Made Easy Using SAS® by Mike Zdeb Models for Discrete Data by Daniel Zelterman Beyond the Obvious with SAS ® Screen Control Language by Don Stanley Carpenter’s Complete Guide to the SAS® Macro Language by Art Carpenter The Cartoon Guide to Statistics by Larry Gonick and Woollcott Smith Categorical Data Analysis Using the SAS System. Tobias. Wolfinger. Everitt and G. Naik In the Know ..S. Stokes. Wang and Brad J. Dror Rom.. Second Edition by Lora D. Cody and Jeffrey K. Second Edition by Ravindra Khattree and Dayanand N. Smith An Array of Challenges — Test Your SAS ® Skills by Robert Virgile Learning SAS ® in the Computer Lab. Burlew Efficiency: Improving the Performance of Your SAS ® Applications by Robert Virgile Multivariate Data Reduction and Discrimination with SAS ® Software by Ravindra Khattree and Dayanand N. Slaughter The Little SAS ® Book: A Primer. Charles S. and Yosef Hochberg Multiple-Plot Displays: Simplified with Macros by Perry Watts Debugging SAS ® Programs: A Handbook of Tools and Techniques by Michele M. Delwiche and Susan J. Davis. Russell D. Slaughter (updated to include Version 7 features) Logistic Regression Using the SAS® System: Theory and Application by Paul D. SAS ® Tips and Techniques From Around the Globe by Phil Mason Integrating Results through Meta-Analytic Review Using SAS® Software by Morgan C. Second Edition by B. Koch Cody’s Data Cleaning Techniques Using SAS® Software by Ron Cody Common Statistical Methods for Clinical Research with SAS ® Examples. and Alan Wilson Annotate: Simply the Basics by Art Carpenter The How-To Book for SAS/GRAPH ® Software by Thomas Miron Applied Multivariate Statistics with SAS® Software.Books from SAS Institute’s Books by Users Press Advanced Log-Linear Models Using SAS ® by Daniel Zelterman Health Care Data and the SAS® System by Marge Scerbo. Fourth Edition ® by Ronald P. Der The Next Step: Integrating the Software Life Cycle with SAS ® Programming by Paul Gill . Second Edition by Rebecca J. Second Edition ® by Maura E. Second Edition by Glenn A. Walker Concepts and Case Studies in Data Management by William S. Bushman Applied Statistics and the SAS Programming Language. Calvert and J. Westfall. Randall D. Craig Dickstein. Elliott The Little SAS ® Book: A Primer by Lora D. and Gary G. Delwiche and Susan J.

Littell. Walter W. Stephen A. Kathleen B. Walter W. Sivo. Gupta SAS ® System for Regression. Burlew Painless Windows: A Handbook for SAS ® Users by Jodie Gilmore (for Windows NT and Windows 95) SAS ® Programming by Example by Ron Cody and Ray Pass Painless Windows: A Handbook for SAS ® Users. ˝ and Sean C. Muller and Bethel A. Third Edition by Rudolf J. Hardy SAS ® System for Statistical Graphics. Carpenter and Charles E. Wolfinger Quick Results with the Output Delivery System by Sunil K. Brocklebank. Freund and Ramon C. Cantor Professional SAS ® Programming Shortcuts by Rick Aster SAS ® System for Elementary Statistical Analysis. Littell. Shipp SAS ® System for Mixed Models by Ramon C. 1986 Edition by John C. and David A. and Terrence N. Willard L.Output Delivery System: The Basics by Lauren E. and Rudolf J. Brocklebank and David A. Fetterman Selecting Statistical Techniques for Social Science Data: A Guide for SAS® Users by Frank M. Keenan A Step-by-Step Approach to Using the SAS ® System for Univariate and Multivariate Statistics by Larry Hatcher and Edward Stepanski . Second Edition by Alan B. Stroup. Patrick M. Andrews. Second Edition by Rick Aster SAS ® Survival Analysis Techniques for Medical Research. Haworth SAS ® Software Roadmaps: Your Guide to Discovering the SAS ® System by Laurie Burch and SherriJoyce King Professional SAS Programmer’s Pocket Reference. Littell Programming Techniques for Object-Based Statistical Analysis with SAS® Software by Tanya Kolosova and Samuel Berestizhevsky SAS ® System for Forecasting Time Series. First Edition by Michael Friendly Reading External Data Files Using SAS®: Examples Handbook by Michele M. Milliken. Second Edition by John C. Welch. Dickey Statistical Quality Control Using the SAS ® System by Dennis W. Burlew The SAS ® Workbook and Solutions Set (books in this set also sold separately) by Ron Cody Regression and ANOVA: An Integrated Approach Using SAS ® Software by Keith E. Dilorio SAS ® for Forecasting Time Series. Schlotzhauer and Ramon C. Spector PROC TABULATE by Example by Lauren E. and Russell D. Fourth Edition ® SAS ® Software Solutions: Basic Data Processing by Thomas Miron by Rick Aster Professional SAS ® Programmer’s Pocket Reference. Fourth Edition ® A Step-by-Step Approach to Using the SAS ® System for Factor Analysis and Structural Equation Modeling by Larry Hatcher by Ramon C. Haworth SAS ® Macro Programming Made Easy by Michele M. Stroup. Ákos Felsovályi. Freund SAS ® for Monte Carlo Studies: A Guide for Quantitative Researchers by Xitao Fan. Second Edition by Jodie Gilmore (updated to include Version 7 features) SAS ® Programming for Researchers and Social Scientists. Second Edition by Sandra D. George A. Dilorio and Kenneth A. Littell Quick Start to Data Analysis with SAS ® by Frank C. King SAS for Linear Models. O’Malley. Davidson Reporting from the Field: SAS ® Software Experts Present Real-World Report-Writing Applications SAS Applications Programming: A Gentle Introduction ® Solutions for Your GUI Applications Development Using SAS/AF ® FRAME Technology by Don Stanley by Frank C. Rodgers. Second Edition by Paul E. Dickey Quick Results with SAS/GRAPH ® Software by Arthur L. Laura Klem.

Ramon C. Waterman Strategic Data Warehousing Principles Using SAS ® Software by Peter R. and Richard P. LIttell. Welbrock Business Analysis Using Regression: A Casebook by Dean P. Stine. Freund. Tilanus Your Guide to Survey Research Using the SAS® System by Archer Gravely . and Lee Creighton Table-Driven Strategies for Rapid SAS ® Applications Development by Tanya Kolosova and Samuel Berestizhevsky Regression Using JMP® by Rudolf J. Second Edition by John Sall. John Paul Broussard. Timm and Tammy A. Foster.Step-by-Step Basic Statistics Using SAS®: Student Guide and Exercises (books in this set also sold separately) by Larry Hatcher JMP® Books Basic Business Statistics: A Casebook by Dean P. and Juha-Pekka Kallunki Using the SAS ® Windowing Environment: A Quick Tutorial by Larry Hatcher Visualizing Categorical Data by Michael Friendly Working with the SAS ® System by Erik W. Stine. Raithel Univariate and Multivariate General Linear Models: Theory and Applications Using SAS ® Software by Neil H. and Richard P. Ann Lehman. Robert A. Allison JMP® Start Statistics. Mieczkowski Using SAS ® in Financial Research by Ekkehart Boehmer. Waterman Survival Analysis Using the SAS ® System: A Practical Guide by Paul D. Foster. Robert A. and Lee Creighton Tuning SAS ® Applications in the MVS Environment by Michael A.

.

Cressie. J. Teugels Editors Emeriti: Vic Barnett. Nicholas I. M. Fisher. Scott. Louise M. Stuart Hunter. Balding. SHEWHART and SAMUEL S. Jozef L. B. Noel A. Kadane. Kendall A complete list of the titles in this series appears at the end of this volume. Adrian F. David G. . Smith. WILKS Editors: David J. Iain M. C. Johnstone.WILEY SERIES IN PROBABILITY AND STATISTICS Established by WALTER A. David W. J. Ryan. Peter Bloomfield.

Third Edition. MUKHOPADHYAY. FIENBERG. and Statistical Issues GREENWOOD and NIKULIN · A Guide to Chi-Squared Testing GROSS and HARRIS · Fundamentals of Queueing Theory. Third Edition CHERNICK · Bootstrap Methods: A Practitioner’s Guide CHERNICK and FRIIS · Introductory Biostatistics for the Health Sciences CHILÈS and DELFINER · Geostatistics: Modeling Spatial Uncertainty CHOW and LIU · Design and Analysis of Clinical Trials: Concepts and Methodologies CLARKE and DISNEY · Probability and Random Processes: A First Course with Applications. and SEN · Sequential Estimation GIFI · Nonlinear Multivariate Analysis GLASSERMAN and YAO · Monotone Structure in Discrete-Event Systems GNANADESIKAN · Methods for Statistical Data Analysis of Multivariate Observations. and PEACOCK · Statistical Distributions. Third Edition DUPUIS and ELLIS · A Weak Convergence Approach to the Theory of Large Deviations *ELANDT-JOHNSON and JOHNSON · Survival Models and Data Analysis ENDERS · Applied Econometric Time Series ETHIER and KURTZ · Markov Processes: Characterization and Convergence EVANS. Second Edition *COCHRAN and COX · Experimental Designs. Second Edition FULLER · Measurement Error Models GALLANT · Nonlinear Statistical Models GHOSH. Designs. Simulation. Sixth Edition *DANIEL · Fitting Equations to Data: Computer Analysis of Multifactor Data. Second Edition DASU and JOHNSON · Exploratory Data Mining and Data Cleaning DAVID · Order Statistics. and Estimation CAIROLI and DALANG · Sequential Stochastic Optimization CHAN · Time Series: Applications to Finance CHATTERJEE and HADI · Sensitivity Analysis in Linear Regression CHATTERJEE and PRICE · Regression Analysis by Example. DOMHOF. Development. Second Edition *DEGROOT. Third Edition COVER and THOMAS · Elements of Information Theory COX · A Handbook of Introductory Statistical Methods *COX · Planning of Experiments CRESSIE · Statistics for Spatial Data. and KADANE · Statistics and the Law DEL CASTILLO · Statistical Process Adjustment for Quality Control DETTE and STUDDEN · The Theory of Canonical Moments with Applications in Statistics. and Analysis DEY and MUKERJEE · Fractional Factorial Plans DILLON and GOLDSTEIN · Multivariate Analysis: Methods and Applications DODGE · Alternative Methods of Regression *DODGE and ROMIG · Sampling Inspection Tables. and the Analysis of Mixture Data. Third Edition FELLER · An Introduction to Probability Theory and Its Applications. Probability. Revised. Second Edition DRAPER and SMITH · Applied Regression Analysis. HASTINGS. Third Edition DRYDEN and MARDIA · Statistical Shape Analysis DUDEWICZ and MISHRA · Modern Mathematical Statistics DUNN and CLARK · Applied Statistics: Analysis of Variance and Regression.BRUNNER. Third Edition *HAHN and SHAPIRO · Statistical Models in Engineering HAHN and MEEKER · Statistical Intervals: A Guide for Practitioners HALD · A History of Probability and Statistics and their Applications Before 1750 *Now available in a lower priced paperback edition in the Wiley Classics Library. Second Edition DUNN and CLARK · Basic Statistics: A Primer for the Biomedical Sciences. and LANGER · Nonparametric Analysis of Longitudinal Data in Factorial Experiments BUCKLEW · Large Deviation Techniques in Decision. Second Edition FLEMING and HARRINGTON · Counting Processes and Survival Analysis FULLER · Introduction to Statistical Time Series. Second Edition *DOOB · Stochastic Processes DOWDY and WEARDEN · Statistics for Research. Second Edition CONGDON · Bayesian Statistical Modelling CONOVER · Practical Nonparametric Statistics. Second Edition GOLDSTEIN and LEWIS · Assessment: Problems. . Revised Edition ´´ CSÖRGO and HORVÁTH · Limit Theorems in Change Point Analysis DANIEL · Applications of Statistics to Industrial Experimentation DANIEL · Biostatistics: A Foundation for Analysis in the Health Sciences. Models. Second Edition FISHER and VAN BELLE · Biostatistics: A Methodology for the Health Sciences *FLEISS · The Design and Analysis of Clinical Experiments FLEISS · Statistical Methods for Rates and Proportions. Volume I. Second Edition COOK · Regression Graphics COOK and WEISBERG · Applied Regression Including Computing and Graphics COOK and WEISBERG · An Introduction to Regression Graphics CORNELL · Experiments with Mixtures. Volume II.

BRILLINGER. Second Edition KHURI. GRIFFITHS. and TUKEY · Exploratory Approach to Analysis of Variance HOAGLIN. and GREENHOUSE · Case Studies in Biometry LARSON · Introduction to Probability Theory and Statistical Inference. PANJER. BALAKRISHNAN. and TUKEY · Exploring Data Tables. and Historical Introduction LAMPERTI · Probability: A Survey of the Mathematical Theory. and KEMP · Univariate Discrete Distributions. Second Edition JOHNSON. and BALAKRISHNAN · Discrete Multivariate Distributions JOHNSON. READ. Volume 1. and BANKS (editors) · Encyclopedia of Statistical Sciences: Update Volume 1 KOTZ. and BALAKRISHNAN · Continuous Univariate Distributions. . KOTZ. Volume 2. RYAN. PANJER. Second Edition HOSMER and LEMESHOW · Applied Survival Analysis: Regression Modeling of Time to Event Data HØYLAND and RAUSAND · System Reliability Theory: Models and Statistical Methods HUBER · Robust Statistics HUBERTY · Applied Discriminant Analysis HUNT and KENNEDY · Financial Derivatives in Theory and Practice HUSKOVA. and LE · Shape and Shape Theory KHURI · Advanced Calculus with Applications in Statistics. CONQUEST.HALD · A History of Mathematical Statistics from 1750 to 1930 HAMPEL · Robust Statistics: The Approach Based on Influence Functions HANNAN and DEISTLER · The Statistical Theory of Linear Systems HEIBERGER · Computation for the Analysis of Designed Experiments HEDAYAT and SINHA · Design and Inference in Finite Population Sampling HELLER · MACSYMA for Statisticians HINKELMAN and KEMPTHORNE: · Design and Analysis of Experiments. Third Edition LAWLESS · Statistical Models and Methods for Lifetime Data. MOSTELLER. Second Edition KASS and VOS · Geometrical Foundations of Asymptotic Inference KAUFMAN and ROUSSEEUW · Finding Groups in Data: An Introduction to Cluster Analysis KEDEM and FOKIANOS · Regression Models for Time Series Analysis KENDALL. and BALAKRISHNAN · Continuous Univariate Distributions. KOTZ. MOSTELLER. Trends and Shapes *HOAGLIN. HILL. READ. Second Edition KOTZ and JOHNSON (editors) · Encyclopedia of Statistical Sciences: Volumes 1 to 9 with Index KOTZ and JOHNSON (editors) · Encyclopedia of Statistical Sciences: Supplement Volume KOTZ. and PEGG · Mathematical Theory of Reliability of Time-Dependent Systems with Practical Applications LACHIN · Biostatistical Methods: The Assessment of Relative Risks LAD · Operational Subjective Statistical Methods: A Mathematical. KOTZ. Second Edition JOHNSON and KOTZ · Distributions in Statistics JOHNSON and KOTZ (editors) · Leading Personalities in Statistical Sciences: From the Seventeenth Century to the Present JOHNSON. Philosophical. Second Edition HOEL · Introduction to Mathematical Statistics. KOTZ. and BANKS (editors) · Encyclopedia of Statistical Sciences: Update Volume 2 KOVALENKO. Second Edition HOSMER and LEMESHOW · Applied Logistic Regression. Second Edition LAWSON · Statistical Methods in Spatial Epidemiology LE · Applied Categorical Data Analysis LE · Applied Survival Analysis LEE and WANG · Statistical Methods for Survival Data Analysis. LÜTKEPOHL. and DUPAC · Collected Works of Jaroslav Hajek—with Commentary IMAN and CONOVER · A Modern Approach to Statistics JACKSON · A User’s Guide to Principle Components JOHN · Statistical Methods in Engineering and Quality Assurance JOHNSON · Multivariate Statistical Simulation JOHNSON and BALAKRISHNAN · Advances in the Theory and Practice of Statistics: A Volume in Honor of Samuel Kotz JUDGE. Third Edition LEPAGE and BILLARD · Exploring the Limits of Bootstrap LEYLAND and GOLDSTEIN (editors) · Multilevel Modelling of Health Statistics LIAO · Statistical Group Comparison *Now available in a lower priced paperback edition in the Wiley Classics Library. Second Edition LANGE. KUZNETZOV. Volume 1. BERAN. Volume 1: Introduction to Experimental Design HOAGLIN. and LEE · The Theory and Practice of Econometrics. Second Edition JOHNSON. and WILLMOT · Loss Models: From Data to Decisions KLUGMAN. and WILLMOT · Solutions Manual to Accompany Loss Models: From Data to Decisions KOTZ. and TUKEY · Understanding Robust and Exploratory Data Analysis HOCHBERG and TAMHANE · Multiple Comparison Procedures HOCKING · Methods and Applications of Linear Models: Regression and the Analysis of Variance. MATHEW. BARDEN. Fifth Edition HOGG and KLUGMAN · Loss Distributions HOLLANDER and WOLFE · Nonparametric Statistical Methods. Second Edition JUREC KOVÁ and SEN · Robust Statistical Procedures: Aymptotics and Interrelations JUREK and MASON · Operator-Limit Distributions in Probability Theory KADANE · Bayesian Methods and Ethics in a Clinical Trial Design KADANE AND SCHUM · A Probabilistic Analysis of the Sacco and Vanzetti Evidence KALBFLEISCH and PRENTICE · The Statistical Analysis of Failure Time Data. and SINHA · Statistical Tests for Mixed Linear Models KLUGMAN. MOSTELLER. CARNE. and JOHNSON · Continuous Multivariate Distributions. BILLARD.

PECK.LINDVALL · Lectures on the Coupling Method LINHART and ZUCCHINI · Model Selection LITTLE and RUBIN · Statistical Analysis with Missing Data. Second Edition RENCHER · Linear Models in Statistics RENCHER · Methods of Multivariate Analysis. Second Edition MYERS. SUGIHARA. Second Edition OLIVER and SMITH · Influence Diagrams. CHAN. and VINING · Generalized Linear Models. and TEUGELS · Stochastic Processes for Insurance and Finance ROSENBERGER and LACHIN · Randomization in Clinical Trials: Theory and Practice ROSS · Introduction to Probability and Statistics for Engineers and Scientists ROUSSEEUW and LEROY · Robust Regression and Outlier Detection RUBIN · Multiple Imputation for Nonresponse in Surveys RUBINSTEIN · Simulation and the Monte Carlo Method RUBINSTEIN and MELAMED · Modern Simulation and Modeling RYAN · Modern Regression Methods RYAN · Statistical Methods for Quality Improvement. SCHMIDLI. and Analysis by Some Friends of Cuthbert Daniel MANN. Second Edition RENCHER · Multivariate Statistical Inference with Applications RIPLEY · Spatial Statistics RIPLEY · Stochastic Simulation ROBINSON · Practical Strategies for Experimenting ROHATGI and SALEH · An Introduction to Probability and Statistics.0 Statistical Experimentation. Second Edition McCULLOCH and SEARLE · Generalized. and TOLLEY · Statistical Applications Using Fuzzy Sets MARDIA and JUPP · Directional Statistics MASON. Third Edition MORGENTHALER and TUKEY · Configural Polysampling: A Route to Practical Robustness MUIRHEAD · Aspects of Multivariate Statistical Theory MURRAY · X-STAT 2. Statistical Models. Data. and Mixed Models McFADDEN · Management of Data in Clinical Trials McLACHLAN · Discriminant Analysis and Statistical Pattern Recognition McLACHLAN and KRISHNAN · The EM Algorithm and Extensions McLACHLAN and PEEL · Finite Mixture Models McNEIL · Epidemiological Research Methods MEEKER and ESCOBAR · Statistical Methods for Reliability Data MEERSCHAERT and SCHEFFLER · Limit Distributions for Sums of Independent Random Vectors: Heavy Tails in Theory and Practice *MILLER · Survival Analysis. SCHMIDT. With Applications in Engineering and the Sciences NELSON · Accelerated Testing. and TSAY · A Course in Time Series Analysis PIANTADOSI · Clinical Trials: A Methodologic Perspective PORT · Theoretical Probability for Applications POURAHMADI · Foundations of Time Series Analysis and Prediction Theory PRESS · Bayesian Statistics: Principles. Belief Nets and Decision Analysis PANKRATZ · Forecasting with Dynamic Regression Models PANKRATZ · Forecasting with Univariate Box-Jenkins Models: Concepts and Cases *PARZEN · Modern Probability Theory and Its Applications PEÑA. WOODBURY. BOOTS. and SINGPURWALLA · Methods for Statistical Analysis of Reliability and Life Data MANTON. and Nonlinear Optimization MYERS and MONTGOMERY · Response Surface Methodology: Process and Product Optimization Using Designed Experiments. and VINING · Introduction to Linear Regression Analysis. Second Edition PRESS and TANUR · The Subjectivity of Scientists and the Bayesian Approach PUKELSHEIM · Optimal Experimental Design PURI. and Data Analyses NELSON · Applied Life Data Analysis NEWMAN · Biostatistical Methods in Epidemiology OCHI · Applied Probability and Stochastic Processes in Engineering and Physical Sciences OKABE. Second Edition SALTELLI. and WERTZ · New Perspectives in Theoretical and Applied Statistics PUTERMAN · Markov Decision Processes: Discrete Stochastic Dynamic Programming *RAO · Linear Statistical Inference and Its Applications. Second Edition MONTGOMERY. and Applications PRESS · Subjective and Objective Bayesian Statistics. Models. VILAPLANA. and HESS · Statistical Design and Analysis of Experiments with Applications to Engineering and Science. TIAO. SCHAFER. Test Plans. GUNST. and SCOTT (editors) · Sensitivity Analysis *SCHEFFE · The Analysis of Variance *Now available in a lower priced paperback edition in the Wiley Classics Library. MONTGOMERY. Linear. Design Data Analysis. . Second Edition LLOYD · The Statistical Analysis of Categorical Data MAGNUS and NEUDECKER · Matrix Differential Calculus with Applications in Statistics and Econometrics. Revised Edition MALLER and ZHOU · Survival Analysis with Long Term Survivors MALLOWS · Design. Second Edition ROLSKI. and CHIU · Spatial Tesselations: Concepts and Applications of Voronoi Diagrams.

and Application SCHOTT · Matrix Analysis for Statistics SCHUSS · Theory and Applications of Stochastic Differential Equations SCOTT · Multivariate Density Estimation: Theory. W. and Robustness TIERNEY · LISP-STAT: An Object-Oriented Environment for Statistical Computing and Dynamic Graphics TSAY · Analysis of Financial Time Series UPTON and FINGLETON · Spatial Data Analysis by Example. JONES. . and MECKE · Stochastic Geometry and Its Applications. WILLIAMS. SHELDON. Second Edition WU and HAMADA · Experiments: Planning.SCHIMEK · Smoothing and Regression: Approaches. Analysis. Anderson: 1943–1985 SUTTON. and Visualization *SEARLE · Linear Models SEARLE · Linear Models for Unbalanced Data SEARLE · Matrix Algebra Useful for Statistics SEARLE. and McCULLOCH · Variance Components SEARLE and WILLETT · Matrix Algebra for Applied Economics SEBER and LEE · Linear Regression Analysis. Second Edition WELSH · Aspects of Statistical Inference WESTFALL and YOUNG · Resampling-Based Multiple Testing: Examples and Methods for p-Value Adjustment WHITTAKER · Graphical Models in Applied Multivariate Statistics WINKER · Optimization Heuristics in Economics: Applications of Threshold Accepting WONNACOTT and WONNACOTT · Econometrics. and MCCLISH · Statistical Methods in Diagnostic Medicine *Now available in a lower priced paperback edition in the Wiley Classics Library. Second Edition SEBER · Multivariate Observations SEBER and WILD · Nonlinear Regression SENNOTT · Stochastic Dynamic Programming and the Control of Queueing Systems *SERFLING · Approximation Theorems of Mathematical Statistics SHAFER and VOVK · Probability and Finance: It’s Only a Game! SMALL and MCLEISH · Hilbert Space Methods in Probability and Statistical Inference SRIVASTAVA · Methods of Multivariate Statistics STAPLETON · Linear Statistical Models STAUDTE and SHEATHER · Robust Estimation and Testing STOYAN. CASELLA. and FINDLAY · Models for Investors in Real World Markets TIAO. Second Edition WOODING · Planning Pharmaceutical Clinical Trials: Basic Statistical Principles WOOLSON and CLARKE · Statistical Methods for the Analysis of Biomedical Data. PEÑA. BISGAARD. Second Edition THOMPSON · Simulation: A Modeler’s Approach THOMPSON and SEBER · Adaptive Sampling THOMPSON. Volume II: Categorical and Directional Data VAN BELLE · Statistical Rules of Thumb VIDAKOVIC · Statistical Modeling by Wavelets WEISBERG · Applied Linear Regression. Practice. OBUCHOWSKI. and STIGLER (editors) · Box on Quality and Discovery: with Design. and Parameter Design Optimization YANG · The Construction Theory of Denumerable Markov Processes *ZELLNER · An Introduction to Bayesian Inference in Econometrics ZHOU. Computation. and SONG · Methods for Meta-Analysis in Medical Research TANAKA · Time Series Analysis: Nonstationary and Noninvertible Distribution Theory THOMPSON · Empirical Model Building THOMPSON · Sampling. KENDALL. Random Shapes and Point Fields: Methods of Geometrical Statistics STYAN · The Collected Papers of T. Second Edition STOYAN and STOYAN · Fractals. Control. HILL. ABRAMS.