P. 1
SAS for Time Series

SAS for Time Series

|Views: 401|Likes:
Published by sibunqui
SAS Time Series Analysis
SAS Time Series Analysis

More info:

Published by: sibunqui on Jan 28, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/24/2014

pdf

text

original

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

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

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

x .

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

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

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

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

1 lists some common questions and answers concerning the procedures. Figure 1. Table 1. As you continue reading the rest of the book.Chapter 1: Overview of Time Series 5 forecast considerably better than its competitors in some time intervals but not in others. you may want to refer back to this chapter to clarify the relationships among the various procedures. The dimension of the model is overestimated when 50 observations are used.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 . PROC ARIMA is a viable alternative. If a transfer function model is appropriate. This chapter introduces some techniques for analyzing and forecasting time series and lists the SAS procedures for the appropriate computations. Brocklebank and Dickey generate data from a simple MA model and feed these data into PROC STATESPACE in the default mode. but the procedure is successful for samples of 100 and 500 observations from this simple series. it is wise to consider intervening in the modeling procedure through PROC STATESPACE’s control options.1 shows the interrelationships among the SAS/ETS software procedures mentioned. Thus. In SAS Views: SAS Applied Time Series Analysis and Forecasting. Figure 1.

5. 3. and X2t could be competitors' sales in month t.1 Linear Regression This section introduces linear regression. You also observe explanatory variables X1t. For example. 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. 2. Suppose that at time t you observe Yt.1 Selected Questions and Answers Concerning SAS/ETS Software Procedures Questions 1.6 SAS for Forecasting Time Series Table 1. 4.1 shows a simple plot of monthly sales versus date. X1t could be advertising expenditure in month t. Yt could be sales in month t. X2t. .3. Output 1. and so on. an elementary but common method of mathematical modeling. 7.3 Simple Models: Regression 1. 6.

assume that the errors • ε+ t 2 X2β + 1X1β + 0β = Y t • • t .noitubirtsid lamron a evah t ε For this model. For example.Chapter 1: Overview of Time Series 7 Output 1.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. MODEL SALES=ADV COMP / DW. TITLE2 “EXPENDITURES AND COMPETITORS’ SALES”. OUTPUT OUT=OUT1 P=P R=R. suppose you have 80 observations and you issue the following statements: TITLE “PREDICTING SALES USING ADVERTISING”. )s morf tnereffid t rof detalerrocnu era s ε dna ε ( rehto hcae htiw detalerrocnu era semit lla ta ecnairav emas eht evah t t . such as PROC REG or PROC GLM. PROC REG DATA=SALES. RUN.

4 31E9518109. You have created an output data set called OUT1 and have called for the Durbin-Watson option to check on these error assumptions.0 1000.759373 rorrE dradnatS 706506.7013.2 serauqS fo muS 97 77 2 FD latoT C rorrE ledoM ecruoS 188770989642 31E1190362.0 1000.0 08 493.sbO fo rebmuN roF( D nostaW-nibruD 33456480. is e + 1−t ερ = :0 H ε :1H t ε 382.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.0 |T| > borP 3955.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.0576971.1 31E2281625.t ε 8 SAS for Forecasting Time Series Output 1.61 .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 ). 2 β dna . 1< ρ t t is related to 1− t ε t ε .V.0 F>borP 041.5 122.0 1000.15 eulaV F and et is an uncorrelated series.1 55893. in which where called an AR (autoregressive) error of the first order. 0 β Output 1. The standard errors are incorrect if the assumptions on are not satisfied.1 451. 1β .979694 ESM tooR 31E899724.C 17807.0 5075.0 48640719. This type of error term.2274603 naeM peD 22759.2 shows the estimates of .

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

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

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

0 :eulav F 1 :F>borP 67 :FD 55257591 :rotanimoneD :FD 768.41 05212.0 1000.9265.0 08 378.3661240132 2.9265.1 1000.0 2225.0 901.1 nostaW-nibruD 3328.0 0.0 48242225.3 6670.1 ESS setamitsE serauqS tsaeL yranidrO SELAS = elbairaV tnednepeD erudecorP GEROTUA SELAS S'ROTITEPMOC DNA SERUTIDNEPXE GNISITREVDA GNISU SELAS GNITCIDERP Output 1.11 507.31783.V.4751 393.0 8768400.0 1000.5302830.0 1000.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.5302830.0 qs-R jdA erauqs-R 30239.6 722365.9684 rorrE dtS WD<BORP qsR latoT CIA ESM tooR EFD 483881.9534898148 97 548.3851 CBS 55257591 ESM 9E7784.0 50690140.0 1000.0 qsR geR 736.0 499.C naeM peD ESM tooR 1000.45257591 2.4244 67 8278.0 F>borP 820.sbO fo rebmuN roF( D nostaW-nibruD 483881.2B Predicting Sales from Advertising and Competitor’s Sales 12 SAS for Forecasting Time Series .0 3328.31783.4244 .38830136:rotaremuN RPMET :tseT SELAS :elbairaV tnednepeD SELAS S'ROTITEPMOC DNA SERUTIDNEPXE GNISITREVDA GNISU SELAS GNITCIDERP 440.0 |T| > borP 499.811 eulaV F 4.2C Predicting Sales from Advertising and Competitor’s Sales Output 1.8639177841 67 7.076953 etamitsE retemaraP 1 1 1 1 FD 1VDA VDA PMOC PECRETNI elbairaV setamitsE retemaraP 3618.7322.6 722365.076953 eulaV B 1 1 1 1 FD 1VDA VDA PMOC tpecretnI elbairaV borP xorppA oitaR t 9322.7 1915.0 1140.03692 61393.11 507.0 1000.9684 rorrE dradnatS noitalerrocotuA redrO ts1 ).0 3328.7 0=retemaraP :0H rof T 47521915.0 1000.

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

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

β β ε around the appropriate curve.11 Plotting Exponential Curves ) 1 (0 X Output 1. Because this plot is straighter with more uniform variability. The curvature and especially the variability displayed are similar to those just described. Treasury bill rates against time. Note that the curvature in the plot moves away from 1 in either direction. you decide to analyze the logarithms.13. A plot of the logarithm of the rates appears in Output 1.12 shows a plot of U.11 for several examples of this type of plot. 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. Because the error term 1 β is multiplied by .22 SAS for Forecasting Time Series See Output 1. the variation .S. you simply have Xt=t. In this case. Output 1.

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

LFYGM3. . OUTPUT. . SET TBILLS END=EOF. OUTPUT. END. on TIME to estimate log )1 ( You also produce predicted values and check for autocorrelation by using these SAS statements: PROC REG DATA=TBILLS2. . TITLE2 'REGRESSION WITH TRANSFORMED DATA'. β 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 β( . ID DATE. RUN. TIME+1.. MODEL LFYGM3=TIME / DW P CLI. you first create a data set with future values of time: DATA TBILLS2. DATE=INTNX('MONTH'.14 Displaying Future Date Values for U.S. . . . RUN.15. . The result is shown in Output 1. LFYGM3=.DATE. You then regress the log T-bill and in the following model: rate. TITLE 'CITIBASE/CITIBANK ECONOMIC DATABASE'. Output 1.24 SAS for Forecasting Time Series To analyze and forecast the series with simple regression.1). . Output 1. . IF EOF THEN DO I=1 TO 24. Treasury Bill Data ESABATAD CIMONOCE KNABITIC/ESABITIC EMIT 552 452 352 252 152 472 372 272 172 072 )seniL tuptuO eroM( 3MGYFL . TIME+1. DROP I.14 shows the last 24 observations of the data set TBILLS2.

0 030.V.0 qs-R jdA erauqs-R 88760.1 6299.04321.0 530.2 8184.045 eulaV F 64060.41 0 .2 6799.0 030.0 |T| > borP EMIT PECRETNI elbairaV setamitsE retemaraP 3486.0 052 090.0 5586.1 130.159.74 56399. .41 38747.2 5200.0 830911.0 130.1 1431. .1 6000.51 6399. 2189. CLI.0 530. and DW Options in the MODEL Statement ATAD DEMROFSNART HTIW NOISSERGER Chapter 1: Overview of Time Series 25 .0 530. .0 0146. .0 530.1 etamitsE retemaraP 1 1 FD 1000.41 07586.15 Producing Predicted Values and Checking Autocorrelation with the P.1 1716.04331.0 6673.1 1921.0 .1 7789.SBO FO REBMUN ROF( D NOSTAW-NIBRUD )sserP( SS diseR detciderP slaudiseR derauqS fo muS slaudiseR fo muS .2 8684.1 7289. .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.1 1931. .0 0646.1 1726.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.1 1226.2 . .2 9069.1 0421.2 8174.0 1000.0 rorrE dradnatS 010500. 28VON 152 )seniL tuptuO eroM( 3851.0 05591130.1 6000.0 9536.0 3400.0 130.1 2216.C naeM peD ESM tooR 1000.2 0669.23 erauqS naeM 53976.2 5888.0 1441.53 0=retemaraP :0H rof T 84512000.0 130.2 1179.2 1679.08421.2 NOITALERROCOTUA REDRO TS1 ).0 F>borP 336.0 07586.1 88542.0 1156.2 8674.0laudiseR 0236. 8468.0 9194.0 4312.1 8589.1 630. .1 2656. 48TCO 48PES 48GUA 48LUJ 48NUJ 472 372 272 172 072 )seniL tuptuO eroM( .08431.32 278.1 3400.

Therefore. We prefer to simply exponentiate and think of the result. nor would you want it to do so.090.55. Because the distribution on the original levels is highly skewed.377) = 10.377 < 2. Your forecast for November 1982 can be obtained from 1.26 SAS for Forecasting Time Series Now. x ) For this reason. some authors suggest adding half the median exp(Mx) and mean exp(Mx+ error variances to a log scale forecast prior to exponentiation.645.377) = 10. in Output 1. you should recompute your forecasts and confidence intervals using some of the methods in this book that consider autocorrelation.0 ( )69.1 < ) 0β ( gol < )2130. exp(2. 552. At the 5% level.77 is the predicted value.888 < 2. as an estimate of the median.46% and 0.77 does not lie midway between 6.13.61 < FYGM3251 < 17. for example. the prediction 10.77.0 = 48. because n=250 to compute 1 β σ½ 0 β is a 95% confidence interval for 4500. 159. you compute: )2130. The growth rate of Treasury bills is estimated from this model to be between 0. you obtain is beyond the range n .2 ρ − 1( / ρ ˆ ˆ 2 /1 .55 is a 95% prediction interval for the November 1982 yield and exp(2.1 2 < 0β < 088.0 ( )69. in which the data fluctuate around the overall trend in a clearly dependent fashion.1 + 911.61 and 17. 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. Then y = exp(x) and y has . for example.54% per time period.1( − 911. However.1( Thus. you can conclude that positive autocorrelation is present (or that your model is misspecified in some other way).3 which is a 95% confidence interval for . reasoning that this is a more credible central estimate for such a highly skewed distribution. you use 2/ is d=0.1 1 ) < 1β < 6400.865 so that 6. Similarly. This is also evident in the plot.63 which is greater than 1.

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

Thus. by extending equation 2. in fact.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. You can also compute a covariance between Yt and Yt-j from equation 2.261 = )1( γ .3.801 = )2 ( γ .342 2 ρ − 1( / 2 σ = 2 σ + ) 2 ρ − 1( / 2 σ 2 ρ . j you have ) t An interesting feature is that does not depend on t. Equation 2.23 = )5( γ . is often called the “Wold representation” of the series. Suppose you observe this sequence: . Why emphasize variances and covariances? They determine which model is appropriate for your data. 3/2 3/2 =ρ all the way through the sequence.1. model 1. you decide that model 1 is appropriate and that Because ) = )6( γ .2 back into the infinite past. . 3/2 and.28 SAS for Forecasting Time Series is ) 2. In other words. 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.84 = )4 ( γ ) 2 ρ − 1( / 2 σ ) j (γ which shows that the variance of Yt is also . Calling this covariance 1< ρ ) − t Y.27 = )3( γ . Y( rav j ρ = ) 2 ρ − 1( / 2 σ ρ = ) j ( γ − te 2 t ρ − 1( / 2 σ = )0 ( γ Y( j = ρ 0 =∞ Σ + µ = v oc j (2..3) )1 − j ( γ / ) j ( γ = )1( γ = ) 0( γ j = )j ( γ = )0( γ / ) 2( γ / )1 γ ( t Y ρ . . in which the series is expressed in terms of a mean and past shocks. 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. which is 342 = )0( γ = ) Y(rav t and you note that 3/2 Also. This again shows that if effect of shocks in the past is minimal. if they decline exponentially at rate as lag j increases.3.12 ) j (γ You know the variance of your process. as j the that is.1.

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

. 2.1. L+n 531 = 2 σ = ) e ( rav µ− Y =µ L+n t Y Y . 233. The forecast error variances. .1 .5. for your parameters.721 become 135.6.09 PROC ARIMA DATA=EXAMPLE.. 200 data values Y1.2 .1 helps you forecast in the short run.2. 103. but you may as well use the series mean to forecast a stationary series far into the future. plus a prediction error that is a linear combination of future shocks (e’s) is possible.30 SAS for Forecasting Time Series and the forecast error variance ) For example. It will be shown that for a whole class of models called ARMA models. 108. Y200 with mean Y200 = 140.246 are analyzed with these statements: . such a decomposition of Yn+L into a prediction that is a function of current and past Y’s. 112.3 ) 2 ρ − 1( / 2 σ 2 3/2 =ρ σ . . RUN. IDENTIFY VAR=Y CENTER.4.001 . + 4 ρ + 2 ρ + 1( 2 σ si . Y2. but from the historic residuals an estimate of can be obtained so that the error variance can be estimated and a prediction interval calculated. 105. 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. =Y As an example. substituting . based on . if the forecasts become 118. like si e cnairav rorre 001 = µ L 2 − L2 =ρ ρ ρ + . The forecasts decrease exponentially at rate to the series mean . 221. FORECAST LEAD=5. 238. .8.3.3 / 2 ρ ˆ You must substitute estimates. and 241.. like . The coefficients in these expressions are functions of the model parameters.. At time n + L this expansion was } t The future shocks (e’s) in item 2 have not yet occurred. 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 . . .1 Forecasting with PROC ARIMA 190. which can be estimated.. 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.7. 195. The forecast error variance converges to the series variance )0 ( This shows that an equation like equation 2. 102. ESTIMATE P=1 NOCONSTANT.

.0 846841. snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM elbairaV fo emaN ) 0( γ / ) j ( γ = ) j (ρ | | | | | | 77752.803 473. Thus a t exceeding 1. .0 27533.54 (covariance at lag 0) gives the estimated sequence of correlations.52711. If were 0.653 with forecast standard error 2 .246 – 90.99370.8.7275 . and forecast.73).204 630.5 = 20.0 868121.0 ρ | *****| . is significant. Y srorre dradnats owt skram ".41960.0 288741. You forecast Y201 by an estimate of 90.73(1 + . you have 430.807 485.503 with forecast standard error (430. .91 exceeds the 5% critical value.754 Next. .) The correlation plot shows roughly exponential that you can test for decay.0 00000. decrease at a rate of about .43 0 Y . .74- σ ) j (γ 5 4 3 2 1 0 gaL 42 32 22 12 02 91 .96 in magnitude would be considered significant at about the 5% level.0 81195. 002 78916.1 shows the results when you use PROC ARIMA to identify.0 117070.0 92797.0 027741. this t would have approximately a standard normal distribution in large samples. . Dividing each covariance by the variance 1198. 402. Since t=18. | | *********| . 309.05505386.0 .80575(140. | | ****************| . .0 474921.246 – 90. Estimate.311725. .0 32734. | | *******| . . 709. The CENTER option tells PROC ARIMA to use the series mean. and Forecast erudecorP AMIRA ehT 557331.091 + (.88545. to estimate .091) = 130. 524. The covariances 1199.Chapter 2: Simple Models: Autoregression 31 Output 2.041195768. The ESTIMATE statement produces an estimate significance with the t ratio.1 noitalerroC 93240. | | ************| . you forecast Y202 by 90.0 865601. The estimates of are called covariances with j labeled LAG on the printout.0 643841.6528 Output 2.559 535.425 155. . .28054173." =ρ ˆ |* |* |** |** |* |* snoitalerrocotuA .25930. (The correlation at lag 0 is always and in general .80575)2(140. Also.091 + .80575 )) = 26.8911 ecnairavoC 324308.47490.0 866741. . | |********************| | 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1- | | | | | | µ ρ ˆ 57508.0 0 rorrE dtS 238841.5 (430. 956.- )seniL tuptuO eroM( . . estimate.1 Using PROC ARIMA to Identify. 2 1 = )0(ρ 249.091) = 122.

. *| .543 64. |* . | | .0 042. . | | .< 1000. | 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA laitraP 26900. . | | .0 25675. ***| .0960.0 730.077211.025720. |**. . | | .**| .0 52630.092797.0 797.**| .0 22690.0 734.000510.0 342.0 852.0 42 32 22 12 02 91 )seniL tuptuO eroM( | .1 Using PROC ARIMA to Identify. |* . | .0 31221.0 --------------------snoitalerrocotuA-------------------- 1000.0 111. *| . *| . Estimate.0 170. and Forecast (continued) 32 SAS for Forecasting Time Series . |* .243 52.0040.0 751.0 162.0590. | | .0 37401.061841. | | . *| . |**** .0 78510.042 32 22 12 02 91 )seniL tuptuO eroM( | .029940.0 450.0711.353 71. .0 01270. | .0470.0800. |**.069902.0 891.0 633.0noitalerroC 5 4 3 2 1 gaL Output 2.0 722.< 1000. | | ****************| .782 erauqS -ihC 42 81 21 6 gaL oT esioN etihW rof kcehC noitalerrocotuA | | | | | | .0 630.240.0 75560. | .054230.< 1000. | | | | | | 01530.0 195. |*** ****| .0 42481. *| .0 95621. . | | .0 240. |************ | 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA esrevnI 45040. . | | | | | | 65710.0 noitalerroC 5 4 3 2 1 gaL | | | | | | . | .< qSihC > rP 42 81 21 6 FD 93.

0230.62 0457.02 rorrE dtS 8421.84 5268.0020.611 3356.0 700.0 --------------------snoitalerrocotuA-------------------- T AM E Output 2.0600.11 64. This means that 9327.1871 CIA 79357.031 tsaceroF 502 402 302 202 102 sbO Y elbairav rof stsaceroF )1(**B 57508.0890.0 3407.0630.4871 CBS 866.1RA retemaraP noitamitsE serauqS tsaeL lanoitidnoC Y L Chapter 2: Simple Models: Autoregression 33 .1 Using PROC ARIMA to Identify.81 eulaV t 16240.0200.9 64. and Forecast (continued) F In the manner previously illustrated.0360.0 .5 erauqS -ihC 63 03 42 81 21 6 gaL oT slaudiseR fo kcehC noitalerrocotuA .24 6315.92 8256.98 stimiL ecnedifnoC %59 3959.701 4132.171 5628.07 6081. The coefficients are estimated through the least squares (LS) method.471 9414.171 7525.0 920.0700.0 200.0 240.0 100.0 6048. Estimate.0200.23 2777.0 560.0 011.371 2949.0 1975.tnanimreted gol edulcni ton od CBS dna CIA * 002 slaudiseR fo rebmuN 669.ledom siht ni mret naem oN eulav eht gnitcartbus yb deretnec neeb evah ataD Y elbairav rof ledoM erudecorP AMIRA ehT 0928.72 94.< |t| > rP xorppA 19.13 1568.0470.0 etamitsE 1.42 01.0 qSihC > rP 53 92 32 71 11 5 FD 60.0 3263. PROC ARIMA produced the forecasts and standard errors.471 6397.111 0823.02 etamitsE rorrE dtS 5727.0430.0 500.0240.0460.0 470.0150.0 920.02 03.1 :1 rotcaF 46090.0581.0820.0 650.034 etamitsE ecnairaV 1 gaL 1000.0340.0301.09 srotcaF evissergerotuA .0840.)Y 2 − 1− t ( Y Σ / )Y − 1 − tY ( ) Y − t Y( Σ = 57508.0 9536.0 700.0 rorrE dradnatS 57508.0 410.0 060.0 470.75 8198.221 6305.0 330. 640.

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

The first term cannot be changed by manipulating also minimizes _ _ _ so the CLS method with inserted ρ . The negative of the likelihood is shown so that a minimum is sought in each case. 10. the expression USS/n is substituted for likelihood function and the resulting expression. is maximized.Chapter 2: Simple Models: Autoregression 35 The estimates that minimize USS are the unconditional least squares (ULS) estimates—that is. USS is the objective function to be minimized by the ULS method. 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. The minimization can be modified as leaving only to be estimated. in the If full maximum likelihood estimation is desired. and it is seen that these estimates can vary somewhat from method to method when the sample size is very small. with each function truncated by a convenient ceiling plane.) µ .Y ( [ + … + 2 ] ) µ . is used as an estimate of the population mean. Each plot also shows a vertical slicing plane at =10. Likewise the that minimizes the cross section plot is not the same as the one minimizing the surface plot. µ− 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.) µ . Crosshairs in the plot floors indicate the minimizing values. unconditional least squares.n Y ( ρ. so the sample mean differs somewhat from the estimate that minimizes the objective function. it can be modified by inserting in place of ]) µ- 1.ρ( µ n Y([+…+ ]) Y 2 ρ 1 Y( ρ ) Y – – – – – Y _ .Y [ ρ n . The slicing plane does not meet the floor at the crosshair mark. although this difference is quite minor for ULS and ML in this small example. and maximum likelihood for an autoregressive order 1 model fit to these data. µ 1 Y 2 2 1 leaving only to be Y([ .Y ( [ + 2 ] µ . . ρ estimated. as with the other methods. The right panel in each row plots the function to be minimized over a floor of pairs. The three rows in Output 2.2 display the objective functions just discussed for conditional least squares.µ Y and. corresponding to the sample mean. Thus it minimizes a slightly different objective function. The left plots show the cross section from the slicing planes.Y ( ρ. 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. 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.n Y( ρ-) Y )µ . These then are the objective functions to be minimized when the sample mean. called a concentrated likelihood.

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

31 5053.11 0000.3 457411.0 425070.0 597458.2 762743.2 907013. The estimates correspond to the coordinate(s) on the horizontal axis (or the floor) corresponding to the minimum.21 9911.2 907013.0 789470.0 7597.0 330300.85 76762.0 3049.01 UM 99954.0 403120.0 1128.0 560100.31 6035.85 76762.31 0832.21 2424.21 7684.0 3468.0 8588.0 31230.0 8890.2 762743.1 554861.0 108100.65 84027.0 370500.01 UM 74171.0 6639.0 635612. 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. 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).0 635612.1RA 9935.31 0405.0 585310.55 74171.3 tnatsnoC 0149.0 403208.0 5886.1 132364.3 457411.31 4635.0 121798.0 3507.0 7049.0 550618.3 tnatsnoC 3468.75 21389.21 7684.0 3507.75 21389.31 1574.55 77818.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.0 1.0 8131.0 5839.65 84027.55 14064.55 15364.55 32164.0 3709.0 1 tirC R 9-E1 8-E1 7-E1 6-E1 10000.0 7597.0 2339.31 2140.0 601138.26 ESS 4 3 2 1 0 noitaretI noitamitsE serauqS tsaeL lanoitidnoC 826000.21 9911.0 366060.31 1418.1 700686.55 09725.0 adbmaL 13997.0 1.SLC rof noitacificeps dohtem on dna doohilekil mumixam rof LM=DOHTEM htiw Output 2.0 8131.55 30064.31 5025. ρ .0 1919.1 554861.11 0000.1RA 2424.55 07326.0 8890. A partial output showing the iterations for our small series is shown in Output 2.65 74675.789470.0 5886.55 31064.0 690540.11 7532.0 2829.0 770959.0 335708.3 Using PROC ARIMA to Get Iterations for Parameter Estimates noitamitsE serauqS tsaeL lanoitidnoC Chapter 2: Simple Models: Autoregression 37 .31 2034.55 83684.1 955902.11 7532.55 87964.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.0 773800.0 1128.65 74675.0 adbmaL 700686.0 6939.3.

26 ESS 2 1 0 noitaretI noitamitsE serauqS tsaeL lanoitidnoC 7-E312.2211269.0 870820.01 3905.1 700686.0 5886.01 2424.01 1968.0 810200.0 3468.2296169.3 tnatsnoC 3468.01 2123.0 7328.0 970560.85 76762.0 825600.0 1.1RA 8384.25 03386.26 ESS 4 3 2 1 0 noitaretI noitamitsE serauqS tsaeL lanoitidnoC 854000.01 UM 74171.0 5886.2 819907.0 3468.11 0000.3 31230.0 469332.1 tnatsnoC 0937.0 239010.0 2628.1 554861.2 97596.0 554850.0 1 tirC R 21-E1 11-E1 01-E1 9-E1 8-E1 7-E1 6-E1 10000.1 684338.0 0738.2 263808.0 1 tirC R 7-E1 6-E1 10000.26 76762.2297733.25 12386.0 adbmaL 9117.01 8294.01 8463.3 31230.1 434948.0 1.2 326627.26 93302.7-E312.01 2533.2267169.0 276630.01 9745.75 21389.45 ESS 8 7 6 5 4 3 2 1 0 noitaretI Output 2.25 05477.2256469.1RA 93302.26 76762.2286169.01 7015.0 7597.2 971873.0 6967.25 83989.01 7283.0 7538.21 9911.32ekilgoL 7 6 5 4 3 2 1 0 retI noitamitsE doohilekiL mumixaM 789470.26 93302.01 8453.0 8131.0 adbmaL 700686.26 ESS 2 1 0 noitaretI noitamitsE serauqS tsaeL lanoitidnoC 78000.0 1 tirC R 9-E1 8-E1 7-E1 6-E1 10000.0 9117.0 1 tirC R 7-E1 6-E1 10000.01 2424.0 5886.0 9117.1 177177.2 700686.0 1778.65 74675.1 153058.11 7532.0 597400.01 7006.1RA 2424.0 4528.0 401100.0 1.0 1128.3 457411.65 84027.1RA 0063.01 5094.2269479.0 1.25 34686.01 1484.0 461561.25 71007.1 559627.0 8890.0 3507.0 635612.0 1.2 762743.0 1 tirC R 21-E1 21-E1 11-E1 01-E1 9-E1 8-E1 7-E1 6-E1 10000.0 8347.21 UM 91386.1 569203.0 5837.0 62510.0 7937.21 UM 86169.0 adbmaL 851358.25 28386.0 5328.1RA 93302.1 257138.21 7684.0 76200.25 54613.0 adbmaL 90407.2 764746.2 907013.0 8237.0 adbmaL 9117.1 tnatsnoC 2328.0 4737.3 Using PROC ARIMA to Get Iterations for Parameter Estimates (continued) noitamitsE serauqS tsaeL lanoitidnocnU 38 SAS for Forecasting Time Series .

2275389.0 5886.25 80798.0 9228.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.2227479. .2217479.0 824130.0 7697.0 1.26 76762. you may have (2. RUN. In more complex models. 379000. 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.0 9117.0 950100.0 1 tirC R 720000. The CLS estimates. as are the other objective functions.25 75328.3 Using PROC ARIMA to Get Iterations for Parameter Estimates (continued) e + ) µ − 2− tY( 2 α + ) µ − 1− tY( 1α = µ− Y t .0 589200.Chapter 2: Simple Models: Autoregression 39 Notice that each method begins with conditional least squares starting with the sample mean and an estimate. after a few iterations.0 743240.0 9117.0 9117.25 01428.0 1 tirC R 7-E312.4) which is a second-order autoregressive (AR) process. which is facilitated by writing the models in backshift notation.3 31230.45 ESS 93302.0 727331.0 3837. the likelihood function is more involved.0 1. You have no reason to believe that dependence of Yt on past values should be limited to the previous observation Yt-1.0 9837.25 73590.6885.26 ESS 17479. IDENTIFY VAR=Y. t You thus need to study the form of autocorrelations for such AR processes.0 6518.0 adbmaL 5328.1RA 35328. of the autoregressive coefficient. are substituted in the ULS or ML objective function when one of those methods is specified.25 49928.0 adbmaL 8-E1 7-E1 6-E1 10000. Nevertheless the basic ideas presented here generalize nicely to all models handled by PROC ARIMA.26 93302.0 adbmaL 7-E1 6-E1 10000.1RA 3837.0 1.0 753900.1RA 9117.0 2128. For example.22ekilgoL 5 4 3 2 1 0 noitaretI 2 1 0 noitaretI 3 2 1 0 retI Output 2.

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

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

59 31 2 . 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 . you then compute 01 = σ 2 ) 2( γ .42 SAS for Forecasting Time Series and 587 and so forth. and . Thus. ).492 7 − 7. You can eliminate the first-order AR model 1 based on the to damp out at a constant exponential rate.728 ( 7. . For example.4.788 ( 27. j=1.292 9 − )j ( γ 6.1 + = )1( γ .268 0. With that in mind. failure of 29.8. Using equation 2. you can use the Yule-Walker equations to and autocorrelations 5. you get 01 = 2 σ 0( γ )j ( γ 2 σ If you assume a value for compute autocovariances )0 ( γ / ) j ( γ (for example.772( 2 α + )063( 1α = 093 and )093( 2 − 5 . )6. but 77. If the model is a second-order autoregression like equation 2. How do you do it? First.898 1 = = = = / )4 ( γ )j ( γ )j ( 0 )3 ( γ ) 2( γ 093 = )0 ( γ ρ )j ( γ j .772 )0. and .322 01 − 2.728 6 − = )2 ( γ = = 8.1 )4.322 4.713 8 − 5 .772 ) ( γ1 2 1 = )1( γ = )0( γ / )1( γ ) j (γ α = )0 ( γ 063 1. ) The Yule-Walker equations for j=0.481 41 5. ) 2 − j ( γ 2 α + )1 − j ( γ 1α 9.91 4 ) ( γ2 2 6. you need a model for the data. Solving these (using ).4) are 2 and 0> j .751 − − 3 α α + )063( 1α = 5.268 ( 7.268 ( 27.31 21 The last two observations are 130 and 132. you have the Yule-Walker equations 2 )063( 2 α + )093( 1α = 063 σ + )5. and j=2 are three .788 5 .521 11 − 9 .311 )4. 2 ) ( σ 1 γ The autocorrelations do not depend on equations in three unknowns: . and you want to predict five steps ahead. the Yule-Walker equations for a second-order AR process (see equation 2.

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

j=1.1 – t e) . . j=2.44 SAS for Forecasting Time Series Surprisingly. A general review of the discussion so far indicates that an AR model of order p.1 − 1( = ) µ − t Y ( ) B59. . the weights taper off.10 by writing the model t j as t Now replace B with an algebraic variable M. = )µ − 2 + B08.1 + 1( = e 1− e ) B59. just as in equation 2. + M08. you see that the weights eventually taper off toward 0. . You obtained equation 2. . .2 + B08. + 3B14. .11 and 1. written as . . 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 M59. α −. You have also used covariance patterns to distinguish the second-order AR of the covariances model from the first-order model. if you continue to write out the expression for Yt in terms of et. 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.25. which is a complex pair of numbers with magnitude 1. tY ( ) = t . .1 − 1( t t tY ( Y( Y( 1 (2. . t − 2 M 2 α − M 1α − 1 2 − 2B 2 α − B1α − 1( + B08. However. = M Mp p − 2B 2 α − B1α − 1( = ) µ − Bp te + ) µ − p − tY ( p α+ α −. In In this case. . )j ( γ α use these Yule-Walker equations to estimate coefficients ) µ − j −t Y( 1> M are such that .11) when you know or can estimate values . 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 . . and by computing expected values. . te ) . . i93 . = )µ − + ) µ − 2 − Y ( 2 α + ) µ − 1− Y ( 1α = ) µ − + 3B 3W + 2B 2W + B1W + 1( = α −. . p ± 59. the roots are equation 2.5. the weights on et-j seem to increase as you move further into the past. .2 + 2B92. 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.03. the roots are 1. You can 2.7.11 on both sides by .

Chapter 2: Simple Models: Autoregression 45 2.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).” shows that associating autocovariance patterns with models is crucial for determining an appropriate model for a data set.3 Fitting an AR Model in PROC REG Chapter 3. . LSILVER3=LSILVER2. OUTPUT. it is crucial to build a catalog of their covariance functions as you expand your repertoire of models.. Yt-2. LSILVER4=LSILVER3.5. “The General ARIMA Model. Thus. CARDS. Assuming a fourth-order model is adequate. T=_N_. LSILVER1=SILVER. and thus simplify your analysis. and Yt-4 using these SAS statements: DATA SILVER. you can fit the models by ordinary regression techniques like PROC REG or PROC GLM. DATE=INTNX('MONTH'. INPUT SILVER @@. RETAIN DATE '01DEC76'D LSILVER1-LSILVER4. remember that the primary way to distinguish among them is through their covariance functions. RUN. As you expand your set of models. PROC PRINT DATA=SILVER. Yt-3. The covariance functions are like fingerprints. PROC REG DATA=SILVER. If you deal only with AR processes. PROC REG DATA=SILVER. Output 2. MODEL SILVER=LSILVER1 LSILVER2. helping you identify the model form appropriate for your data. RUN. FORMAT DATE MONYY. RUN. TITLE 'MONTH END STOCKS OF SILVER'. LSILVER2=LSILVER1.DATE. 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 .1). RUN. as illustrated in Output 2. MODEL SILVER=LSILVER1 LSILVER2 LSILVER3 LSILVER4 / SS1. You also can simplify the choice of the model's order. you regress Yt on Yt-1.

. 4REVLISL 728 648 . . . 3REVLISL 997 728 648 . . .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 .5 Using PROC PRINT to List the Data and PROC REG to Fit an AR Process .4 Plotting Monthly Stock Values 46 SAS for Forecasting Time Series Output 2. 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. . 2REVLISL 867 997 728 648 .

995 03539.77 etamitsE retemaraP 1 1 1 FD 2REVLISL 1REVLISL tpecretnI elbairaV setamitsE retemaraP 5998.< F > rP 62.73 rorrE dradnatS 63211.0 87062.1601 27482 592783 34507491 SS I epyT 3364.0 0279.33 raV ffeoC naeM tnednepeD ESM tooR 1000.040.9 27.21 85.< 1310.0 qS-R jdA erauqS-R 55310.5 Using PROC PRINT to List the Data and PROC REG to Fit an AR Process (continued) Chapter 2: Simple Models: Autoregression 47 .5 38598.0 qS-R jdA erauqS-R 56591.59 eulaV F 56700.00.0 6309.078094.0 73162.568.0 65151.0 40958.201 etamitsE retemaraP 1 1 1 1 1 FD 4REVLISL 3REVLISL 2REVLISL 1REVLISL tpecretnI elbairaV setamitsE retemaraP 2988.098583.636 09090.0 |t| > rP 47.0 98511.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.03 rorrE dradnatS 44116.1 27359.2 eulaV t 34511.0 07.< 1000.141.012900.0 1000.1 62148.0 13244.246 21522.< F > rP 03.0 83012.022 eulaV F 05854.0 6898.2 eulaV t 58151.0 1790.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.5 00067.23 raV ffeoC naeM tnednepeD ESM tooR 1000.0 |t| > rP 03.< 5900.

distribution.77 − M94. In Chapter 3. These models require more sophisticated fitting and identification techniques than the simple regression with overfitting used in the silver example. and now the final estimated model t which becomes All parameters are significant according to their t statistics. − 1− tY9094.76 34 2 You have identified the model through overfitting. suggests that this series may be nonstationary. The fact that M=1 almost solves the characteristic equation 2 M16. you extend your class of models to include moving averages and mixed ARMA models. a TEST statement could be used is ) 746 + + 7359.48 SAS for Forecasting Time Series Output 2.1 1 − 1 = t Y = 746 − t Y . − 2 − tY ( 4116. t e e + + ) 746 2 − tY4116. Alternatively.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 = . 1− tY ( 9094.

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

1. In backshift notation you write .0 = )3 ( γ . 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 .04 = )1( γ . and and are 0 for j>q. dealing with an MA process of order 1 because .1) Clearly. − . . .08 and 0= )j ( for j>1.− = β so and The model is the resulting sequence of autocorrelations is 04 = σβ − 2 . .001 = 2 σ ) 2 β + 1( for j>1.50 SAS for Forecasting Time Series 3.2σ 1− te )j ( and 0 for j>1.β regardless of the value 0.. . . Note that 2 /1 The general moving average of order q is written as q − te q Similarly. Y( voc =) + e+µ= j − tY . − 1− te 1β − te = − ) µ − 1− tY ( 1α − ) µ − tY ( .1. 0. .2 Terminology and Notation The moving average of order 1 is given by (3. the autocorrelations for lags 0 through 4 are 1. q − te qβ − .4. . )0 ( γ If each autocovariance is divided by For a moving average like equation 3.0 = )2 ( γ . you are and . ) 2 β + 1( / β− = )1( ρ β− = ) 1− Y . β − . . .q) as ) ρ µ− ρ −t ( ρ Y t e) q B q β − . In the example. 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. you write the mixed autoregressive moving average model ARMA(p. Also.. − )j ( γ and is characterized by the fact that 2 B2 α −. 0. . )j ( = 2σ 5.001 = )0 ( γ If you observe the autocovariance sequence . )j ( ρ .

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

0 = 3r4.( ˆ j j +7 Y Note that the prediction of is just and thus declines exponentially to the series mean (0 Y 6=n .3– = 1e t Y 4– 1 5– 01 )0( 01 3 Y 6 Y 7Y 8Y 9Y noitciderP ˆ ˆ ˆ laudiseR Predict by Using as an .344) = 4.4– 4. The illustration simply shows what PROC ARIMA is computing. These are one-step-ahead predictions for the historic data.0 + )5(6. 2 can be computed recursively as follows: — — — 6 1 8– 3– 5 01 noitavre sbO and by and by 3. you use only the data up through (and the assumed ) to predict .2 Future Predictions Predictions into the future are of real interest.3 4 Y 3= t − = )4− (4.52 SAS for Forecasting Time Series The predictions for the model 1− te4. the form 7Y )6. For example. = t Y 46.6(4.4 − = 1 − 3Y = 3r The residual is Then predict by Y 2r . the default in PROC ARIMA.0 + 1Y6. Continuing the process as shown.7 t .6 4 =2−6=2−n = 1e4.0 = 2r4. 7e6.0 + )3− (6.634 with error PROC ARIMA provides these computations for you. 4 3.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.2 — 835. you are performing conditional least squares estimation.2 656. The sum of squares of these residuals.4(0) = 2.723) + 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.3 + e + 1− Y6.0 .01 46. for this ARMA(1.538 with error is 0.1 — 327.2 4.0 + + 52 + 001 .420.0 + 2Y6.01 1 = )5− (4.0 + 3Y6.622 s te = 2 443.0 + 8e + 9e + 8e 01 = 1e 7e . that is. The prediction error variance increases from var(et) to var(Yt).6– 46. j in the example).6(6) + 0.723 with error is 0.0 6.656.2.4(2. is called the conditional sum of squares associated with the parameters 0.6(2.4(0) = 1. while one-step-ahead computations are used to start the as 0 for t beyond n ( observations in the process. estimate example).01 .2 e − 5 Y .1) with mean 0.4.6 and 0.4 — 443. that is. The next three predictions are as follows: 7e is 0. In a practical application. estimate future Ys by their predictions. If you search over AR and MA parameters to find those that minimize this conditional sum of squares.538) + 0.

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

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

− 4− tY460. In the ARMA(1.1) example. The model is stationary if all values of M such that 0= p Mp are larger than 1 in absolute value. µ − tY ( ) p B p α − . α − . so the ability to estimate en from the data was crucial. Note that in Section 3. Stationarity ensures that early values of e have little influence on the current value of Y. In the example. t Y) 2 − 1( 1−)B4.1 the forecast of Yn+1 was . provided the series is moderately long.3. B3..6Yn+. − 2B 2 β − B1β − 1( = − 3− tY61. 1− tY M α − M 1α − 1 β − M 1β − 1 + B3. The decreasing weights on lagged values of Y allow you to estimate et from recent values of Y. B6. . Any MA process is stationary. t and + 1− tY so + 4− tY460.. One AR example is t which is not stationary (the roots of 1 1.42M2=0 are M=10/7 and M=10/6). .3M+.4en. the prediction of Y6 with 0 as an estimate of e1 differs from the prediction using the true e1 by the quantity . 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.1 Stationarity and Invertibility Consider the ARMA model ) . ...1 − 1( + B3.2.01 e1. − 2B 2 α − B1α − 1( te ) − − + q B q β − ..3 Model Identification 3.. − β − .1 2 2 − M2 > M2 B24. + 1( = e t Y) 2 .. 3− tY61.1 − 1( + e= − t t Y = e t Y t t .3M2=0 are M=1 and M=10/3).3M+. . 2− tY 4. Another example is which is stationary (the roots of 1 1. . 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.Chapter 3: The General ARIMA Model 55 3. − + − Y) t e= e= 2− tY 4..

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

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

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

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

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

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

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

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

8 0.410 0.365 0.161 0 0.64 0.49Yt–2 + et Yt = et + .4Yt–2 + et Yt = .245 0. are given in Output 3.8 0.8 et–1 − − 1 0.550 − 3 0.3Yt–1 + .4900 0.0434 Plots of these values against lag number.64 SAS for Forecasting Time Series Lag Series 1 2 3 4 5 6 7 8 Model Yt = .2.4et–1 0 0 0.7Yt–1 . A list of actual autocorrelations for Series 1 8 follows: Lag Series 1 2 3 4 5 6 7 8 Model Yt = .343 − 0.1634 5 0 0 0 0 0.488 0.328 0.0173 5 0.8Yt–1 + et Yt = .272 0 0 0 0.4Yt–2 + et Yt = .1087 0 0.500 0.328 0.6Yt–1 + et + .756 − − Yt = et .330 0.6Yt–1 + et + .7561 4 0.1304 4 0 0 0 0 0.8 − 2 0.3 et–1 .161 − 0.4698 0 0.470 0.144 0.3123 3 0 0 0 0 0.0944 Yt = et Yt = .163 Yt = et Yt = .4et–2 0.64 0.3 e t–1 .5 0.49Yt–2 + et Yt = et + .32 0 0 0 0 0.055 0 0 0 0.144 0.1652 0.1267 0. 7Yt–1 .454 − − − − − 0.098 − .8 Yt + et Yt = .512 0.8 et–1 − − 1 0. with A used as a plot symbol for the ACF and P for the PACF.512 0.2756 0 0.3Yt–1 + .4 0.2215 0.3480 − − 0.4et–2 0.8 Yt + et Yt = .8Yt–1 + et Yt = .4et–1 0 0.4878 − − − − 0.8 2 0 0 0.410 − − − − − − Yt = et .

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

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

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

68 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 69 Begin the PROC ARIMA analysis by estimating the three functions defined above.3. Use these estimates to identify the form of the model.j < i rof 0 ≠ ) i ( γ − j + tY() Y ) 0(C / ) j (C − t Y( Σ = ) j (C 4.3 is the mean of the entire series. Each data series contains 150 observations.2. The purpose of the plots is to indicate the amount of sampling error in the estimates. Define the estimated = ) j (r .3 illustrates the actual (A) and estimated (E) ACFs for the series.ecnairav siht fo toor erauqs eht si rorre dradnats ehT .) 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 . 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.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 .

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

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

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

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

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

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

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.4 Plotting Actual and Estimated Partial Autocorrelations for Series 1–8 (continued) .

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

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

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

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

0 185541. . |* .086630.0 13560.0 99513. . .0 966731.0 22867.*****| | .5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA 82 SAS for Forecasting Time Series . . .0 399918.842.069580. | .202 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | .0 93842.0 08820.0 765405.1 noitalerroC 414273. | . . ***| | .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 .047484. . . .1 679495.0 604061.0 0 rorrE dtS | . .0 1000. |********** | | | | | | | | | | 40020. *| .0 056180.0 435551. . .0 784256.0 790851.0 613.015620. .0 014.0 480051. | | | | | | | | | | 80330.039500. *| .0 854906.0 867.0 152.0 078360. 079161.0 44491. | .0 365021. .0 891736. |* .0 475446.< qSihC > rP 6 FD 27.0 99510.0 68432. . | .*****| | .0 675. . |* .**| . .0 03050. | | | | | | | | | | | 15341.0 44152.006530. |* . .1 106394. |* .0 00000.1 17538.0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 1Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3. .**| .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 97340.*****| | ******| | ********| | ************| | ***************| |********************| .1 815399. |* . .0 51960.052600.0 79904. . ****| | . .0 55542.022867.0 46211.024270.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 00730.0 64900. |* .0 668251. . *| . . .0 75575.

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.0 537851. | *******| . .033420. | .0 838181.0 17872.0 0 rorrE dtS | .0 869871. | | | | | | | | | | 11200. |**. | .1918189.**| .0 94697. | .< qSihC > rP 6 FD 42.492 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | . |**************** |********************| | | | | | | | | | | | 22361. | .008610. | . |**** . | .0 94697.0 056180. |* .0 589221. *****| .066101.0 92080.0 276471.0 55930.0 96502. .1 760414.0 037448. .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- 1000.1 318242.**| . | . | . |******. |******** | **********| .004320. .0 80300.057930.0 66570.0 24480.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 | | | | | | | | | | . |**. .**| . .2398030. . .054250. .0 55275.063221.077140.0 213441. . . |**.35733.0 50014. . |* .5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 83 .0 375.1 40370.0 23001. | . |*********** | *************| . | . |**************** | | | | | | | | | | 44300. |* . | .00000.0820320.0 324326. ***| . *| .0- 084. | .0 313481.0 697. . *| .0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 2Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3.78356. .002001.1 noitalerroC 196494.0- 456.833.89974. .0 231861. .**| .96062.1557454.0 85005.092350. . **********| .1 843537.0 014.0731097.

0 58070. .045771. .022620.101 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | .1 46055. |* .024440.**| .0 521592. | .0 30354.0 058472. |**** | | | | | | | | | | 44930. .0 19820. . |* .0 67200.0 97291.0 372.0 315396. | .0 906021.0 45971.****| | .0 838657.**| . . .0 056180. . . .0 017212. . . .0 354. . | . |* .0 799121.0 252342.045230. . *| . .0 356593.0 209721.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. ***| | .035940.0 61302. .0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 3Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3.0 625211. .0 78670. .0 00000.036340.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 30354. .0 500113.0 54852.000400.1 noitalerroC 468451. ***| | *****| | *****| | **********| | *********| |********************| .0 62203.0 852. .0 614611.0 77170. *| . *| .0 71570.0 74300. |****** . *| . .0 829714. **| | .****| | .0 232421. .0 09851.< qSihC > rP 6 FD 65.****| | .5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) 84 SAS for Forecasting Time Series . *| .038363.0 10372. | | | | | | | | | | 33940.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 0 rorrE dtS | . .0 59831.049360. .0 93494. . . |* *******| *********| .0 248035.0 1000.302.0 059521. | | | | | | | | | | | 61101.0 079690.0 951.0 494. |* .

. .0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 4Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3. |**.0 09150.0 66421.0 91900.073490.0- 094.0 718732.**| .034094.0 137911.**| . | | . *| . | | .0 21660. |* .02651.0 501811. |* . .0 00000. *****| .011901.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 78600. . *| . |***. |* . | .0 111142. ***| . |**. |********** **********| . *| . .1 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 891370.0 788423.5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 85 .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. |* . .34094.1 38512.0106018.0 650.< qSihC > rP 6 FD 33. | | .0560550.0 70375.0 99050. | | .48 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | . *| .0 286601.0985539.521. *| .0 11750. ***| . |**. .0 740711. | |********************| | 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 051 291183.0579792.081990.0 099001. | .0 38690.063225. .095220.04682. | .0 76722.0 056180. .19424.0 663990.0 0 rorrE dtS snoitalerrocotuA esrevnI | . | | .0 29550.0- 682. . |****** | | .0- 651. .0- 524. | . |******** | | . | | | | | | | | | | 50530. |* . .0 296709.0 872211.027830.0 522711.68820.023620.0 1000.0 45990. | | . .0063645. .0 93621.0 716021. .0 03071. **| . | | **********| .0noitalerroC 73830. . |*********** | | | | | | | | | | 89910.

| .0 877101.0 37450. | . | | | | | | | | | | 71500.0 00000. . |** .0 0 rorrE dtS snoitalerrocotuA esrevnI | .5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) 86 SAS for Forecasting Time Series .0 05140.0 912337.0- 294. .0 93600.68130. . . **| . | |********************| | 1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1snoitalerrocotuA 051 815613.0 40280. . |* .0 114001. |* .0 860110.0 39063.0 44000.077550. | | . | | . |***** *********| . | .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.0 18600.0- 230.0 254990.0 25380.0 455361.0- 611.0 30310.1 noitalerroC 01 9 8 7 6 5 4 3 2 1 gaL 9073100. | .0 68071. .0 187101.039831.0 15531.***| . | | . |** . .0 60396.037944.1 84003. |** . | .0 023101.0- 711. .0712550.0 025990. .0 52240. | .0 155301.066410. | .0 168432.0 16180.084010. . | | .0572258.0noitalerroC 97000.37194.24 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | . *| . **| . |* .0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 5Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3.0 254141. . | . .92711.< qSihC > rP 6 FD 84. |*** ***| . |******* **********| .0 367441.**| .0 480. . | | . | | . | . | | .0 363201.0 1000.051621. .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 | | | | | | | | | | . ***| .037194. |************** | | | | | | | | | | 26200.0083002. | | **********| .0 45942.0 63490. | | .0 056180.600. *| .0782302.16511.

0172703.0 0 rorrE dtS | .002903.0 515811.10501.0 40900. *| .0 qSihC > rP 6 FD 30.44410. **| .0 16244.0- 2900.088631.5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 87 .71 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | .0 262911.0 27375.63600.039421.0 209980.77492.0 412090. *| .0 560.0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 6Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3. | | | | | | | | | | 60620.900. | . |****** | .0- 501.0- 600.0 218110. .0 013090.0 782980.0 09460.0 68220.0 022090. | . .010501. |**.0 229090.079281. .0 998980. |**. .0 32190. | .087802. . .0 056180.0 776540. |* . .055210.0 51730. . . |** . | .0- 592.**| ***| ******| *******| *********| ***********| ***********| .0672731.0 49430. | .0 09733. |* . | .1 35240. .0288810. | | | | | | | | | | 81540. | . | .0 66090. |* .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. .1 noitalerroC 275380. .026800.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. |********************| | | | | | | | | | | | 39360.0 30545.0 545280.0 97901. | .0 37182. .032941. *| . | .0 26161. | .0 348480.04013800. | . | . | . . . .0043583. |*** |**** |*** |**** |****** |**. .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 | | | | | | | | | | . .00000.0 190.

. |**.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.0 621480. | .51210.0 976180.1 noitalerroC 272620. | .0313701. |* . |**.0 qSihC > rP 6 FD 58.0 9628. | .008810.0 345640.58130.054530. | .0 984320.08810. |**.0- 210.079180.080220. |**. . *| . |**. .071860.2 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | . | .0517210. . | .0 196180.0 00000.0 180. | . | .0 47410.0 671840. | . | | | | | | | | | | 41120. .0 056180.031201.0 18101.0 26580. | .0- 210.0 445601. *| . | .**| . | .**| . .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 655280.015210.0 42330. *| .0 131380. . . .0 30640. |********************| | | | | | | | | | | | 01520. | . . |* .0 64180.0 21020. . | .042480. .5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) 88 SAS for Forecasting Time Series . *| . | .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.220. . | . |* . | . | | | | | | | | | | 26020.0733330.0 090380. . .0086910.0457210.046330.0 052580.0 445280. . | .0- 301.0 0 rorrE dtS | .0 95140. | .91210.0 53480. *| . . | . . | .0 39700.1 26751.0 09400.0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 7Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3.0 44220.0- 910.0 003380. | .076800. | .45201.

| | . . . | . .0 24373.0 303711. *| | .0 852972. .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 81910.0 1000. **| | .0 595253. .0 39256. . |* .1 noitalerroC 728241.0 38833.0 19660.0 88102. .0 78011.0 0 rorrE dtS | .077930. | . |* .601 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | .0 931.0 388051. | | | | | | | | | | | 73650.0 927.068980.0 81710.5 Using the IDENTIFY Statement for Series 1–8: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 89 .0 952621. *| | . . |* . .0 55950.0 430.1 50475.0 89330. . .0 83927. | | | | | | | | | | 83100.0 679421.1 239335. ***| | .0 95611. .0 38141.0 579621.0 612649. *| .**| .066520.**| .0 004953. . . .0 51931. .059000.0 620821. | . ****| .0 00000. *| | .0 170621.0 22250. | . |* . *| .083927. .0 500621. | .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 50010. .0 35700. |******* ***************| .0 660621.055540. |************* | | | | | | | | | | 46000. *| .0- snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM 8Y = elbairaV fo emaN erudecorP AMIRA ehT Output 3.0 37860. 756821.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 056180. .0 444592. . . | .0 82740.060. . **| | .0 010. | .0 70120.< qSihC > rP 6 FD 56.0 12011.0 374520.0 373.0 391848.0 390680.

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

| | | | | | | | | |

. . . . . . . . . .

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

| | | | | | | | | |

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

0530.< 5300.544 CIA 427850.0 950.0 050.461 22623.0300.0 601.1 etamitsE rorrE dtS 598021.0150.461 77.5 79.tnanimreted gol edulcni ton od CBS dna CIA * 051 slaudiseR fo rebmuN 2208.1RA 1.1AM UM retemaraP setamitsE retemaraP fo snoitalerroC .0)8y( UM )8y( 1.1AM UM retemaraP noitamitsE serauqS tsaeL lanoitidnoC Output 3.0 2099.461 22613.2 erauqS -ihC 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.1eulaV t 92790.0 qSihC > rP 82 22 61 01 4 FD 91.0400.0 920.222.0400.0- 87.0 1.454 CBS 3077.0 22123.0760.461 87.31 57.1 610.1 096.0 01801.0 rorrE dradnatS 95425.461 22123.065782.0 340.1AM :setamitsE raeN dirG no ecafruS ESS 430.0110.1RA 1.0 000.0 510.0 730.87.0 280.0 610.0 010.0 1.0041.0 7422.461 87.0 930.1AM 450.0 430.1 UM 1.0 950.0400.0etamitsE 1.00299.0 000.1RA 096.0600.1 etamitsE ecnairaV 17631.461 87.0etamitsE tnatsnoC 1 1 0 gaL 1000.461 77.0 8579.0990.0220.065292.3 80.10 Using the ESTIMATE Statement for Series 8: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 99 .0 |t| > rP xorppA 93.5 22.0 430.0 200.0 450.461 87.11 97.0 700.0 830.065782.0100.0 7127.0 3269.0- 77.0- 65282.0 78532.

1RA :setamitsE raeN dirG no ecafruS ESS 87.065292.461 87.461 87.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 .0 97.0 87.461 95925.461 87.0)8y( 1.461 77.degrevnoc evah ton yam setamitsE :GNINRAW .1AM )8y( 1.461 87.461 95915.0 77.461 87.022123.0 1563.461 87.022623.detanimret neeb sah ssecorp noitareti ehT .1 :1 rotcaF srotcaF evissergerotuA 65782..461 77.elbatsnu si setamitse wen eht yb denifed ledom ehT :GNINRAW )1(**B 22123.461 slaudiseR derauqS fo muS 660811.461 95925.0 87.461 87.10 Using the ESTIMATE Statement for Series 8: PROC ARIMA (continued) 100 SAS for Forecasting Time Series .1 100.461 77.441 942726.0 .461 77.0)8y( UM )8y( 1.461 97.0 + 1 :1 rotcaF srotcaF egarevA gnivoM )1(**B 95425.461 95915.0 10000.degrevnoc evah ton yam setamitsE 02 100.0 65282.461 95425.461 95425.0 7346.065782.0naeM detamitsE 8y elbairaV rof ledoM 77.1RA :setamitsE raeN dirG no ecafruS ESS Output 3.0 22613.

0141.1RA 1.0 2.1RA 2.0 920.262.< 0960.0 430.0 165.0 8919.11 87.0 830.0 730.1AM UM retemaraP noitamitsE serauqS tsaeL lanoitidnoC Output 3.0 13086.0 2429.1AM 1.0551.0530.0400.0110.02.1 .091525.1RA 1.0 rorrE dradnatS 36525.0 430.0 700.1 17.0eulaV t 39881.1 96913.0 + )1(**B 91525.)2(**B 96913.1RA 369.0 9453.0 340.1 etamitsE ecnairaV 31000.0 551.0990.0244.1 48.1AM UM retemaraP setamitsE retemaraP fo snoitalerroC .0 .0 86963.0etamitsE 2.)1(**B13086.0 6179.0852.0329.4 38.1 etamitsE rorrE dtS 374531.0 000.464 CBS 8356.0 .tnanimreted gol edulcni ton od CBS dna CIA * 051 slaudiseR fo rebmuN 707.31 67.0 53503.0 010.0 qSihC > rP 62 02 41 8 2 FD 02.0 032.0 8760.1 UM 2.0220.01.0300.0 050.1RA 244.0150.0 280.0 96753.0 950.0 |t| > rP xorppA 87.0700.1 369.0- :1 rotcaF :1 rotcaF naeM detamitsE 8y elbairaV rof ledoM 530.1AM 1.0 950.1RA 2.0 65034.0 000.0200.0860.01.5 22.0 200.0732.01289.0 601.0000.0100.0479.0400.10 Using the ESTIMATE Statement for Series 8: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 101 .944 CIA 685560.1 852.0 3974.1AM 732.0336.1AM 329.2 erauqS -ihC 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.1 srotcaF egarevA gnivoM )2(**B 36525.0etamitsE tnatsnoC 2 1 2 1 0 gaL 1600.0 032.3 70.0 479.0 610.0 730.1 srotcaF evissergerotuA 53503.1 336.0 1000.1 165.0 84471.0000.

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

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

Also. but predictions are given for the original series levels.( 1= i Σ+ − j +nY t n Y( j W t Y Y Σ . modeling is done on the differenced series. you can easily derive the forecasts and their variances from the model.5jWn as the prediction. Y2.. you predict future values by first predicting future values of Wn+j. Yn from this series.104 SAS for Forecasting Time Series 3. + t e = ) 2 − tY − 1− tY(5. by using estimated parameters and by estimating from the model residuals. 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. Given data Y1. the following computation of forecasts shows a few values of Yt.4.6 Effect of Differencing on Forecasts PROC ARIMA provides forecasts and 95% upper and lower confidence bounds for predictions for the general ARIMA model. Now j so the forecast of Yn+j is n To illustrate further.. so the forecasts converge to 550 + (1)(32) = 582 2 σ +nW + . using .( i Y− Y= = n 1= i Y j t )5. prediction error variances increase without bound as you predict further into the future. In general. the first differences 1− t are stationary. when you specify a model with differencing. in the model t note that t Thus. For example. . PROC ARIMA accomplishes this task for you automatically. . − ) 1− tY − 2 + nW e = 2− tY5. . . If you specify differencing.1 − + 1+ nW W )5. Wt. + 1− tY5.

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

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

| ******************| . |*. | .0 50020.0 582961.011910.0 472922.0 19720. |********************| | | | | | | | | | | | | | | | | 78088.0 71659.5466 177. |*.0 58910.028610.0 38369.038901. | *******************| .| | | | | | | | | | | | | | | .8686 926.0 34798. |********************| .0 95800.0 99079.0 71988. | *******************| .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 177980. | .0 04399. **| .0 82039.0 271691. | *******************| .0 09589.8436 794.0 01419. |*. | *******************| .0 09230.083870. . | .040715. .9826 290.0 0 rorrE dtS | ******************| .7186 334.0 596351.5076 785. .3676 018.0856 104." 049462.0 850250. | . |*. .0 749832.0 733381. |********************| .1 noitalerroC 149.077610. | . | *******************| . .0 93720.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 ". . | ******************| .12 Identifying the IBM Price Series Chapter 3: The General ARIMA Model 107 . .0 80879.0 99749.3796 669. .8196 419.6207 856.0 51229. . | ******************| .0 344511. | .0 950631.052720.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.0 38509. |** . |********************| . | ******************| .2256 844. | .0326 466.0 93090. . **| . | *******************| .0 399812.7046 010. .0 800802. |********** | | | | | | | | | | | | | | | 37600.0 870842.0 627652. | ******************| .0 64939.0 00000.6646 589.

049330. |********************| .0 039. | .0 469.2498270.069350.046170.0 419. | . | . | **| .23450.0 939.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.7 98972. |*.0 46350. |*. | **| .357250.054800.0 1000. |*. | .0 03820. | .5312 erauqS -ihC 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | .< 1000. | .0 905250.0 52320. | . | .85580.4 905835. | | | | | | | | | | | | | | | 96410. | .0 229.< qSihC > rP 21 6 FD 04.0 0 rorrE dtS | **| .042180.0 327250.0 849.*| .01 gnicnereffid yb detanimile )s(noitavresbO snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM gnicnereffiD fo )s(doireP ECIRP = elbairaV fo emaN 609.93100. | . | .6 164162.0 399.0 921250.0 689.053510. | .0 905250.0 659.0 78100. | . | . | . |*. | .7904 13. |*. |*. | .0 879. | .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. |*. | . | .1 noitalerroC 460053. |********************| | | | | | | | 68021. | .1957358. |*.0 00000.031620.0 179.040210. | .004399.022440. | .0410694. | .12 Identifying the IBM Price Series (continued) 108 SAS for Forecasting Time Series .1718028.0 10420.0 266250.66430.

019001. . |*. . **| .*| . .0 76680.4 812941.0 220450.*| .3606178.0 03660.058350.2 887340.0 640450.0 43070.056520.*| .0 52860. .12 Identifying the IBM Price Series (continued) Chapter 3: The General ARIMA Model 109 .083620.3 51 41 31 21 11 01 9 8 7 Output 3. .*| . |*. | | | | | | | | | | | | | | | 06650. |** **| . .0 36620. | .0 55420.0 | | | | | | | | | .086780. .0 005350. . **| . .*| . | .16350. . | .038050. |** .*| . |*.057320.75560. . .1 527585.0 006450.| | | | | | | | | | | | | | | .0 108350. .*| .0 57740.0 23040. .006420.0 04910. .*| . |** | | | | | | | | | | | | | | | 26350.0 55540. | . .0 784450.0 19221.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 | | | | | | | | | | | | | | | . | .2993618. |*." 418450.093970.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 79670. |*. .0 100074.090870.0 637350.0 63210.*| .0 24770. |*. **| .*| .0 04130.019170. |** . .0 14260. .0 78120. |*. . . | .084140. .077800.*| .*| .3 407805.26530. . | | | | | | | | | 50660. |*. .*| .006950. .0 10540. |*. . | .085580. |*. **| .0 343450. .1 682384. .3101544. .

98 and 17.0 26VON2 OT 16YAM71 SECIRP KCOTS YLIAD MBI B SEIRES noitamitsE serauqS tsaeL lanoitidnoC 220.0 420. In fact.42 are not significant. in the regression of Yt on Yt–1.0 530.0|t| > rP xorppA 0790. it is common to find an indication of a lag 1 MA term.0 680. therefore.0450. RUN. ESTIMATE Q=1 NOCONSTANT.0 esioN etihW rof kcehC noitalerrocotuA qSihC > rP 4431.0etamitsE 85680.0158.1AM FD 21 6 erauqS -ihC 24.0860. The first autocorrelation is 0.0 121. 0. The ACF of the differenced series looks like white noise.0 1. Next. the Q statistics 9.71 89.0rorrE dradnatS 30250. so 9. the probability of a value larger than 9.99340.13 Analyzing Daily Series with the ESTIMATE Statement: PROC ARIMA retemaraP --------------------snoitalerrocotuA-------------------450. 6 2 The results are shown in Output 3.126.1erudecorP AMIRA ehT 660.0 6521. The PACF indicates a very high coefficient. IDENTIFY VAR=PRICE(1) NOPRINT.9 χ gaL oT 21 6 .110 SAS for Forecasting Time Series Output 3.1052 211632. The Q statistics are computed with the first six (9.42) autocorrelations of the differenced series.12 Identifying the IBM Price Series (continued) The ACF dies off very slowly.0 100.13.0 CBS CIA etamitsE rorrE dtS etamitsE ecnairaV 630.98 in a distribution is .5052 349.7 23163.98 is to the left of the critical value and. is not significant.052.0 gaL 1 770. 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. For example.25 eulaV t 66.08558 with a standard error of about 1/(368)1/2=.98) and first twelve (17. With a first difference. Output 3.

0 7122.0 270.0 311.0 620. --------------------snoitalerrocotuA------------------- 750.0 220.0 8910.0550. In this example.6 erauqS -ihC 84 24 63 03 42 81 21 6 gaL oT Output 3.0700. IDENTIFY VAR=PRICE(1) NOPRINT. you ignore an autocorrelation 0.0070.66 is significant at the 10% level. The t statistic –1.0- .0 021.0 750.0001.31 99. therefore.0 040.14.0150.0980.0660. More attention should be paid to the lower-order and seasonal autocorrelations than to the others.0 720.0 520.0 820.0 660.0 6910.0 140.0811. FORECAST LEAD=15.0 2210.0470.0 100.0150.93 40.04 that attains significance because of autocorrelations .0 450. ESTIMATE Q=1 NOCONSTANT NOPRINT.0slaudiseR fo kcehC noitalerrocotuA 1 )1(**B 85680.0 2110. residuals from the final fitted model show a Q statistic 31.13 Analyzing Daily Series with the ESTIMATE Statement: PROC ARIMA (continued) .0 qSihC > rP 4400.0 420.118 and .0 500.0580.67 24.0 4900.0 060.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.tnanimreted gol edulcni ton od CBS dna CIA * 863 slaudiseR fo rebmuN 500.65 38.0 360. See the forecasts in Output 3. make a third run to forecast: PROC ARIMA DATA=IBM.0 820.121 at lag 6 that was even bigger than the lag 1 autocorrelation.0 810. The model appears to fit.0 530.113 at lags 16 and 17. Ignore this significance in favor of the more parsimonious MA(1) model. you nevertheless fit the MA(1) model.0270.0 990.0 :1 rotcaF 611.0 970.0 710. Similarly.0srotcaF egarevA gnivoM gnicnereffiD fo )s(doireP 730.0 270.0650.ledom siht ni mret naem oN ECIRP elbairaV rof ledoM 370.46 74.0 030.0 + 1 .0 5632.0 950.13 49.0180.0 930. RUN.94 50.0 960.0 74 14 53 92 32 71 11 5 FD 33.

The t test on µτ p − tY 7583.7 0692.133 3044. or  .173 7267.753 7383. . The test involves a regression of where p is at least as large as the order of the AR process or. unlike PROC FORECAST with METHOD=EXPO. however.112 SAS for Forecasting Time Series If 1− te as in the IBM example. .01 1632. 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.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∇ . in the case of the mixed process. . PROC ARIMA.873 2665.753 7383. .614 2827.92 6181.82 erudecorP AMIRA ehT Output 3.ledom siht ni mret naem oN ECIRP elbairav rof stsaceroF ECIRP elbairav rof ledoM srotcaF egarevA gnivoM gnicnereffiD fo )s(doireP rorrE dtS 6662.31 6586.753 Y − 1− Y t ∇ t 2 − tY( .203 1 )1(**B 85680.14 Forecasting Daily Series: PROC ARIMA ∇ .. then by repeated back substitution .003 7841. Said and Dickey (1984) extend the test to ARIMA models.753 7383.03 9752. Higher degrees of differencing plus the inclusion of more MA terms is equivalent to higher-order exponential smoothing. estimates the parameters from the data. is large enough to give a good is called because it does not have approximation to the model.. .383 0723. .343 7400.0 + 1 :1 rotcaF .414 7816. Forecasting Yt by such an exponentially weighted sum of past Ys is called single exponential smoothing.633 2102. 1− tY ]senil tuptuo erom[ + ) 3− Y − tsaceroF 7383. .214 stimiL ecnedifnoC %59 26VON2 OT 16YAM71 SECIRP KCOTS YLIAD MBI B SEIRES 7183.753 7383.892 2930. .753 7383. + 3− t so that ).

“Simple Models: Autoregression. the coefficient of will be negative. 3. 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.1.Chapter 3: The General ARIMA Model 113 a Student's t distribution and must be compared to tables provided by Fuller (1996. then So the term drops out of the model and forecasts do not revert to the mean. This does not mean the test cannot be done. With a little algebra. . regressions they studied.4.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 . suggesting a one-tailed test to the left if stationarity is the alternative. but it does require the tabulation of a new distribution for the test statistics.8 Models for Nonstationary Data You can formally test for unit root nonstationarity with careful modeling and special distributions. Y− Y t t t t Y∇ Y∇ Y∇ t t t . 642). Here ) 1= M . p. There is. t . The silver series from Chapter 2. The leftmost column of the following tables shows the denotes a first difference. 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.” is used as an illustration in the next section. however. 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 . even when the neither the estimated coefficient of sample size becomes very large.1. one major problem with this idea: nor its t test has a standard distribution. If all roots M exceed 1 in magnitude. ssergeR t 1− t t .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 ). 1981) studied the distributions of estimators and t statistics in autoregressive models with unit roots. Dickey and Fuller (1979.

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

642).16. this statistic has the distribution tabulated by Dickey and Fuller.267.Chapter 3: The General ARIMA Model 115 Because this test involves only the lagged differences. Although the sample size here is not particularly large.6 87. stseT tooR tinU relluF-yekciD detnemguA F > rP F 4843. p. 68.1 sgaL dnerT naeM elgniS naeM oreZ epyT Output 3.72 erauqS naeM 08715. RUN.0 2326.0 1210.15 Test of Augmenting Lags . The second PROC REG produces Output 3. This is an error because all p-values from PROC REG are computed from the t distribution whereas. thus providing no evidence against leaving out all but the first augmenting lag.05.0 2011.17 Unit Root Tests. 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.0079 is less than 0.< 9700.0 0085.16 PROC REG on Silver Data FD elbairaV Because the printed p-value 0.0 F > rP 3082.2 eulaV F 23.0 LED elbairaV tnednepeD rof stluseR 1 tseT eulaV t 12. The appropriate 5% left tail critical (Fuller 1996.0.17 contains several tests. I VAR = SILVER STATIONARITY=(ADF=(1)) OUTCOV=ADF.2803 is not even close to 0.0 59363. This test is also available in PROC ARIMA starting with Version 6 and can be obtained as follows PROC ARIMA DATA=SILVER.0 68.1 rorrE dradnatS 60801.0 2800. Silver Data |t| > rP 1000.05.178 11791.51.0 61240.0 92.3 uaT < rP uaT 7962. Output 3.2 Output 3.1 1642.037085. Nonstationarity cannot be rejected.282.287. the p-value 0. under the null hypothesis of a unit root.1 5497.0- ohR < rP ohR 3831.4 7911. 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 9860.71.0 36.57 FD 14 3 rotanimoneD rotaremuN − 1 1 1 ecruoS 1LED REVLISL tpecretnI Output 3.0 30711.

2 )251176. − 1(/ )430711.116 SAS for Forecasting Time Series Every observed data point exceeds 400. the PROC REG output strongly indicated that one lagged difference was required. )1 − ρ(n ˆ 87. However. is an estimate of m. These tests are seen to provide even less evidence against the unit root. 0H 5497. 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. 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. The 50 observations studied thus far do not display any noticeable trend.1 = ρ : 0H . For the silver data. This is no surprise. The associated tau test.05 level against the unit root null hypothesis. the regression model AR(1) model with coefficient form becomes )1 − ρ(n ˆ t so that the coefficient of is in terms of the roots. the tau tests are preferable to these normalized bias tests. In summary. . then.0121) less than 0. Also.0− (05 . Similar adjustments can be made in higher-order processes. has a p-value exceeding 0. as any statistical hypothesis test requires a realistic model for the data. 0. If interest lies there is no advantage to using the F statistics.0 ( ρ t − t ) m − 1()ρ − 1( − . so the model with a constant mean seems reasonable. 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 . − . ρ t t − 1− Y ( t . then multiply by n. based on simulated size and power results (Dickey 1984).71 − = )251176. although tests based on the model with linear trend would be valid and would guard against any unrecognized linear trend. in order to get good power.05.05 and hence fails to provide significant evidence at the usual 0. The F type statistics are discussed in Dickey and Fuller (1981). Furthermore. so any test from a model that assumes a 0 mean can be ignored. the adjustment for lagged differences is motivated by large sample theory and is not particularly large. 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. If it is seen that the coefficient of . in terms of lags and trends. getting a test with validity and good statistical power requires appropriate decisions about the model. Thus the tests with no lagged differences can also be ignored and are not requested here. is shown in the printout and has a p-value (. ρ 05 = n 1− t 1− t Y− Y t Y ) 2− tY .671152 in the silver example.

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

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

the IACF will die off slowly. These too show a trend. Output 3. This is in line with what you've learned about unit roots on the autoregressive side. 1− t eρ − te = .20 shows the volume of the same Amazon. Output 3. te = t Y t Y )B ρ − 1( .20 Amazon Volume ρ . to die off slowly.com stocks. 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. but notice the IACF of the differenced series.Chapter 3: The General ARIMA Model 119 In contrast. If a series has a unit root on the moving average side.

0 81352000.120 SAS for Forecasting Time Series This behavior is expected anytime is the difference of an originally stationary series. 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. Of course a linear trend in the data will make the ACF of the levels appear to die off very slowly.005951000.0 34378.5 06.71- Y FD 1 1 1 FD 1 1 1 1 1 CGAL etad tpecretnI 2VD 1VD VGAL etad tpecretnI elbairaV elbairaV .4 51340.0 93931.0 6200. t.3 etamitsE retemaraP 01920. as appears to happen in the volume data. LAGC and LAGV as the lag levels of closing price and volume.< eulaV t 95. the parameter estimates from PROC REG using the differenced series as a response.608.1 40296. They find that an essentially linear descent in the IACF is consistent with overdifferencing. Output 3.< 1000.0 rorrE dradnatS 77340. and lagged differences indicated that no lagged differences were needed for the log transformed closing price series and two were needed for volume.2- eulaV t 08.0 SS I epyT |t| > rP 9900. Using the indicated models.0 27460000.0 52640. respectively.0 09511.0 26420. Regression of differences on 1.21. This can follow an initial drop-off.074100.264.0 99430.0 SS I epyT 20561.0 |t| > rP 2000. a lagged level. as is also apparent in the volume data. and lagged differences DV1 and DV2 for volume are shown in Output 3. Chang and Dickey (1993) give a detailed proof of what happens to the IACF when such overdifferencing occurs.2- etamitsE retemaraP 12661.0 52225000.069931.0 1410.0 36434.045322.0 88510.0 1000.5- setamitsE retemaraP setamitsE retemaraP rorrE dradnatS 42110.0 6410.2 54.330. DATE as the time variable.52 94300. You just need to think a little outside the class of ARIMA models to models with time trends and ARIMA errors.< 1000. The apparent mixed message-differencing indicated by the levels’ ACF and too much differencing indicated by the differences’ IACF is not really so inconsistent.393.21 Closing Price and Volume— Unit Root Test t 10520.

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

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

produces very wide forecast intervals on the original scale. and then the IACF of the differenced series indicates that you have overdifferenced. Some practitioners are under the false impression that differencing is justified anytime data appear to have a trend.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. 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. Hall (1992) studies several methods and finds that overfitting lagged differences then testing to leave some out is a good method. 3. You can obtain the correct analysis in this particular case by regressing Y on t using PROC REG or PROC GLM. 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 lagged differences. Note that if Yt has a linear trend then the differenced series 1− t t involves only the constant. The linear trend plus white noise model presented above is interesting. Both of these show inappropriately small p-values when the p-values are computed from the t rather than from the Dickey-Fuller distributions. To get tests with the proper behavior. suppose t where et is white noise. Bell. While this may disappoint the analyst. 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. In summary. This was illustrated in the silver example and was done for all examples here. Now the IACF of W looks like the ACF of a time series with a unit root nonstationarity. ignorance of unit roots and deterministic trends in time series can lead to clearly inappropriate mean reverting forecasts. 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 . This is discussed next. unfortunately. that is. such differencing may or may not be appropriate. Thus. 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. the data have been overdifferenced. For example. the IACF of W dies off very slowly.4. practitioners difference data to remove a linear trend. You can detect overdifferencing this way. In the regression of differences on trend terms. The ACF of the original data dies off slowly because of the trend. Dickey. it might nevertheless be a reasonable assessment of uncertainty. You respond by differencing. given that 95% confidence is required and that this is a volatile series. Note also that the combination of logs and differencing. is a noninvertible moving average. In fact.9 Differencing to Remove a Linear Trend Occasionally. while it makes the transformed series behave nicely statistically. lagged level. Then which does not have a trend but. while careful modeling of unit roots and deterministic trends can lead to quite reasonable and informative forecasts.

IDENTIFY VAR=NONPUB(1) NOPRINT. Bureau of Labor 1977) shown in Output 3. you do that fitting by specifying these statements: PROC ARIMA DATA=WORKERS. β .S. TITLE 'PUBLISHING AND PRINTING NONPRODUCTION WORKERS'.23. is stationary.124 SAS for Forecasting Time Series Output 3. ESTIMATE Q=1.24 is obtained by specifying the following statements: PROC ARIMA DATA=WORKERS. 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. . The data are the percentages of nonproduction workers in the industry over several years. RUN. 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. IDENTIFY VAR=NONPUB(1) NLAG=10. FORECAST LEAD=10. RUN.

The number 0. ESTIMATE.0 470810.26390.0 68690.0294410. Note that the MU (0. |** | .0 00000.0 565520.74601. *| | .0146010. look at the two standard error marks on the ACF).0 0 rorrE dtS | .0 890791.0 718791. Also. |* | . . it is a negative number. |** | .23040.3033) estimate is statistically significant and is roughly the slope in the plot of the data.0 870471.0 477191.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. . With only 33 observations.3033 is sometimes called drift.0 743591.0 196430. and their t statistics .0101820.0 2249700. .1 noitalerroC 3736100.0 90030. you have little evidence of overdifferencing.0 30303.19450.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. in fact. | | | | | | | | | | | 02600. |* | .0 44131. ***| | . the MA coefficient is not near 1. **| | .0 582091.0807420.24 Modeling and Forecasting with the IDENTIFY.551991. .0783280. Thus.0 84860. . you have a lot of sampling variability (for example. . .0 719191. .61213.0 626491. *| | .0 978491. | | . and FORECAST Statements: PROC ARIMA The output shows a good fit based on the Q statistics the parameter estimates.******| |********************| .0 039362. Chapter 3: The General ARIMA Model 125 . .

ESTIMATE. . | | | | | | | | | | 85001. *| .550. ***| . *| .0- 213. |* .0 94651. .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. .061213.079900.0 44934. **| . . | . |* . .0 790.074221. . ***| . .0 68910.0 131. .079230.091250.061180. .0 83720. | . **| .24 Modeling and Forecasting with the IDENTIFY.******| . . .066622. . |**** .0 82512.003690. |** . |** .0 20160.4 erauqS -ihC 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | .0- 040. .0 37551. *****| . |********* | | | | | | | | | | 59670.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 | | | | | | | | | | .072841.0 6175. |** . . |*** . . |* . .0 030.0 95340. .0 qSihC > rP 6 FD 97. and FORECAST Statements: PROC ARIMA (continued) 126 SAS for Forecasting Time Series . |* .089830. .

0 rorrE dradnatS 62664.0630.1 3303.0 320.84 CIA 482884.0911.0 1.0980.0330.1 UM 1.0 760.0 9169.0 411.0 qSihC > rP 32 71 11 5 FD 70.15 CBS 91472.1 600.0 gnicnereffiD fo )s(doireP naeM detamitsE BUPNON elbairaV rof ledoM 750.7 08.0 750.0 020.0 3910. ESTIMATE.tnanimreted gol edulcni ton od CBS dna CIA * 33 slaudiseR fo rebmuN 2762.274.0 230.09099.0390.0 |t| > rP xorppA 98.1AM UM retemaraP noitamitsE serauqS tsaeL lanoitidnoC erudecorP AMIRA ehT 7791-4491 SREKROW NOITCUDORPNON GNITNIRP DNA GNIHSILBUP Output 3.0 etamitsE 1.0 49221.0300.1 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.0700.0 etamitsE tnatsnoC 1 0 gaL 0700.0720.0 etamitsE rorrE dtS 224832.24 Modeling and Forecasting with the IDENTIFY.0 4579.0 571.0 460. and FORECAST Statements: PROC ARIMA (continued) Chapter 3: The General ARIMA Model 127 .0270.0 6779.0801.0100.01 14.0 000.0751.1AM 600.0 etamitsE ecnairaV 3303.3 10.0 450.003303.2 eulaV t 84161.1AM UM retemaraP setamitsE retemaraP fo snoitalerroC .0 580.0321.

24 )1(**B 62664.1 1421.44 1071.24 5606.128 SAS for Forecasting Time Series Output 3.4.24 Modeling and Forecasting with the IDENTIFY. 1− eβ − e = 1− Z α − 1679. IACF.14 2709. 1985) develop the ESACF and SCAN methods and show they even work when the autoregressive operator has roots on the unit circle. These methods can be understood through an ARMA(1. ESTIMATE.94 3159. 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 .54 0080.64 9989.84 5063. .0 :1 rotcaF t t tsaceroF 2392. Tsay and Tiao (1984.1 4028. . and FORECAST Statements: PROC ARIMA (continued) srotcaF egarevA gnivoM 3. three methods called ESACF. 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. The ARMA(1. and columns MA 0.05 7270. and PACF.44 8668.05 6025. SCAN. etc.34 t t t e = ) 3− tY − 1− tY (7. … . MA 1.1) example. For ESACF and SCAN should give 3 as the autoregressive order.1 7376. You look at the table entries to find the row and column whose labels give the correct p and q.54 6025. 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 .0 − ) 2 − tY − Z sbO 44 34 24 14 04 93 83 73 63 53 … . AR 1.14 6118.10 Other Identification Techniques In addition to the ACF.2 1380.1 = )0 (ρ Z .74 3373. These consist of tables with rows labeled AR 0. 2− t 1> j Z Z ({E 1− t t Y( .14 4518.2 2659.44 4374.14 3168.14 3861. in which case rather than p is found.0 + 1 BUPNON elbairav rof stsaceroF d+p t rorrE dtS 7202.14 9669. etc. and MINIC are available for simultaneously identifying both the autoregressive and moving average orders. 1− t … Z based on t .44 stimiL ecnedifnoC %59 ) α − β( + α − 1[/ ])βα − 1()β − α([ = )1(ρ .1 7233. 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 .54 3383. Suppose you have the where is the deviation from the mean at time t.34 5365.84 9147.1 6668. That is.64 4565. are 4016. k − tZ . or “projecting” onto the space spanned by a theoretical regression” of .0 3884.14 6258.54 7677. and Z .14 6997.1) process )1 is minimized.1 9215. This is sometimes referred to as “performing on .74 5580.54 6686.

F T AM E Y L in the ARMA(1.1R 22C + 1 − tZ12 C That is. 1− t Z t Z . say and which give the same fit. is which is a 1− t . (See Section . 2−t Z 1− t Z linear combination of and so regressing on and produces regression on and .3. In general neither the sequence nor any sequence contains the autoregressive coefficients unless the process is a pure autoregression. 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 .2 . 1= k kk φ = kπ Letting 3.1) example. 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.1− t eβ − te . the coefficients satisfy  22   11  C   φ−  12C   1 0   22φ  =    12φ  1 . 2 − tZ 22 φ+ 1 − tZ12φ =) 2 − tZ11 − 1− tZ ( 22C φ + 1 − tZ12C = 1 − t.α . Still. 22 C 12 C coefficients. 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. 22 Thus it must be that 1− t Z t Z . or projection.2.1R 1− t Z t Z The lagged residual from the theoretical regression of on C order q (1 in our example). The trick is to discover p and the s from the data.) for … produces the sequence of partial autocorrelations. 22 C11φ− = 22φ and In matrix form you have . 2 − tZ11 φ− 1 − tZ = 1 − t. 1− t Z11φ − Z Zα − Z t t . 2− t t t Z . as regressing 1 − t.3.1 R 1− t Z t Z . 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 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 π . Increasing k beyond 1 will not solve the problem.

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

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

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

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

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

0165711.0 5 AM 0882.0205771.04493.03040.0 2 AM 54130.0 1000.073530.068340.020540.0 4704.0 2969.0 6810.2 3 1 q 5 4 1 d+p FCASE )leveL ecnacifingiS %5( stseT noitceleS redrO evitatneT )q.0 4810.082420.0 2310.0 0465.0 2 AM 7771.0 1000.027320.0 1000.069630.02530.085930.040440.0 9213.0 1000.0 3571.0 4789.074030.0 1000.03992.0 9110.0 7140.0 1000.029710.0 1000.0 3106.0 1 AM 1000.0 4 AM 6330.0751820.0 1000.0 0857.0 4650.04150.0 2 AM 1000.0353950.0 5447.0 3622.0 0 AM 5 4 3 2 1 0 RA RA RA RA RA RA sgaL noitcnuF noitalerrocotuA elpmaS dednetxE 73840.06233.0 7910.0 1000.066320.0 4367.0 1 AM 6384.0 4812.0 2091.011710.= )0.0 0630.0 4 AM 7710.d+p(AMRA 1588.0 1000. SCAN and MINIC Displays Chapter 3: The General ARIMA Model 135 .056530.0 9841.0 3975.0 1 AM 33830.086140.0 0100.0 1000.0 6000.035110.072030.0 1000.05100.045820.0 1594.0 1000.07532.05752.0 0 AM 5 4 3 2 1 0 RA RA RA RA RA RA sgaL noiretirC noitamrofnI muminiM Output 3.035740.02491.04754.25 ESACF.0 3 AM 16420.08800.00200.0 3 AM 1380.0 8959.02420.065482.082030.0 5 AM 67110.0.0 6110.0 5 AM 8830.0 3006.0 0 AM 5 4 3 2 1 0 RA RA RA RA RA RA sgaL seulaV ytilibaborP FCASE 1500.012140.0 4 AM 9873.0 1000.07651.0 5401.3(CIB :eulaV elbaT muminiM )9(RA :ledom seires rorrE 79400.05505.0778300.0 7043.073840.07021.0 7120.0 3 AM 3370.

)1.0 β 4 − tY 5.0 5543. occurs at the correct As a check on the relative merits of these methods.0 1000.0 3394.0 1200.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 7904.0 7676.0 2000.0 0100.0 5976.0 3840.3. .0 2000. { = )q .0 2000. the results are saved.0 2000. A final set of 600 runs for using gives the last three columns.0 1000. )leveL ecnacifingiS %5( stseT noitceleS redrO evitatneT )q.0 7789.d+p(AMRA setamitsE noitalerroC lacinonaC derauqS seulaV ytilibaborP ]1[erauqS-ihC NACS = α t Y 3 AM 3 AM 1000.0 9420.0 1000. The MINIC criterion uses estimated white noise series.05 by default).0 . 50 ARMA(1.35740. .0 8000.0 2000.0 0100.0 2000.0 3147.0 β α( 0 AM 0 AM 5000. − + t e+ 4 AM 4 AM 2000.0 8786.0 7652.0 0711.0 1119. Asterisks indicate the correct model. and the estimated p and q are extracted for each method.0 1417.0 7000.0 1100.0 − 1− te3.0 7646.0 2000.25 ESACF. to create the the top of the list. These are listed in descending order of size (below the tables). then selects as the order.9. size being the number of elements in the triangle or rectangle.0 1000.1) order at a preliminary AR(9) model.0 4006.0 8558.p ( 5 AM 5 AM 4000.136 SAS for Forecasting Time Series Output 3. .0 0410. 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.β ≠ α 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 8000.0 1473.0 0760.0 1000. )0 .0 3651. For each.0 3622. the ESACF.0 1000.0 1000. and MINIC methods are used.0 5491.0 5395. p ( 9= k − 2 AM 2 AM 2000.0 8100.0 7430.0 2293. 1 AM 1 AM 1000.0 .0 3153.0 9481.0 2000.0 0 1 q 3 1 d+p NACS ) . SCAN.0 6676.0 0227.0 0100.0 0766.3. The second smallest SBC. .0 0807.0 1366. In our example ESACF (previous page) and SCAN (above) list the correct (1. .0 3000.0 1337. this also being one choice given by the SCAN option.0 1379.0 2000.0 3200.0 1000.1( 05 = n }9. The whole experiment is repeated with series of length 50.3( = ) q .0 0824.0 2000.0 2000.

finding a random sample of 10 men whose shortest member exceeds 6 feet in height would be extremely rare. happens rarely—not the 30 times you would expect from .1) with parameters in this range.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.1(AMRA -<| |>.Chapter 3: The General ARIMA Model 137 It is reassuring that the methods almost never underestimate p or q when n is 500. Thus the appearance of a significant bottom-rightcorner element in the SCAN table.05=n )1. The SCAN and ESACF columns do not always add to 600 because. which would imply no rectangle of insignificant values. even if 5% of men exceed 6 feet in height. for some cases. By analogy.4(AMRA -<| |>. Because SCAN compares the smallest normalized squared canonical correlation to a distribution ( ) that is appropriate for a randomly selected one.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 |>. no rectangle or triangle can be found with all elements insignificant. it appears that SCAN does slightly better than ESACF. For the ARMA(1.005=n )1. with both being superior to MINIC. it is also very conservative.(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 χ .

Also shown are the differences (upper-right corner) and the corresponding log scale graphs.4 ( = )q . The data require differencing and the right-side graphs seem to indicate the need for logarithms to stabilize the variance. + t e+ 4 − tY 5.26 shows monthly interbank loans in billions of dollars. = t Y )1.05 =n 1− te3. Output 3. 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.26 Loans . Output 3. There does not seem to be a universally preferable choice among the three.p ( .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. As a real data example.

0 7930.0 1000.0 1000.d+p(AMRA erudecorP AMIRA ehT 6381. called LOANS in the data set.< 2200.0 0200.< 4200.0 6580.0 8689.0 9100.0 7229.0 1 AM 8500.0 0490.0 2 AM 3000.0 5 AM 1000.27 shows the SCAN results.0 7647.0 4000.0 2000.0 3310.< 6799.0 8030.0 4000.0 2031.0 3000.0 1327.0 3400.0 7040.0 2491.0 5389.0 3300.0 4720.0 7130.< 1 AM 3161.< 2 AM 8767.0 8857.0 9030.0 8162.0 4310.0 1000.0 3574.0 3562.0 1000.0 6310.0 5219.0 4800.)leveL ecnacifingiS %5( 3 0 2 4 q d+p ---NACS---stseT noitceleS redrO evitatneT )q.0 4746.0 3 AM 7600. .< 0 AM 5 4 3 2 1 0 RA RA RA RA RA RA sgaL seulaV ytilibaborP ]1[erauqS-ihC NACS 8700.0 1399.0 5210.0 1880.27 SCAN Table for Interbank Loans setamitsE noitalerroC lacinonaC derauqS Output 3.0 2599. To identify the log transformed variable. RUN. IDENTIFY VAR=LOANS SCAN P=(0:5) Q=(0:5).0 2651.0 6393. Chapter 3: The General ARIMA Model 139 PROC ARIMA DATA=IBL. use this code to get the SCAN table.0 9851.0 6210.0 6700.0 3000.0 7300.0 7000.0 0 AM 5 4 3 2 1 0 RA RA RA RA RA RA sgaL Output 3.0 7300.< 5 AM 8079.0 1000.0 1000.< 4 AM 9074.0 9144.0 1000.0 1000.< 3 AM 1091.0 4 AM 2200.0 9989.0 3500. They indicate several possible models.

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

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

142 .

but ACFs are given for a few seasonal models.2. You should find a pattern that matches your data among these diagnostic plots.2.2. The forecast for the next December’s Y is 100+.1.1.3.4 732 kcattA tsirorreT 332 )noitnevretnI( eracS kliM 132 detisiveR seireS noitcurtsnoC 322 selaS liateR aniloraC htroN 761 elpmaxE dna ygolodohteM 3. Consider the model t where et is white noise. .3. as plus a proportion of last December’s deviation from If and last December’s Y=120.4 1.64(20).8j (20).3.4 1.µ 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.1.8(20)=116.4 4.001 =µ .2.4. =α .4 341 gniledoM lanosaeS ot noitcudortnI 1.4 3. followed by model identification.4 3.4 3.3. and the forecast for j Decembers ahead is 100+. The potential behavior of autocorrelation functions (ACFs) for seasonal models is not easy to characterize.4 21 t ( µ t 4.4 6.8.4 2.4 µ − −Y α = µ − Y 322 selpmaxE rehtruF 4.4.4 2.4.1 Introduction to Seasonal Modeling The first priority in seasonal modeling is to specify correct differencing and appropriate transformations.4 461 selbairaV yrotanalpxE htiw sledoM 2.4 2.4 4.2.4.4 1. for example.4 retpahC .1 Seasonal Time Series 4. This model is applied to monthly data and expresses this December’s Y. This topic is discussed first. the model forecasts this December’s Y as 100+.4 5.4 e+) 341 seireS emiT lanosaeS 1.4 The ARIMA Model: Introductory Applications 4.2.

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

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

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

3122 547. .0 677852. .814 983.6471 295.0 68410. |* . . *******| | .87 950.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. |***** **| . | | | | | | | | | | | | | | | | 87030.0 48240.0 54870.0 34132.0 57268.0 00000.0 05353.0 11332.6211 038.464 775.0 90864. . .0 76953. *| .0 92300. . .| | | | | | | | | | | | | | | . | .0 470242.709 639. .895 000.1 noitalerroC 402089.0 71320. | .0 927291. *| . . ***| | . 550003.0 76772.0 788252. .05 9414.068220.0 324892.498 100.0 84505.007384.0 18271.0 66843.1021 469.0 0 rorrE dtS | .015440. . .0 868082. . *******| | **********| | **************| | *****************| |********************| . *****| | . *******| | . ****| | . . *| | .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 224072. | .0 48000. ****| | . .344 011. *********| | .6921 392.0 78081. . . . . **| . | .002201. | .0 581362. .0 19012.0 082292.0 09520.0 791652.0 40361.0 961221. | . ******| | . *********| | .0 32934. .0 066942. | . . . *| . .145 603. |********** | | | | | | | | | | | | | | | 02730.0 31810.229 344. .023410. ***| | .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. .217 051.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 147 .0 177522.0 446452.0 26086. .

0 414.062311. .0040.< 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 :tnemetatS YFITNEDI eht htiw FCA eht gnitupmoC 2.0864. |* .991 45.1 66 23165.****| . |* .0 01600.0 19811.673 81. . **| . .< 1000.91 636311. *| .0 952.0 453.0111.512 50.0391. |* .0130.4 tuptuO 148 SAS for Forecasting Time Series . .0691.0 751. .0722.< 1000. | | | | | | | | | | | | | | | 41130.057268. .025230.0863.< qSihC > rP 63 03 42 81 21 6 FD 88.0 872.0 83931.0590. .060364.0 371. .0934.< 1000. |********* .0 505. .0842. |** .0 1000.034750. *| .0771.0063.571 30.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.0 89671.0 361.0 186. **| .0943.0181.0870.692 13.0 112. .0 26480.0864. .911 erauqS -ihC 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | | | | | | . **| .0 368.0 364. | .0 75460.022942. ***| .024450.0634. .0162.< 1000.0 32111.0482.0 332. |***** *****************| .0400.0 943.

|*****.025341.0 51380.37272. ***********| . ******| . |****.82980. .74131.0 426141.5811361.0 478571.401087703. **| .0 015112. |* . |****** | .9594767.051 546.0 53860. . .05887940. . |** . . *| .852 647. | . |*** . |* . *| . | . | . .15692. |* . *| . | . |* . |** .049750.072065.057602.401 103298.35995. |*****.0 38020.20380.0 0 rorrE dtS | .0 24970. .0 478951. |** .053720.0 59476.0 86992.035680. | . |* .098480. *****| . |*** .057070. |** . |* . *| . . . . |** .0 176341.411 862. | . | .070530. .0 955861.71456162.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. ********| .401954.0 638141.072293. **| . |*** . |* .0 467041.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 149 .43355513.040670. |*** . | . *| . | . | | | | | | | | | | | | | | | 34640. . .43 101. . | | | | | | | | | | | | | | | 67700.044260. .63372. | .0 508661.13 176. **| .0 04510. | .0 692961. . |****.085422. .0 19860.0 213151. .053351. | *************| . . |****.0 17660.1 noitalerroC 615182. | .069612. |********************| | | | | | | | | | | | | | | | | 62420.062870. .311953.0 47372. .0 948712. |** .0 190321. .0 34960. .070711. |********* **| . | .0 72293.0 472961.0 00000.33931.65440.071001. .0 98720.0 87932.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 | | | | | | | | | | | | | | | .| | | | | | | | | | | | | | | . | .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. .0 72744. **| . | .45980. *****| . | ********| .

0 1000.731 07. |* |********************| . .67 36.122541. *| | . .1 240587.0 421.171 60.0 824631.0380. |* | . .4 tuptuO 150 SAS for Forecasting Time Series . .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.121.9469716.< 4000.00000.1 gnicnereffid yb detanimile )s(noitavresbO snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM gnicnereffiD fo )s(doireP TCRTSNOC = elbairaV fo emaN 143.0180.0472.77810.0 077831.< 1000.0510.1 noitalerroC 327220.0- 041.< 1000.0 841.0- 521.0 94640. | | .58940. |*** | .0 202.< 1000. | | .0 746341.7198397. **| | .01804837.0181.21671505.0 048141. |* | . | | .0 271. | | . .0- 161. .0 923141.0- 711.421 66.0 24501.9 62907.0576. . |** | .0850.< 1000.0 422.28131.0 792.0 380631.0090.0041797.0244. .0 773631.0610.35611.84120. | | | | | | | | | | | | | | | | 28570. . **| | .5 289144.0 372.0 54260.0 931.0 234631.0 46080.4927926.0 0 rorrE dtS | .0 892141.0980. . .0420.4598012.0 622.39 44. .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.0 75510. |** | .0 375041.04910.0 112. .0131.0412.0 qSihC > rP 63 03 42 81 21 6 FD 32.0 70170.0 436041.0 201931.7 715964.1 150385.0 372.0 99570. | | .0170.0 384441.54500.6604989.0220.0190. .0 688141.0003.1 534603.7 939830.1 278467.0540. |** | .0293.

.0670. ***| .0- 120. . **| . .0 150. .2 erauqS -ihC 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | | | | | | . .0531. .0 610.0281.0 670. |** . | | | | | | | | | | | | | | | 67401. .0- 480. |** . .071131.0260.0090. |* .0 6917. |* . . . . . .0 19690.0 231.0 180.0 94640.0 500. .0040. **| . **| . ***| .0 qSihC > rP 63 03 42 81 21 6 FD 83. .82 36.0 64130. . .019231. **| .0 63760. . .0 78521.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 151 .0 93022. . .0 730.0 3699.076380.0 39701. .019330.0910.082880. .0 58440.3 50.0 110.0120.082710. .0910.0660. |** .0 4246.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 | | | | | | | | | | | | | | | .077300. .043290.068900. . **| .62 95. . *| .0 710.5 07.0350.530.0480.****| .0 93211.0 540.0 41550. .0 942.0- 4318.0 28230.0 711.0 640. . .0- 830.0- 720. .016410. . .0 050.080360.0 98111. .0 042. . .0 3889.0 16801. |* .0 401.016890. . .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.057670. . .0 550. .056251. | | | | | | | | | | | | | | | 61670. **| *| |** |*** | *| | |** | |** |* |*** | | |* .91 79.0 08110. .0 170.0 9419.0501.

345 0008.0 801.095 3232.23 4119.0 531.0 201.0160.906 3243.864 7168.0870.706 5490.0 0889. FORECAST LEAD=12 INTERVAL=MONTH ID=DATE OUT=OUTF. and FORECAST Statements: PROC ARIMA is known as the airline model.12) NOPRINT.925 97 87 77 ]senil tuptuo erom[ 9387.0840.0 5899.0 7799.5 26. ESTIMATE.0050.0 130.695 2580.0 980. Output 4.ledom siht ni mret naem oN 21.965 9039.31 0577.0 970.0 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 45 2764. RUN.0450.235 0005. IDENTIFY VAR=CONSTRCT(1.03 0006.0 211.774 7752.61 22.993 430577.0 250. use the following statements: PROC ARIMA DATA=CONST.9 rorrE dtS 0006.145 5509.0270.33 1024.0390. ESTIMATE NOCONSTANT METHOD=ML.806 1614.61 0428.05968.4 shows plots of the original and log scale data from Box and Jenkins’s text.0902.0 110.1 gnicnereffiD fo )s(doireP TCRTSNOC elbairaV rof ledoM 591.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.9 3155.585 0009.3 Forecasting Seasonal Data with the IDENTIFY.475 0000.216 7850.0 330. t e ) B1θ − 1( )B1θ − 1( = tY ) B − 1( )B − 1( 21 21 The model The results are shown in Output 4.0 640.0 300. .993 2764.0 qSihC > rP 42 81 21 6 FD 94.0020.885 tsaceroF 07 96 86 sbO stimiL ecnedifnoC %59 TCRTSNOC elbairaV rof stsaceroF . To forecast the seasonal data.7769. Its popularity started when Box and Jenkins (1976) used it to model sales of international airline tickets on a logarithmic scale.0750.2 39.755 3147.3.964 8419.0 910.

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

TITLE 'SERIES G'. It is hard to detect seasonality in the ACF of the original series because all the values are so near 1. IDENTIFY VAR=LAIR(1. The model is identified from the autocorrelations. and partial autocorrelation function (PACF). 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 > 2θ . you see little decay. indicating you should consider a span 12 difference.12). The results are shown in Output 4.24). issue the following SAS statements: PROC ARIMA DATA=AIRLINE. Identification depends on pattern recognition in the plot of the ACF values against the lags. The slow decay is much more evident here than in the construction example.154 SAS for Forecasting Time Series Now analyze the logarithms. Once you take the first difference. IDENTIFY VAR=LAIR. using these SAS statements: PROC ARIMA DATA=AIRLINE. The nonzero ACF values are called spikes to draw to mind and the plots PROC ARIMA produces in the IDENTIFY stage.5. IDENTIFY VAR=LAIR(1).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 . RUN. For the airline model. Looking at the seasonal lags (12. TITLE2 'INTERNATIONAL AIRLINES PASSENGERS'. To create the variable ) 31− t and its ACF. inverse autocorrelation function (IACF). you obtain the ACF . which have the more stable seasonal pattern.

|* . *| .0 671245.067920.0 147051.0 06737.0 275142. . | .0 62447. . .0 49167.0 197792.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 593641. | .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 819931.0 694752.| | | | | | | | | | | | | | | .0 02800. | . | .0 107641. | . . . | .099670.0 377172.0 31727.*************| | **************| | ***************| | ***************| | ***************| | ***************| | ***************| | ***************| | ***************| | ****************| | ****************| | *****************| | ******************| | *******************| |********************| | | | | | | | | | | | | | | | | 63816.0 333380. .5 Identifying the Logarithms with the IDENTIFY Statement: PROC ARIMA Chapter 4: The ARIMA Model: Introductory Applications 155 .0 29898.0 044013.0 954741. . .0 682533.0 847241.0 30857. |******* ***| .0 994571. .0 56337.0 07359.0 09877. .0 92300. .0 321202. . 574453.0 61041. . | .0 657543.0 830323.093210.0 38143. .0 554651.0 566831. |********** | | | | | | | | | | | | | | | 62660.0 175481.0 44657.0 22910.**| . .0 73220.0 07900. .081010.0 34808. . .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 08058.0 913821. . . .0 869371. ************| | .078305.1 noitalerroC 276911.0 227041. .0 369482.044351.0 00000.0 40366. . | .0 389141. ***| . .0 0 rorrE dtS | .0 656461.0 630441.0 254322.0 05617.0 035391.007010.

69011.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.01524200.0 73440.0 811941.02252200. | . |****** | . | .57991.0 426380.0 58502.0 605.**| . |** . | .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 272151. |* . | .0 67320.0 0232100. | .0 34148.05697300.0 0 rorrE dtS | .0 875790.02453100.0 28511. |*** . | *****************| .0 459.**| .02303100.0 72901.87520. |**. *| .0 445. | | | | | | | | | | | | | | | 22240.0 050880. | . | .0 738980.0 977.< 1000. |* . |**.0 031890.0 998. | . |***.0 753801. | ****| .0 00000.056092000.1 noitalerroC 8703100. |** .0 850111.0 808.0 26990.5 Identifying the Logarithms with the IDENTIFY Statement: PROC ARIMA (continued) 156 SAS for Forecasting Time Series .0 0784900.90512.0 657. | .0 1000. | . | *******************| . | ****| .0 105. *| .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.27633.0 217601.1251 26.040601.03136300.0 717.961251.0 158. | . | .04375100. | .0 094.0 715.0 300990.0 01402. |********************| | | | | | | | | | | | | | | | | 00611. |******* | . *| .0 44900. | .074240.55931.0 79380.0 894.**| . |** .0 798680.0 30830.0 572110. | .0 837. | . ****| .0 267. | .5871 49. *| . | .0 19360.0 727.7511 73.0 437.0 915.< 1000. | ****| .034584. |********** | . | .0 857.95511.01021. | .0 32450.70223.0 366.0 9023200.0 53430.0 75711. |** .836 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | . |** .0 280890.77051.0 675.< 1000. *| . *| .0 485701.0 8649000.< qSihC > rP 42 81 21 6 FD 23.0 447. | .0 816.09996100.007359.01152100.

. ************| .0 26043.082012.0 46382. .087700. ****| .056661.092291.026301.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 62590. ***| . .055470. |****** .5 Identifying the Logarithms with the IDENTIFY Statement: PROC ARIMA (continued) Chapter 4: The ARIMA Model: Introductory Applications 157 . ******| . | | | | | | | | | | | | | | | 40021. |********** . |**** . .0 40142.0 26372. | . .0 91181.| | | | | | | | | | | | | | | .088135. ****| . .0 92203.0 57950.0 96740. |**** . |*** ****| . ***| .**| .089520.**| . |* .0 05671.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. *****| .057991.0 22331. |**** .**| . | | | | | | | | | | | | | | | 72830.067494.088590. |* . . . |**. |***** . *| .045051.003911.0 98013.0 26020.

0- 570.0 7124000.< 1000.0 620.062460000.0 6117000.5 Identifying the Logarithms with the IDENTIFY Statement: PROC ARIMA (continued) 158 SAS for Forecasting Time Series .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. | .0733.0 63120.0041.0611.0 110511.0901. |** .0 991.0 240101. | .123 57. | .0 625611.0 813401.0 198301. |******* |********************| | | | | | | | | | | | | | | | | 75941.0 975101.447611. **| .72 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA Output 4.< qSihC > rP 42 81 21 6 FD 35. |******** | . | ****| .50501.0 41202.961 59. |* .0 975101.0 250.0 16750.0021.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.0611.0972. | . |**** | .08030. | .0 126401. | .0 3951000. | .013431000. *| .0 21143.019763000. | .0 67000.031912000. |* .83460.0 5608000.0 480.0 148.85550.0 700101.0151.0 192000.19511000.0 743101.< 1000.06151.0 111.0 1000.0 6-E7685.591 98.0 2021000. | .0512.0 01611000.0 078790.0223.0 63670.0- 701.0002.< 1000.0- 411.0 210.00000. | .0602. | . *| . | .0- 733.0 21.0 16683.0 0 rorrE dtS | .042613000. | .1 noitalerroC 00213000.0 56550.0 572101.0 600790. ***| . ***| . *| .00680200.73671.0 65440000.0 073780.

| | | | | | | | | | | | | | | 44150.0 322.0- 1000.0931. |**.47 44.0 49590.096833.0 64421.095640.0 97950. | . |******* .0 qSihC > rP 42 81 21 6 FD --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | | | | | | . *| .0 22020.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 | | | | | | | | | | | | | | | .t e = tV ) B 2 θ − 1( )B1θ − 1( 21 t e ) B 2 θ − 1( )B1θ − 1( = 21 810.0 460.0143. .091060.066291.0120.15 72. *| .0- 711.0 29990. |******* | | | | | | | | | | | | | | | 57120. *| . *******| .0 051.**| . .0 783.< 1000.0610. .0 31410. .0 55650. *| . | .0 85522. |* .**| .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 . . .**| .018210.0 08480.0850. .094920. |**.0100. |**.0 58973.0 190. ********| .098801.021143. |**.0130.0501. .0 23623.0 70340. .< 7000. | .010661. *| .26 74.072121. . .0 671.0 30521.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. .< 1000.0251. . .0 070.**| . | . .0 80501.0 202.081901. . |**** . . . .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. *| . *****| .086430.0 110. |* . . |*** .0 90330.0 650.0670.0 650.048670. |*** . *| .0 930.**| . .

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

0 110.7.< 1000.7 51.0690.01.0 180.1 190.0 2724.22 89.0540.0 890.1 gnicnereffiD fo )s(doireP RIAL elbairaV rof ledoM 310.0210.2AM 190.0 412.0 550.0 120.2AM 1.0460.1AM retemaraP setamitsE retemaraP fo snoitalerroC .0 911.0 2547.tnanimreted gol edulcni ton od CBS dna CIA * 131 slaudiseR fo rebmuN 383.< |t| > rP xorppA 43.0 .0 0046.0820.0770.11 98.0 rorrE dradnatS 63275.0001.684CIA 455730.0 520.0 .0630.0 72773.1AM retemaraP noitamitsE serauqS tsaeL lanoitidnoC erudecorP AMIRA ehT SREGNESSAP SENILRIA LANOITANRETNI G SEIRES Output 4.1 :2 rotcaF :1 rotcaF srotcaF egarevA gnivoM .0 411.084CBS 331.5 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.0 320.2AM 1.0 320.0 3272.6 and Output 4.0 etamitsE 1.0 etamitsE ecnairaV 21 1 gaL 1000.ledom siht ni mret naem oN 21.0631.1 )1(**B 72773.0000.0 69180.7 06.)21(**B 63275.0130.0 etamitsE rorrE dtS 14100. Chapter 4: The ARIMA Model: Introductory Applications 161 .1AM 1.0 qSihC > rP 22 61 01 4 FD 65.6 Fitting the Airline Model: PROC ARIMA The results are shown in Output 4.1 1.4 eulaV t 20870.0 940.0010.

5 5009.elbairav modnar )1.0 6970.6 0050.0(mrofinu a fo FDC eht dna margodoirep eht fo smus laitrap dezidradnats eht fo ecnereffid etulosba mumixaM :citsitatS vonrimS-vorogomloK s'tteltraB 930556.0 9280.5 1250.6 9669.0 rorrE dtS 8271.6 1802.5 9530.6 651 551 451 ]senil tuptuo erom[ 9072.6 5901.0 2010.6 7470.0 2440.6 4041.0 6730.6 1381.0 910980.0 56 = ))*(P(muS ))*(P(xaM M LAUDISER elbairaV rof esioN etihW rof tseT erudecorP ARTCEPS ehT SREGNESSAP SENILRIA LANOITANRETNI G SEIRES 7633.6 2680.3 appaK ))*(P(MUS/))*(P(XAM*M :appaK s'rehsiF 204181.6 1463.0 8761.6186.6 tsaceroF 741 641 541 sbO stimiL ecnedifnoC %59 RIAL elbairaV rof stsaceroF erudecorP AMIRA ehT SREGNESSAP SENILRIA LANOITANRETNI G SEIRES Output 4.6 6350.0 eulaV-P etamixorppA citsitatS tseT .6 1360.6 9899.6 6522.6 Fitting the Airline Model: PROC ARIMA (continued) 162 SAS for Forecasting Time Series .

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

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

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

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

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

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

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

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

211 44736.053.0 341.01 09. | .0 350. | .0 610.0410. | .0 880. |** . | .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.32 89.0 qSihC > rP 42 81 21 6 FD 73. | .69552 345. |******** |********************| | | | | | | | | | | | 51990.0 823181.0981.0 619. ***| .216 6086.0 820.1 noitalerroC 815. *| .0990.0 170.7007 225.29430.0 975881.0 831.0 834181.0 38110.0793.688881. |* .0000. |** .0 9771.0 651.0 782781.89693.0 330. | .0210.0340.0619.506 5089.071 0 0 0 0 tfihS STRATS CIPD TROM SELAS elbairaV 0 0 0 0 gaL 1000.0330.0000.0 854181.01894.1 820.08791666.1 930.01MUN TROM 610.0 5425.00000. | .15175830.30772 334.0 620.0 3971.0000.0 3MUN STRATS 930.0 586381.1 170.45721.79891466.1 UM SELAS 3MUN 2MUN 1MUN UM STRATS CIPD TROM SELAS retemaraP elbairaV setamitsE retemaraP fo snoitalerroC 04 2634.4 60521.4 21200.02MUN CIPD 943.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 171 .0 98422.0530.0 3295.100470.0943.0 411851.61 72.0990. |* .23820.0466933.0110.0 527481.686002 6830.0 55780. ***| .149.21 42.2865521.0 471.< 5218. | .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.07571265.0 |t| > rP xorppA slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC 73.0 2943.8 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000. | .0 eulaV t 25893.0 0 rorrE dtS | .0 930.744 5.0221. |** .0 147881.40831.0 65890.181 rorrE dradnatS 90039.0961.3732374.0821.90330. | .0820.

**| .0 84651. |*****. . . . ***| .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. .047202. .096022. .002720.0 03430. .000420.038270.0 33530.0 04205. |* .11 CIPD rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 2 rebmuN tupnI 470.0 12141. .0 53000.071 gnicnereffiD fo )s(doireP tpecretnI detamitsE SELAS elbairaV rof ledoM erudecorP AMIRA ehT | | | | | | | | | | . . .0 93651. | | | | | | | | | | 46631. *| . |*** . . . | .0 73211.049381.4 tuptuO 172 SAS for Forecasting Time Series . . *| . *| . | .030132. |**** .0 17461. . ***| . ****| .099650. *| .4 1 STRATS rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 3 rebmuN tupnI 21200.089693. |**** .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 | | | | | | | | | | . |******** | | | | | | | | | | 57402. |*** .1511 TROM rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP elbairaV tupnI 1 rebmuN tupnI 1 6830.490039. . . . **********| . |**** . ***| .

the IACF dies off very slowly. The results are shown in Output 4. The correct model includes specifying the error structure. . where you do not use the t statistic for a variable in a model with an important explanatory variable omitted. The next step. only the t statistic for housing starts exceeds 2. You can accomplish this in PROC ARIMA by replacing the ESTIMATE statement above with ESTIMATE INPUT=(MORT DPIC STARTS) Q=1 METHOD=ML. 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. and remember that differencing is often accompanied by an MA term. you decide to model the SALES series in differences also and then to check for overdifferencing with the PLOT option.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 . RUN. You may argue based on the chi-square checks that the residuals are not autocorrelated. the t statistics are meaningless.10. Overdifferencing also results in an MA coefficient that is an estimate of 1. you fit an MA(1) model to the errors. However. For the moment. ignore these t statistics. If you have. which you have not yet done. unless you fit the correct model. 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. Based on the ACF of the differenced series. Because the explanatory series seems to require differencing.β − β η + Xβ + α = Y η . However. Residuals from the model may not resemble the true errors in the series because the estimate of is inconsistent. You interpret the ACF of the differenced series as having a nonzero value ( 0. check the IACF to see if you have overdifferenced the series. In terms of significance. then. 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. Also. Look separately at the first few autocorrelations. 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.39698) at lag 1 and a near-zero value at the other lags. is to fit the regression model with an MA error term. You use the same procedure here as in regression settings. Thus.

0 250.452432 39715.885 2857.02MUN CIPD 156.03MUN STRATS 754.0216.1 754.0204.982doohilekiL naissuaG goL 872351.03 82603.< 7534.1AM UM retemaraP noitamitsE doohilekiL mumixaM .degrevnoc evah ton yam setamitsE 31 100.0204.0 8379.0 000.1AM SELAS 216.01MUN TROM 413.0 4350.695 3531.81 87.0 01941.0 000.0 |t| > rP xorppA 72.0912.72 100.0 43.19 etamitsE 3MUN 2MUN 1MUN 1.933 7.0 39.0000.0 8-E1 860.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.0951.0859.1 UM SELAS 3MUN 2MUN 1MUN 1.0 000.0 912.0 94183.20237999.06 94184.74 rorrE dradnatS 45031.1AM UM STRATS CIPD TROM SELAS SELAS retemaraP elbairaV setamitsE retemaraP fo snoitalerroC 04 7975.1 66936.534511 94183.0 04262.4 tuptuO 174 SAS for Forecasting Time Series .330.0 1.0063.1 063.1 250.1 951.0859.1 eulaV t 38082.0 1.000.0 413.5 66598.0 9000.0 156.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.

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.0970. 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.6 80.0 3838.0 441. Further inspection of the printout.19 262.0 470.99973 is not significant (p-value >.0 420. 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.0670.5 1 STRATS slaudiseR fo kcehC noitalerrocotuA 801. Also note that PROC AUTOREG.0021.0741. reveals that this number may in fact not be a --------------------snoitalerrocotuA-------------------- 880.0381.0040. The moving average parameter estimate is almost 1.11 05.41 34.2021 TROM 956598.0 :1 rotcaF qSihC > rP 7609. Something has happened here that can happen in practice and is worth noting.0 370.0821.0 FD 32 71 11 5 erauqS -ihC 56.05).4 tuptuO 370.0 1 94183.0 440.0660. however.0080. This in turn indicates that just an ordinary regression would suffice to fit the model without any differencing being required.0 2838.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.0681.0 )deunitnoc( AMIRA CORP :mreT rorrE AM na htiw ledoM noissergeR eht gnittiF 01.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.0350. Remember that the IDENTIFY statement determines the degree of differencing used.0710.0 6338. You should note that the MA parameter 0.0 730. another SAS procedure for regression with time series errors.0970.2 gaL oT 42 81 21 6 .0 .0 1 CIPD 345031.0731.0 )1(**B 37999.

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

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

1 071. but forecast intervals differ considerably. and thus these points cannot be used in the estimation.0 1MUN STRATS 071.22391 tsaceroF 94 84 74 64 54 44 34 24 sbO stimiL ecnedifnoC %59 SELAS elbairaV rof stsaceroF )1(**B 79306.0211.274 1819.01.37781 4230.0 160.39491 1408.0950.0781.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.19 gnicnereffiD fo )s(doireP tpecretnI detamitsE SELAS elbairaV rof ledoM 551.4 tuptuO .30502 1366. Predicted SALES are the same (recall that future values of STARTS in this example are the same as those produced in PROC ARIMA).48491 3144.0 qSihC > rP 32 71 11 5 FD 92.13.1AM SELAS 000.983 rorrE dtS 9066.465 1252.67591 8917. Note that future values were supplied to and not generated by the procedure.0 700.794 2548.1 UM SELAS UM retemaraP SELAS elbairaV setamitsE retemaraP fo snoitalerroC .51802 5398.75891 0273.0431.0 1MUN STRATS slaudiseR fo 860.0 031.0 0418.0 520. forecasts are generated.06302 9234.97691 5617.3.2 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------000.49791 9269. See Output 4.345 7148.94991 2466.50781 0759. Forecast intervals are valid if you can guarantee the future values supplied for housing starts.29781 9045.0241.51302 7440.0 920.17681 4365.94681 4677.0001.1AM SELAS kcehC noitalerrocotuA 010.0 511.644 2193.0 010.01.ψ )deunitnoc( seulaV selaS erutuF gnissiM dna seulaV tupnI erutuF htiw gnitsaceroF 11.0440.0 812.0030.04486.91 77.0750.0010. A request of LEAD=10 also gives only eight forecasts because only eight future STARTS are supplied.1 :1 rotcaF srotcaF egarevA gnivoM 1 96699.0110. Otherwise.0870.6 70.914 9529. Section 4.0 8838.0 290. they are too small.025 7224.0 270.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.0 150.80681 6944.0 .24881 6909.22902 0302.78002 2427.11 18. Because future values are available for all inputs.85581 0477.0 0418.65012 9814.0922.0 000. Note that the general increase in predicted SALES is caused by including the drift term 6795.45602 9574.1 860.

FORECAST LEAD=8 ID=DATE INTERVAL=QTR OUT=FOR2 NOPRINT. IDENTIFY VAR=STARTS(1) NOPRINT. The data are quarterly and. but the intervals were not large enough because future values of housing starts were forecasts. 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. in this case).3. This made it impossible to incorporate forecast errors for Ht into the forecast of St. The model t fits well. you have the problem of obtaining these future values for housing starts. 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 forecasts were valid.3.1. The SAS code follows: PROC ARIMA DATA=HOUSING. you supplied future values of Ht to PROC ARIMA and obtained forecasts and forecast intervals. an input series is used in an input option to identify and estimate a model for the target series St. Some of the output has been suppressed (it was displayed earlier). Step 1 in this methodology identifies and estimates a model for the explanatory variable Ht. but you do not see them unless you request them. PROC ARIMA correctly incorporates the uncertainty of future housing start values into the sales forecast. Use an AR factor to handle the seasonality of this series. based on the usual criteria. 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 . FORECAST LEAD=8. ESTIMATE Q=1 INPUT=(STARTS) METHOD=ML NOPRINT. Also. In Section 4. you obtain the model t t In case 1. The differenced series shows some correlation at lag 4 but not enough to warrant a span 4 difference. The entire set of code is shown below and some of the output is shown in Output 4. housing starts Ht are used as an explanatory variable for a company's sales. forecast intervals are wider than in case 1.S. ESTIMATE P=(4) Q=(3) METHOD=ML NOCONSTANT. housing starts. In step 2.Chapter 4: The ARIMA Model: Introductory Applications 179 4. the series was forecast eight periods ahead to obtain future values.2 Case 2: Simple Transfer Functions In case 2. Using fitting and diagnostic checking. IDENTIFY VAR=SALES(1) CROSSCOR=(STARTS(1)) NOPRINT. In addition. the series should be differenced. The two steps must be together in a single PROC ARIMA segment. This part of the SAS code is the same as that in the previous example. RUN. Diagnostic checking was done on the STARTS series Ht. U.12.

1RA 391.0350.81 85.1RA 1.0 6866.0 811.0910.0 |t| > rP xorppA 38.0791.2 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.2 eulaV t slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV 28551.0761.0 23324.4 tuptuO 180 SAS for Forecasting Time Series .1 77.0 8555.1AM retemaraP noitamitsE doohilekiL mumixaM erudecorP AMIRA ehT SELAS DNA STRATS GNITSACEROF AMIRA CORP :doohilekiL mumixaM gnisU gnitamitsE 21.41 09.0120.235 922.0 860.0- 660.0330.0 611.0351.0 1536.471 5.0232.0 6500.0 6944.1AM retemaraP setamitsE retemaraP fo snoitalerroC 04 8606.06303 4 3 gaL 4760.0 000.0400.0802.0601.925 6242.0 rorrE dradnatS 00582.0360.0 1.0 etamitsE 1.9 55.0 qSihC > rP 22 61 01 4 FD 26.0 411.0 850.0 711.0 38251.1RA 1.0 901.0060.1 391.0 690.1AM 1.740.1 1.0430.

4 tuptuO .ledom siht ni mret naem oN )4(**B 582.813 1797.1 STRATS elbairav rof stsaceroF .1 STRATS elbairaV rof ledoM srotcaF egarevA gnivoM srotcaF evissergerotuA gnicnereffiD fo )s(doireP rorrE dtS 7076. The narrower interval is questionable in light of the downturn in SALES at the end of the series. where the same future values for housing starts are read into the data set rather than being forecast by PROC ARIMA.153 3580.1301 1 )3(**B 23324. The first graph gives forecast intervals that arose from using PROC ARIMA to forecast housing starts.1731 7291.526 2068.2991 1407.3731 sbO 94 84 74 64 54 44 34 24 21.0731 3863.9631 7291.0602 4826.7831 6242.034 3958.0691 4636.9631 3966.409 3337.0 . This is illustrated in Output 4.465 0397.283 4937.0 .471 :1 rotcaF :1 rotcaF tsaceroF 6201. 6102.186 9657.547 2186.4212 4356.4122 9173.014 4344.4171 stimiL ecnedifnoC %59 )deunitnoc( AMIRA CORP :doohilekiL mumixaM gnisU gnitamitsE 5300.5712 7349.777 2207. Note how the broken line drastically underestimates the uncertainty in the forecasts.625 2338.642 6242.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.0731 6201.103 3614. The second plot gives these forecast intervals as a solid line along with intervals from the previous analysis (broken line).5731 8652.0781 9157.13 to indicate the difference in interval widths for these data.

182 SAS for Forecasting Time Series Output 4.13 Plotting Forecast Intervals .

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

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

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

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

041820. | *****| .0 285060.31211. |*.0 86430.0 258950. .23120.0 0 rorrE dtS | . | **| .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.0 15805.*| .0 580550.047193. |*.32960.0 02060.0 60300. | ***| .0 965781.1 noitalerroC 236090.0 915663.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.0 08461.0 915850. |*.0 21500.0887101. |*. .| | | | | | | | | | | | | | | . . . .94470.63700.91820. | .0 87650. | .0 57120. | . | ***| . **| .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 169950.0 698496.33870. | .0 808950. | . .0830701.002110. |******** | | | | | | | | | | | | | | | 37930.0 973060. | . | . |*. |********************| | | | | | | | | | | | | | | | | 23660.*| .0 50430.0 62731. | . | .0032870.0995490.0 44480.0921920. |** | . | .0 951950.0 846950.0 385750.52750. |*. | . .4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 187 . .1 951000.0 018950.*| .0 00000.0 484263.0332351. |*.0 494711.0 62562. |** | . | **********| . .0 89580. | . .0 102522. |*.*| .*| . | **| . .0 127440.083530.0715830.0260010.098520. .0 738950.058110.0 004950. | .0 383511.034580. .

0 870.31 17.4 tuptuO 188 SAS for Forecasting Time Series .0 1000.0 00900.0 42610.1RA UM retemaraP noitamitsE serauqS tsaeL lanoitidnoC 660.1 etamitsE ecnairaV 490064.2 etamitsE tnatsnoC 1 0 gaL 1000.0 470.0 330.0 401.0 150.0 905. | .tnanimreted gol edulcni ton od CBS dna CIA * 005 slaudiseR fo rebmuN 798. |*.5 etamitsE 1. . | . | | | | | | | | | | | | | | | 77000.0 96500.691 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | | | | | | .0 511.060920.0680.0 rorrE dradnatS 45805.0 140.0480.< 1000.0 170. .0 20840.712 14.9241 CIA 75800.0700.0960.087000.0820.0561.< 1000. |*.080420. .0 660. |** . . | .0 750.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.0731. | . .0 001. .1 etamitsE rorrE dtS 312710.0 15805.< 1000. | .0 211. . |*. . .0 18530.7341 CBS 864. .142 07. | .*| .096200.702 61.0 66470.< 1000.0 110. | . .058400.< |t| > rP xorppA 81.0120.003950.45 eulaV t 85830.*| ..< qSihC > rP 42 81 21 6 FD 24. .029770. **********| .0 94190.049150.*| .0562.

0 8726.0 320.005 165141.1RA 500.0 810.0 120.0 050.0400.0240.0 6425.0500.0 550.0- 8419.0 020.0 1.0- 520.0640.0360.0- 420.43 76.0540.2 erauqS -ihC 84 24 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.6 51950.0 5509.0340.0 .0790.51 73.0610.0 800.0 830.02 99.0 210.1 :1 rotcaF srotcaF evissergerotuA 196500.42 32.1 UM 1.01 snoitavresbO fo rebmuN noitaiveD dradnatS seireS gnikroW fo naeM Y = elbairaV fo emaN )1(**B 45805.92 44.0010.0 330.0 030.0210.0140.0550.0 710.0 500.0 700.62 92.0 940.0100.0 900.0140.0 600.0 4417.0050.0 7214.0 410.0 450.0 qSihC > rP 74 14 53 92 32 71 11 5 FD 73.0 000.0 720.0 800.11 29.1RA UM retemaraP setamitsE retemaraP fo snoitalerroC )deunitnoc( AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw noitcnuF refsnarT a gnittiF 41.0 260.0820.0 110.0220.0 270.0110.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 189 .0 500.1 500.0 6058.5 naeM detamitsE X elbairaV rof ledoM 170.0 0217.0 310.

.0 46840.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 44910.0 12490. | *******| .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 34180.0 85691.0 53731. | .0 086790.1 noitalerroC 949137. |********************| | | | | | | | | | | | 49890.098420. . | ******| .0 95053.074240.*| .0 417380.0 127440.*| . . |********** | | | | | | | | | | 04010.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 532070.0 66124.076100.0 92658.0 29972.5 747414. .51 805393.050900.0 62027.91 619119.0 73130.0 79570. | .0 87800.0 22270. . |** . | .***| .017640. |*. | . | **********| .092658.*| .091600. . *****************| . | ************| .4 tuptuO 190 SAS for Forecasting Time Series .3 605081.7 451855. .22 193761. . | ********| . .0 552101. | .099960.0 888501. |** .| | | | | | | | | | .0 556301. . | .0 44706.0 901290. .0 94125. . |*.0 0 rorrE dtS | .01 778322.0 651501.72 813892.0 55150. | | | | | | | | | | 51910. | **************| . | *****************| . | ****| . .0 00000. | . |** .0 61415.23 377817. |*.31 334409.

***| .0321741.0 024777. .0 671029.22830.0 20641. | .*| . . ****************| .0 19460.0 72397.3 788330.0411541.1 60326.0 24131.0 585320.0 438505. .02710.0 920741. | .0 437980.< qSihC > rP 6 FD 30.0 658942.0 027. *****| .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. . |*.*| . .*| . . |*. . .*| .noitalerroC 285452.0 658.0 415.1 143350.0 31600.07730.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 .| | | | | | | | | | | | | | | | | | | | | . |*. . | .41 005 X seires demrofsnart fo ecnairaV Y seires demrofsnart fo ecnairaV snoitavresbO fo rebmuN X dna Y fo noitalerroC 153.denetihwerp neeb evah seires htoB 251310. .0539792. *******| .0 1000. |** | | | | | | | | | | | | | | | | | | | | | 41660.0 53060.0 997572.0 02830.0 60932.0 13320. ****| . | .0 85320.04770.0 347090.0 08800. | .0 71530.0 706.0 16902. .0 483531. ***| .0 64133. .0 808608. ***| .0 140265.0 224.0 89102.0 045775. ****| .0991660.0 50051.0 803232.

) . 2− t X) B α k L( . .4 tuptuO gaL oT 5 .1 1. .33146 followed by a roughly exponential decay.0 seireS neewteB kcehC noitalerrocssorC 397. 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. 2− t X) B .( . INPUT=(2$(1. .1 N srotcaF evissergerotuA + ))5 − retliF gninetihwerP 900. In INPUT=(form1 variable1 form2 variable2. α − 1( / )B)θC( − C( = 1. . . ). . Now review the PROC ARIMA instructions needed to run this example. the specification for the transfer function form is ) where S lag polynomials variable j For example. FD 6 − )01 − erauqS -ihC 58. . .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. . . 1. L . The default in PROC ARIMA is to estimate the model with the C multiplied through the numerator as shown on the right.1 + k L( / ) . = )5 − = )01 − 1− tY(8.< e + )5 − 1− t X(5.3)(1)/(1)X) ALTPARM.814 t t Y( X( 41. )Bα − 1( lag The form of the transfer function is then -------------------snoitalerrocssorC-------------------- 202. ) Bθ − 1( − )5 − 320. You now see a spike (0. . The ALTPARM option gives the factored C form as on the left.. 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).. .0 :1 rotcaF 2− t X((3 qSihC > rP 1000.0 3− t X(4.0 932.1 .79327) followed by an arbitrary drop to 0. L($S − 1( / )Bθ − 1(C 2 .0 )deunitnoc( AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw noitcnuF refsnarT a gnittiF :retlif gniwollof eht yb denetihwerp neeb evah selbairav htoB 133.0 . . ) .0 )1(**B 45805.

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

.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.4 tuptuO 194 SAS for Forecasting Time Series Neither cross-correlation check indicates any problem with the transfer specification. In an example without prewhitening. .15 ESTIMATE ESTIMATE INPUT=(2$(1)/(1)X) .3 16799. future values of X must be in the original data set. First. from .99 71.33etamitsE 1. .34 48.< 1000.8091 328346.0 56893.0 17260. .1MUN 1ELACS UM retemaraP noitamitsE doohilekiL mumixaM erudecorP AMIRA ehT NOITCNUF REFSNART A GNITTIF AMIRA CORP :noitcnuF refsnarT a gnittiF 51. .0 53070.< 1000. .2 6799. the inputs are forecast and then used to forecast Y.5291 154.1NED 1.0 rorrE dradnatS 96097.16 See Output 4.< 1000. from .< |t| > rP xorppA 76. P=1 . . .0 35577.1 351207.34eulaV t 0339700.0 56420.794 582.61 35.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.

1NED X 128.1MUN 1ELACS UM X X X Y retemaraP elbairaV setamitsE retemaraP fo snoitalerroC )deunitnoc( AMIRA CORP :noitcnuF refsnarT a gnittiF 51.< 1000.0 880.0 140.2 351207.0570.0 601.0 810.0 080622.0840.0950.0 424980.1 noitalerroC 302921.1 289046. *| . | ************| .0 0 rorrE dtS | .0520.0000.208 08.0823.487 41.0 285980.0741.0 611.0720. | ****************| .01ELACS X 436.326980.0 452345.0340. *| .0 001770.0 986.0380.0 76380.0701.268 76.0 366123.0 152517.0130.0241.< 1000.0 00000. | *****| . **| .0611.0 102.< 1000.0521.< 1000.0341.0561.0 110.0 436.0111.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 40102.0 192.1MUN X 192.0 901380.< 1000.0200.319 91. | **********| .01.0 350.< 1000.0141.0910.0 941744.0590.0 92706.0 65463.0480.1 986.0 901589.< 1000.0840.0 984.0 562.0 84561.0 706.< qSihC > rP 84 24 63 03 42 81 21 6 FD 29. | .0 214511.0780. | .0260.0120.0 743.0690.0 087.0 688780.298 72.0690.0 880.0740.0390.1 946701.0 587660.0 000.0 762680.0 17240.0 000.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 195 . | ****| .1NED 1.177 66.0743.***| . | *******| . | .137 erauqS -ihC 84 24 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.157 66.0 090.0 563.0170.1 UM Y 1.0 608880.0680.0 99977.1 128.01.1 823.0 1000.0 658440.0 07462.0 11984.0801. |********************| | | | | | | | | | | | 18740.

*| .0 14994.0 210.0 230.*| .0 83941. **| . . |*.0 erauqS -ihC 74 14 53 92 32 71 11 5 gaL oT -------------------snoitalerrocssorC-------------------- X tupnI htiw slaudiseR fo kcehC noitalerrocssorC | | | | | | | | | | . |*** .0 700.0750.0620.1 75.069050.0 070.0 810.0700.0 37080.0 310.0 3069.0 550.0 100.0 230. .0- 9199.0 840.0 570.91 53.*| .0 200. .016140.0 27131.0 200.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- 100.0 2869.080830.058050.0 0038.0 400. |** .32 78. . | .0 740.0 130.0910.0- 910. | .023470.*| . .0 720.0 qSihC > rP 64 04 43 82 22 61 01 4 FD 31. |*.51 52. .0 8669.0 530.7 39.0 920.0 200.740.0910.0 14330. | | | | | | | | | | 23960.0 220.0 400.0 650. .026960.0 240. .0610.0 53800. .0800.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 3479. |*** .0 120. .0 730. |********** | | | | | | | | | | 80140.4 tuptuO 196 SAS for Forecasting Time Series .0600.62 98.0 310.*| .0200.0 65410.0 30020.0 440.*| .099977.61 17.0 6979.0 900. . | .082540.0 08200.0 17480.0300.*| .0 340.0270.0910.0- 320.0 850.0 300.*| . | . ****************| .0 9699. . .

1 :1 rotcaF srotcaF rotanimoneD )1(**B 56893.1 :1 rotcaF srotcaF rotaremuN 807260.0 etamitsE 1 setamitsE evissergerotuA laitinI noitamitsE yranimilerP erudecorP AMIRA ehT NOITCNUF REFSNART A GNITTIF ataD detareneG rof stsaceroF gnittolP dna gniledoM 61.0 .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.0 .01 175544.59160.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 197 .1 tsE ecnairaV esioN etihW etamitsE mreT tnatsnoC 92658.4 tuptuO )1(**B 96097.

3 1ELACS 72477.453873.1NED 85273.230624.784576.1RA 2181.3 100.0 61763.0 33273.0 56877.0 1.2 71499.01700163.0 1.0 72477.0 65054.7tnatsnoC 27877.017doohilekiL naissuaG goL 523000.0 10000.0 689752.3 6-E251.3 noitcnuF evitcejbO ni egnahC evitaleR 842000.255 69.0 62593.4 tuptuO 198 SAS for Forecasting Time Series .2 1ELACS 36297.231554.0 adbmaL 36830.52377.2 42387.0 snoitaretI atleD noitabrutreP evitavireD laciremuN yrammuS noitazimitpO noitamitsE AMIRA 8-E1 835.0 398850.451950.0 67878.130937.235 21.1MUN 05299.0 12118.0 100.1MUN 04399.2 05299.0 47957.0 35297.0 06877.0 25987.3 05689.0 46628.0 93967.235863.0 1.01722835.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.1NED noitamitsE serauqS tsaeL lanoitidnoC )deunitnoc( ataD detareneG rof stsaceroF gnittolP dna gniledoM 61.0 1 tirC R 1000.2 50100.0 1 tirC R 8-E1 7-E1 6-E1 10000.117ekilgoL 3 2 1 0 retI noitamitsE doohilekiL mumixaM 749681.0 70709.0 68193.628476.0 100.01 UM 13.2 17310.0 00001.0 824909.1RA 2364.232181.9353170.0 61763.0 502900.0 759534.0 6-E1 10000.1132 83.0 adbmaL 40237.615 32.01720955.0 15273.0 1.0 00001.2 23399.0 51497.0 548188.636830.8093 ESS 4 3 2 1 0 noitaretI tnatsnoC 1.0 1.0175544.636337.0 92658.1 93967.13UM 02835.

0811.0 61364.23etamitsE 1.0 483.0 45540.1RA UM retemaraP noitamitsE doohilekiL mumixaM )deunitnoc( ataD detareneG rof stsaceroF gnittolP dna gniledoM 61.62 60.< 1000.1MUN 1ELACS 1.91 22.0 300.0 200.1 120.0 600.82 18.0730.0 7011.93 51.1 399920.0 68220.0 730.1 40237.0040.2 36297.0 4815.1 rorrE dradnatS 27877.0 040.01.0 66527.0882.0030.65 03.0 110.0520.25 18.1NED X 818.0- 580.0370.1NED 1.56 49.0 qSihC > rP 74 14 53 92 32 71 11 5 FD 03.1RA UM X X X Y Y retemaraP elbairaV setamitsE retemaraP fo snoitalerroC 794 911.0820.81eulaV t 96310.0910.0882.4 erauqS -ihC 84 24 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.0200.0 8170.1RA Y 597.0 401.0000.0 000.0 1.0- 820.0 04399.1 UM Y 1.0- 540.0 250.85 23.0660.0200.0 710.0 120.1MUN X 510.0 210.1 070.01ELACS X 210.620.0500.0 010.0597.0 510.0630.0 760.0480.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 199 .0360.0 1190.43 51.0 000.0710.0940.0440.0 0360.0 300.1MUN 1ELACS 1.1NED 1.0 700.0070.0 640.0 600.0920.2541 670.0830.< |t| > rP xorppA 68.< 1000.0 000.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.0 85273.0483.0430.0810.0 93720.0 890.0040.01.0210.0 9950.< 1000.24 75.1341 688410.0 300.0 170.1 818.< 1000.0010.0340.1 820.0270.0760.0 0171.0- 8421.0- 210.61 47.

0 020.0 300.0640.0131.0510.11 07.0 530.1 :1 rotcaF srotcaF rotanimoneD )1(**B 85273.0 330.0060.0800.0501.83 59.0 300.0420.23- tpecretnI detamitsE Y elbairaV rof ledoM 830.0 650.0760.0910.0 970.0 020.0470.0820.0100.0 6489.0310.0 qSihC > rP 64 04 43 82 22 61 01 4 FD 77.0 .0 020.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 150.0700.0 200.0 010.0 6379.0 510.0 4837.0- 110.0 620.33 41.0 200.0 740.82 43.0- 4667.1 :1 rotcaF srotcaF rotaremuN 593399.0 120.0 510.0 810.0 100.0 4927.0810.2 2 X rotcaF noissergeR llarevO tfihS elbairaV tupnI 1 rebmuN tupnI )1(**B 36297.0 320.0500.0720.0 .0 510.0 3759.0 .4 tuptuO 200 SAS for Forecasting Time Series .41 80.0910.7 69.0 770.6 57.)1(**B 27877.0 620.0 8947.0 200.0 920.1 :1 rotcaF srotcaF evissergerotuA 2364.0 620.0 420.0 7449.

5 93318.6 8603.0 Y 584 484 384 284 184 T 5 4 3 2 1 sbO TES ATAD TUPTUO TSACEROF 8736.1 98410. .02 9121. . 8736.12 5765.1 6932.12 7044.41 9653.0 21640.12 0938.159L 98410.0- 21668.3 6947.2 5823.01 1037.01 5371.4 4643. .01 3243.12 5765.02 9653.1 DTS 2216.31 3817.01 1453.1 90673.18800.5 30727.0 LAUDISER 3106.5 78585.8 3876.01 9072.1 0877.1 98410.164820. 015 905 805 705 605 03 92 82 72 62 )senil tuptuo erom( 87971..01 1668.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 201 .5 95553.12 7044.2 59U 0326.1 rorrE dtS 4041.5 9585.04476.71 2405.8 9463.16022.18800. .12 0912.5 5089.1 98410.5 4318. .5 7837.5 4041.4 8724.0 63313.01 0669.5 6553.12 0912.5 0727.11 8180.01 3243.5 5149.1 9410.1 3171.9 8831.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.91 9882.12776.01 0612.01 9072.01 8065.05451.12 0938.4 0863. .0 7999.02 6791.16022.8 0047.1 98410.05451.01 .6 8573. .7 6301.01 0634.01 5371.12776.01 0612.3 0592.4 6713. .01 2927.9 7290.0 TSACEROF 0297.

1RA 748. causing the ACF to die off slowly. The results are shown in Output 4.1AM 71.0 NOTSNIK DNA OROBSDLOG TA REVIR ESUEN FO SETAR WOLF setamitsE retemaraP fo snoitalerroC 993 834.202 SAS for Forecasting Time Series In addition to generated data. Obviously.231493.41 erudecorP AMIRA ehT 1. The goal is to relate flow rates at Kinston to those at Goldsboro.0 24480. RUN. and 30 miles downstream at Kinston. TITLE 'FLOW RATES OF NEUSE RIVER AT GOLDSBORO AND KINSTON'.0 1000.0000.038042.1 547.< 1000. These data include 400 daily observations.1 748.0547.1RA 1.0 76470.1RA 1. The differenced data should suffice here even though nonstationarity is probably caused by the 365-day seasonal periodicity in flows.1AM 473.0 retemaraP 3.0 619930.0 000. North Carolina.0 387.0763. IDENTIFY VAR=LGOLD(1) NOPRINT.047092.1RA 2.1RA 000.0 slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV rorrE dradnatS 49350. logarithms of flow rates for the Neuse River at Goldsboro.1RA 455.1 387. are analyzed.326.244.0noitamitsE doohilekiL mumixaM eulaV t 71.1RA 1.0 763. ESTIMATE Q=1 P=3 METHOD=ML NOCONSTANT MAXIT=100. You can obtain a model for the logarithms of the Goldsboro flow rates by using the following SAS statements: PROC ARIMA DATA=RIVER.1 49378.1AM retemaraP 3.1 etamitsE 42711.61 78. North Carolina.841197991.0000.4 tuptuO . IDENTIFY VAR=LKINS(1) CROSSCOR=(LGOLD(1)).< 3.0 1.1RA 1. the flow rates develop a seasonal pattern over the 365 days in a year.0 473.0 2. Taking differences of the logarithmic observations produces ACFs that seem well behaved. AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw ataD wolF fo smhtiragoL gnizylanA gaL 3 2 1 1 |t| > rP xorppA 7920.17.0455.1RA 2.0 87850.0 6000.

**| .0 994660. |*** | .43 81.0 470. |*** | .0 590.0020.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.08590. | ****| .23 81.0 230.ledom siht ni mret naem oN 1 gnicnereffiD fo )s(doireP DLOGL elbairaV rof ledoM 140.0 2053400.0 41845.0 7824.71511.0 qSihC > rP 44 83 23 62 02 41 8 2 FD 12.0560.0100.0 84350. | . |*** | .27021.0320. |**.0 9186.00160400.0 7437.0140.0 5242100.48701. | . | .41 76.0410. | .04505200.0020. *| .0 010.0 1173.0 740.0700. | . | ***********| . |*** | .08471.0 477170.0 600.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 203 .1 :1 rotcaF srotcaF egarevA gnivoM )3(**B 42711.0 040.0660.35061.0 520.0 100.0 500.06408200.0 320.0 470560.0 508600.0 040.0 65130.0 250.0500.0 824070.0910.0 220.0 600.0 360050.0 31337000.908170.04252000. *| .0420.47241.0980.1 .1 noitalerroC 7174100.35841.0 540.68010.0 920. |**.0270.0 750860. |**** | .0240.0 517460.0 00000.0 + )2(**B 47092. | .0 371960. |**.00257400.0 230. |********************| | | | | | | | | | | | | | | | | 43360.22 91.0 343360.0080.09054300.62 51.1 srotcaF evissergerotuA . |* . | .0420.0 476170.0 332320.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 070560.0 537210.0500.45402.0 7905.0 800.0 810.0 7086.0 996960.03613300.0120.06927300.0 170. | .0 5557.0700.05558.0 42781.0300.0 400.0 + )1(**B 38042.0 170.06576200.0 0 rorrE dtS | .0 210.0610.0 850.8 77.0 .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.91 82.0 902170.0 125560.07522200.

0161.094701. .083260. . . |** **| . | . |** .0690.0 19050. |*. | . | | | | | | | | | | | | | | | 34610. |*********** | | | | | | | | | | | | | | | 57271. .0 62510.0- 030.0 360. |** .*| .*| .0101. |*** **| .038550.0 93075. . .0 48161.0 511. . |*** *****| .0781. . .0- 960.041845. | .076780.< qSihC > rP 42 81 21 6 FD 18.0 40631. |*.074820.080140. .0 121.222 04.0110.0 470.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. .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 | | | | | | | | | | | | | | | . .073360. |*** ***********| . | .0 341.046600.132 14.0 37040.*| .*| .0- 750.0845. | . .008590. .0 48700.*| .089050. . |*. .071001.050.< 1000.087062.0502. .006980.066421.212 98. . |*. | . .062420.0 230.4 tuptuO 204 SAS for Forecasting Time Series . .0 20100.0 1000. | . |*.0 470. |*.0 97950.0 941. |** .< 1000.0 200. .< 1000.0 350.0 670.089830.351 erauqS -ihC 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- esioN etihW rof kcehC noitalerrocotuA | | | | | | | | | | | | | | | .0 20550.0 47400.0801.0 571.

| .29561.09462400. | .0 08910. | . |*. . | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 23310.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 205 . .018244000. .77050. . | . .00351200.059344000. | .0 01816000.0 77596.0 15920. .08714000.*| .0 10772000. . |** .0 30029000. . ***| . | .*| .*| .noitalerroC 34243000. |** . .*| . |*.73140.0 91196000. .0 56860.0 05830. .0 9805000.0 0852000. . | . | .0 2892100. .00775000.0 95857000.0 58010000.72710.54220.*| . .83100.0 5972900.0 32021000.0 98620.0 91050.0 00163.decnereffid neeb sah DLOGL elbairaV )deunitnoc( AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw ataD wolF fo smhtiragoL gnizylanA 71.0 40010. | . |*.52610. | .0 9950000.04502200.0 1092100. .denetihwerp neeb evah seires htoB 705930.0 588710.0 32210.| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . .0 86400. .0 527610. . | . .0 24000. | .0 1010100.0 87010.67380. | . | .0 92930. |*.0 30734000. .0 92413000. . | .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 .08580.*| . .05360100.32710.00503100.034530000.93300.0 00710.0 50420.0 27989000.0 6467100. .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 . .03780000.0 97530. *******| . **************| .0 33200.0 05050. | . .

0 + )1(**B 38042. This also implies that t statistics for the model parameters are computed from improper standard errors.1 .< 1000. Add the following SAS statements to the code above: ESTIMATE INPUT=(1$(1)LGOLD) PLOT METHOD=ML.0500.0 631.0 930.942 93.0110.0 720.206 SAS for Forecasting Time Series The output from the ESTIMATE statement shows a reasonable fit. The cross-correlation check looks reasonable.842 71.1 srotcaF evissergerotuA srotcaF egarevA gnivoM retliF gninetihwerP 340. 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.0 680.< 1000.662 88.0 210.1 :retlif gniwollof eht yb denetihwerp neeb evah selbairav htoB 100.0 960.0 seireS neewteB kcehC noitalerrocssorC 910.0150.0 070. but the autocorrelation check indicates that the error is not white noise.0 .< :1 rotcaF FD 42 81 21 6 erauqS -ihC 58.0 710.0 050.362 05. -------------------snoitalerrocssorC-------------------- 310.0 + )2(**B 47092. RUN.0 130. with little other effect.0 )deunitnoc( AMIRA CORP :stnemetatS ETAMITSE dna YFITNEDI eht htiw ataD wolF fo smhtiragoL gnizylanA 460.0 )1(**B 49378.0710.0 150. Diagnostics from the PLOT option are used to identify an error model. 1− t X) Bθ − 1(C Results are shown in Output 4.0 310.18.4 tuptuO gaL oT 32 71 11 5 .0 163.0 696.0420.< 1000.0 )3(**B 42711. This suggests function.0:1 rotcaF qSihC > rP 1000.

0 940.0 320.0 140.0360.0 041.251 81.< qSihC > rP 84 24 63 03 42 81 21 6 FD 42.0330.0 350.01MUN DLOGL 020.731 94.0 6798100.131 53.0910.0780.0 020.0 840.0164.< 1000.67 erauqS -ihC 84 24 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.0 53700.0240.0 rorrE dradnatS 73822.0240.< 1000.0450.0290.0 601.0 240.< 1000.1 810.0- 310.0 650.411 15.0- 301.0370.< 1000.0 810.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 207 .0 4503400.450.808948.0- 650.0051.0000.0010.0 eulaV t 60120.1MUN 1MUN UM DLOGL DLOGL SNIKL retemaraP elbairaV setamitsE retemaraP fo snoitalerroC 793 798.0 961.1MUN DLOGL 014.0180.021 79.0 400.< 1000.0- 810.< 1000.0130.78 04.1 014.0 591.0 310.0 etamitsE 1.0990.02 44.0860.0880.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.< 1000.0- 821.0930.028337580.0 898100.1 UM SNIKL 1.0950.0 1000.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.< 4956.090134.0960.0 500.0 330.0 320.< 1000.0950.0 260.0260.0501.0513.0630.0 000.0 1.0 440.0 70120.0 |t| > rP xorppA 48.79 51.

4 tuptuO 208 SAS for Forecasting Time Series .09377000.0 98802.0 311060.01546000. | . . |*** | .08534100.0 269950. | . ****| .13513.*| .0 12160.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 ".0 981050.80450. | **| . |*. |********************| | | | | | | | | | | | | | | | | | | | | | | | | | 41960.0 489060.0 82134000. |*. | . | .0 75850.00535000. | .07290000. . |** | .031510. . .05713200. **| . |****** | | | | | | | | | | | | | | | | | 25390. | . .*| .*| . | .0 479850.68861. | . | . |** | . |** ***| . **| . |* .*| .02142100. | . .0 259450. |* .21320.0 374160. | . | .*| .0 94650.0 262850.0 10870. | .0 403550. **| .32601.0 511060. | .0 610750.0 644950.0 1053700.0 92070.059290.0 12010.0 90530.0 775260.24041.*| .0 86850.0 061060.0 78190.0 480060. |**** | .00040000.0 55000.0 089060. |** | .00071000.67780. **| .077651.0 747850.015762000.0 583260.89230. . | ***| .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 190060.0 58601.0 1570000.0 0 rorrE dtS | .0 6795000.0 25034000.54500.0 28160.07242000.*| .1 noitalerroC 2805000.0 55121.0 10430. *| .97270.04630.0 688950.0 527950.053471.035793000. | . .0 4001100.08087000.01230100.43591.0 33240.0 621160. | .0 03180. ***| . |*.*| .*| .0 42576000.0 56182. | .0 61113000.04242000. .10330. |*.0 325260. |*** | .| | | | | | | | | | | | | | | | | .0 27941." 126260.0 53454000. | .03501. | .0 00000. | .16210.0 16730.

0630.0 89680.0 3955.0 390. .0540. | . .0 270.048702.0 650. |** .068111.0 600.0 12870.*| .0550. **| .0110. | . |** .0520.0700.0 260.060740.0 010. | . .0 500. | .0560. | | | | | | | 89900.11 80. |*. .4 erauqS -ihC 74 14 53 92 32 71 11 5 gaL oT -------------------snoitalerrocssorC-------------------- DLOGL tupnI htiw slaudiseR fo kcehC noitalerrocssorC | | | | | | | | | | | | | | | | | | | | | | | | .42 41.013910.086070.039670.0 320.0 49270. . **| .097680. |** . | .0 800.0 10330.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 209 .0 80530.0 110. | . .0 55890. |** . .0 700. |*.*| .0 20400.068310. |*.0840.0 910.0 4104.059190. |*.0 760.0410.0 84751.*| .014431.0 2523.0 99900. .44 21. |**** ******| .074360.0041.0210.0 560. |** .077770. .057930.059710. |*. .33 77.020270. | | | | | | | | | | | | | | | | | | | | | | | | 70310.*| .0 5434. |** .0670.0360.0510. | .0610.0 020.0 2022.05 07.0140. .0170.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 | | | | | | | . .013513.72 40. |** .0- 750.0 3913.0 101.0700.0 420.0740.0621.0 48320.0630. .0- 440.0 360.064070. | .0200.0720.0720. .0 330.0 830. . . |*** .12 11.0 3735.0 240. | .0 3035. .0 qSihC > rP 74 14 53 92 32 71 11 5 FD 38.050320.330.004280.0 42 32 22 12 02 91 81 )deunitnoc( noitpO TOLP eht hguorht ledoM rorrE na gniyfitnedI :setaR wolF gniledoM 81. |*** .

this is an example of a leading indicator.0 + 90134.1) model fits the error term. Because you encountered a pure delay.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. + B52361. 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. − 1( / = t SNIKL ∇ 81. RUN. Output 4.210 SAS for Forecasting Time Series An ARMA(2.4 tuptuO .1 + 1( 93594. although this term is generally reserved for economic data. )deunitnoc( noitpO TOLP eht hguorht ledoM rorrE na gniyfitnedI :setaR wolF gniledoM 1 898100. and the model becomes ) B7788.19 shows the results. More insight into the effect of this pure delay is obtained through the cross-spectral analysis in Chapter 7.0 )1(**B 73822. :1 rotcaF ∇ ) B55.

0020.0020.0 2.1AM DLOGL DLOGL SNIKL SNIKL SNIKL retemaraP elbairaV setamitsE retemaraP fo snoitalerroC 793 84.0 rorrE dradnatS 62055.0 650.0 840.1RA SNIKL 790.1RA SNIKL 190.010.33 01.0 420.0621.0520.0 290.0100.01.0 3071.0650.0 121.0 810.1RA 1.1 874.0 etamitsE 1.0801.0 440.0 530.1AM SNIKL 1.0 240.052361.988993.0 801.93 66.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.0340.0 0270.62 15.0 320.1MUN 1ELACS 2.0 874.0840.1 816.2138.0250.0 540.< 1000.0460.02 70.0250.1MUN 1ELACS 2.32 23.0 500.0500.0 qSihC > rP 54 93 33 72 12 51 9 3 FD 87.01 73.0 74810.0 4781.0 300.1RA 1.0100.0800.0- 820.0- 111.0 60530.0 1ELACS DLOGL 240.0 490.0150.0 816.0 910.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.13 40.093594.0 000.0 440.0010.0540.74 04.0 010.0000.0 000.0 790.0 8649.0650.0 6443.0 400.0 030.0 1.1 121.0 64050.0190.< |t| > rP xorppA 21.0210.1 095.0530.< 1000.0 810.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 211 .0 530.0 5063.1MUN DLOGL 095.0 2254.0 850.0 810.0 46540.52 eulaV t 04540.1RA 1.0 5462.0 700.0- 450.< 1000.73 03.0541.0 621.0 231.1 1.0 200.0 500.0 838500.0 36974.1RA 1.< 1000.909704670.1 67788.0 630.0 500.0 erauqS -ihC 84 24 63 03 42 81 21 6 gaL oT --------------------snoitalerrocotuA-------------------- slaudiseR fo kcehC noitalerrocotuA 000.0000.

0430.0 620.0830.0 0561.92 21.0 + )1(**B 52361.41 14.0 + 1 :1 rotcaF srotcaF rotaremuN 493594.0300.0 140.0 520.0 980.0200.0 010.0600.0 800.0650.0 5812.0580.0 810.04 84.0 910.0 qSihC > rP 64 04 43 82 22 61 01 4 FD 41.0 260.82 59.0 200.0100.0 240.0830.4 tuptuO 212 SAS for Forecasting Time Series .84 85.0 1 1 DLOGL rotcaF noissergeR llarevO gnicnereffiD fo )s(doireP tfihS elbairaV tupnI 1 rebmuN tupnI )1(**B 67788.0 201.55 06.0350.0740.0- 4761.0 970.0 840.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 150.0300.0450.0040.0401.33 79.0 800.0 5071.0 001.0 8202.0 380.0 0431.0- 960.0440.0 6030.0540.0630.0300.0 .)1(**B 62055.0 040.0600.0 420.0 2911.0 031.0 440.0130.0 230.0 880.0780.1 .ledom siht ni mret naem oN 1 gnicnereffiD fo )s(doireP SNIKL elbairaV rof ledoM 710.1 srotcaF evissergerotuA :1 rotcaF .1 :1 rotcaF srotcaF egarevA gnivoM )2(**B 36974.

Thus. X21=1 and the previous Xs are 0.. ESTIMATE).3. + 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). 6.. Compute cross-correlations. Now change t Y Y .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. . Forecast X and Y (FORECAST). you see that ratios of polynomials in the backshift operator B can provide interesting approaches to new levels. 3. . If the model is you have through time 20 and or esion At time 21. 2. Fit transfer function and compute and analyze residuals (ESTIMATE.3.4 1. 5. PLOT).3. to identify transfer function form (IDENTIFY). Prewhiten Y and X using model from item 1 (IDENTIFY). Identify and estimate model for input X (IDENTIFY. (j). 4.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. Thus. You can also write ) β + α ot α morf ( after time 20. + ρ − 1( / β + ′ α = ) . Y experiences an immediate level shift the model to ygetartS gniledoM fo yrammuS 4. 4. so At time 22 you get Yt eventually approaches ) if you ignore the noise term. esion +) . Fit transfer function with noise model (ESTIMATE).

20 Plotting Intervention Models . you cannot prewhiten. Output 4. Several such response functions for Xt=1 when t>20 and 0 otherwise are shown in Output 4. 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. Therefore.214 SAS for Forecasting Time Series When you use an indicator input. impulse-response weights are not proportional to cross-covariances.20.

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.

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

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

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

0530. The first time is 1.11 70.2 t X t X dnerT .0 920.0- F > rP 4690.0 1902.384. IDENTIFY VAR=CALLS(1) CROSSCOR= (IMPACT(1)) NOPRINT.421 6311.369.0 100.0 200.0 021.0 7832.5 07. and a larger-in-magnitude and positive Motivated by the pre-intervention analysis. 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.4 48.0.0 SLLAC elbairaV rof ledoM srotcaF evissergerotuA 0 = 0β uaT 81. ESTIMATE INPUT = ((1)IMPACT) P=(12) METHOD=ML.0030.0 1158.0- ohR < rP 9999.0 2521.1 slaudiseR fo kcehC noitalerrocotuA β − 0β )21(**B 43965.0 400.0 3868.61 01.0810.0 8733. 0β β .0 −t FD 32 71 11 5 sgaL 31 21 3 2 erauqS -ihC 46.0590.0060.220 SAS for Forecasting Time Series Output 4.3 X 941.0 . The intervention variable IMPACT is created. Since the majority of the drop is seen in March.0760.0 1 553770.0910.1 280.0560.1 .0 uaT < rP 4290.0 930. Pre-intervention Calls Data stseT tooR tinU relluF-yekciD detnemguA PROC ARIMA.0 5400.1 :1 rotcaF β ohR 6393.2- erudecorP AMIRA ehT gnicnereffiD fo )s(doireP naeM detamitsE 820. you fit an intervention model of the form where is the IMPACT variable at time t.0 9841.0 8880.0 600.0580. The code is as follows: t ------------------------------------------------------------------------------- ---------------snoitalerrocotuA--------------- 940.0 9999.0 7305.25 2981.240.077 per month.81qSihC > rP 3628.0 A first difference will reduce a linear trend to a constant.0- F 64.0760. having value 1 from February 1974 onward.0 111.4 73. RUN. so calls tend to increase by 1.6 17. you try the same seasonal AR(1) error structure and check the diagnostics to see if it suffices. t X )B1 epyT gaL oT 42 81 21 6 β − 0β( .138071.0510.22 Unit Root Tests.0 1547.0 760.

0 420.22 9297.< 1000.< 9914.0850.0 910.0slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC 07243.1MUN 1MUN 1. and this indeed happens.0011.0 610.0- TCAPMI TCAPMI SLLAC SLLAC 620. Output 4. that is.7 34.0 6887.0610.91 40.6 18.0620.0- YAD REP SLLAC EGAREVA YLHTNOM .0 510.2361 363.0 07.0 9027.0 8156.0 390.91 74.< 1000.32154054.0550.0 2436. Despite this.0 slaudiseR fo kcehC noitalerrocotuA 871 90.0600.ECNATSISSA YROTCERID 1 0 21 0 520.0 97688.0 100.0920.qSihC > rP 501.0 120.0030.0 220.305 496972.23 that all terms except mu are significant. Because the model has a unit root.686.02 20593.0 860.2 120.3 retemaraP 1.0880.9161 33544. The trend part of the fitted model is overlaid on the data in Output 4.1 noitamitsE doohilekiL mumixaM |t| > rP eulaV t rorrE xorppA dradnatS 1000.11 19.0 36823.0261.22 38.1RA UM gaL oT 03 42 81 21 6 erudecorP AMIRA ehT .0 2138. the model seems to capture the intervention well and seems poised to offer an accurate forecast of the next few values. It also explains why the standard error for mu is so large.0 890.Chapter 4: The ARIMA Model: Introductory Applications 221 It is seen in Output 4.0520.23 PROC ARIMA for Calls Data tfihS elbairaV gaL 0 0 0 0 ------------snoitalerrocotuA------------.0 260.004 16881.2 FD 92 32 71 11 5 erauqS -ihC 37.24.02 04760. An additional drop of 400 leaves the calls at 523 below the previous levels.0900. with random walk errors it is difficult to accurately estimate the drift term. the data can wander fairly far from this trend.0 640.0 etamitsE 22196. so there was an anticipation effect.0 901. The drop of –123 in calls the month prior to the charge is significant.0840.

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

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

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

26 Plotting the Original Data Output 4.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 .

052 42.23626 50956. indicating a first differencing. .0 63. as you will see.0 1000. Heeding the remarks at the beginning of this section. The plot of the data displays nonstationary behavior (nonconstant mean). with the ACF spikes at 1 and 12 indicating MA terms at lags 1 and 12.0 63147.0 8.elbatsnu si setamitse wen eht yb denifed ledom ehT :GNINRAW erutcurtS AM evitacilpitluM eht gnittiF 82.1AM UM retemaraP noitamitsE doohilekiL mumixaM erudecorP AMIRA ehT .0eulaV t slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC 99668.0 50956.detanimret neeb sah ssecorp noitareti ehT .2581 3462.0 10000.12) differenced variable indicate that some MA terms are needed.645563 42872. The original ACF shows slow decay.1 rorrE dradnatS 97999.131 508.38 79950.2AM 1.021 1 0 gaL 5099.329doohilekiL naissuaG goL 14931. Such a structure also serves as a check on the differencing.0 90.0 78925.0681 81. The Q statistics and ACF on the SALES(1.0 |t| > rP xorppA 10.< 6666. The ACF of the differenced series shows somewhat slow decay at the seasonal lags. 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. The results are in Output 4.degrevnoc evah ton yam setamitsE 8 100.degrevnoc evah ton yam setamitsE :GNINRAW . indicating a possible span 12 difference.0etamitsE 1.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 . Adding ESTIMATE Q=(1)(12) ML.28.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.21 34.96 100.

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

1161.69326606. ESTIMATE INPUT=(S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11) p=2 q=1 ml.17346136.24669197.< 6200. PROC ARIMA DATA=NCRETAIL.208.28 91463. and Since errors should be stationary for proper modeling in PROC ARIMA.066693.29014.0 55141.67454284.707.383.< 1000.0 3000.0 41328. SYMBOL3 V=NONE I=JOIN C=BLACK L=1 R=1 W=2. 2 S∇ δ + S∇ δ + β = Y∇ tj S 2 t Z etamitsE 81845.587.644.49 41068.410.3 55. The data set had 24 missing values for sales at the end with seasonal indicator variables nonmissing.46263549.1102.88 06135. 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. WHERE DATE> '01JAN90'D.524.4 11 rorrE dradnatS 50216.09 46154.5 + t.429. PLOT (SALES L95 U95 FORECAST)*DATE/ OVERLAY HREF ='01DEC94'D.42477203. FORECAST LEAD=24 OUT=OUT1 ID=DATE INTERVAL= MONTH.0 1000.< 1000.0 48041.228 SAS for Forecasting Time Series Now is stationary if has a unit root.09 36049.< 1000.< 1000.30.860111892.11 STSACEROF FO SRAEY 2 SELAS LIATER CN erudecorP AMIRA ehT Z∇ + S∇ δ + eulaV t 49.1183. Note that the seasonal indicator variables can be generated without error and so are valid deterministic inputs.< 1000.1AM UM t Z∇ .29 92450. PROC GPLOT DATA=OUT1. SYMBOL1 V=NONE I=JOIN C=BLACK L=1 R=1 W=1.0 09098.1RA 1. the model will be specified in first differences as .18 77329. The following code produces Output 4.< 1000.04411756.59 42521.0 = α − α = α∇ t t. 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.76421805.78 20495.< .62 t.< 3710.< 1000.0 1000.29 and Output 4.98 51363. This code fits the model with specified as ARMA(2. RUN.1 1 92.401.433.39 13763.1 The parameters have the same interpretations as before.4 tuptuO retemaraP t 11MUN 01MUN 9MUN 8MUN 7MUN 6MUN 5MUN 4MUN 3MUN 2MUN 1MUN 2.0 1500.206. SYMBOL2 V=NONE I=JOIN C=BLACK L=2 R=2 W=1.1RA 1.039605.< 1000. RUN.1) and plots forecasts.

0 qSihC > rP 12 51 9 3 FD 48.6931 5S 706.72 80.0801.0 310.0 750.0 030.0 430.1161 3S 31.54 slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC )deunitnoc( selaS liateR aniloraC htroN rof ledoM lanosaeS 92.62 gnicnereffiD fo )s(doireP tpecretnI detamitsE :1 rotcaF SELAS elbairaV rof ledoM 961.549.6741 4S 284.0 .0222.7 88.0 1085.0730.0 + 1 srotcaF evissergerotuA 1 41328.06441.0 040.1 srotcaF egarevA gnivoM )2(**B 11892.61 55.1 erauqS -ihC 42 81 21 6 gaL oT ---------------snoitalerrocotuA--------------- slaudiseR fo kcehC noitalerrocotuA 341 344.0 690.0 3795.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.932 26.79375 29854.0 800.0310.0 + )1(**B 66693.0030.0 911.2302 100.0 900.0 410.0420.0 0773.0 801.0 100.0 670.29011 2S 14.4 tuptuO Chapter 4: The ARIMA Model: Introductory Applications 229 .0 610.0 120.0 861.8891 875.0 020.

932 rorrE dtS 6688.493 1210.1358 5848.2767 8684.4387 1376.342 9886.782 4468.6578 3640.863 4501.3288 2698.9327 9534.1327 2492.4387 9739.8118 4772.0441 9S 756.6946 5386.4008 3939.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.772 1528.4107 5686.4 tuptuO 230 SAS for Forecasting Time Series .7857 3148.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.5427 3339.2427 2595.162 7995.1408 9975.573 6257.5678 8750.7737 2964.0208 4403.3807 7965.183 8182.2068 3311.1338 2012.004 8222.6188 2593.6427 1070.6877 7204.143 2781.553 2034.1497 2137.7641 11S 805.7728 5399.1731 7S 236.2461 01S 297.9077 9882.3028 9340.592 4192.5258 1615.303 7058.7187 1214.5197 2812.1417 8800.2478 1110.4241 8S 303.0018 7281.042 0875.263 5133.8317 2720.0696 0537.7056 5222.0996 5173.6428 7839.7628 2712.433 1048.072 0269.4338 1800.6507 3504.3657 8101.2239 9261.4733.2617 3718.0218 4069.913 1795.883 1007.5026 4302.8347 6674.2867 9631.0036 9953.4827 6265.9277 2968.4427 7028.4077 0316.8986 0407.7807 2082.1308 6237.604 4733.5538 1206.5617 3876.623 1463.9287 6326.7667 9758.7807 1777.3997 2274.7257 2331.4488 1689.113 4246.0568 2861.9057 2238.843 6193.7766 7767.9417 0233.7507 8331.

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

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

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

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.2 90238.38 etamitsE 1.1MUN 1MUN 1.02 98230.< 1000.0 0 0 0 0 0 0 x x x selas selas selas selas 1 1 0 21 1 2 0 1000.< 1000.0 85269.11 60.0 01089.34 Model for Milk Sales Intervention Output 4.9392987.0 92943.< 1000.< 5300.2RA 1.33 Effect of Tainted Milk 234 SAS for Forecasting Time Series .1RA 1.1NED 1.4133.005510.5 29.0 1000.268.0 08911.61 90.< 65.94 14698.81 37.< 1000.0 66501.0 71435.2 46960.0 43955.3 15016.

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

3 24070.11 35.0 16213.079459.< 1000.61 77.1AM UM retemaraP tfihS elbairaV gaL |t| > rP eulaV t rorrE xorppA dradnatS Output 4. ESTIMATE INPUT=((1)/(1)X LEVEL1) P=(1)(12) Q=(2) METHOD=ML.< 1000.57 etamitsE 2MUN 1.4 78.920.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.3 56437.0 43611.0 07299.0 1000.31 36689.61 22.754 3722. PROC ARIMA.0 63021.1343677.1NED 1. IDENTIFY VAR=SALES NOPRINT CROSSCOR=(X LEVEL1).1RA 1.2 06.2 35330.< 4110.35 and Output 4.35 Model Allowing Permanent Effect noitamitsE doohilekiL mumixaM 236 SAS for Forecasting Time Series Output 4.77 8779.< slaudiseR fo rebmuN CBS CIA etamitsE rorrE dtS etamitsE ecnairaV etamitsE tnatsnoC 58.934 920607. .0 15717.0 45455.0 24492.36 show the results.36 Intervention Model with Permanent Shift Output 4.< 1000. RUN.0 4900.2RA 1.84 77676.1MUN 1MUN 1.72 77622.2 69097.259.01 56565.2 33342.< 1000.

0 1384.0990. The stock market was closed following this incident and reopened September 17. 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.76B)Xt + 1.79 permanent loss in sales.4.0960. In that sense.96(2. A model that seems to fit the data reasonably well. in Queens.49 on the day it happened. so there is not a lot of information about the nature of the response to the second incident. including the estimated 10.48B)/(1–.0860. Of course.0- slaudiseR fo kcehC noitalerrocotuA 840. the inclusion of this lag ---------------snoitalerrocotuA--------------- 691.0210.0411.0 2856. The second incident sparked a j log(volume) increase 1. 97.57 920.81 72. The permanent effect of the events of September 11 on log volume would be (2.21 74. at this point it is clear that the old model was misspecified. 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. indicating a faster approach to the new level than that from the first model. as it did not include LEVEL1.49) above what it would have otherwise been.4.84B) et where Xt is a level shift variable that is 1 after September 11 and 0 before.0- 080. but it is not statistically significant.0490.0 010.0 FD 12 51 9 3 erauqS -ihC 82. The numerator lag for X allows a single arbitrary change from the initial shock (followed by an exponential approach at rate 0. an American Airlines jet crashed on November 12.2 gaL oT 42 81 21 6 Output 4.0005 and those for the chi-square check of residuals were all larger than 0. Other models can be tried.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. You can add and subtract 1. 2001. The AR1. defined similarly to those of the milk example in Section 4.4 Terrorist Attack On September 11.80) (1.0 270.35.01 4.0 521.0 881. while Pt is a pulse variable that is 1 only on the day of the second incident.76 to the eventual new level).95. are significant.1 coefficient 0.58–2.0030.79 to get an approximate 95% confidence interval for the permanent component of the sales loss due to the contamination scare. according to the model.56565.0 190.9 64.52B)/(1–.48)/(1–. log(volume) is (0. Seasonal dummy variables might be tried in place of the seasonal AR factor.29 is quite a bit smaller than 0. Data through November 19 are used here. according to this model.76) = 0. 2001.0 010.49/(1–. resulting in the collapse of the World Trade Center in New York City.36 Intervention Model with Permanent Shift (continued) .0 qSihC > rP 0136.46 according to the model. The estimated permanent level shift is about the same and still significant in its presence. is log(Volume) = 0.0 090. but j days later.0 9493. New York.2268) from 10. with parameters estimated from PROC ARIMA. suggest that some sort of trend might be added to account for a decline in consumer preference for milk.0 760. All estimates.0011. The geometric rate of approach to the new level is 0. American Airlines flights were among those involved.0110. 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. In a second incident. The p-values for all estimates except the intercept were less than 0.0380. A simple linear trend gives a mild negative slope. terrorists used commercial airliners as weapons to attack targets in the United States.53 from the first model.59–2.80B) Pt + (1–.05 + (2.0 020.0330.3. indicating an excellent fit for the 275 log transformed volume values in the data set. Liu et al.

With that in mind—that is. It is also interesting how similar the decay rates (denominator terms) are for the two incidents. Two horizontal lines. with no adjustments based on recent residuals—it is striking how closely these forecasts mimic the behavior of the data after this incident.66.05) = 1. Output 4. . a 58% increase in volume.76)) = 1. one at the pre-intervention level exp(0. That becomes a multiplicative increase of exp((2. the existence of a permanent effect remains in question. The model was fit to the full data set.48)/(1–.76) in log transformed volume.59–2. are drawn.05 + (2.59–2.37 shows a graph of the data and a forecast from this model.76)) = exp(0.48)/(1–. 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. The permanent effect of the event of September 11 is an increase of (2.37 American Airlines Stock Volume Calculations from the log model were exponentiated to produce the graph.51) = 1. Output 4. The level shift variable for the second incident did not seem to be needed either.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. according to the model. but with so little data after November 12. only the X and P parts of the model are used in the post-September 11 forecasts.58.48)/(1–.05 and one at the ultimate level exp(0. that is.59–2.

) α − 1(/ 2σ σ t e AR(p) series.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.5 2.5 1.5 942 secnairaV lauqenU rof HCRAGI dna .5 362 stooR tinU dna noitargetnioC 5.5 562 elpmaxE evitartsullI nA 6. from which the normal density function of α t e + 1− tZα = Z retpahC .HCRA 542 secnairaV lauqenU 142 ytisrevinU a ta dnameD ygrenE :elpmaxE 932 srorrE evissergerotuA 932 secnairaV lauqenU dna srorrE seireS emiT htiw noissergeR 1. Such a model can be written in two steps.5 and 5.2.5 4.1.5 where | |<1 for stationarity and t t Z + X1β + 0 β = Y t t 652 noitargetnioC 2.HCRAG .5 372 sgaL eroM dna stpecretnI 8.2.2. The variance of t Z is ) with obvious extensions to multiple regression and .2.5 572 XAMRAV CORP 9.2.5 072 rotceV gnitargetnioC eht gnitamitsE 7.2.2.2 2 5.1.2. you can write t X Y t 972 stsaceroF dna scitsongaiD 11.5 852 seulavnegiE dna noitargetnioC 2.2.2.5 3.1 Autoregressive Errors 5 The ARIMA Model: Special Applications ~N(0.1.1.5 062 sledoM redrO-rehgiH ni stooR 4. With a response related to a single input and with an AR(1) error.2.1.5 652 noitcudortnI 1.5 772 setamitsE eht gniterpretnI 01.5 062 noitcnuF esnopseR eslupmI 3.

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

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

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

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 .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.71 eulaV t 3297.0001) indicating nonzero lag 1 Chapter 5: The ARIMA Model: Special Applications 243 .0 161294.0 57720.61 02.0 918137.< 1000.01 84.< 1000. thus showing that the DW statistic tends to be less than 2 under positive autocorrelation.noitalerrocotua evitisop gnitset rof eulav-p eht si WD<rP :ETON 1000.< 1000.4 17.0 266875.5331.0 988423.5 27.0 262763.851 0472. is significantly less than 2 (p<0. The autocorrelation plot shows strong autocorrelations.were alike (strong positive correlation).0 960035.208 953 WD < rP erauqS-R latoT CIA ESM tooR EFD 0000.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.noitalerrocotua evitagen gnitset rof eulav-p eht si WD>rP dna .0 555123. The correction for autocorrelation reveals that lags 7 and 14 are present.0 486134.< 1000.0 8397.1 1335.0 73826.051 8541. If and be near 0.72 3953 etamitsE 1 1 1 1 1 1 FD 1PMET KROW HCAET QSPMET PMET tpecretnI elbairaV .202 rorrE dradnatS 3380.43 5862 3351 8897.< |t| > rP xorppA 88.2 OLS Regression = 0.< 4978. | *******| | ********| | ******| | ******| | ******| | *******| | *********| | **********| | ***********| | ***********| | **********| | *********| | **********| | ************| | ***************| |********************| | | | | | | | | | | | | | | | | 130353.5 2928.0 067954.3295 98982.5 19. The Durbin-Watson statistic.0 690874.0 2153.0 362092.0 210683.0 000000.0 860755.5 2728. The DW is expected to be near 2 for uncorrelated data.< 1000.0 188394.0 4978. Extensions of DW to lags of more than 1 are available in PROC AUTOREG. then would autocorrelation in the errors.

the model for the error is written with plus rather than minus signs—that eulaV t 06. Note that AUTOREG cannot fit moving average terms.4. te = tZ) p B p α + .8 73.4 Final Estimates Using OLS from Output 5. All others of the 15 lags you started with are eliminated automatically by the BACKSTEP option.0749451.< ± eulaV t 44.259.0 8740.6 36. producing the final estimates with correct (justified by large sample theory) standard errors in Output 5.< 1000. the likelihood function is computed and maximized. This error model is a bit more aesthetically pleasing than that of AUTOREG.00550. a model with p=(1).0 2300.704 41− tZ 21.0 387751.0277721.383.0 + 5− Z 51.52 48.3 0034.< 1000.7. but lags 5 and 12 are a little harder to justify with intuition.0 1840.0 9835.0 128040.0 = etamitsE 5411. Lag 1 is also sensible.0 1174.2 62.0 1000..08141.0 8131.00241.0 3300.0 4050.6 83.< 1000.0 1040. Using the same regression inputs in PROC ARIMA.0 1385.0 + 1− Z 85.0911085.< 1000.11 e+ rorrE dradnatS 9640.96(114).2 or from PROC REG.6199.32 8364 t t Z In PROC AUTOREG.00946.0 997540.0t FD 1 1 1 1 1 1 1 1 1 1 1 .281. |t| > rP xorppA 1510.312.< 1000. q=(1. of teaching classes would have been incorrectly computed as 1533 1.511 4782.14) showed no lack of fit in Output 5.208. Output 5. on energy demand.0 + 21− Z 31.3 is t Using this AR(14) structure and these estimates as initial values. + 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 .244 SAS for Forecasting Time Series effect.0 786540.0 tneiciffeoC 096611.96(150)..5.3 Autoregressive Parameter Estimates gaL is. Output 5.52 9192 1101 5047. whereas the correct interval is 1011 1.2 26.0 3900.411 2611. Therefore the AR(14) error model in Output 5. a 95% confidence interval for the effect.< 1000.0 − 7 − Z 61.6 72. as it does not include the unusual lags 5 and 12.279.0 044840.3 8115.41- sretemaraP evissergerotuA fo setamitsE rorrE dradnatS 718440.

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.6 83.0 040. it can be quite apparent just from a graph that this constant variance assumption is unreasonable. Clearly the log transformation improves the statistical properties and gives a clearer idea of the long-term increase than does the untransformed series.7 93.82 78.1. Many macroeconomic time series are better understood on the logarithmic scale over long periods of 1− t t Y 2988 Y Y 108. PROC AUTOREG provides methods for handling such situations.032752.111 37111.0 110. Doing so (not shown here) will show the AIC and SBC criteria to be smaller (better) for the model with the mixed ARMA error.0 elbairaV 220.0 370.0 23803.0 1PMET KROW HCAET QSPMET PMET DNAMED DNAMED DNAMED DNAMED DNAMED 120. The chi-square white noise tests.0 75260.1AM UM gaL oT 84 24 63 03 42 81 21 6 t L . have higher (better) p-values for the mixed ARMA error structure.0 410.0 5991.0220.11 58.0240.0630.0 510.0 19350.0770.0 300.< 1000.< 1000.0 310. In Output 5. that are assumed to have constant variance.0170.0 700.1AM 2. For long data sets.075691.< 1000.52 92748.0480.32 94.0 200.0 200.41 40.0 570.0101.0810.0 7437.0 120.0 250.0 340.0 910. 1920 with = =log( ).0 2204.0 700.0 17794.0 500.02 17.3 22630.356.< 1000.0 1641.76 to December 31.0 24654.363 qSihC > rP 5986.62 05.0940.< 1000.0 601.< 330.0 010.0 200.7 58.83 89.0210. while acceptable in both.0 1.0 520. 5. The purely autoregressive model from PROC AUTOREG and the mixed ARMA error model can both be estimated in PROC ARIMA.3 retemaraP t Y 5MUN 4MUN 3MUN 2MUN 1MUN 1.5803 95880.< 1000.0240.63 42.51 56.3 40209.838 42747.8644 FD 44 83 23 62 02 41 8 2 t D erauqS -ihC 09.52 4.1AM 1.3 Unequal Variances The models discussed thus far involve white noise innovations.0250.Chapter 5: The ARIMA Model: Special Applications 245 Output 5.311.0 1000.0810.0 5756.13) of = the Dow Jones Industrial Average.0 98250.0 3000.1RA 3. somewhat different from PROC AUTOREG and quite different from the OLS estimates.4 03.0700.0000.0- gaL 0 0 0 0 0 1 41 7 1 0 slaudiseR fo kcehC noitalerrocotuA noitamitsE doohilekiL mumixaM |t| > rP xorppA 1000.411 83496.0 7847. or shocks.0 erudecorP AMIRA ehT Y etamitsE 31923.0640.7 96.0711.21 410.0470.0eulaV t 43. 1 Y tfihS 0 0 0 0 0 0 0 0 0 0 ---------------snoitalerrocotuA--------------- 610.0050. 1949 with t =200.0 710.0 04481.< 5000.0 240.0 800.0 3615.0 rorrE dradnatS 37944. and =log( ) –log( ).6 you see graphs of 8892 daily values (from January 1.

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

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

That is. A similar regression using six lagged differences showed all six to be significant according to their t tests. Perhaps this long autoregression is an approximation of a mixed model. tS 7910.1) series with parameters as shown in Output 5.81 50. no further differencing seems to be needed. 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. I VAR=LSTD(1) STATIONARITY=(ADF=(6)).0 . E P=1 Q=1 ML NOCONSTANT.0 31440. using LSTD as the variable name for seems to provide a reasonable ARMA(1. The following code.4 66.0 9999. tS The constant was suppressed (NOCONSTANT) after an initial check showed it to be insignificant.223 6 1252.0001) when six lagged differences are used. the S series appears to be well modeled as an ARIMA(1.1.7. 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. Said and Dickey (1984) show that even for mixed models. and so a model in first differences is suggested for the log transformed standard deviation series The above results are not displayed.223 6 etamitsE 82323. furthermore.1AM 1− t S− S t 1− t S .< 1000.7 ARIMA Model for S dnerT naeM elgniS naeM oreZ epyT gaL 1 1 F > rP F 0100.0 ohR < rP ohR 9999.0 1− j − t t S S− sgaL j −t S t retemaraP S 1.0 41. The tau test for unit roots suggests stationarity of the differenced series (p=0. In summary.< 1− t S stseT tooR tinU relluF-yekciD detnemguA uaT < rP uaT 1000. The tau test for stationarity suggests a unit root process when six augmenting lags are used.1RA 1.1160. .223 6 2279. RUN. The reason for choosing six lags is that the partial is near 0 after lag 6 and.0 56328.< 1000. That test cannot reject the unit root hypothesis.t S noitamitsE doohilekiL mumixaM eulaV t 14.< 1000. these stationarity tests are valid as long as sufficient lagged differences are included in the model.11- rorrE dradnatS 83370.1170.248 SAS for Forecasting Time Series Now apply a time series model to the series. 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.< .1) model: PROC ARIMA DATA=OUT1.0 9999. Output 5.16 1− t S− S t |t| > rP xorppA 1000.16 0100.

qSihC FD erauqS > rP -ihC Exponentiation of gives a conditional 030.0 6322. 5.0010.4 ARCH.0 550.0510.0 500.14 38.43 69.0 420.0500.0 350. First. The theory underlying ARIMA models is based on large sample arguments and does not require normality.0510. so the use of log transformed standard deviations as data does not necessarily invalidate this approach.0 0981. GARCH.0750.0050.32 29. The purpose of the monthly standard deviation approach was to illustrate the idea of an ARMA type of structure for standard deviations or variances.0710. 1− tS ˆ − 1B S S t t D 1B tˆ e where would be replaced by the residual ------------snoitalerrocotuA------------.0540.0 610.0200.0- slaudiseR fo kcehC noitalerrocotuA 820.0650.0 610. tS ˆ t S ˆ standard deviation for month t.0410.0350.0180.0 720.0 131.0510. the resulting standard t S ˆ . there are at least two major problems with approaching heterogeneous variation in the manner just used with the Dow Jones series.0 1436.0410.0 010.0 870.1. However.0270.0 7225.0431.0560. the use of a month as a period for computing a standard deviation is quite arbitrary.0010. and IGARCH for Unequal Variances The series whose variability is measured by has nonconstant conditional variance.0810. Notice that because is a logarithm. A more statistically rigorous approach is now presented.0010.0 440. Thus the usual approach to modeling ARCH or GARCH processes improves on the method just shown in substantial ways.0 220.0 070.73 73.0 400.0610.0 610.0810.0 310.0 540. 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. t .Chapter 5: The ARIMA Model: Special Applications 249 The model suggests the predicting equation 1− tˆ 56328. 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.0 0327.0 64 04 43 82 22 61 01 4 96.7 ARIMA Model for S (continued) t S ˆ .83 83.0 4613.0 + 1− S = gaL oT 84 24 63 03 42 81 21 6 t Output 5.0060.0080. 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.2 t t − ) 2 − S − 1− S(3323. An analyst likely would use the more sophisticated approach shown in the next section.0810.0 4943.0220. 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.0700.0 070.0 3356.91 59.7 70. and second. you will not often have so much data to start with.

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

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

0 369300.858.1 0000.8 IGARCH Model for Dow Jones 252 SAS for Forecasting Time Series erudecorP GEROTUA ehT .0 rorrE dradnatS 2070000. 2988 qSihC > rP CIA erauqS-R latoT raV dnocnU snoitavresbO 9920.1671571310.0 eulaV t 041000.0 1000.1 tseT ytilamroN CBS doohilekiL goL ESM ESS setamitsE HCRAG detargetnI .0 8470000.788655332.0 995010.0 9060.0363000.0 etamitsE 1 1 1 1 1 1 FD 2HCRAG 1HCRAG 1HCRA 2RA 1RA tpecretnI elbairaV 1000.0 8707.< |t| > rP xorppA 88.3 36. .2eulaV t 995010.3 97.0 675900.< 1000.0 etamitsE 1 FD tpecretnI elbairaV 0000.0 421.0 1000.66482 8371000.< 8000.0 130.< 1000.1000.0 |t| > rP xorppA 05.11 06.22965.0 1988 erauqS-R latoT CIA ESM tooR EFD 7249.71 73.degrevnoc mhtiroglA 05.0 3230.0 95873545.0tneiciffeoC 2 1 gaL sretemaraP evissergerotuA fo setamitsE 5516.0 8680.0 126920.3 29.0 137900.0 rorrE dradnatS 4222.6883 300.457155371000.0 189245.0 8960.1 nostaW-nibruD erauqS-R ssergeR CBS ESM ESS setamitsE serauqS tsaeL yranidrO wodd elbairaV tnednepeD Output 5.4 eulaV t 3750.< 764.0 rorrE dradnatS 421730.

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

so their contribution to forecasts and to the width of prediction intervals into the future is imperceptible in the graph. the -based intervals are appropriately narrower.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. ( ). It appears that ( ). Clearly the IGARCH estimated mean 0. two horizontal lines. but not exactly. 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.n t where Although the lag Z coefficients are statistically significant. Since the last few data periods were relatively stable.t h h 2 t ε 2−t h − 1− h t 1+ n h 1− t h− h t 1+ t t ε + 2 − tZ3230.254 SAS for Forecasting Time Series Output 5. The ordinary mean 0. the resulting danger of bias. The . and its failure to represent the observed growth over the period. The autoregressive error model is seen to be 2 . and were fairly small at the end of the series. they are small. They are almost.00007 is an unbiased estimate and exactly reproduces the observed growth.000363 is unacceptable in light of the nonnormality. contributing very little to so that is approximately as are all n+ j for j>0.0 = h t Z eh t = t ε h .0 − 1− tZ8680.

0 + 8680. produced by PROC MEANS.0 t 2 ε )D 2 2 − t D( 1 . − n(/ 2 )D − α t D( ∑n 1= t 1B the usual OLS formula. )1 t mean. for example.1) model also fits the series quite nicely but still gives an unacceptable estimate of the t mean 0 and variance 1. A little thought shows that this could be anticipated for the special case of this model. However. ignoring all of the variance structure. Proceeding on that basis. The problem is not with IGARCH versus GARCH. in fact a GARCH(2. p. gives an estimate of the standard error of the .ε equal to t From it follows that the (approximate) variance of Hamilton (1994.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 t D = 64855. 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 . 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 . Interestingly. gives about the same t.5841000. There is no reason to expect the naive approach to work well in general.0 t h = Z and that of is thus n t eh t = ∑ ) α − α − 1( 1= t n 5841000. a simple t test on the data. The summing of and division by n yields what might be thought of as an average variance over the period. and despite the comments above. might be reasonable for these particular data. Additional care would be required. − 1( .1 2− )3230. to make this into a rigorous argument. D α Z t h 1B 2988 as t h . Because the s are small here.t h h . 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. but more will be said about this shortly.0 which is not significant at any reasonable level. Also the graphical evidence indicates that the estimated series has captured the variability in the data nicely. this line of reasoning does suggest that the naive t test.h t ∑ 1= t 2− 2 B n ) 2 α − 1α − 1( t h n 5. you sum the estimated series and use estimated autoregressive coefficients to estimate the standard deviation of the mean In this way you get 70000.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 . such as consideration of the assumed unit root structure for and the error introduced by ignoring the s.

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

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

< 0951. you find fitted k× k identity.1 39.8 55.11 shows the estimates. and denotes a determinant.2 eulaV t 69.< 7130. k× k coefficient matrix.0 11488.< 1000.02 1 .0 09950.0 13254.0 etamitsE retemaraP 90245. it 1< α .  elbairaV  µ− 3254. I is a where A is the matrix above.t e + 1− t Yα = Y t Recall that in a univariate AR(1) process.nozamA no GER CORP Y Y  . RUN.0 37510.41 51.0 24010. MODEL HIGH LOW = HIGH1 LOW1.0 Y 2 etamitsE retemaraP 38511.2 hgih :elbairaV tnednepeD wol :elbairaV tnednepeD Y FD 1 1 1 FD 1 1 1 1wol 1hgih tpecretnI 1wol 1hgih tpecretnI elbairaV 1488. 11. What The answer lies in the is the analogous requirement for the vector process “eigenvalues” of the coefficient matrix A. 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.0 1000.0 03700.2 Cointegration and Eigenvalues .  =  µ− 2 1 2×2 t1 t2 ataD moc.0 93700. ti where high1 and low1 are lagged values of the log transformed high and low prices. would have weights on past shocks that decay exponentially as you move further into the past.5 tuptuO The estimated model becomes  t e   µ − − t Y   1245.1- rorrE dradnatS 97950.0 |t| > rP 1000.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.7 14. The partial output Output 5. ∞ the requirement was imposed so |t| > rP 3350. For the A − Im Any matrix has k complex numbers called eigenvalues or roots that determine certain properties of the matrix.0 22950.  +   t e   µ − − t 1   8511. Using just one lag you specify PROC REG DATA=AMAZON.0 rorrE dradnatS 74060.0 eulaV t 49. 5. 1 1 1 .

− m( =  8899.  ZDZ()1− ZDZ( = L A   Z= = .  3254. + 1488.0 0 L m()1488.)4724.n V LA = L +nV ˆ )8511. L L  4724.0  0 1488. 1−  Z L − m ()8899. 1− 2×2 Z LDZ = ) 1− ZDZ( Z = Z 1−  1− Z DZ = L  8511. Note that By the same reasoning as in the univariate case.   1 − 0 8899. − .  ) 1− 3254. ledoM 1 gaL .()3254.   8511. L 1488.0   0  1245.( − 2m  4724. + m)1245. 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. For the . − m ( = 9624.0  0 .esnopseR eslupmI 0 1− 1 m ZDZ = A L is the last A .Chapter 5: The ARIMA Model: Special Applications 259 which becomes so the roots of this matrix are the real numbers 0.( − )1245.  1245.5 tuptuO all converge to 0.42740.9988 and 0. V where predicted deviations from the means L steps into the future are matrix currently under study you have observed vector of deviations. the n A so that the elements of 21.

nonstandard distributions of estimates will arise just as in the univariate case. )0 . it would not be at all surprising to find that the true A matrix has a unit root. It is seen that at time responded to the jump in decreased. would not decrease at all and the forecasts would not Clearly. In higher-order vector processes.3 Impulse Response Function . 2 Y . Similarly.0  . that is. if it were exactly 1. t. the two series come close together then descend very slowly toward 0. The sequence so computed is called an impulse response function.9988 being so close to 1. and increased to about 0..000. 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. Output 5.1( t  85256. This demonstrates the effect of a unit shock to the log of high price. this estimated model  V 72931. in other words traces out the path that would be followed with increasing lead L in absence of further shocks. although technically.e.t Regressing as above on lag 1 and 2 terms in the Amazon. and that the largest eigenvalue of the estimated matrix here.0 L A = 11V LA = L+11V ˆ t 1 t. The equilibrium.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). L 000.88. . L +11 t 2 Y V ˆ t.0 2− t . not greater in magnitude. hence the requirement that these roots be less than 1.0−   + 1− t   54532. it is still the roots of a determinantal equation that determine the characteristic polynomial is stationarity.com high and low price series.1( = 11 V Y ′ t V ˆ t 1 . is approached slowly due to the eigenvalue 0. The roots here are analogous to the reciprocals of the roots you found for univariate series.0−  is found. In an order 2 VAR. Note is uncomfortably close to 1. 5. From then on. to about 0. When the true A has unit roots.45 while Continuing through time.0  68489.2 t 1 Y 1= t  41460.′ )0 . not converge) if the eigenvalues or roots of the coefficient matrix A are one—that is. 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). At time is shifted to 1 with remaining at 0. Series satisfying this requirement are said to be stationary.0− =ρ ˆ e + 2− V2 A + 1− V1A = V .11 1 11 = t Y =t To illustrate.8899.2. thus representing a shock to the high price. 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 . following the terminology from univariate processes. 2 A − m1A − I2m = .260 SAS for Forecasting Time Series 5. then converge to the mean (0). 0 deviations of both series from their mean.4 Roots in Higher-Order Models The requirement that the roots are all less than 1 in magnitude is called the stationarity condition. or VAR(1).0 41522. if A has any unit roots.0− 37180.1 Y t V t 2 Y 70136. When all the eigenvalues of A are less than 1. is stationary. we say that the vector autoregressive process of order 1.2. following the initial jump. process satisfies the stationarity condition.

Comparing to the 5% critical value the unit root hypothesis is not rejected. then Using this vector AR(2) model.0 33700.0 etamitsE retemaraP 72931.0 69860. and it would not be at all using the true coefficient |t| > rP 7530.085256.0 81170. a prerequisite for validity of any statistical test.3.054532. normalized as univariate AR(1) case.0 etamitsE retemaraP 41460.0 77860.0 eulaV t 11.0 − m()78799. Fountis and Dickey (1989) show that if a vector AR process has a single unit has the same limit distribution as in the root.0 |t| > rP 2133. is very close to 1.0 59760.0 − m ( = 37180.0(905 = )1 − ρ(n ˆ 2 A − 1Am − I2m surprising to find that the characteristic equation .0 13700.0 7100.< 1000. and the AR(2) used to extrapolate into the future.0 1000.< 6832.9 81.1- rorrE dradnatS 41660.0 hgih :elbairaV tnednepeD  41460.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.037180. Also.306.0− wol :elbairaV tnednepeD )48771.061. whose roots determine stationarity.0 1000.0 =ρ ˆ Note that again.0−   85256.9 81.5 tuptuO  fo ssecorP m 2 redrO .0 6000.241.0 41522.2 eulaV t 79.0 78410.0 26800.78799.0 rorrE dradnatS 59560. no diagnostics have been performed to check the model adequacy.41 30. 11− . the characteristic equation.0 68489.0−   72931.)1 − ρ(n ˆ .< 0340. the largest eigenvalue. then the largest estimated root.0  0 1 2 31. This provides a test for one versus no unit roots and hence is not as general as tests to be discussed later. is matrices has a unit root.0 − m()47945. is generated.0 83170.0 8252.3 82.0 −  54532.Chapter 5: The ARIMA Model: Special Applications 261 Inclusion of lag 3 terms seems to improve the model even further.0  m −  0 68489. Keeping all the coefficient estimates. but for simplicity of exposition.1 0= − = )1 − 78799. the one corresponding to the high price. the lag 2 model will be discussed here. The code is as follows: 11 = t 80.0 41860.041522.164.0 70136. + m()76762. a bivariate vector of 0 deviations up to time a unit shock is imposed on the first component.

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

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

− 2.− 5. If you estimate that in you might want to test to see if b is an estimate of 1.0 1   5.0    =  2. but no check has yet been provided as to whether 2 lags are sufficient.− 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). t1Y (   1. 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. t2Y . − Π Π t H − = S t 1 Y t . it stays close to a constant. –. no graph analogous to the plane in the Amazon. a regression of the log transformed high and low stock prices on their lags indicates that 3 lags may in fact be needed. along which points are free to float. In this case there is one cointegrating vector (1.0 . –.5) and thus two common trends.−   5. A popular method by 2C = t 3Y 6.10. However.com example is possible. cointegrating relationships. That is. t1Y ( L t 3Y . 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.− 5. 0 1.  40. there are two cointegrating vectors and one common trend. − t 2Y2. 1C ) t3Y . t2Y .5.com example.0−   40. t 3Y5. Π . t1 1− 1( C = t 3Y5.−    1( 3.com data. This is a plane running obliquely through three-dimensional space just as the line in the lower-left corner of Output 5. hypothetical known parameter example you saw that this matrix was ′βα = )1− 1(  t which is clearly a rank-one matrix.−  2. + t 1 Y ) t3Y . In the previous coefficient matrix.com case and was displayed in the lower-left corner of Output 5. 10. the line of intersection of the planes. As a second example.0 8. there is one dimension.00 to justify the coefficient of The techniques include tests of such hypotheses about the cointegrating parameters.0 =  40. t2Y .0   10. if its lag level coefficient matrix is ) then the points will stay near the plane for some constant C as time passes.0− ) 5. − 0 − t L t 2Y5. 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.10. In this last example. Y − t 2Y5. if  6. − t t 1 Lb − H Y t  10. t1Y ( then the points will stay near the line formed by the intersection of two planes: and .− =    1. This happens to be the same cointegrating relationship that seemed to apply to the Amazon.5670. Note that a lag 1 and a lag 2 bivariate autoregression have been fit to the Amazon.10 runs obliquely through two-dimensional space. A vector time series of dimension 3 could move around anywhere in three-dimensional space as time passes. In fact. ) t3Y . t2Y . Because time added to dimension. This factoring of the matrix not only shows that there is one cointegrating relationship.0−  − = Π  =    2. 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.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.

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

If and you can easily see that which motivates the test. The equations become p ′ α t p e ′α + 0 + λ p′α = tV∇ p′α dna t p e ′α + 0 = tV∇ p′ α α dimensions as such that .com data. In the Amazon. Up to now. Before using PROC VARMAX on the Amazon. Suppose now that where is a vector of means. a matrix of known constants. ′ βα = I − A and so p In the cointegration case.0 = ′βα p α = )I − A ( p α ′ ′ 0 = αp′ α α . ( 1 t t = 1− V′ H = daerps = S t t t e + 1− V′ βα = t . thus enabling a test for r.2. if is some multiple of one would expect the two and to consist of one number near 0 and squared canonical correlations between . the test that its form is is the one involving comparison of two eigenvalues and.com data. could be taken as any multiple of the vector In the Amazon. such as those found in the error correction model.t .1( t t µ = ′H t t V∇ . Johansen tabulated the required distributions.φH = β t V∇ t e + 1− V)I − A( + λ = V∇ t t t e + 1− VA + λ = V t t t V . the “intercept restriction” must hold.1− t 1− t V V t )1 .)1− .1( − t t t ′ V∇ V∇ β d na dna ′ β t e + )µ − 1− V()I − A( = V∇ ) µ − 1− V ( . is shown by Johansen to have a standard chi-square distribution under the null hypothesis in large samples. the number of cointegrating vectors. The test that the first number is near 0 is a test for the cointegrating rank and involves nonstandard distributions. Standard procedures such as PROC CANCORR will deliver the desired estimates. as in the case of the Amazon. As with the univariate unit root tests.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. 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. interestingly.8 Intercepts and More Lags PROC VARMAX gives these tests and a lot of additional information for this type of model.com data. vector no intercept was needed in the model. it appeared that Johansen also provides a test of the null hypothesis that where H is. Given that there is one cointegrating vector.1( = ′ H e + ) 1− V′ H(′ φα = V∇ . t 5.com data. In order for these two equations to be equivalent. The test essentially compares the squared canonical correlations between and to those between and . The left-hand equation will be referred to as the “deviations form” for the model. 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 ′ .φH = β V)1 t e + )µ − 1− V(A = µ − V −. just as an ordinary regression program will deliver the test statistics for a univariate unit root test but not the right p-values.)1− . the distributions of tests based on the squared canonical correlation coefficients are nonstandard for unit root processes. some comments about higher-order processes and was assumed to have been centered so that the role of the intercept are needed.

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.1 . For example. As in the case of univariate unit root tests. V∇ … 1− V∇ . appears in either format. 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). t 3. 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 .274 SAS for Forecasting Time Series their first differences are white noise processes.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 . Regress on getting residual matrix . t t t t the common trends for this t . and inferences about its rank are the same either way. 1+p − t t t. The right-hand equation appears to describe random walks with drift terms given by the elements of vector Of course.” as it is called. The procedure has been described here in a manner that emphasizes its similarity to univariate unit root testing. becomes The same “impact matrix. 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: . then. once you remember the practitioners are interested in the possibility of an unrestricted (nonzero) drift in such data. Regress on getting residuals R 1− t − 2R 1− V∇ V∇ t 1R 1− V V∇ 1.t I − 2A + 1A = Π e + 2− V)I − 2 A + 1A( + 1− V∇)I − 1A( = V∇ t . t1 In higher-order models. steps 1 and 2 would have and furthermore. some t . 2 R t t 2. λ 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.1− t. 0 = µ)A − I( p α ) I − 2 A + 1A ( e + 2− V2 A + 1− V1A = V t t ′ t t . Regress on . Johansen shows that seasonal dummy variables can regressors be added as regressors without altering the limit distributions of his tests.2 R t t 1 R t 1− t V t V∇ . t 1 e + 2− V2 A + 1− V1A = V t − t. In a lag p model. you might prefer to associate the unrestricted drift case with a deviations form that allows for such trends. Such data will display rather regular upward or downward trends. t . you can simply replace and with and and follow the same steps as described earlier for a lag 1 model.

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.0 4021.9 PROC VARMAX Returning to the Amazon.com data. ID T INTERVAL=DAY. PROC VARMAX is used to produce some of the cointegration computations that have just been discussed.0 05. This requests a vector autoregressive model of order 3. The normalize option asks PROC VARMAX to report the multiple of that has 1 as the coefficient of high.2 21813.1 42632.0 3021.)1− . MODEL HIGH LOW/P=3 LAGMAX=5 ECM=(RANK=1 NORMALIZE=HIGH) COINTTEST.51 16422.1 veDdtS tseT knaR noitargetnioC eulaV lacitirC eulaV lacitirC 31.0 eulavnegiE 3210.Chapter 5: The ARIMA Model: Special Applications 275 5. 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.3 56621. Part 1 PED PED epyT wol hgih elbairaV .1 niM tnatsnoC noitcirtseR eht rednu tseT knaR noitargetnioC tnatsnoC MCEnI tfirD MCEnI tfirD . They are the log transformed high and low prices for Amazon.56 ecarT 62.9 99. OUTPUT OUT=OUT1 LEAD=50.17 76050.5 92993. Output 5. RUN.5 xaM tnatsnoC ssecorP nItfirD ssecorP nItfirD raeniL A 1A . PROC VARMAX DATA=AMAZON.5 = xamgal 2 3 1 A . The COINTTEST option asks for a test of the cointegrating rank.3 43.6 51.17. VAR(3). ECM.17 VARMAX on Amazon.3 naeM . 80569.1( 0 905 t Vβ ′ = ′H 48.com Data.com stock. Diagnostics of fit will be given up to The error correction model. is assigned a rank 1. Here and represent the VAR coefficient matrices.91 erudecorP XAMRAV ehT gnissiM esiwriaP fo rebmuN snoitavresbO fo rebmuN ecarT 66.2. meaning that the impact matrix is such that and are column vectors (rank 1).t β V eulavnegiE 3100.0 62360. -1 ).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 . COINTEG RANK=1 H=(1 .

0   11460.0 3950.0  =  63010.0 wol hgih wol hgih 00000. The test for versus does not reject the null hypothesis. Note that the tests are based on eigenvalues. Output 5.com Data.0 11460.000000.0− 00000. as might be anticipated from the earlier discussion linking squared canonical correlations to eigenvalues. 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.090200.0−  90200.1 47100.1 1 ymmuD 31053. so the test without the restriction seems appropriate. 31053.0−  11460.0 1> r 0−  ′βα = Π 0=r   1= r .50. The null hypothesis that the intercept restriction holds is rejected using the chi-square test 5.10.0 FD 1 2 2 ymmuD 44342.60 with 1 degree of freedom. In light of the plot. the hypothesis − elbairaV elbairaV   = ) 63010.276 SAS for Forecasting Time Series of cointegrating vectors is rejected.0 2660.0 053. In this computation.0- Π r=knaR nehw noitcirtseR eht fo tseT setamitsE ATEB retemaraP nuR-gnoL erauqS -ihC 06.0 4021.0−   8460.1 1= r 1= r 00000. Assuming a rank .17a allow the user to estimate impact matrices of various ranks.1− tcirtseR nO eulavnegiE 3210. it would seem that a drift or linear trend term would be appropriate here. so is rejected.0- − eulavnegiE 3100.100000. in the unrestricted case.0− 93843.0 p ′ α Whether or not the intercept restriction (that anihilates the intercept) is imposed. though both tests agree that anyway.34 . Output 5.5 0=r p ′ 44342.0−   382560.1− α  8453.0 These are almost the same.0 1 = 1− 2 = r − k 460. Thus Johansen’s test indicates a single cointegrating vector. the null hypothesis that anihilates the intercept is tested by comparing eigenvalues of certain matrices with and without this intercept restriction.17a VARMAX on Amazon. For this data the rank 1 and rank 2 versions of are and 433353. Part 2 knaR 1 0 )1 The long-run parameter estimates in Output 5. 1= r = r( qSihC >borP 9710. it is not surprising to find a drift in the common trend.1(   31053.5 56.0 1 ymmuD 63010. From the graph. exceeding the critical value 15. For example.0 3021. and hence a single ( ) common trend.1 setamitsE AHPLA tneiciffeoC tnemtsujdA 2 ymmuD 47100. Johansen’s “trace test” has value 65.

0 .0 H 1 ymmuD 67240.1  t2e   2− tL∇   231.t ′ 5.t . Because the last column of ALPHA is 0. the “Dummy 3” columns could be omitted as you might expect from the preceding discussion.17c) that shows that the fitted rank 1 model for the log and is transformed high and low prices.1 3 ymmuD 61-E4520.0   1 wol hgih wol hgih .0- 790.  1− tL   453.17b VARMAX on Amazon.0 00000.′ β r− k .000000.1 2 ymmuD 41600. Output 5.1− t V +β ′ t H βα′ β elbairaV elbairaV   91010. 1− t V . Part 3 .0−   + =  75800. This shows how the addition of an extra element.0  440. These are the first . they elements in the last column of represent the intercepts for the stationary linear combinations.100000.0−  +   t1e   2− tH∇   930. te p α = tep α + 1− t ′ ′ W +βα p′α = tV p′α∇ ′ α p ′ ′ β .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.0 +   1− t H∇   191.com Data. Recall the previously mentioned transformation matrix T constructed by stacking above where is a elements of are driftless unit root processes.093010.1− t W t dnerT detcirtseR eht no desab ATEB tneiciffeoC nuR-gnoL dnerT detcirtseR eht no desab AHPLA tneiciffeoC tnemtsujdA 2 ymmuD 02484. the last entry of In other words.961-E36494.0-   1− tL∇   310.0−  053.133497.0 L 460.1 1 ymmuD 35453. a 1.0−  860. you are not really interested in these results that assume the restriction.t e + 1− W + βα = ′ 492. The result is the same in higher-order models.10 Interpreting the Estimates A list of estimates follows (Output 5. PROC VARMAX gives “dummy variables” for this case as well. Write the whose first entries are the same as those of model as where is the same as except for its last column.044700. they might be of interest and hence are shown for completeness.2.0−    1− t   560.247930.0 77850. Having previously rejected the restriction of no drift in the common trends.0 . They satisfy The get multiplied by 1.0 + ′ 0 = αp′ α matrix such that t Because it follows that the The elements of p ′ α .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. to forces a model in which the unit root components do not drift. last r elements are the stationary linear combinations. In another data set.

77 between the errors.014930.0 11460.0 89200.0 wol 31053.17c VARMAX on Amazon.01 ymmuD wol hgih elbairaV 1 = KNAR nevig setamitsE AHPLA tneiciffeoC tnemtsujdA 63010.com Data.0 hgih wol hgih elbairaV noitavonnI eht rof xirtaM ecnairavoC 90231.0 tnatsnoC wol hgih elbairaV setamitsE tnatsnoC 31053.057392.0 hgih wol hgih wol hgih elbairaV 2 1 gaL_FID setamitsE tneiciffeoC RA 67353.100000.087460.0 92200.0hgih wol hgih elbairaV setamitsE 'ATEB * AHPLA retemaraP 91010.0 19340.1 1 ymmuD wol hgih elbairaV  59.075800.59200.2  0001  = 2 1 Σ Output 5. and error variance matrix .0 wol 39760.2 89.0 27210. 92.0 87091.2   92.0 11460. Part 4 278 SAS for Forecasting Time Series 1 = KNAR nevig setamitsE ATEB retemaraP nuR-gnoL indicating a correlation 0.0 wol 92200.0 30790.

Output 5.0 veDdtS F>borP eulaV F 2-1RA 5617.1 erauqs-R 0081. The test that is referred to as a test of the restriction matrix H.1203 by comparing to a chi square with 1 degree of freedom .28 .) F>borP eulaV F 4-1RA 2815.1038 and 0. (See Output 5. However.1(φ wol hgih wol hgih = ′β )1− .1 elbairaV t wol hgih L∇ t L− H elbairaV elbairaV t )1− .< = )85810. In a similar vein.0 9478.< F>borP 1000. type.0 8550. tL10. or ARCH.2.0 − 1(gol[)3 − n( 3450.0 6662.1(φ = ′β .0 52.0 4929.com Data.0 20.< 905 = n eulaV F 1HCRA 74.441 60.0 )1(WD 89. The test compares eigenvalues 0.< 1000.11 Diagnostics and Forecasts There follows a series of diagnostics.91 and R square 0.1 F>borP 1000.0(605 = ])3021.0 6450.1 89. (See Output 5.Chapter 5: The ARIMA Model: Special Applications 279 5.0 70.0 18. 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. 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. Both of these departures from assumptions are found.0 00.< 1000.)The residuals similar line describing the from these models are checked for normality and unequal variance of the autoregressive conditional heteroscedastic.17d VARMAX on Amazon.81 19. and a regression is found just below this.0 13.0 − 1(gol − )8301.0 56.9 qSihC >borP 1000.0 33.0 79.0 − t H F>borP eulaV F 1RA 1789. Part 5 t was found to be stationary using a standard unit root test. and that the Recall that the spread estimated cointegrating relationship was Given these findings.0 H∇ qSihC ytilamroN 54.17d. The DurbinWatson DW(1) statistics are near 2 for both residual series. it is a bit surprising that the test that rejects that hypothesis.< 1000. These tests indicate uncorrelated residuals. and autoregressive models fit to these residuals up to 4 lags show no significance.0 7504. the sample size is somewhat large.964 39.0558 .17e. so rather small and practically insignificant departures from the null hypotheses might still be statistically significant.4 skcehC citsongaiD ledoM etairavinU eulaV F skcehC citsongaiD ledoM etairavinU skcehC citsongaiD ledoM etairavinU 04.91 F>borP eulaV F 3-1RA 7485.

5 04669.4 13957.02SER elbairaV elbairaV elbairaV 40708.com Data. . so the use of the actual dates as ID variables causes a missing data message to be number as an ID variable. Last Part noitavresbo = t 40710.0 50680. Output 5.0436850.4 92898.4 hgih . thus making the produced.0 46517.4 95357. Part 6 . 09217.17e VARMAX on Amazon.4 73578.4 86288.4 2ICU qSihC >borP 2200. The last bit of code requests forecasts using the VAR(3) in rank 1 error correction form.4 60835.4 24407.0 16450.4 50169.17f. .0 erauqS -ihC 04. .0 57480.4 99795.4 20458.0 .4 wol xednI 1 215 115 015 905 805 t sbO 215 115 015 905 805 sbO 215 115 015 905 805 Output 5. 391750. is shown.4 02436.17f VARMAX on Amazon. 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.1 1 ymmuD 68782.4 89647. .0079910. a few observations from which are shown in Output 5.100000.0 16450.4 03008. An additional complication with these data is that the market is closed on the weekends.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.0 03450.4 08507. A portion of these data.4 wol hgih wol hgih wol hgih 1ROF tcirtseRnO eulavnegiE 8301.4 88256. 604640.4 56577. including standard errors and upper and lower 95% confidence limits.4 17607. .9 1DTS 55801. .0eulavnegiE 3021.4 27268.4 52197.0 16450. .0 03450. These are put into an output data set. . 28697.100000.0 40795.4 22218.4 22486.4 2ROF .4 48018.1 1 ymmuD 00000.0 1 ymmuD 00000.0 03450.com Data.0 64770.4 47568.4 1ICL ATEB tneiciffeoC nuR-gnoL detcirtseR rof tseT 88205.4 2ICL FD 1 51701.4 56819.4 27989.4 1ICU 04829.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 .

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

282 .

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

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

1Y3.0 − t1Y94.0− 3.0 + t1Y1.1Y = = ˆ 1 = 1 1 = = t 2 t1 .2 . then the forecast will differ from only by . An easy case to consider is  t e   −t  +  t e   −t 1 2 2 .1 Y t2 Y 7.0−   ˆ      1.1 t1 Y4.2 .0 + t1Y1.2Y ˆ  1. at time t.0− Y7. has yet to be realized. 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.0 t1 − Y4. The same is true for you thus have t2  9. 1 1 Y + t. Y = t1 + t.1 + t.2Y9.1 1 + t.2e9.0 Y 7.1 This is a vector autoregressive model.0 − 1+ t.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.2 .0 − ) 1+ t.1 3.0−  +t e    1  +t e   0 1 1 .0 = − 2 + t.1  Y Y .0  =  1 2 3.2 .2e + 1 + t.1e + Y + 1 t1 .1Y3.t which is the error term that.1Y Y ˆ ˆ + 1 + t.2e t2 Y36. VAR.0 − ) 1+ t. 1+ t.1 and e .0 EG + ZF = 1+ Z 1 + t.0 =  +t Y    +t 1     0 to You have .1 1 + t.0 +   − t 1   9.0− + 1+ t t2 Y7. Next.1Y(3.1 2Y Y t1 + t. note that if the best predictor is used and the coefficients are known as is assumed here.1 36. 2 + t.1e3.0 0 − t2   − t Y   7.1 .2 Y  0 Y  0 4.Chapter 6: State Space Modeling 285 6.0(9.1Y ˆ 2 .2Y9.1 Y + t.0 1 1 .0    t   0  Y  1 1  t Z These three equations show how to update from  + t +t Y  94.1 .1.1 = 1+ t 2 + t.1  ˆ      0 + t Y  0 7. The state vector is  t +t  Y  ˆ    t =  t1    To see why this is the case. of dimension 2 (2 elements) and of order 2 (maximum lag is 2).2 A Simple Multivariate Example Now suppose a vector process is of interest.1 Y Y t Z  .1 t2 t1 .2Y + t.0 + t1Y1.0 − 1+ t.1+ t Z  t +t  Y   3.1 e+ t1 1+ t Y4.0 + t1 1.2Y ˆ using it is would produce 1 + t.1e t1 + t.

1 57525. Output 6. respectively. corresponding to Y2t and Y1t .1 0 1 564810.3(G )1.0 0 retemaraP )T. RUN. a simulation of 2000 values from this bivariate VAR model is used to produce some state space output.3(F )3.0 869720.8356.2(F )2.4136.0 347040. .0630386.2(F )1.0 888211.0147223.06 68.4 ledoM dettiF dna mroF ecapsetatS detceleS erudecorP ECAPSETATS ehT )T.61 40.1.T(X etamitsE 40858.3(G )3. The data set TEST contains the variables Y and X.057525.1+ t is all that is needed to produce the results in Output 6.1+T(Y 86443.0 147223.3(F )2.43 16.3(F )1. VAR Y X.0630386.1 04675. The code PROC STATESPACE DATA=TEST.0 setamitsE retemaraP rotceV etatS 4675.0 053450.1 2810.01 0 7179.0 0 )T.067.0 975830.0 rorrE dradnatS 055220.01 xirtaM noitisnarT fo etamitsE noitavonnI rof xirtaM ecnairaV noitavonnI rof xirtaM tupnI 40858.286 SAS for Forecasting Time Series This looks quite a bit like a vector autoregressive model. deciding from the observed data what elements are needed to construct the state vector.1 PROC STATESPACE on Generated Data eulaV t 50.0 814830. Prior to discussing this new problem.1 086443.0 908120.0 332730.002810. 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).0 469820. 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.0121.T(Y EG + Z F = 1+ Z )2.0888211.2(F t t .0 564810. it introduces a new problem—namely.

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.T(Y 1  dna notation user could specify using the X Y variable names.0−   = 1.   43.0  ˆ    68.T(X )T. the . Knowing that the estimate –0.2.1  20. t 1+ t.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.0 0   9.1  0   1 G 36. t2Y . . No elements of F or G are more than 2 standard errors away from the true values. you would expect its t statistic to be smaller than 2 in magnitude. which it is You might want to drop that term from your model by forcing its coefficient to 0. They are structural parameters that do not require estimation. and all estimates are quite close to the true values both numerically and statistically. column 3 element to 0.1+T(Y )T.0B  1   0 0 − = t( 23. t1 Y The state vector has been correctly identified as containing and as is seen in the 1 X 2 Y MROF   3. )36. Of course this assumes the unlikely scenario that the user has some prior knowledge of the state vector’s true form.0− 7.1   = 0 dna  ˆ )T.1Y ˆ .0−   1 85. using the statement RESTRICT F(2. Had this not been the case.0− 86.0 0  35.0 in the PROC STATESPACE step to restrict that row 2.02 is in fact an estimate of 0.3)=0.0−  1   0  94.1   =  1  0 0 G F . Doing so produces the results in Output 6.0−   =F 11.0   3. The matrix F is referred to as the transition matrix and G as the input matrix in the output.

0 593210.2(F retemaraP setamitsE retemaraP 288179.8326.0 618120.0 964300.75 15.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 etamitsE )2.0944590.0406223.3(G )1.T(X rotceV etatS ledoM dettiF dna mroF ecapsetatS detceleS erudecorP ECAPSETATS ehT )T.7170.0 244810. Plots of both series and their forecasts are seen in Output 6.3.1 0 1 noitavonnI rof xirtaM tupnI 525823.0 944590.082015.01 0 406223.0324707.0 0 xirtaM noitisnarT fo etamitsE )T.0 799820.0 244810.0 rorrE dradnatS 25758.0 223340.3106.3(F )1.06 74.1 62895.1+T(Y )T.0324707.3(F )2.Output 6.1 noitavonnI rof xirtaM ecnairaV 25758.44 18.3(F )2.0 678920.72 eulaV t 255220.3(G )3.1 0 1 62895.0 714830.2(F )1. 30.1 525823.T(Y .0 0 82015.

is a vector of random normal variables that can be contemporaneously correlated in any Here arbitrary way. As in a univariate series.Chapter 6: State Space Modeling 289 Output 6. and interest rates from their long-term means. This has to do with the nature of the roots of the characteristic equation. the behavior of a VAR of the form t t is determined by the roots of a “characteristic equation.” and the same is true for a vector ARMA. but must be uncorrelated across time. For these might be the time t deviations of GDP. and each is a matrix of parameters to be estimated. is a dimension k vector of deviations from means. 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 .3 Forecasts for Generated Data The forecasts seem to have a little more interesting structure than some you have previously seen. unemployment.

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

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. the two systems will produce exactly the same sequence of Ys. predictions into the future.1+ t t t EG + Z F = 1+ Z = )j 1 sj 1 2 − (Γ t Y . . t2 } −t ′ j Y 1Y Y Y{E 0   2e  =  raV = Σ 1   1e  .0− = Y     −t 1 0 t . if the two-step-ahead predictor is included.t EG + 1− Z F = Z 1 1 . For example might contain and predictors up to two steps ahead.1 = t( Y 3Y . that is.0    9. so must be the . for any e sequence and any given initial values. 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. t2 t Z . 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.1  Y  7. t2 + t.0 3. t2 t. t1 + t.1 Y . 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”. but it is needed to make the system square.t Z Every state vector 4×4 2 1 . Y     ti t Y . 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 resulting reduction gives  t   −t  e   t   −t e +     0   −t 2 . so leaving out the second row and column makes no real change in the system.2 . This system is observationally equivalent to the system in that.) j ( Γ . The entries of Z and of the matrices F and G depend on the particular formulation. )s t1 + t.t + 1Y Y 1Y .Chapter 6: State Space Modeling 291 or not.2 Y . 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.1 again having a familiar form The first row gives a trivial identity.t t Z Y { E1A t 3 Y )j = = i( . you see that t Y } j +t ′ Y Y{E = )j (Γ t defined as an expected value.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. as has been demonstrated. Σ + )2(Γ2A + )1(Γ1A = )0(Γ 0=j . namely. you define (assuming has mean 0). The second column is all 0s.

The size of the state vector 2.93  60.) 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.2Y + t. )j ( Γ These in turn lead to a matrix M formed by stacking together the form previously suggested.8−  . Items 2 and 3 are always the same for any covariance matrix.0−  18. (See the PROC CANCOR documentation for more information on canonical correlations.5 37.1Y ( Γ Γ Γ Γ 1A)1  23. The rank of the covariance matrix M 3.53  6×6 . rather than a model with known coefficients.0−  85.) 2 + t. the these identifying the columns of M.6−   = )2( 68. then.0 45.3   85.1  70.52  Γ  26. With only data.6 73. 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.31  85.) j (′ − j 92. For such a matrix M. namely. Returning to the order 2 VAR with known coefficient matrices.1 )2(Γ    )1(Γ = M  Γ )0( 1 1 ( Γ = ) j − (Γ − t.7 71. The initial autoregressive approximation provides an upper bound for the size of M. 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. matrices in the block Hankel Γ Σ 83. and then to use the fitted model as though it were the true structure to construct an estimate of M. The number of nonzero canonical correlations between the set of current and lagged Ys and the set of current and future Ys. the following numbers are all the same: 1. That matrix would have what is known as a block Hankel form:   )4(  )3(   )2( .292 SAS for Forecasting Time Series These.7 24.1 + ′ 1 1 )3(Γ )2 (Γ Γ )1( − t. and the vector these identifying the rows.1Y Now so for you have Γ = ) j (Γ   = )0(  = )3( t2 t2 Y Y Γ Γ t t1 1Y( Y( . say.8−   = )4 ( 41.) 2 − t.1Y + t. The strategy used is to fit a long vector autoregression whose length is determined by some information criterion.1Y + t. by substitution.2Y .2Y 2 ′ Α)2 Γ Γ 0>j − j 2 2 − t. you can see that these matrices satisfy the multivariate Yule-Walker equations.2Y 64.2−   = )1( 74.2  40. the covariances must be estimated.

53     )2 (  68.2 Y Y The dependent and with series . but not before. Column 5 is associated with so even though you columns. Regressing any other column on columns 1.7  83. Regressing column 2 of M on column 1 and column 3 on columns 1 and 2.0 Y 37.2 + t.6  23.52 74. you can build a sequence of matrices by sequentially appending columns of M.0 45.0−   85. will almost certainly be of full rank.0− 64. 0. then a regression of that first column on those others (no intercept) will fit perfectly. 2 + t. Since dependencies for both series have been discovered. Regression reveals that (column 5)= –0. Linear forecasts such as we are considering are functions only of the covariances. A perfectly fitting regression corresponds to a canonical correlation 0 in matrix M. that matrix.7 83.52 85. Column 6 is automatically a linear combination of columns 1. )3 nmuloc ( 0 + )2 nmuloc ( 7. 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. and any future Y is the same as that between and that same future Y. t1 + t. then (associated with column 5) would have been included in the state vector. but in this example. 1+ t. Once the first dependency in each variable has been discovered. so the same regression that displayed the dependency gives the corresponding row of F.63(column 2)+1.7 73.8− 24.2 71.8− 60. and 5 of M. + )1 nmuloc (1.1 2Y 7. t2 t that show dependencies.1.7 0 t 2 Y 18. and hence is redundant information. the state vector has been completely determined and no further investigation is needed.1 Y M ˆ . and 3 at this point.1 Y needed in the state vector.7 . When estimated covariances are used to get an estimated M matrix. When you use the first four columns of M you will get a 0 canonical correlation.52 + − t 1Y1.0   45.93    Γ Γ Γ )3(Γ )2 (Γ Γ )1( )0( )2(Γ    )1(Γ = M  Γ . ˆ t2 2 Y M + t. and 3 gives a perfect fit and so shows that the rank of matrix M is 3. 23. there is nothing to be gained by including   26.2 70.3(column 3) with 0 error sum of squares. thus far considered are the first columns associated with series 1 . adding to a set of predictors that already contains and does not add any more prediction accuracy. 2. column 3 is not a perfect linear combination of columns 1 and 2.2 60.5 85. the addition of column 5 also produces a 0 canonical correlation. you find nonzero error sums of squares.1   70. Again note that the coefficients give a row of F.Chapter 6: State Space Modeling 293 You can diagnose the column dependencies and rank of matrix M using a clever trick. On the other hand. Note that the second row of the state space transition matrix F is 0. 3.1 70.2−    = )3( 74. 4 and 5. 2.0 = )4 nmuloc ( Y 83.6− 68. you find by regression that so that the covariance between the column 4 variable.1 Y Y t1 + t. If that matrix had no 0 canonical correlations.3    )4 ( 18.31 64. You get a positive error mean square when regressing column 3 on columns 1 and 2. Therefore. 0.7. indicating that columns 1.53 − t 1 .1 40. That tells you the fourth column.1 40.5 73. Leave out that redundant fourth column and consider a matrix consisting of column 1.2 Y t1 + t.6−  92. For example. and 3 form a linearly independent set.6 41. In particular.1 24.8− 24.31 68.49(column 1)–0. If any column of a matrix is a linear combination of some others.2. What is is consistent with the needed is a statistic to decide if a small estimated canonical correlation in . you need not look any further. 2. possibly with some small but nonzero canonical correlations.

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

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 . will provide k if t . t L+t Y t Z So if the state vector contains then it will also contain the predecessor Thus . 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  . ψ L= ∞ j −L + t j j t provided the series is stationary. t 1+ t Y Y t t Z and so if the state vector contains . which combined . 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. Expanding the set of autoregressive when you have the complete set of equations .p (xam . The forecast of any E ψ 0=∞ ∑ = L+ Y using information up to and Y t L+t L+t Y Y Y . 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.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 . where M is then every . t p −M+ t Yp A + + t 1−M + tY1A = t M+t Y Finally. note that M>L t L+t Y forecast with will be a linear combination of these. what should you use as the subscript M? To the model becomes answer that. t t . This establishes M. t .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. you look for dependencies. t M+ Y . using a . to replace the “?” in F and G. At time q−L +t For leads L exceeding the moving average length q. you have In particular. the forecast of t 1− L + t would be . 1+ t L + t t Y will contain and the relationship between these.)1 + 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. namely.

1 92.−  +t e     1  +t e   0 1 .1 6.      tY   1 1  +t + t  440. ultimately producing a state space representation with dimension 3.− ( =  +t +t  Y    1+ t X  )8.0 22. + t X85. 44.      0 +  t X  8.− =       1+ t  0 Y 4×4 −   1− tX   7.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. It had a linear dependency.−        +t +t 440. 0 4.2 1 . + t Y44.− ( = 440.− 85. unlike the Section 6.  Y  27.1 Y .  Y  =  1+ t  44.( +  tX  )06. 8.2 example Consider the state space representation From row 2 1 850.− ( = 1+ t 2 + tX t 1+ tY8. 0 1 92.− )8. 27.   1. 0 1 2 1 .  Y     + tX  44.0   t  Y  850.− 85.” In this case the link between the ARIMA representation and the state space representation is relatively easy to see.  Y 0  + 0 0 t   X    t 0 1 Y  + t + tX  22.0  =  t  3.   1+ t   Y 85.2  6.  t +t  Y   2.  t +t  Y  27.−( +  tX  8. 850.2.  1 85. Such a full-rank system is called “block identifiable.    0 )8. 44.  6.0− Y  tX  1.′ ) tY t X( 1 .0 +   1− t   9.    44.−     + t 1e  1   0   t +t 2.− 85. 0 1 2 1  t +t  8.1 8. −= t 1+ tX where the system arising from the current discussion was not block identifiable.    44.−  +t e     1  + t 1e    0 Inserting this extra line into the state space equations you get 1 1 .2  +t e    )1.   0 2 85.  X 0       t +t 8. and a reduction in the size of the system was called for.   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 .   + t e   6.  + t 1e  1 .2 1 1 2 1 .− X      1+ t  0 Y 1 .

0 1 92. it is clear from the ARMA model that lagged shocks to Y do not have any effect on Y or X. 27. 2. + t Y44. + t X85. + t Y44.  1.− 8.1 000 and row 4 is . 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.  5.−  X      + t + tY 440.−     + t 1e  1   0  t +t  2. (1.0   = 1  B− A =  1  1.  Y 0  + 1 0 t   X    t 0 1 Y t Now anytime you see you can replace it with .− 0 5.   + t e   6. 0 = 2A 2. 8. 0 =  6.0 +) t 1+ tY8.    = 0 1+ t X       1+ t  2 2 0 .0  t t t E1B − E + 1− Y1A = Y 1 2 1 1 .0 2.2 1 1 .1) model.1 6.  6. t 1+ tY2.  0  = 1 B 1  B−  5.  Y  1.   1. t 1+ tX 1+ tY8.1) with with .− 2.  8. + 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. while that is not so clear from the state space representation. − 1 1  + t +t  22.− 8. 8.       t +t 8.   1.  −  1.0 2.   + t e   6.0 + t 1+ tX1.−  = 1ψ     1.−     + t 1e  1   0  t +t  2.−  +  1 0 t   X    t  0 1 Y t 1+ tY8. It can be expressed as .  1− t     5. − replaced by Anytime you see a multiple of row using Row 3 gives So you have recovered the original ARMA(1. 8.  1 = ψ dna 6.0 − − = 1+ 2 + Y .0 It is seen to be an ARMA(2.1) as the leading term in a row. 2.2 1 1 . you can re-express that Chapter 6: State Space Modeling so row 2 of F can be and 297 . 4.− 0 0 1 .0 −= t t t 1+ tY8. for example.0 1.  X 0       t +t 8.  1 = A 1. t 1+ t X t X85. + t Y 44.− 8. 850.0 = 1+ 2 + X t t Y and setting . + t X85. A useful feature of such a structure is that it sometimes gives a nice interpretation. 2.  X   5.

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

001 − 1+ t ′ Y( = 1+ t Z )001 − 1− tY(63.1 1+ Y(2.1 +  1  Z 63.001 − Y( = 1+ t Z 1+ te + t Z = 1+ Z 6.1 )001 − + )001 − t |1+ tY(2. t t t 001 − Y = Z Y 001 − 1+ t Y= 1+ t e + 001 − t |1 + t t t 1+ te2. −   = 1+ t  0 Z 1+ te + )001 − t |1+ tY( = 001 − 1+ tY ) )001 − ′ t Y ( 63. − )001 − t Y(2. − = − = 001 − 1+ t |2 + tY 1+ te + )001 − 1− tY(63. − )001 − 1+ tY ( 2. the state vector was and Two examples have been discussed thus far. the state vector changes to Now Chapter 6: State Space Modeling 299 .1 . When the data at time t+1 become available. − )001 − t Y(2.1 = 001 − t |1+ tY and In the second example. In the first. an AR(2) model.1 = 001 − 1+ tY 1+ te + 001 − t |1+ tY = 001 − 1+ tY 1+ te  t 2.1+ t EG + ZF = 1+ Z t t t ′ )001 − t |1+ tY .1 1  2. 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 + )001 − + )001 − t Y(63. Y(63.001 − 1+ tY ( = )001 − 1+ t|2 + tY . an AR(1) model.

. Yt+1|t. At that point. .  t 1+ tY  = =  tY   tY  t| 1+ t Y 1α + Y 0 α Y | t (which is with ). stop expanding Zt. Yt+1|t.−   =  e8.1 Yα dna 1 + 2. . t + − | t|1+ t G t |1+ tY ( 2. . At some point. = 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 . any prediction of Yt+R|t with R>k is also a linear combination of state vector elements. Yt+2|t. Suppose 1–te8. the state vector has the following form: − t Y ( 63. .300 SAS for Forecasting Time Series where 2.1. )001 ) t k + tY . t 1+ tY . .1   1 = | t Yα= 001 0 63. t| k + tY k In the AR(2) example.   = 1+ t  1+ t  0= 1 α = 0α  te8.2 shows how this can be accomplished using canonical correlations. ) 001 so k=1. consider the sequence Yt. you find that Yt+k+1|t is a linear combination of the previous sequence of elements Yt. . for j>1. . 0= t| j and  1+ te8. . This determines the state vector as ′ Furthermore. .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. Section 6. 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. because t and. . . . α + − . such as k+1. + t Then. that is. Yt+k|t. One more univariate example follows.

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

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

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

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

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

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

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

6 .0 Y -1=gaL-- Y CIA muminiM rof setamitsE reklaW-eluY neewteb si . 3 .41 9=gaL 30746. 4 .rorre dts*2 > si + 2 + 1 Y gaL/emaN snoitalerrocotuA laitraP fo noitatneserpeR citamehcS neewteb si . 01 .61 01=gaL sledoM evissergerotuA rof noiretirC noitamrofnI 8155.32932.0Y -4=gaL-- 989803.21 49017.1 rorrE dradnatS 99404.11 824499. 7 .0Y -2=gaL-- 270987.rorre dts*2.rorre dts*2 > si + .rorre dts*2. . . 9 + 8 . 6 .6 tuptuO 308 SAS for Forecasting Time Series . 2 + 1 + 0 Y gaL/emaN snoitalerroC fo noitatneserpeR citamehcS 75984. 01 .9 8788.72 78468. 5 4 . 5 .01 2857.55 2=gaL 1=gaL 0=gaL sledoM evissergerotuA rof noiretirC noitamrofnI 632223.< si . 9 . 7 .21 8=gaL 7=gaL 6=gaL 12059. 8 .31 5=gaL 4=gaL 3=gaL 42725. 3 .31 73950.0 Y -3=gaL-- 52285.< si .0naeM Y elbairaV 001 snoitavresbO fo rebmuN erudecorP ECAPSETATS ehT snoitpO TNIRPTI dna RROCNAC eht htiw ECAPSETATS CORP ni ataD detalumiS gniledoM 4.

1- 175802.0 50594102.1 )1.1 33162040.0 58978911.T(Y 1 )T.T(Y 22 17 21 542020.0 100.0 81835621.1+T(Y 16 )T.0 10.2(G 4998911.1 740520.00 xirtaM noitisnarT fo etamitsE rotceV etatS setamitsE yranimilerP dna mroF ecapsetatS detceleS FD erauqS ihC noiretirC noitamrofnI )T.1 noitavonnI rof xirtaM ecnairaV 270987.0 1 noitavonnI rof xirtaM tupnI 390092.0 1 79261.0 697984.4 83255.0 )2.0 49951248.1 12503020.0 25290092.6 tuptuO 309 .1 58640520.0 1000.1+T(Y sisylanA snoitalerroC lacinonaC 12 13 14 15 3 19083.0494150.1 72542020.1 542020.22 erauqS ihC 61901.0 65392338.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.1(amgiS 41939048.0)1.T(Y 4.0 69170987.51 noiretirC noitamrofnI 932454.0 )1.02479261.0 1.0 4609048.0 )T.0 )T.1 503020.1 tnanimreteD 2 0 0 0 0 flaH 4 3 2 1 0 retI 1 )T.03900750.70542020.2(F 100.2(F 1215150.1+T(Y )T.1 162040.0 adbmaL noitamitsE doohilekiL mumixaM :gnittiF evitaretI 441020.02327511.

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

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

01 . 5 4 .41 9=gaL 30746. 4 .< si . .0naeM Y elbairaV 001 snoitavresbO fo rebmuN erudecorP ECAPSETATS ehT tnemetatS TCIRTSER eht htiw ECAPSETATS CORP ni ataD detalumiS gniledoM 5.72 78468.9 8788.0 Y -3=gaL-- 52285. 6 .21 49017. 3 . 2 + 1 + 0 Y gaL/emaN snoitalerroC fo noitatneserpeR citamehcS 75984.21 8=gaL 7=gaL 6=gaL 12059.01 2857. . 6 .6 tuptuO 312 SAS for Forecasting Time Series . 9 + 8 . 3 . 9 .< si . 7 .rorre dts*2 > si + . 01 .55 2=gaL 1=gaL 0=gaL sledoM evissergerotuA rof noiretirC noitamrofnI 632223.31 5=gaL 4=gaL 3=gaL 42725. 7 .32932.11 824499.rorre dts*2.0Y -4=gaL-- 989803.0Y -2=gaL-- 270987.61 01=gaL sledoM evissergerotuA rof noiretirC noitamrofnI 8155. 8 .1 rorrE dradnatS 99404.rorre dts*2. 5 .31 73950.rorre dts*2 > si + 2 + 1 Y gaL/emaN snoitalerrocotuA laitraP fo noitatneserpeR citamehcS neewteb si .0 Y -1=gaL-- Y CIA muminiM rof setamitsE reklaW-eluY neewteb si .

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

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

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

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

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

the number –.0 .632.468 indicates that large mink values (predator) at time t are associated with small muskrat values (prey) at time t+1.468 is an estimate of 0.0 147763.122-    Y 726. Xt and Yt are not related by a transfer function because you can use the t statistic to reject the hypothesis that . the state vector is simply ′ Zt = (Xt.542.9228=gaL 7=gaL − 1 .122.   + X KNIMR 4=gaL 456.881elbairaV TARKSUMR KNIMR 3=gaL 2=gaL 1 1 t t 1=gaL 0=gaL 7.302.52.507.522.6 tuptuO .2 5=gaL 94.845. 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. Here. The transfer function methodology in PROC ARIMA is not appropriate. so the vector ARMA model is easily derived from the state space model .722. 864. That is.877.−   + Y  TARKSUMR = X 892. When Xt=RMINK (mink residuals at time t) and Yt=RMUSKRAT (muskrat residuals at time t) are used. for example.721.318 SAS for Forecasting Time Series The state vector is simply the vector of inputs.152. Yt) and the model is  + t e t     +    t    + t 1e  9=gaL 198.426.032- snoitavresbO fo rebmuN sledoM evissergerotuA rof noiretirC noitamrofnI 01=gaL 211. 965. each series is predicted by using lagged values of the other series.242.

T(TARKSUMR rotceV etatS )T.+ 1 TARKSUMR KNIMR gaL/emaN snoitalerrocotuA laitraP fo noitatneserpeR citamehcS neewteb si .+.0947865. .< si .6 tuptuO Chapter 6: State Space Modeling 319 .. . .rorre dts*2. . . 01 .0 93864. .. 3 . 8 . . ..5 . 9 .+ 01 .0 xirtaM noitisnarT fo etamitsE )T.0 262892.rorre dts*2 > si + . ... . 8 . 7 .0 262892. 4 ..0 93864.+ ....4 ..rorre dts*2 > si + .. 5 . .rorre dts*2..0947865. . 2 +.+ 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.1 0 0 1 noitavonnI rof xirtaM tupnI 851726.6 ...< si ..... -+ 9 . .. 3 . 7 ..0 TARKSUMR KNIMR TARKSUMR KNIMR -------1=gaL-------CIA muminiM rof setamitsE reklaW-eluY neewteb si .+ -.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 .. . 2 +++ 1 +.

0 131970.0 93864.49.0 352901.459.T(KNIMR ledoM dettiF dna mroF ecapsetatS detceleS erudecorP ECAPSETATS ehT DNERT RAENIL MORF SLAUDISER 0981-2481 SDROCER GNIPPART RUF YAB S'NOSDUH .T(TARKSUMR rotceV etatS )T.degrevnoc sah noitamitse doohilekil mumixaM 270360.0947865.0 307200.5 eulaV t 653090.0262892.0 noitavonnI rof xirtaM ecnairaV )deunitnoc( slaudiseR eht ezylanA ot ECAPSETATS CORP dna ataD eht dnerteD ot GER CORP gnisU 7.2(F )2.0 131970.0 93864.0 262892.6 08.2 12.0 307200.0 947865.0 302101.0 rorrE dradnatS 851726.0 307200.0 etamitsE )2.0 noitavonnI rof xirtaM ecnairaV 1 0 0 1 noitavonnI rof xirtaM tupnI 851726.0 307200.2(F )1.0 445790.0 xirtaM noitisnarT fo etamitsE )T.1(F retemaraP setamitsE retemaraP 270360.1(F )1.6 tuptuO 320 SAS for Forecasting Time Series .

|**** .0 8197000.0 74900.0 4239800. ****| .0 6491000.54121. |** ." | | | | | | | | | | | | | | | | | | | | | .*****| .0 202210.00355900. |** . | .0982510.0 33200.86601. . . |********** .8.0 69541.0 2638400.0 228220.49404.0 58601. |******** .)2(**B 43192. *| .72481.0 48221. you could have fit an AR(2) to the mink series and computed the prewhitened cross-correlations.0 99272.84820. . . ****| . . ***| . |** . . . .1 srotcaF evissergerotuA retliF gninetihwerP :1 rotcaF :retlif gniwollof eht yb denetihwerp neeb evah selbairav htoB srorre dradnats owt skram ".02183200.94122.0351010. **| . | .0471040. . that there are nonzero correlations at both positive and negative lags as shown in Output 6. You observe a somewhat subtle warning in the cross-correlations plot—namely. . .0358330. | | | | | | | | | | | | | | | | | | | | | 17080.6 tuptuO T AM E F If you had (mistakenly) decided to fit a transfer function.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 noitalerroC 7747600. *| .72411.0 92361. . **| . .09719800. |** . Y L Chapter 6: State Space Modeling 321 .0 + )1(**B 25487. .0 .78410.65801. . ***| . . .0 4960100.0715810. | .0 97210. **| .0 072010.05570900.0 156310.0504510. | .88281. .0 58750.55084.03342100.

322 .

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

432 213. and then regress Y on these two variables.1415926.096 306. 265. )δ(nat = A / B ) tω(soc ) tω(nis . the original data have been detrended using linear regression. OUTPUT. TITLE2 "(DETRENDED)". collected observations on leaf enzyme activity Y every 4 hours over 5 days. Each observation is an average of several harvested leaves.460 287.2 Example: Plant Enzyme Activity As an example. OUTPUT OUT=OUT1 PREDICTED=P RESIDUAL=R. creating the sine and cosine variables for a period 3 (frequency per observation). and B can be estimated by ordinary least constructed in a DATA step and the parameters squares as in PROC REG. CARDS. 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. 3/ DATA PLANTS. RUN. Chiu-Yueh Hung.744 261.351 283.352 310.168 308. 7.099 285.945 290.324 SAS for Forecasting Time Series This is a very nice expression in that.886 317.385 251. INPUT Y @@. variables and can be A.370 283.128 252. π2 First read in the data.998 The analysis of variance table is shown in Output 7. DO T=1 TO 30.173 276. There are 6 observations per day and 30 observations in all.988 303. END. C1=COS(2*PI*T/3). which corresponds to 3 observations. MODEL Y = S1 C1/SS1.870 379. PROC REG DATA=PLANTS.α = )δ( 2 nis + )δ( 2 soc α = 2B + 2 A cycles . 301.909 284.µ ω .199 341.458 296.648 234.696 246.160 316.289 307. in the Department of Genetics at North Carolina State University. PI=3.348 253.544 . To focus this discussion on periodic components.363 321.780 313. TITLE "ENZYME ACTIVITY".870 314. if is known.666 333.1. RUN. S1=SIN(2*PI*T/3). The researcher anticipated a 12-hour enzyme cycle.

7 . It is seen to be statistically significant based on the F test. 3 / π2 = ω =P F > rP 4300. Output 7. The sum of squares 11933 associated with frequency called the periodogram ordinate at that frequency.7 7592.1 Plant Enzyme Sinusoidal Model = ) 238544. degrees of freedom. It appears that the sine term is significant but not the cosine term.0 =F eulaV F 90.1 latoT detcerroC rorrE ledoM 1c 1s tpecretnI elbairaV =t ecruoS . which is the sum of squares associated with frequency is 11933 and has 2 ( ).7 35094.192 17010. however.027.6695 Y :elbairaV tnednepeD 1LEDOM :ledoM erudecorP GER ehT ecnairaV fo sisylanA setamitsE retemaraP 06.7 16692. A given set of data may have important fluctuations at several frequencies.0 9000. 4300.0 48874.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. if had been used as the first time index rather than both would have been significant.192(03 = 2 Yn 70459.992 33611 0228452 SS I epyT 90.0 1000.2 shows the actual and fitted values for the plant enzyme data.498848.55 eulaV t Output 7. such a splitting of the two degree of freedom sum of squares is not meaningful in that.330.9 38544.3 / π2 = ω 8555.7238544.0228452 qS-R jdA erauqS-R 0=t erauqS naeM 82126.192 etamitsE retemaraP FD 92 72 2 1 1 1 FD .5 rorrE dradnatS serauqS fo muS 75643 42722 33911 raV ffeoC naeM tnednepeD ESM tooR 52864.< |t| > rP .0 3443.148 19544.92 35094.

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

1482 47. after doubling some.58720.9067.3753 53.0 66.21497.6012. SET OUT2.2 220.2 .2 04490. DATA OUT2. VAR Y.28850. you see the regression sum of squares which matches the regression output.2 7703. .1 80664. IF ROUND (FREQ.285 DOIREP 0000.5 298.2 0000.0 530.23911 66.2 17227.586 87.10 _P = 33911 . RUN.33911 = ) 2 )1497.0038.4 384.03 .51 0000.08597.0 QERF sbO Output 7. PROC PRINT DATA=OUT2. π … .0654 85.292 19.1 680.1297. You see that (See Output 7.1 25576. RUN.2 0005.489 00.91279.Chapter 7: Spectral Analysis 327 associates twice the correction term.5 0000.1416 THEN SSE = . with frequency 0 and twice the sum of squares at frequency (when n is even) with that frequency.71116.6 0000.) 97.4 0000.2 38303.292 19. 1 0 .1 02740.144 49.31 5367.586 87.2 72315.71( + 2)488.3.231 54.6 0005.0 10_P 06.0654 85.1 46652.144 49.5488. This doubling is done here because.6942.926 70.) 2B + 2 A()2 / n( .12− = A 10 _s oc( 92 .295 98.0 44902.2 69488.3.3131 58. 1 61 51 41 31 21 11 01 9 8 7 6 5 4 3 2 1 .2 9241. RUN.6 446.3753 53.926 70. so one must divide the frequency ordinate by 2 to get its contribution to the error sum of squares from regression.12− (()2 / 03( .295 00.0 23826.5*P_01.110546.0 00000.71 882.3 0057.489 34. The frequency 0 ordinate is replaced with 0 when the option ADJMEAN is used in PROC SPECTRA.71 ESS 87.3131 58.0 379.95865.0 9424.1 67738.71 0871.0001) = 3. THEN SSE=0.7 0000.32722 ======== 03.7592 31.03 . TITLE J=CENTER "ENZYME DATA". SUM SSE.019478.01083.7592 31. 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. Looking at the period 3 line of Output 7.66 54.4141 78. SSE = P_01. IF PERIOD=3 OR PERIOD=.2 3727. These ideas are illustrated here for the plant enzyme data: PROC SPECTRA DATA=PLANTS OUT=OUT2 COEFF.01 0000.3 3333.1482 47.0 88814.3 51239. The option COEFF in PROC SPECTRA adds the regression coefficients and to the data.9632 51.17643.6 3703. .3 OUT Data Set from PROC SPECTRA π )10 _ n is =B 88.9632 51.3 7582. … .4141 78.0446905 10_NIS 10_SOC )dednerted( ytivitca emyznE 0000.0446905 = 2 Yn2 . 95141.12774. division of all ordinates by 2 becomes the same as dividing unadjusted numbers by their degrees of freedom.

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

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

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

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

6 =j 2=j 1= j .7 Increased Resolution Using Harmonics Output 7. 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. … =j . The following PROC SPECTRA code is used to generate Output 7. 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.10. the F test 1. PROC SPECTRA DATA=COMPRESS P S ADJMEAN OUT=OUTSPECTRA. they are treated as pairs. . The fitted values on the right side are those coming from the fundamental and all harmonic frequencies for omitting the sine at The .6 . VAR Y.2 .7 shows three sets of fitted values.8 and Output 7. 1 6.4 . so they are orthogonal to each other.3 2>j =j )21 / π2 ( j )21 / π2 (2 = 2ω 1= j 21 / π2 = 1ω . … .9). and they miss the low and high extremes. The sine and cosine at the fundamental frequency are used to produce the fitted values on the left side. Including the first harmonic gives a better fit and gives an idea of what the datagenerating function looks like. These fitted values do not capture the double peak in each interval of 12 time points. RUN. and the Type I and 2 are large enough that neither the nor frequencies can be sums of squares for omitted.53 for frequencies with is not significant. From PROC REG (see Output 7.332 SAS for Forecasting Time Series Output 7. WEIGHTS 1 2 3 4 3 2 1. Recall that you would not eliminate just a sine or cosine.

0 6814.1 eulaV F 03347.9 Regression Estimates and F Test setamitsE retemaraP 21 / π2 Chapter 7: Spectral Analysis 333 .0 52.0 12302.0 12302.078571.< |t| > rP 28.10. Smoothing is not helpful in this particular example.< 1026.226.62 55.215 30549.0 8909.0 28090.0 12302.07 eulaV t 96341. shown in Output 7.1 20509.9 22. The last few lines of the program deliver a smoothed version of the periodogram.0 47900.028.052761.062320.0 96341.0 1000.06 68584.8 Periodogram with Two Independent Frequencies The periodogram.1 erauqS naeM 42 7 FD rotanimoneD rotaremuN ecruoS Y elbairaV tnednepeD rof stluseR scinomraH tseT 37405.1 27655.472 54781.0 1000.021172.0 6250.21 / π4 Output 7.160.< 1000. and its first harmonic.9963 SS I epyT 0814.5 68731.91 05.0 7491.0 41323.0 12302.0 08333.178.0 12302.< 1000. shown in Output 7.0 rorrE dradnatS 14811.1 76859.0 24090.0 15305.040. that will be discussed in Section 7.0 F > rP 35.072048. makes it quite clear that there are two dominant frequencies.0 12302.0 12302.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.071033. .083414.9.011.0 12302.0 3711.0 12302.0 4593.033.0 48531.0 12302.3 02269.3 50201.4502.8.

π − [ . and an radians per observation—for example.3 / π2 3/ 3/ π2 π2− .. Based on the dot’s position. the observer only knows that the frequency of rotation is for some integer j.e.10 Smoothed Periodogram 7. π > 3 / π4 . radians—from its previous position. If the wheel rotates clockwise radians per second. observer who looks at the wheel each second.334 SAS for Forecasting Time Series Output 7. at the first observation.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.] π . and similarly for subsequent observations. 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. π 3/ π2− 3/ π4 j π 2 + 3 / π2− . the dot will now be radians counterclockwise—i.

the Nyquist frequency radians per observation would convert to hour. For that reason. etc. … . the plot is just a rectangle of height over an interval of width π ≤ ω ≤ π− π2 σ 2 π2 σ 2 .0[ ∑ π12 = )ω( W t 1 = 2 σ = )0( γ ω .)ω− ( f = )ω( f is the autocovariance function.. is . If observations are taken radians per every 15 minutes. + 01 = t t Y . in general of a spectral density whether or not it is plotted as a rectangle. ) ec na irav = aera( . Thus it is sufficient and customary to compute frequency with so that . the Nyquist frequency is also referred to as the folding frequency.0 . te + )01 − 1− Y(8.7 The Spectral Density variance 1.Chapter 7: Spectral Analysis 335 Because it is not possible to distinguish a cycle of from one of using the periodogram. negative. for all integers j. rather than radians per observations as a unit of measure.) tω − (nis B − ) tω − (soc A = ) tω(nis B + ) tω(soc A n / j π2 j π ]π . 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.0[ π π ω− + )01 − 1− Z (8. is the variance of the series and this will be true π2 π2 π2 σ 2 )ω( f white noise. where π π4 2/ n m. Each process has mean 10 and π ≤ n / j π2 ≤ 0 . 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. The spectral density for becomes just t . or 2 cycles per hour.] π . 1 2 / )1 − n ( =j ω . and zero.0[ t Z f . The reason that this frequency has names instead of always being called is that some people prefer radians or cycles per second. radians per observation and the Nyquist frequency will be the standard. te and is white noise. 7. 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.2 . te )3 / 5( + 01 = t W Consider three processes: .0( N∼ e t where . In this book. and is for a general white noise series . 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. 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. positive. per day.] π . 2σ = area of the rectangle. Since for The . per hour. − 01 = π .

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

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. tV . + 52 / tπ2 (nis 2. In contrast. 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 .8 for Y and for Z.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. − coefficient.0 t Y π2 = )ω( f σ 2 3152. 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 . the . For autoregressive order 1 series. t noise spectral density t D π2 ))ω(soc ρ2 − 2ρ + 1(/ ))ω(soc θ2 − 2θ + 1( σ = 2 )ω( Yf ))ω(soc θ2 − 2θ + 1( = )ω( D f . See Section 7.))ω(soc ρ2 − 2 ρ + 1(/ theoretical spectral density is where is the lag 1 autoregressive the spectral Y 0± . The low horizontal line associated with white noise has been discussed already. the spectral density of t X . Note that . tY )1. 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. 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. 1− eθ − e = X t t t 8. the plot of the altered of the original . Because the is nearly indistinguishable from that amplitude of the sinusoid is so small. For a moving average (MA) such as ρ .11. AR(1) like Y and Z.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.))ω(soc θ2 − 2 θ + 1( density is Both the AR and MA spectral densities involve the white . the periodogram in the middle of the bottom row shows a strong spike at the Fourier frequency radians.3152.

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

Designing filters to amplify certain frequencies and reduce or eliminate others has been studied in some fields.11. the model is expressed as D .t e density of which is .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. When a complex expression is multiplied by its complex conjugate. The multiplier associated with the filter. The complex polynomials ) p ωi ep α− − 2 ω e2 α − te) i q B qθ − )q .1 − 1 < niag ))ω(soc ρ2 − 2 ρ + 1(/ ωi e1 α − 1( = )ω(A − B1θ − 1( = tY ) p B p α − − B1α − 1( .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. so the use of i along the way is a convenient mechanism for calculation of quantities that ultimately do not involve imaginary numbers. the product involves only real numbers and is positive. into frequency components.1 = θ .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.)ω(nis i + )ω(soc = ω e .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 . The spectral density for the i π2 σ 2 i replacing everywhere with Start with the spectral becomes process )ω( M * . Filtering affects different frequencies in different ways.p ( AMRA Using the backshift operator B. calculations done with such terms often result ultimately in expressions not involving i. not the standard deviation. is sometimes called the squared gain of the filter in that amplitudes of some waves get increased ( ) and some get reduced ( ). ))ω(soc θ2 − 2 θ + 1( t 7. t Y )q .)ω(nis i − )ω(soc = ω −e )ω( A * and have corresponding complex conjugate expressions and obtained by )ω( A on the moving average side. j ωi e ωi 1− t Y− Y = D j t t If then so i . The term squared gain is used because the spectral density decomposes the variance. such as in the examples above. Replace with getting on the autoregressive and .

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

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

21 / π2 = ω t t . using arbitrary input and its associated output. you simultaneously estimate the gain and phase at all Fourier frequencies. + B nis A − 1 = )ω + B ( soc A8. − ) 2 / 3 (1906. − 1906. − 1( / ) ω( nis ω ( nis = 1− Y8. = ) ) ω( soc )tω(nis = ) tω ( soc ) )ω + B ( nis A8. Only the amplitude and phase are changed. + )B ( nis A − ( + ) tω ( nis ) )ω + B ( soc A8.( − 1( / 4.9828 times that of the input. In cross-spectral analysis. / 1 = A { } = )3 ) 4.1 = 29.1 and The transfer function produces output with amplitude 1. = °5. 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. − B soc A 8. it has the same frequency and a phase shift of arctan radians.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.1(  )  2 / 1(1397. − )B − tω ( nis A ) 0 = )ω + B ( nis A8.25 = )2203. An intermediate step is the computation of quantities called cospectrum and quadrature spectrum. − )B ( soc A ( = ω − B − tω ( nis A8. = )B ( nat t π2 = ω . ω 8289.− Y B − tω ( nis A = Y 8. 8.

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

in our case .1 / ) ω ( nis 8. − )ω( soc 8.12 (pp. xx f = ) ω( A = ω( q yx yx yx t X .1 − 46. 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.10. − 1( = )ω( yx f ω ( soc 6. or ) .1( / ))ω( nis i8. ) The gain is defined as the amplitude divided by the spectral density of X. − 1( )ω ( xx f = )ω ( c ω( ω( xx f 2 q+) 5.2 Interpreting Cross-Amplitude and Phase Spectra 5.1 − 46. − 1( Multiplying and dividing the left side by the complex conjugate you ω( xx f ))ω( soc 6. 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.1( function.{ ) ω ( xx f = ) . − ) ω ( soc 8.1( = ) ω ( A 2 c( = ) e ω( ω ( / )ω ( A + yx f 1− t X 5. ω 5.1 − 46.0 The cross-amplitude spectrum is defined as )) In this example.0 − .0 − )) ω( ω ( soc 6.1( / ) )ω( soc 8. ) )ω(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.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. )) ω ( nis i8.1 − 46.1 − 46.0 ≠ )ω ( xx f ω provided frequency Thus.

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

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 . K. )mret esion a gnidda( e t X + + t η+ 1− t X5. respectively. and PH request. Thus. It produces the cospectrum C_01_02 and the quadrature spectrum Q_01_02 when used in conjunction with S. RP and IP are unweighted estimates. and phase spectra (CROSS must be specified also). VAR Y1 Y2. Plots of estimated and true spectra are overlaid in Output 7. t η with variance 1.3333 and where )noitcnuf refsnart sselesion eht( is white noise with variance 1. and C and Q are weighted and normalized estimates of the cospectrum and quadrature spectrum. WEIGHTS 1 1 1 1 1. estimation of crossamplitude.10. CROSS indicates that cross-spectral analysis is to be done. Weighting is necessary to obtain a valid estimate of the squared coherency.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.12.346 SAS for Forecasting Time Series 7. VAR Y X. 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. A. 1− tV8. RUN. squared coherency. RUN.

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

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

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

(142. with 9930.1 + 142. − ) 711.(142.1 − 1( ( / ) ) ωi− e478. the model-based spectral quantities are developed.350 SAS for Forecasting Time Series 7. − 1( = i    ) π 2 ( / 9930. − )192. − 1( ) ωie478. + 2    192.1 + 1 { /  )ω ( soc )478. − 1− t ε361. 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. + )2 t − j ( XX γ372. ωi2− i e192. When the models above are used. + 2142. + 1− t X594.1 + B142. + 1− X594. + ωie142. First.( B192. + ωi − e142. “The General ARIMA Model. + X372. = 3− t X 711.[ )ω3 ( soc 2 + − e= ω ( XX f ) ω 2− e372. + t v 2 − t X192.4 Cross-Spectral Analysis of the Neuse River Data In Chapter 3. (192.( 2 − 2478. the direct estimates (no model) of the spectral quantities from PROC SPECTRA are plotted.1 )ω2 ( soc 2 −  ) 711. 1− t X142. − 1( (   2 711. + ωi2 e192. }]711.1 − 1( t X) − 3 ε + 2− t X372. + )) π 2 ( / 9930. and vt is a white noise series with 8500.1 )ω ( soc 2 − ωi3 e711. = B711. + )1 − j ( XX γ594.1 − 1( = )ω( = )ω ( XX f = )j ( t = vσ 2 − e = 2σ YX f t t X Y . and t where 1− t v888. + 1 e)B478. + 2− t ε84. the cross-spectrum is )     192. Then.1 = t ε + ωi− 2 e594.10.( ) ) ω 3− e711. The spectral quantities discussed above are computed and plotted using the estimated model parameters.” 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.

− 1( ) ω e888. + ω e361.1 − 1( (  εε   = )ω( f 8500. + )ω ( soc 594. This indicates a lag of 1. + ω −e361.34 as an estimate of c. in the prewhitened cross-correlations.( = )ω ( c e594. − 1( (  ω− i i The squared coherency is simply )) Consider this pure delay transfer function model: c− t Using the Fourier transform.( = )ω ( q XX γ( ∞− =h Σ β = ) e)h( YX γ( ∞−=h Σ = ) ω( YX f ∞ hωi ∞ ωi− ω( XX f ) )ω2 ( soc 372. i + ωi e594. you can show the following relationship: ) so )) Thus. + )ω ( nis594. at lags 1 and 2. However.( ) ω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. ) ω ( εεf + ) ω ( XX f ) ω 2− e372.34 days between Goldsboro and Kinston. +  ωci e) c − h(ωi e) c − h( i i i ω ( XX f ))ω2 ( nis372.(  = ) ω ( YY f Xβ = tY . you are not restricted to integer lags. a simple linear regression using a few low frequencies gives 1. Because ARIMA models contain only integer lags. with the cross-spectral approach.1 − 1( ) ω 2e84.13 the irregular plots are the cross-spectral estimates from PROC SPECTRA. These are overlaid on the (smooth) plots computed above from the transfer function fitted by PROC ARIMA. 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. In Output 7.   )) e888.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.

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

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

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

1 94728. Output 7.21 4478.Chapter 7: Spectral Analysis 355 Since no weights were specified.01 42000.0 74204.084590.12 0000.021215. and you see that this of Y is radians less than the phase produces the phase of X by Y.3 95348.41 5831.1 ω δ + ω− π4 = ] 2)84590.0 53691.0 12742.0 07293.0 78791.61 3333. a distribution with mean 2.0 07293.0 61906.0 = )π 4(/ 78231. where 0.23739sin(2 t/64) = 0.0 82645.068773.1 Each Y periodogram ordinate is times the corresponding X periodogram ordinate.1 63118.46 0008.0 53691. This motivates as an estimator of for both Y and X.0 71890.1 76381.0 π 4 / )ω( n I IP ot doireP 0 morf ycneuqerF )ω( n I 78094.0 15620.23 0000.046435.031261.0 51962.21 0000.0 78094.0 51090. Each periodogram ordinate is times the sum of squares of the two 78231.10302) and Y has a component 0.0( + 2 )31261.6 34561.564465/0.3 78087.0 35090. for example.0 53691. no smoothing has been done.564465sin(2 t/64 –2.61 3333.046362.09817 radians.0 7657.5 65684. the periodogram divided by (where the true spectral density of the process is ) has approximately a chi-square distribution with 2 degrees of freedom. Only a few frequencies are printed out.0 92402.3 B B 34575.21 0000.009751.0 78094.12 0000.1 60865.23 0000.0([)2 / 46( coefficients. In the VAR statement of PROC SPECTRA.46 δ .0 50302. The phase of X as was shown above.09548sin(2 t/64) = 0.6 91161.2 78231. Each spectral density estimator is the . X has a component 0.0 B B 0008.0 64795.22 9591.188156=3 is the amplitude increase in going from X to Y.04965. For example.1 21333. 64817.065822.0 07293. the order of variables is X Y.0 48811.61 3333.84 1973.2 66155.0 23271.23 0000.0 25492.093732.0 )2 / n ( 15200.12 0000. The phase shift is 2.4 66663.0 92094.1 61431.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.0 1 1 1 1 1 )ω( f 50873. Within the class of ARMA models.0 54072.00486).24 9992.0 25492. not Y by X.21 0000.0 B B ωfπ2 2 3 96623.0 71890.10302 – 2.2 14394.7 3283.027538.22 0569.46 0008.0 25492.0 71890.0 53691.1 02182.0 84746. This exact relationship would not hold if noise were added to Y.51212cos(2 t/64) – 0.7 9705. 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.0 70724.0 71890.1 13030.1 26395.138300.0 57057.14 X and Y Series It is seen that at period 64.16213cos(2 t/64) – 0. for X at corresponding periodogram ordinate divided by period 64.0 94631.0 07293.0 25492. Thus the entries in the phase column are exactly the same as the )ω( f 2090.188156sin(2 t/64 + 2.00486 = 0.

)h ( XX γ If and if has an absolutely summable covariance function in the current example. Had the order been X Y.)ω( 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. the plot would be reflected about the horizontal line and an initial positive slope would have been seen. at period 32 you find and .)ω(q . and with the variables listed in the order Y X. 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. giving the negative slope. .356 SAS for Forecasting Time Series frequencies. The room temperature Y is related to lagged furnace temperature X. as long as the coherency there is reasonably strong. the phase of Y by X is produced. as was illustrated with the river data earlier.2 = )23 / π 2(soc 3 )ω( XX f )ω(soc 3 = )ω(c . and this slope gives the so d=1.)ω( XX f )ω(nis 3 = )ω(q 3585. would have pure delay d for appeared as the phase spectrum estimate.0 i − the coefficient of is the quadrature spectrum In this example For example. 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 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. The phase plot of the generated data that simulated furnace and room temperatures had a negative slope near the origin. For the river data. The plot of phase by frequency is a straight line with slope 1. 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 . you see that the sites must have been listed in the order Goldsboro Kinston in PROC SPECTRA.)ω( qi − )ω(c Writing as the real part . since the phase slope is positive and Goldsboro (X) is upstream from Kinston (Y). The delay need not be an integer. Had the variables been listed in the order Y X. Multiplying these by the estimated X spectral density gives )ω(c .

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

358 .

8 6. how long they stay. Most models herein. The goal is to illustrate a modern automated interface for a collection of forecasting models.8 2. and define the information into a data warehouse. summarize the information for detailed and historical analyses. All parameters associated with the forecast model are optimized based on the data.8 5.8 Data Mining and Forecasting 8. are equivalent to specific ARIMA models. Results are displayed on the Web and accessed by an Internet browser. 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. The SAS Web Analytics reports provide important details about your Web traffic—who is visiting your site. Analysis of such large amounts of data is often referred to as “data mining.8 .1 Introduction This chapter deals with the process of forecasting many time series with little intervention by the user. including many that have been discussed so far. such as damped trend exponential smoothing and Winters method.8 3.8 4. Some of these were developed in the literature without using ARIMA ideas and were later recognized as being ARIMA models.” In this chapter SAS Web Analytics are used to read the Web traffic data.8 7. 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. This system provides a menu-driven interface to SAS/ETS and SAS/GRAPH procedures to facilitate quick and easy analysis of time series 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.8 1. In addition. 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. the SAS/ETS software Time Series Forecasting System (TSFS) is examined.8 8.

the chapter uses a scorecard to integrate. The delivery mechanism is provided through an ASP (application service provider) infrastructure. and analyze the information enterprisewide to help make the right decisions. and analyzed using SAS Web Analytics. See www. The Web logs are unzipped.2 Forecasting Data Model Under the ASP framework. 8.com. each night we receive customer Web logs after 12:00 AM local time. distribute. The data examine key metrics used to describe activity during the 24 hours of e-retailing in a given day.360 SAS for Forecasting Time Series Finally. 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. placed in a file directory.) . They can receive automated alerts to early indicators of excellence or poor performance.vermontcountrystore. (They provided a modified version of their data for illustration here. 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.

Table 8. followed by a listing of some of the data.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. 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 .Chapter 8: Data Mining and Forecasting 361 The variables and their descriptions are provided in Table 8.1.

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

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

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

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

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

The daily variable indicator.DAILY_STATS_09AUG02. a variable describing the total number of purchasing dollars for a given day. and upper and lower confidence limits overlaid on the same graph. is formatted date9. date. .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. The program creates a Forecasts data set that contains forecasts for seven periods beyond the end of the input data set VC_DATA. The data represent daily values for Revenue. The GPLOT procedure is used to display the actual values. predicted values.

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

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

As noted. . 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.

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

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.

The revenue is denoted Revenue (TARGET). Standardized differences denoted “Difference” are also displayed for each metric. Since the current day’s value is removed (9Aug02 in this case). The actual value for the day is removed and then forecasted using the HPF procedure.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). i y ˆ s / ) Y − Y( ˆ t t .

The sum of products of weight statistics and Business Performance measures gives an overall daily mean score as shown in the previous display. In the following display. it increases toward 100% as Y gets larger than the prediction. When Y matches the prediction. smaller values are preferred. 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. so we designate the forecasts and upper and lower 95% prediction intervals with plus signs. the Business performance statistic has a value of 75%.376 SAS for Forecasting Time Series 8. ) ˆ 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 +. the forecasts and forecast bounds are based on a model developed from the full data set that includes 9Aug02. On the target day (9Aug02) the observed value is removed. and the dots connected by lines represent the predictions.6 Business Goal Performance Metrics From a retailing business perspective. The same is true of the forecasts and bounds beyond 9Aug02. each metric in the table has a Business performance measure. If the preferred direction is greater than the forecast. the Business performance measure is calculated as x Using this approach. the scattered black dots represent the observed data. When the preferred direction of the business movement is less than the prediction. For a metric like Error Page Percent.7 Graphical Displays You can go to the scorecard table and select each metric to display the predictions and limits in a graphical format. 8. Throughout the other historical data. 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. For each metric a directional business performance measure is computed for the day.5 )*100 where . the calculation is x Thus the Business performance has a minimum value of 50% (when Y is small).

Chapter 8: Data Mining and Forecasting 377 .

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

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

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

and productsuggestion_pages. .Chapter 8: Data Mining and Forecasting 381 8. The %AR macro can be used to specify models with autoregressive error processes similar to the AUTOREG procedure. In this case we are regressing revenue on buyer. dollar_per_purch_session.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.

5. The R square and significant parameters and AR terms suggest a reasonable model. The output below examines the parameter estimates and test statistics. and 7 for the autoregressive errors are statistically different from 0. Lags 1.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. . The signs of the coefficient for purchasing sessions and average order value are positive and negative for product suggestions.

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

384 .

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

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

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

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

321–711 )elpmaxe( ecirp kcots moc.451 )elpmaxe( sregnessap enilria lanoitanretni 18 )selpmaxe seires 8Y( snoitcnuf noitalerrocotua gnitamitse 97–87 detamitse 08–87 esrevni .93 redro-dnoces 652–542 secnairav lauqenu dna srorre seires emit RA htiw noisserger 542–932 .871–761 .852–652 dna erudecorp GER 372–072 rotcev gnitargetnioc gnitamitse 182–972 stsacerof dna scitsongaid 072 .362–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 .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 .052–942 ssecorp )citsadecsoreteh yllanoitidnoc evissergerotua( HCRA 292 .nozamA 391–291 )AMIRA( tnemetats ETAMITSE .tnemetats YFITNEDI osla eeS erudecorp AMIRA .noitpo A Index .FCAI .24 .461 srorre seires emit ni noisserger 132–322 )elpmaxe( selas liater aniloraC htroN 321–311 rof sledom .tnemetats ETAMITSE osla eeS erudecorp AMIRA 652–052 dezilareneg esrevni 552 .451 )elpmaxe( sregnessap enilria lanoitanretni 18 )selpmaxe seires 8Y( snoitcnuf noitalerrocotua gnitamitse 37–96 detamitse 08 .461 srorre seires emit RA htiw noisserger 86–36 FCAP htiw gniyfitnedi 84–54 erudecorp GER ni gnittif 9 tset nostaW-nibruD 182–652 .A 3–2 erudecorp XAMRAV 281–971 .26–65 )noitcnuf ecnairavocotua( FCA 643 erudecorp ARTCEPS .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 .252–942 dezilareneg 552 .86–36 laitrap .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 .noitpo NAEMJDA 411 stset )relluF-yekciD detnemguA( FDA 201–79 sdohtem noitamitse FCA 061 .seires yranoitatsnon 301–201 seires yranoitatsnon 761–461 selbairav yrotanalpxe htiw sledom 732–332 )elpmaxe( eracs klim 322–681 .451 )elpmaxe( sregnessap enilria lanoitanretni 18 )selpmaxe seires 8Y( snoitcnuf noitalerrocotua gnitamitse 77–37 detamitse 08 .FCA erudecorp AMIRA .671 noitargetnioc 201–79 sdohtem noitamitse FCAP .FCA 301 ytiranoitatsnon toor tinu 541–341 sledom lanosaes 061 .FCA 061 .

NACS .NACS .49–29 sledom egareva gnivom gnittif 35 retemarap gnitamitse 98–18 )selpmaxe seires 8Y( snoitcnuf noitalerrocotua gnitamitse 041–821 sdohtem CINIM dna .seires emit lanosaes 461–251 elpmaxe sregnessap enilria .661 snoitcnuf refsnart lareneg 55–25 sdohtem gnitsacerof 311–011 .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 .FCASE 311–401 gnitsacerof no stceffe gnicnereffid 332–132 )elpmaxe( srekrow noitcurtsnoc 182–652 .sledom )egareva gnivom evissergerotua( AMRA 832–732 )elpmaxe( kcatta tsirorret 05–94 ygolonimret 55 ytiranoitats 281–971 .FCASE 311–401 gnitsacerof no stceffe gnicnereffid 501–201 atad gnicnereffid 371 .FCAI .FCAI .seires yranoitatsnon 301–201 seires yranoitatsnon 761–461 selbairav yrotanalpxe htiw sledom 36 .FCAI .561 snoitcnuf refsnart elpmis 461–341 seires emit lanosaes 652–932 secnairav lauqenu dna srorre seires emit ni noisserger 871 –761 .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 .97 slaudiser fo kcehc erauqs-ihc 201–79 )selpmaxe( sdohtem noitamitse FCAP .05 sledom dexim 732–332 )elpmaxe( eracs klim 49–09 )elpmaxe( stropxe leets dna nori 08–55 fo mrof gniyfitnedi 322–381 .gnitamitse 98–18 gnitamitse snoitcnuf noitalerrocotua 292 .44–14 secnairavoc rof snoitauqe reklaW-eluY 413 gniledom ecaps etats 9 .FCA 79–59 sdohtem noitamitse FCAP .FCA 08–55 gniyfitnedi .seires emit lanosaes 461–541 seires emit lanosaes 321–311 rof sledom .FCA 79–59 sdohtem noitamitse FCAP .FCA sledom )RAV( noissergerotua rotcev osla eeS gniyfitnedi .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 .671 noitargetnioc 14–04 noitaton tfihskcab 05–94 dnuorgkcab 201–79 )selpmaxe( sdohtem noitamitse FCAP .sledom AMRA osla eeS 141–94 sledom )egareva gnivom evissergerotua( AMRA 390 xednI .seires yranoitatsnon 49–09 )elpmaxe( stropxe leets dna nori 49–09 )selpmaxe( snoitcnuf noitalerrocotua gnitamitse 041–821 sdohtem CINIM dna .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

Der The Next Step: Integrating the Software Life Cycle with SAS ® Programming by Paul Gill . Elliott The Little SAS ® Book: A Primer by Lora D. Slaughter The Little SAS ® Book: A Primer. Westfall. Everitt and G. Naik A Handbook of Statistical Analyses Using SAS®. Randall D. Bushman Applied Statistics and the SAS Programming Language. SAS ® Tips and Techniques From Around the Globe by Phil Mason Integrating Results through Meta-Analytic Review Using SAS® Software by Morgan C. Stokes.S. 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. Craig Dickstein. Slaughter (updated to include Version 7 features) Logistic Regression Using the SAS® System: Theory and Application by Paul D.. Wang and Brad J. Koch Cody’s Data Cleaning Techniques Using SAS® Software by Ron Cody Common Statistical Methods for Clinical Research with SAS ® Examples. Fourth Edition ® by Ronald P. Smith An Array of Challenges — Test Your SAS ® Skills by Robert Virgile Learning SAS ® in the Computer Lab. Second Edition ® by Maura E. Second Edition by Ravindra Khattree and Dayanand N. Second Edition by Lora D. Charles S. 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. Walker Concepts and Case Studies in Data Management by William S. Second Edition by Glenn A. Calvert and J.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. Naik In the Know . Wolfinger. Davis. Delwiche and Susan J. Meimei Ma Multiple Comparisons and Multiple Tests Using SAS® Text and Workbook Set (books in this set also sold separately) by Peter H. Second Edition by Rebecca J. 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. 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. Russell D. Cody and Jeffrey K.. Second Edition by B. Dror Rom. and Gary G. Tobias.

Walter W. Dickey Quick Results with SAS/GRAPH ® Software by Arthur L. Muller and Bethel A. Patrick M. Fourth Edition ® SAS ® Software Solutions: Basic Data Processing by Thomas Miron by Rick Aster Professional SAS ® Programmer’s Pocket Reference. Rodgers. Ákos Felsovályi. Littell. Second Edition by Alan B. and Rudolf J. Shipp SAS ® System for Mixed Models by Ramon C. Andrews. Second Edition by Sandra D. Dilorio and Kenneth A. Wolfinger Quick Results with the Output Delivery System by Sunil K. Freund and Ramon C. King SAS for Linear Models.Output Delivery System: The Basics by Lauren E. George A. Stroup. and David A. Fetterman Selecting Statistical Techniques for Social Science Data: A Guide for SAS® Users by Frank M. O’Malley. Spector PROC TABULATE by Example by Lauren E. 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. and Terrence N. Littell. Walter W. Milliken. 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. Second Edition by John C. Hardy SAS ® System for Statistical Graphics. Haworth SAS ® Software Roadmaps: Your Guide to Discovering the SAS ® System by Laurie Burch and SherriJoyce King Professional SAS Programmer’s Pocket Reference. 1986 Edition by John C. Laura Klem. Dilorio SAS ® for Forecasting Time Series. 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. Stroup. First Edition by Michael Friendly Reading External Data Files Using SAS®: Examples Handbook by Michele M. Second Edition by Paul E. Dickey Statistical Quality Control Using the SAS ® System by Dennis W. Brocklebank. Stephen A. Freund SAS ® for Monte Carlo Studies: A Guide for Quantitative Researchers by Xitao Fan. Cantor Professional SAS ® Programming Shortcuts by Rick Aster SAS ® System for Elementary Statistical Analysis. Haworth SAS ® Macro Programming Made Easy by Michele M. Sivo. Second Edition by Jodie Gilmore (updated to include Version 7 features) SAS ® Programming for Researchers and Social Scientists. and Russell D. Littell Quick Start to Data Analysis with SAS ® by Frank C. 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. Schlotzhauer and Ramon C. Keenan A Step-by-Step Approach to Using the SAS ® System for Univariate and Multivariate Statistics by Larry Hatcher and Edward Stepanski . Carpenter and Charles E. Gupta SAS ® System for Regression. Brocklebank and David A. Welch. Second Edition by Rick Aster SAS ® Survival Analysis Techniques for Medical Research. Littell Programming Techniques for Object-Based Statistical Analysis with SAS® Software by Tanya Kolosova and Samuel Berestizhevsky SAS ® System for Forecasting Time Series. Kathleen B. Willard L. ˝ and Sean C. Third Edition by Rudolf J.

Welbrock Business Analysis Using Regression: A Casebook by Dean P. Stine.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. Raithel Univariate and Multivariate General Linear Models: Theory and Applications Using SAS ® Software by Neil H. Foster. Timm and Tammy A. Allison JMP® Start Statistics. LIttell. 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. Ramon C. and Lee Creighton Tuning SAS ® Applications in the MVS Environment by Michael A. Tilanus Your Guide to Survey Research Using the SAS® System by Archer Gravely . Freund. Robert A. John Paul Broussard. and Lee Creighton Table-Driven Strategies for Rapid SAS ® Applications Development by Tanya Kolosova and Samuel Berestizhevsky Regression Using JMP® by Rudolf J. Foster. and Richard P. Waterman Survival Analysis Using the SAS ® System: A Practical Guide by Paul D. Waterman Strategic Data Warehousing Principles Using SAS ® Software by Peter R. Stine. Mieczkowski Using SAS ® in Financial Research by Ekkehart Boehmer. Robert A. Second Edition by John Sall. and Richard P. Ann Lehman.

.

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

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 COOK · Regression Graphics COOK and WEISBERG · Applied Regression Including Computing and Graphics COOK and WEISBERG · An Introduction to Regression Graphics CORNELL · Experiments with Mixtures. Third Edition DRYDEN and MARDIA · Statistical Shape Analysis DUDEWICZ and MISHRA · Modern Mathematical Statistics DUNN and CLARK · Applied Statistics: Analysis of Variance and Regression. and the Analysis of Mixture Data. Probability.BRUNNER. Second Edition *COCHRAN and COX · Experimental Designs. Second Edition DUNN and CLARK · Basic Statistics: A Primer for the Biomedical Sciences. Designs. Second Edition DRAPER and SMITH · Applied Regression Analysis. Volume I. 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. 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. Sixth Edition *DANIEL · Fitting Equations to Data: Computer Analysis of Multifactor Data. 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. Development. Second Edition FLEMING and HARRINGTON · Counting Processes and Survival Analysis FULLER · Introduction to Statistical Time Series. 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. 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. Second Edition GOLDSTEIN and LEWIS · Assessment: Problems. 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. 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. Revised. Second Edition *DEGROOT. Models. Volume II. Third Edition FELLER · An Introduction to Probability Theory and Its Applications. and Statistical Issues GREENWOOD and NIKULIN · A Guide to Chi-Squared Testing GROSS and HARRIS · Fundamentals of Queueing Theory. DOMHOF. Simulation. and LANGER · Nonparametric Analysis of Longitudinal Data in Factorial Experiments BUCKLEW · Large Deviation Techniques in Decision. Second Edition CONGDON · Bayesian Statistical Modelling CONOVER · Practical Nonparametric Statistics. FIENBERG. 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. Second Edition *DOOB · Stochastic Processes DOWDY and WEARDEN · Statistics for Research. and PEACOCK · Statistical Distributions. Second Edition FULLER · Measurement Error Models GALLANT · Nonlinear Statistical Models GHOSH. Second Edition DASU and JOHNSON · Exploratory Data Mining and Data Cleaning DAVID · Order Statistics. MUKHOPADHYAY. HASTINGS. Third Edition. . 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.

CONQUEST. KOTZ. BRILLINGER. and GREENHOUSE · Case Studies in Biometry LARSON · Introduction to Probability Theory and Statistical Inference. BARDEN. HILL. . 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. Volume 1. and BALAKRISHNAN · Discrete Multivariate Distributions JOHNSON. and BALAKRISHNAN · Continuous Univariate Distributions. KOTZ. and WILLMOT · Solutions Manual to Accompany Loss Models: From Data to Decisions KOTZ. Volume 1: Introduction to Experimental Design HOAGLIN. 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. MATHEW. Second Edition JOHNSON. RYAN. Third Edition LAWLESS · Statistical Models and Methods for Lifetime Data. READ. LÜTKEPOHL. MOSTELLER. Philosophical. BALAKRISHNAN. KOTZ. Second Edition HOSMER and LEMESHOW · Applied Logistic Regression. and BANKS (editors) · Encyclopedia of Statistical Sciences: Update Volume 1 KOTZ. PANJER. Volume 1. MOSTELLER. READ. and KEMP · Univariate Discrete Distributions. 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. and JOHNSON · Continuous Multivariate Distributions. Volume 2. PANJER. Trends and Shapes *HOAGLIN. and SINHA · Statistical Tests for Mixed Linear Models KLUGMAN. 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. 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. 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 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. Second Edition LANGE. and BANKS (editors) · Encyclopedia of Statistical Sciences: Update Volume 2 KOVALENKO. BILLARD. and TUKEY · Exploring Data Tables. and Historical Introduction LAMPERTI · Probability: A Survey of the Mathematical Theory. BERAN. Second Edition JOHNSON. CARNE. and WILLMOT · Loss Models: From Data to Decisions KLUGMAN. KUZNETZOV.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. KOTZ. and TUKEY · Exploratory Approach to Analysis of Variance HOAGLIN. MOSTELLER. 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. Fifth Edition HOGG and KLUGMAN · Loss Distributions HOLLANDER and WOLFE · Nonparametric Statistical Methods. Second Edition HOEL · Introduction to Mathematical Statistics. and LE · Shape and Shape Theory KHURI · Advanced Calculus with Applications in Statistics. 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 KHURI. 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. GRIFFITHS. and BALAKRISHNAN · Continuous Univariate Distributions. and LEE · The Theory and Practice of Econometrics.

SCHAFER. Second Edition LLOYD · The Statistical Analysis of Categorical Data MAGNUS and NEUDECKER · Matrix Differential Calculus with Applications in Statistics and Econometrics. 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. Statistical Models. CHAN. Second Edition PRESS and TANUR · The Subjectivity of Scientists and the Bayesian Approach PUKELSHEIM · Optimal Experimental Design PURI. 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. With Applications in Engineering and the Sciences NELSON · Accelerated Testing. Design Data Analysis. Second Edition McCULLOCH and SEARLE · Generalized. and CHIU · Spatial Tesselations: Concepts and Applications of Voronoi Diagrams. BOOTS. Linear. SUGIHARA. Models. and SCOTT (editors) · Sensitivity Analysis *SCHEFFE · The Analysis of Variance *Now available in a lower priced paperback edition in the Wiley Classics Library. Second Edition MYERS. Second Edition ROLSKI. and TOLLEY · Statistical Applications Using Fuzzy Sets MARDIA and JUPP · Directional Statistics MASON. MONTGOMERY.LINDVALL · Lectures on the Coupling Method LINHART and ZUCCHINI · Model Selection LITTLE and RUBIN · Statistical Analysis with Missing Data. Test Plans. WOODBURY. 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. VILAPLANA. and WERTZ · New Perspectives in Theoretical and Applied Statistics PUTERMAN · Markov Decision Processes: Discrete Stochastic Dynamic Programming *RAO · Linear Statistical Inference and Its Applications. GUNST. and HESS · Statistical Design and Analysis of Experiments with Applications to Engineering and Science. 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 RENCHER · Linear Models in Statistics RENCHER · Methods of Multivariate Analysis. and VINING · Introduction to Linear Regression Analysis. Third Edition MORGENTHALER and TUKEY · Configural Polysampling: A Route to Practical Robustness MUIRHEAD · Aspects of Multivariate Statistical Theory MURRAY · X-STAT 2. 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. SCHMIDLI. Second Edition OLIVER and SMITH · Influence Diagrams. 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. PECK. SCHMIDT. Second Edition SALTELLI. Data. and Analysis by Some Friends of Cuthbert Daniel MANN. TIAO. Second Edition MONTGOMERY. and Applications PRESS · Subjective and Objective Bayesian Statistics. Revised Edition MALLER and ZHOU · Survival Analysis with Long Term Survivors MALLOWS · Design. 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.0 Statistical Experimentation.

BISGAARD. 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 WU and HAMADA · Experiments: Planning. Second Edition THOMPSON · Simulation: A Modeler’s Approach THOMPSON and SEBER · Adaptive Sampling THOMPSON. ABRAMS. WILLIAMS. . OBUCHOWSKI. 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 MECKE · Stochastic Geometry and Its Applications. and Application SCHOTT · Matrix Analysis for Statistics SCHUSS · Theory and Applications of Stochastic Differential Equations SCOTT · Multivariate Density Estimation: Theory. KENDALL. W. and Parameter Design Optimization YANG · The Construction Theory of Denumerable Markov Processes *ZELLNER · An Introduction to Bayesian Inference in Econometrics ZHOU. HILL. PEÑA. Second Edition WOODING · Planning Pharmaceutical Clinical Trials: Basic Statistical Principles WOOLSON and CLARKE · Statistical Methods for the Analysis of Biomedical Data. and SONG · Methods for Meta-Analysis in Medical Research TANAKA · Time Series Analysis: Nonstationary and Noninvertible Distribution Theory THOMPSON · Empirical Model Building THOMPSON · Sampling. Practice. Second Edition STOYAN and STOYAN · Fractals. Volume II: Categorical and Directional Data VAN BELLE · Statistical Rules of Thumb VIDAKOVIC · Statistical Modeling by Wavelets WEISBERG · Applied Linear Regression. and FINDLAY · Models for Investors in Real World Markets TIAO. Random Shapes and Point Fields: Methods of Geometrical Statistics STYAN · The Collected Papers of T. JONES. 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. Control. and STIGLER (editors) · Box on Quality and Discovery: with Design. 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. and MCCLISH · Statistical Methods in Diagnostic Medicine *Now available in a lower priced paperback edition in the Wiley Classics Library. Analysis. SHELDON.SCHIMEK · Smoothing and Regression: Approaches. Computation. Anderson: 1943–1985 SUTTON.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->