Revised Chapter 7 in Specifying and Diagnostically Testing Econometric Models (Edition 3)

Total Page:16

File Type:pdf, Size:1020Kb

Revised Chapter 7 in Specifying and Diagnostically Testing Econometric Models (Edition 3)

Revised Chapter 7 in Specifying and Diagnostically Testing Econometric Models (Edition 3) © by Houston H. Stokes 30 October 2013. All rights reserved. Preliminary Draft

Chapter 7

Time Series Analysis Part I: ARIMA and Transfer Function Identification.. . . .1 7.0 Introduction...... 1 7.1 Identifying and Estimating an ARIMA Model...... 2 Table 7.1 Use of the ACF and PACF to Identify an ARIMA Model...... 7 7.2 Identifying and Estimating a Transfer Function Model...... 11 7.3 Diagnostic Tests on the Autocorrelations of the Cross Correlations....18 Table 7.2 Setup to Illustrate CCF Diagnostic Tests...... 24 Table 7.3 ACF of Residuals and Cross Correlations for Case 1...... 29 Table 7.4 ACF of Residuals and Cross Correlations for Case 2...... 30 Table 7.5 ACF of Residuals and Cross Correlations for Case 3...... 31 Table 7.6 ACF of Residuals and Cross Correlations for Case 4...... 32 7.4 Spectral Analysis...... 32 7.6 Automatic ARIMA Model Selection...... 34 7.7 Examples of Box-Jenkins Analysis...... 41 Table 7.7 Program to Estimate the Effect of M2 on Interest Rates...... 41 Table 7.8 Data on M2...... 43 Table 7.9 Data on the Commercial Paper Interest Rates...... 45 7.8 IACF and ESACF Identification...... 55 Table 7.10 Inverse Autocorrelation Subroutine iacf...... 56 Table 7.11 Inverse Autocorrelation Subroutine iacfn...... 57 Table 7.12 Analysis of the Box-Jenkins-Reinsel Chemical Process Data Using IACF and ESACF...... 58 7.9 Conclusion...... 79

Time Series Analysis Part I: ARIMA and Transfer Function Identification

7.0 Introduction

The B34S commands bjiden and bjest control identification and estimation of Box- Jenkins (1976) models. The basic code was originally developed by David Pack (1977) and was extensively modified by the author.1 This code also runs under the matrix command where the autobj command can be used to automatically identify an ARIMA model. The basic reference for the theory that underlies these commands is the classic work of Box and Jenkins (1976), which has been updated as Box, Reinsel and Jenkins (1994). Nelson (1973) provides a simplified treatment of univariate models, while a more modern treatment is found in Enders (1995) and Hamilton (1994). Since these excellent references are available, only a brief discussion of the identification and estimation steps will be given here. Zellner and Palm (1974) outline how the Box-Jenkins univariate and transfer function models are special cases of the more general vector autoregressive moving-average models. The simultaneous equations model is shown to be

1 Slight differences in the answers between the first and subsequent editions of this book are due to the subroutines in bjiden and bjest being converted to REAL*8.

7-1 7- 2 Chapter 7 another special case. The btiden and btest commands to estimate these more complex models are discussed in Chapter 8, while the simultaneous equations command simeq is discussed in Chapter 4. A frequency interpretation of the VAR model is discussed in Chapter 12.

7.1 Identifying and Estimating an ARIMA Model

2 Assume two jointly distributed, discrete random variables {x1 ,..., xt } and{y1 ,..., yt } . Define p( x* , y * ) as the joint distribution of x and y or the probability at the point x =x* and y = y*. The marginal distribution of x (y) is the probability distribution of x (y) without regard to y (x) p( x ) p ( x , y ) ( p ( y )  p ( x , y )) and is defined as y  respectively. The conditional x distribution of x, given that y= y* , is p( x | y* ) , where

* * * p( x | y ) p ( x , y ) / p ( x , y ). (7.1-1) x

The conditional distribution is the joint distribution divided by the marginal distribution. A series xt is said to have the property of strict stationarity if

p( xt ,..., x t+ k )= p ( x t + n ,..., x t + k + n ), (7.1-2) which implies that the marginal distribution of each observation is the same

(p ( xt )= p ( x t+ n ) for n 0) , the expected value of each observation is the same

(E(xt ) E( x t n ) for n  0) , the variances of each observation are the same

(V(xt ) V( x t n ) for n  0) and the covariances C(xt , x t j ) are invariant of any offset in time

C(xt , x t j ) C( x t  m , x t  m  j )  j for m  0. (7.1-3)

k Define B as the backshift operator such that B xt x t k . The general form of the ARIMA model is

2p s 2s P s d s D (1-f1 B - f 2 B - ,..., - fp B )(1 - G 1 B - G 2 B - ,..., -G P B )(1 - B) (1 - B ) x t = 2p s 2s P s (7.1-4) (1-q1 B - q 2 B - ,..., - q p B )(1 - D 1 B - D 2 B - ,..., -D P B )e xt

where i is a regular autoregressive coefficient, Gi is a seasonal autoregressive coefficient, d is the order of regular differencing, D is the order of seasonal differencing, s is the seasonal period,

2 The discussion on identification draws heavily on material in Box and Jenkins (1976), Nelson (1973) and Stokes, Jones, and Neuburger (1975, chap. 5). i is a moving-average coefficient, i is a seasonal moving-average coefficient and ext is a white-noise error process having the following three properties:

E( ext ) = 0 for all t (7.1-5)

2 2 E( ext ) = s xe for all t (7-1-6)

E( ext e xt- s ) = 0 for all t and s = 0. (7.1-7)

A correctly specified, autoregressive integrated moving-average (ARIMA) model will filter a series {x1 ,..., xt } such that the estimated covariances of the error term in (7.1-4) vanish as specified in (7.1-7). A GARCH model, relaxes the homoskedasticity assumption (7.1-6) and fits an ARIMA model to the conditional volatility.3 It is possible to write equation (7.1-4) in more compact notation as

fx(B)G x (B)x t = q x (B) D x e xt (7.1-8) or

Hx (B)x t= F x (B) e xt , (7.1-9)

where Hx (B)x (B)  x (B) and Fx (B) x (B)  x (B) and we assume for simplicity that xt has 4 been suitably differenced to make it stationary. If Fx (B) is invertible equation (7.1-9) can be written in the inverted form as an autoregressive model

Ax (B)x t e xt (7.1-10)

while if Hx (B) is invertible, equation (7.1-9) can be written in the random shock form as a moving-average model

xt Cx (B) e xt , (7.1-11)

3 Stokes (200x), currently in draft form, discusses these extensions to the model ARIMA time series model in some detail.

4 For further discussion of invertibility, see Granger and Newbold (1986) and Sargent (1987, 291). Note that n j Fx (B)  f x j B , where f x j is a coefficient in the model filtering xt and B is the backshift operator. Fx (B) j0 will have one-sided inverse if its roots all have absolute values > 1.0 or, in other words, are outside the unit circle.

7-3 7- 4 Chapter 7 where

1 Ax (B) [F x (B)] H x (B) (7.1-12) and

1 Cx (B) [H x (B)] F x (B) . (7.1-13)

Assume that the model that prewhitens the xt series is applied to the series yt . In general, the error

* eyt A x (B) y t (7.1-14)

will not be white noise since the appropriate model for prewhitening yt is

eyt A y (B) y t (7.1-15)

and, in general, Ax (B) A y (B) . Problems concerning the one-filter and two-filter identification technique will be discussed in sections 7.2 and 7.3. The inverted form is easy to understand since it is an AR model, the random shock of MA model is needed for forecasting while the ARMA form is most parsimonious. To aid in the selection of the appropriate ARIMA model, Box and Jenkins (1976) recommend calculation of the autocorrelation function (ACF) and the partial autocorrelation function (PACF). The ACF and the PACF are used in a four-step procedure to identify an ARIMA model. The steps include the following:

a. Make the xt series stationary so the ACF and PACF can be calculated.

b. Use the ACF and PACF to determine a preliminary ARIMA model.

c. Obtain an estimate of the preliminary model, using ML estimation.

d. Diagnostically check the preliminary model to see if the residual is white noise. If the residual is white noise, the model is complete. If the residual is not white noise, then adjust the model based on the ACF and PACF of the residual and repeat steps c through d as many times as necessary to obtain white noise in the residual.

e. Optionally, use the ARIMA model identified in step d to forecast.

If the series is not stationary, then the variance and covariance terms defined in (7.1-17) do not exist. For further detail on this problem see section 12.4. Define μ as the estimated mean of the series {x1 ,..., xt }. An estimate of the autocorrelation at lag j, ˆ j , is defined as

ˆ j ˆ j /  ˆ0 , (7.1-16) where the estimated covariance is

T- j gˆ j=(1/ T) [(x t - m )( x t+ j - m )] for j=0,... (7.1- t=1 17)

Equation (7.1-17) uses T in the denominator in contrast with the usual covariance formula, which uses the small sample approximation, T-j. Equation (7.1-16) will make the estimated autocorrelation smaller than the formula with the small sample approximation. A series is deemed white noise if there are no significant spikes in the ACF.5 The Bartlett (1946) formula for the estimated standard error of rˆ j, sˆ j is

q 2 sˆ j= [(1/ T){1 + 2r i }] forj > q . (7.1-18) i=1

Equation (7.1-18) reduces to the large sample approximation 1/T if i  0 for i < j . The Bartlett form of the standard error will be greater than or equal to the large sample approximation. An estimated autocorrelation coefficient for lag k will be deemed significant at approximately the 95% confidence interval if 2sˆj | ˆ k | . The first k estimated autocorrelations can be tested with the Box-Pierce (1970) Qk statistic

k ˆ 2 Qk T   j , (7.1-19) i1 which is distributed as chi-square with k-p-q degrees of freedom, where p and q are the number of AR and MA coefficients in the multiplied out ARIMA model given in equation (7.1-9), or the Ljung-Box (1978) modified Q statistic

k *ˆ 2 Qk [T(T+2)] { j /(T  i )}, (7.1-20) i1

5 For the purposes of this chapter, this definition of white noise will be used. Since only the second-order cumulant (ACF) is tested, a better term might be second-order white instead of white noise. The Hinich test (1982) for third- order whiteness is outlined in chapter 8 and is available as an option in the btiden and btest paragraphs. Hinich is developing a fourth-order whiteness test.

7-5 7- 6 Chapter 7 which is thought to be closer to chi-square with k-p-q degrees of freedom in moderate-sized samples. The autocorrelation function in the bjiden and bjest paragraphs provides an estimate of the modified Q for each estimated autocorrelation coefficient, and the Q and the modified Q and the levels of significance for the first NCHI estimated autocorrelation coefficients. If NCHI is not set, it defaults to MIN(24,NAC), where NAC is the number of autocorrelation coefficients.

The estimated partial autocorrelation coefficients {1 ,..., k }, where k is specified by the user with the NPAC parameter, are calculated as the successive solutions to the Yule-Walker 6 equations for i given the estimated autocorrelations i

r1= F 1 r2= F 1 r 1 + F 2 (7.1- ...... rp= F1 r p- 1 + F 2 r p - 2 +,..., F p 21)

Inspection of the PACF indicates the maximum order of the pure AR model given in equation (7.1-10). Table 7.1, which was taken from Box and Jenkins (1976, 79), illustrates how the ACF and the PACF are used to determine the appropriate orders p and q of the AR and MA parts of an ARIMA model.

Table 7.1 Use of the ACF and PACF to Identify an ARIMA Model ______Model ACF Pattern PACF Pattern

Pure MA (7.1-11) Spikes at lags 1 - q Tail off then cut off

Pure AR (7.1-10) Tail off according to Spikes at lags (7.1-21) 1-p then cut off

ARIMA (7.1-9) Irregular pattern 1-q Tail off then tail off according to (7.1-21)

______For the purposes of the table, q is the maximum MA term in Fx (B) for an ARIMA model and p is the maximum AR term in Hx (B) in equation (7.1-9).

6 To reduce notational clutter, the hats (^) have been left off where the meaning is clear. The i values are assumed to be the estimated autocorrelation values. If a series is not stationary, the ACF and PACF are not defined, although they can be calculated. The usual procedure to check for stationarity is to calculate the ACF and see if the coefficients die out. If the coefficients do not die out, more differencing is used. While the above procedure has traditionally been followed, unit root tests such as the Dickey-Fuller and Phillips- Perron, can be employed. These tests, callable from the bispec sentence under the bjiden and bjest sentences and available under the matrix command, are discussed in Chapter 12. The following commands will estimate the ACF and PACF for active variables MONEY and PRICE.

b34sexec bjiden list=(money,price) plot=(money,price) nac=48 iwtpa $ var money price$ seriesn var=money name=('money supply m2')$ seriesn var=price name=('cpi all items')$ rtrans dif=(2,1)(1,12)$ rauto money price$ b34seend$

There will be six sets of autocorrelations calculated. These are MONEY, (1-B)MONEY, (1-B)2MONEY, (1-B12)MONEY, (1-B)(1-B12)MONEY and (1-B)2(1-B12)MONEY and the corresponding transformations for PRICE. Both series have been optionally listed and plotted (list and plot parameters) and the autocorrelations have been plotted (iwtpa option). The number of autocorrelations and partial autocorrelations has been set at 48. Assume that (1-B)MONEY is stationary. The ACF of (1-B)2MONEY would show added spikes due to the over differencing. Once the series is deemed stationary, Table 7.1 is used to select the model. Assume a preliminary guess for the correct model is an ARIMA model of the form

12 (1- B)(1 - G1 B )MONEY=(1-q 1 B)et , (7.1-22)

where, if there is no confusion, we assume et eMONEY t .

The following bjest commands will estimate the model listed in equation (7.1-22) and forecast for 12 periods ahead, starting from the 200th observation.

b34sexec bjest$ model money $ modeln p=12 q=1 dif(1,1)$ forecast nf=12 nt=200$ b34seend$

The bjest command uses a variant of the Meeter (1964a, 1964b) nonlinear routine, GAUSHAUS, to minimize the sum of squares of the residual of the general ARIMA model listed in equation (7.1-9). Since the shocks of the system before observation one are not known, the procedure sets them to their expected value of zero. If the iwbf option is set, the model is run backward through time to generate estimates of the errors prior to the first observation. It is recommended that this option not be used initially because of convergence problems using this

7-7 7- 8 Chapter 7 "exact" ARIMA model. The SAS proc arma attempts to get around the problem of obtaining values for the error terms prior to observation 1 by optionally removing them from the calculated residual sum of squares. This approach has not been implemented in B34S at this time because it appears to be arbitrary.

A major problem in ARIMA model estimation is high parameter correlation. Consider the following alternative models for series xt .

12 (1-f1 B)(1 - f 2 B )xt = e xt (7.1-23)

12 13 (1-f1 B - f 2 B - f 3 B )xt = e xt (7.1-24)

Equation (7.1-23), which is specified as P=(1)(12), implies a model of the form of equation (7.1- 24), where

f3 f 1 f 2 (7.1-25)

Model (7.1-24) can be estimated directly as P=(1,12,13) without constraining 3 by equation (7.1-25). If model (7.1-24) is estimated in error, when model (7.1-23) is the correct model, the correlation between f3 and the other two parameters, 1 and 2 , will be high. The bjest command displays a correlation matrix of the parameters to test for this problem. The reciprocal of the condition of the correlation matrix of the parameters is given as a further measure to detect problems of parameter redundancy.

The bjest command also provides a rank condition on the covariance matrix. If there is extreme parameter collinearity, a message is given and the SEs of the coefficients are not calculated. If the user still wants to proceed, the irisk option can be specified to force inversion. If irisk is set, B34S may generate a traceback. SEs calculated with irisk set should be used with caution. Rather than proceeding with irisk, the correct procedure is to try and determine whether it is possible to simplify a model of the form of equation (7.1-24) to a form like equation (7.1- 23). The covariance of the parameters will indicate which parameters are related. If this is not available due to extreme rank problems, the best strategy is to simplify the model and attempt to "walk" in the parameters one at a time to determine what is causing the problem.

Define xt+ j| t as the forecast for x in period t+j, given information in period t. From equation (7.1-11), we can write

xt j   x0 e x t  j   x 1 e x t  j  1  ..., (7.1-26)

where, by notational convention, cxi(B)  xi and μ is the mean of the process. Since E(ex k ) 0 for k  t , then

xt j| t   x j e xt   x j  1 e xt  1  ... (7.1-27) and

lim jx t  j| t   (7.1-28)

 since the sum  i converges where  i 1.0 and as we get sufficiently far out, all future shocks i0 are set to their expected value of 0 . The bjest command lists the  weights if forecasting is requested. Inspection of these weights will indicate how soon the forecast will converge to the mean. If the y i weights die out for i= k , this means the model cannot forecast anything but the mean of the process more than k periods out. The standard deviation of the error in the forecast j periods in the future, ex t j| t[ x t  j  x t  j | t ] , is defined in terms of  weights as

j 2 SD[ext j| t ]  e (  xi ) (7.1-29) i0

In addition to the ACF and PACF, often the inverse autocorrelation function IACF (Wei (2006, 122) and extended sample autocorrelation function , ESACF, Wei(2006, 128-133) and Tiao-Tsay (1983), Tsay-Tiao (1984) ) are employed to provide added insight. Since a MA(1) model can be written as an AR( ) model and an AR(1) model can be written as a MA( ) model, the idea of the IACF is given an unknown ARMA(p,q) model, to calculate the ACF of the ARMA(q,p) model. For a ARMA(0,1) the ACF has one spike. The IACF will trail off since it will be seen as an ARMA( ,0). Unlike the ACF and PACF the IACF depends on the number of terms used to model the AR form of the model. The two basic approaches for estimation are shown in equation (7.1-30). Wei (2006, 126) suggests first estimating an AR(p) model using OLS where p is sufficient to capture the process and forming the IACF as

禳 (I ) 镲-fk + f1 f k+ 1 +⋯ + f p - k f p r = 睚 (7.1- k 1+f2 +⋯ + f 2 铪镲 1 p 30) for k p and 0.0 otherwise. Abraham and Ledolter (1984) suggest using the PACF to estimate fi via the Yule-Walker approach of Box and Jenkins (1976, 82) and forming the IACF using

(7.1-30) with PACF values substituted in place of the OLS values for fi . Using OLS, if an

AR(k) model was estimated, fi i< k will in general differ if an AR(k+j) j>0 is estimated. This is not true if the PACF is used. The maximum order of the AR(k) model must be selected such

7-9 7- 10 Chapter 7 that the process is fully captured. Using (7.1-30) note that from Wei (2006, 127)

禳 (I ) 镲 -f r = 睚 k (7.1- p 1+f2 +⋯ + f 2 铪镲 1 p 31)

Abraham and Ledolter (1984, 610) make the point that contrary to the view of some that the IACF is more informative than the sample PACF, they "find that the informnation in the inverse autocorrelations is rather limited."

The ESACF involves calculation of iterated regressions that attempt to calculate consistent estimates of the AR terms assuming higher and higher order MA terms. Inspection of an ESACF table for p=1,maxar and q=1,maxma, where maxar and maxma are the maximum orders considered, gives insight into the range of models that might be considered, since there no one unique filter. This approach is not as useful for seasonal models.7 Following Wei (2006) p assume a series zt whose model was ARMA(p,q). If a model zi=f i z t- i + e t , t = p + 1,⋯ , n is i=1 ˆ estimated, then fi will inconsistent and the residuals not white. The idea is to try and detect the p (0)ˆ (0) appropriate number of AR and MA terms. Define eˆt= z t - f i z t- i from which we get the i=1 p (1) (1) (0) (1) new model zt=f i z t- i + b1 eˆ t - 1 + e t . This generates a second model of the form i=1 p (2) (2) (1) (2) (0) (2) zt=f i z t- i + b1 eˆ t - 1 + b 2 e ˆ t - 2 + e t or in general i=1

p q (q ) ( q ) ( q- i ) ( q ) zt=邋f i + b i eˆ t- i + e t (7.1- i=1 i = 1 32) where

p q (j )ˆ ( j ) ( j ) ( j- i ) eˆt= z t -邋f i z t- i - b i e ˆ t - i (7.1- i=1 i = 1 33)

th (m ) The m ESACF at lag j, pˆ j , is the sample autocorrelation of the transformed series

7 The ESACF is complex to use and will not be discussed further here. Stokes (200x) provides added examples. (j ) ( j )ˆ ( j ) m yt=(1 -f1 -⋯ - f m B ) z t (7.1- 34)

(m ) ˆ (j ) The B34S implementation provides a table of pˆ j , and a simplified table and tables of fk for all values. Section 7.8 provides an example.

Once an ARIMA model is tentatively identified, the next task is a preliminary estimation. The residuals of this model are then tested and, if need be, the model is adjusted until the residuals are "clean" or in other words contain no significant spikes. The nonlinear estimation procedure of the ARIMA model in bjest uses a variant of the GAUSHAUS program developed by Meeter (1964a, 1964b). Further discussion of this program is contained in Chapter 11, which discusses nonlinear estimation. The bjest command contains a number of parameters to assist the user in estimating the model. The parameter mit sets the maximum allowable iterations. The default is 20 and is rarely exceeded. The parameter esp1 sets the maximum change in the sum of squares before iteration stops. If this parameter is not given, this stopping rule is not used. The parameter esp2 allows the user to set the maximum allowable percent change in any parameter before iteration stops. The default for esp2 is .004. The user is cautioned against raising eps2. In the next section, ARIMA filters are used to identify transfer functions.

7.2 Identifying and Estimating a Transfer Function Model

Assume a multiple-input transfer function model of the form

k yt= c +[w i (B)/ di (B)]X i , t + [ q (B)/ f (B)] e t (7.2-1) i=1

where wi (B), di (B), q (B) and f (B) are all polynomials in the lag operator B, and there are k th th th input series, where X i, t is the t observation of the i input series, et is the error term for the t observation and yt is the dependent variable. If we assume that [wi (B)/ d i (B)] 0 , then equation (7.2-1) converges to an ARIMA model such as equation (7.1-4). If we assume that [ (B)/  (B)] 1, equation (7.2-1) is a rational distributed lag model. If, in addition, we simplify

[wi (B)/ d i (B)], then equation (7.2-1) converges to a multiple-input OLS model, such as equation (2.1-7). Thus, the transfer function model is a more general case of the OLS and the ARIMA models. Equations (2.5-13) – (2.5-17) showed how (7.2-1) is a more general case of the GLS model, which itself could be written as a constrained Granger Causality model.

The difficulty of estimating the mode general model given in equation (7.2-1) lies in specifying the orders of [i (B)/  i (B)] and [ (B)/  (B)]. These difficulties magnify as k

7-11 7- 12 Chapter 7 increases, except in the case in which the series Xi, t are all orthogonal. A number of proposed methods for identification of such a transfer function model have been suggested in the literature. These include the original one-filter identification procedure, suggested by Box and Jenkins (l976); the two-filter identification procedure, suggested by Haugh (l976), Pierce and Haugh (1977), Haugh and Box (1977) and others; and a least-squares method involving estimation of a linear transfer function (LTF) , suggested by Liu and Hanssens (1982) and modified by Liu and Hudak (1986a). In practice, problems often arise in detecting whether it was the input rational polynomial [wi (B)/ d i (B)] or the noise rational polynomial [ (B)/  (B)] that was not correctly specified, since either (or both problems) could result in spikes in the cross correlations between the residual and the input series. Section 7.3 discusses an additional diagnostic test on the cross correlations to pinpoint the nature of any specification problems. Before this diagnostic test is discussed, the alternative identification approaches and problems are their varied problems are advantages are outlined.

Assume there is only one input series in equation (7.2-1) or that k=1. Following Box and Jenkins (1976, 379), equation (7.2-1) can be written in impulse-response form8 as

yV(B) x  [ (B)/  (B)] e t t t (7.2-2) v0 xt  v 1 x t 1 ...  v k x t  k  [ (B)/  (B)] e t

The steps to identify a transfer function with the one-filter method include the following:

a. Difference yt and xt to achieve stationarity so that the ACF is defined.

b. Estimate an ARIMA filter for xt from equation (7.1-9) such that ext is white noise.

c. Apply the filter estimated for the xt series to the yt series, using equation (7.1-14) to form * the nonwhite noise series eyt .

* d. Cross correlate a t and t where t e xt and bte yt ,to form the cross correlation

function r  ( k ) at lag k for k = {-maxk, ...,0,..., maxk}. The value of maxk is set so that the cross correlations die out.

e. Using the estimated cross correlations contained in r  ( k ) , obtain an estimate of the impulse response weights, V(B), in equation (7.2-2).

8 Since there is only one input, for notational simplicity we assume X1 t xt , where X1 t was defined in equation

(7.2-1) and xt was defined in the previous section. It can be shown that

vk  r ( k )  /   (7.2-3)

since if we multiply equation (7.2-2) by Ax (B) , we obtain

tV(B)  t  [H x (B)/F x (B)][  (B)/  (B)]e t (7.2-4)

Equations (7.2-3) and (7.2-4) show that the cross correlations r  ( k ) weighted by their standard errors  and   are directly proportional to the impulse-response function V(B) in equation

(7.2-1). Inspection of vk from equation (7.2-3) provides a guide to select the model for

[wi (B)/ d i (B)] in equation (7.2-1) prior to estimation with ML methods. An estimate of the noise series can be obtained by noting that

K k e垐t y t   v kB x t (7.2-5) k0

where K  maxk . The ACF of et is used to obtain a preliminary guess on the appropriate form of [ (B)/  (B)]. Problems arise if the initial guess for the form of [ (B)/  (B)] and/or

[wi (B)/ d i (B)] is not correct. A proposed diagnostic test for this problem is discussed in section 7.3. Before discussing this test, a brief examination of the two-filter identification approach, the more complex Liu and Hanssens (1982) LTF identification method and the simplified Liu and Hudak (1986a) LTF identification method is in order.

The two-filter approach, suggested by Haugh and Box (1977) and Priestley (1981 Chap.

9), estimates a separate prewhitening model for xt and yt and cross correlates the two prewhitened series, ey t and ext , which can be thought of as being related by the model

 ' eyt=V(B) e xt + e t (7.2-6)

An estimate of [wi (B)/ d i (B)] can be obtained if we multiply equation (7.2-6) by the yt prewhitening model and substitute for the xt prewhitening model to form

 ' yt=[F y (B)/H y (B)][ H x (B)/F x (B)]V(B) x t + [q (B)/ f (B)] e t (7.2-7) from which we can obtain an estimate of V(B) by noting that

7-13 7- 14 Chapter 7 ˆ  V(B)=[Fy (B)/H y (B)][H x (B)/F x (B)]V(B) (7.2-8)

There are a number of problems with the two-filter method of analysis that are discussed in Stokes and Neuburger (1979) and briefly below. The Liu and Hanssens (1982) approach, which was modified in Liu and Hudak (1986a), estimates V(B) by running a transfer function with many lags. This method shows promise but suffers from multicollinearity problems. Its most important advantage is the fact that it works best in multiple-input models, when the one- and two-filter approaches break down. The bjiden command allows all three methods to be used. Details of the command setup are found in Stokes (1996b).

The cross correlation vector r  ( k ) can be tested with the Haugh (1976, 382) S statistic defined as

M 2 S=T (ri j ( k )) (7.2-9) k= - M which is distributed as chi-square with degrees of freedom equal to the number of lags incorporated (2M+1) or the more accurate Haugh (1976, 383) modified S statistic, S*, which is distributed as chi-square with 2M+1 degrees of freedom.

M * 2 2 S= T (ri j ( k )) / T-|k|) (7.2-10) k= - M where T is the number of observations used to form the cross correlations and M is the number th of lags in each cross-correlation vector and ri j ( k ) is the cross correlation between the i and the j th series lagged k periods. Haugh (1976) initially proposed using the S* statistic to test for independence. Pierce (1977) proposed using the Haugh test on one side only. This approach was criticized because the distribution of ri j ( k ) depends on nonzero population cross correlations, even when such nonzero population cross correlations occur at lags different from the sample cross correlations used in the calculation of S* in equation (7.2-10), thus inflating the standard errors. For further discussions of these problems, see Pierce and Haugh (1977) and Stokes and Neuburger (1979).

After the transfer function model listed in equation (7.2-1) is estimated, B34S calculates the impulse response function

V0i (B)=[w i (B)/ d i (B)] (7.2-11)

for each input series i. Summing the terms in V0 i (B) gives an estimate on how fast yt adjusts to a one-unit change in Xi t . If the model is correctly specified, then

V0 i (B)� V i (B) fori 1, k (7.2-12)

If the model is not correctly specified, then, in general,

V0 i (B)� V i (B) for i 1, k (7.2-13)

Box and Jenkins (1976, 392-393) suggest a number of diagnostic tests for model specification. Assuming c =0, equation (7.2-1) can be rewritten as

k yt=V i (B)X i t +y (B) e t (7.2-14) i=1

If we assume only one input, the estimated model becomes

yt=V01 (B)X 1 t +y 0 (B) a 0 t (7.2-15)

Rewriting equation (7.2-15) in terms of a0 t and substituting for yt from the true model in equation (7.2-14) gives

-1 - 1 a0t=[y 0 (B)] {V 1 (B)-V 01 (B)}X 1 t + [ y 0 (B)] y (B) e t (7.2-16)

Equation (7.2-16) indicates that the error of the incorrect model, a0 t , will be correlated with X1 t if the first term{V1 (B)-V 01 (B)} 0 and autocorrelated if the second term -1 {[y0 (B)] y (B)} 1 . If (7.2-16) is placed in the form of (7.2-2) and OLS is used to attempt * estimation, then the estimated error term et will be constrained to be orthogonal to X1t and by * estimation assumption et e t . Two cases are worth mentioning. If the input model is correct, equation (7.2-12) holds and equation (7.2-16) can be written

1 a0t [ 0 (B)]  (B) e t (7.2-17)

In this case the series a0 t is not cross correlated with X1,t but is autocorrelated. The next section discusses the possibility of spurious cross correlations being observed. If the input model was not correct but the noise model was correct, then from equation (7.2-16)

0 (B)=  (B) (7.2-18)

7-15 7- 16 Chapter 7 and

-1 a0t=[y 0 (B)] y (B) e t = e t (7.2-19)

which implies that a0t is not autocorrelated but is cross correlated with X1 t , and hence at . If

X1t is autocorrelated, a0t will be autocorrelated, although this will not indicate problems with the noise model. A further complication arises if the orders of the input (noise) model are correct, but due to problems in the noise (input) model, equation (7.2-12) (equation [7.2-18]) does not hold due to the correlation between the estimated parameters. If both the noise model and the input model are not correct, equation (7.2-16) holds. The above discussion suggests that the estimated impulse response function V0i (B) from equation (7.2-11) should be corrected to form

Vci (B) , which contains elements vck i defined as

vc k i= v0 k i +[ra e ( k ) s e / s a ] (7.2-20) where

e0t= b t - V 0 i (B) a t (7.2-21)

The corrected impulse response weights are used two ways: First, their sum provides a way to measure the effect of a one-unit change in Xi t on yt , given the specified model. Second, the degree to which equation (7.2-12) holds determines how well the model captures the dynamic relationship. In short, Vi (B) measures the modeled impulse response function, while Vci (B) measures the correct impulse response function.

If forecasts are available beyond period t, a transfer function model can be used to forecast. These forecasts are usually obtained from an ARIMA forecasting model such as equation (7.1-27). The noise model [ (B)/  (B)] is used to form psi weights {0 ,  1 ,..,  k } . The variance of the conditional forecast of yt j given information at period t, [yt j| t ] , is

j-1 2 2 2 V[yt+ k| t ]=s e [ (( v k ) + ( y k ) )] (7.2-22) k = 0

One problem in transfer function model building is that the rational polynomial

[i (B)/  i (B)] is not unique. Most of the time, initial guesses on the parameters are not needed. If initial guesses are needed or the user desires to experiment with alternative models, the bjiden command has a startvalue option that implements suggestions contained in Box and Jenkins (1976, 383, 512-513). Assume that equation (7.2-3) is used to obtain an initial estimate of the impulse response vector, V(B) . Given user-specified orders for w i (B) and d i (B) , the startvalue option will generate an initial guess on the parameters. The startvalue option will also optionally output the "A matrix" and "H vector" as defined in Box and Jenkins (1976, 512).

By supplying alternative orders and numbers of parameters in w i (B) and d i (B) , the user can study the changes in the coefficients prior to attempting estimation of the transfer function model. The commands listed below show preliminary identification of the Box and Jenkins (1976) gas furnace data model. The user is investigating the effect of changing the numerator orders from 1, 2, 3 to 1, 2, 3, 4, 5, given the denominator orders. The parameter on the first bjiden call is all that is needed to save the vector for the subsequent bjiden type=startvalue steps. The default of 24 cross correlations and 24 terms in V(B) is used. The data set used in this example is discussed further in the next section and used in Chapter 8.

b34sexec options ginclude('gas.b34'); b34srun; B34sexec bjiden type=transi ncc=50 irwcnt=5$ var gasin gasout$ seriesn var=gasin name=('series j x from bj 1976 gas input ')$ seriesn var=gasout name=('series j y from bj 1976 gas output')$ modelpre var=gasin p=(1,2,3) ar=(1.97494,-1.3732,.3424) avepa=-.061$ output avepa=53.50800 $ pcross=(gasin,gasout)$ b34seend$ b34sexec bjiden type=startvalue$ startvalue nterms=(1,2,3) dterms=(1,2,3) rufile=sdata5 print=(ha,rw)$ b34seend$ b34sexec bjiden type=startvalue$ startvalue nterms=(1,2,3,4,5) dterms=(1,2,3) rufile=sdata5 print=(ha,rw)$ b34seend$ Before discussing the examples, the effects of autocorrelation in a series on the structure of the estimated cross correlation function will be examined.

7-17 7- 18 Chapter 7

7.3 Diagnostic Tests on the Autocorrelations of the Cross Correlations

A diagnostic procedure that will distinguish between spikes in the cross correlations of the residual and the prewhitened input series that arise from inadequacies in the noise model from those that arise due to problems in the specification of the input model is described below.9 The proposed procedure simplifies the second-round iterations of transfer function model building discussed in section 7.2.

Assume a multiple-input transfer function model of the form of equation (7.2-1).

Problems often arise in detecting whether it was the input rational polynomial [i (B)/  i (B)]or the noise rational polynomial [ (B)/  (B)] that was not correctly specified. In the first pass since either (or both problems) could result in spikes in the cross correlations between the residual and the input series. An additional diagnostic test on the cross correlations to help pinpoint the nature of the problem is proposed. First, the theory behind the proposed diagnostic test will be developed and outlined. Finally, an example will be given.

While the original, one-filter procedure showed promise in identifying one-input models, there were problems in identifying more-than-one-input models, unless the inputs were orthogonal with each other. The one-filter procedure had a major weakness, even in a one-input model, since the xt series prewhitening model usually would not prewhiten the yt series. If this was the case, there was the distinct possibility that the observed cross correlation between the two filtered series was due to the yt series not being completely prewhitened rather than to the series being related. The reasons for these spurious cross correlations occurring are outlined below. Further information can be found in Bartlett (1955), Box and Jenkins (1976, 376-377) and Stokes and Neuburger (1979). Often, no matter what method of identification has been selected, in the second-round identification process,10 when the preliminary specification of the model had been estimated by maximum likelihood techniques and the model was being fine tuned, the noise would show some autocorrelation and the cross correlation between the prewhitened xt series and the noise would show some spikes. In this situation, it was difficult to determine whether it was best to try to clean up the input model or the noise model first. The proposed new diagnostic test is always appropriate in the second-round identification step, no matter which of the procedures is used in the first stage. If the one-filter procedure is used in the first stage of the identification of a one-input transfer function, the proposed diagnostic procedure can also be used to reject spurious cross correlations as was done in Stokes and Neuburger (1979) and Neuburger and Stokes (1979b).

The two-filter procedure does not suffer from the problem of spurious correlations being

9 This section has been adapted from Stokes (1990). 10 The first-round identification process occurs prior to actual estimation of the model with maximum likelihood techniques. The second-round identification process takes place after the initial specification of the model has been estimated, using maximum likelihood techniques as the model is being refined. observed in the first-round identification stage when the one-filter procedure is used, and initially showed promise. However, Sims (1977) and others have shown that the two-filter procedure produces downwardly biased estimates of the cross correlations because the two prewhitening filters are not estimated jointly with the cross correlations. The major drawback of this proposed method is that a relationship between the two series, yt and xt , can be hidden from the researcher.11 A secondary drawback is that, as Liu and Hanssens (1982) and others have noted, it often results in very complex models being attempted. The search for common factors to delete often resulted in difficult judgment calls having to be made on how to initially set up the model. The second-stage identification process, using the two-filter procedure for the first stage, often was more difficult than when the one-filter procedure was used for the first-stage since the model tended to be overly complex initially. The proposed diagnostic procedure is most helpful in assisting the researcher on just what terms to add or change in the second-stage.

The original Liu and Hanssens (1982) LTF identification procedure, which involves the use of an OLS equation to identify the impulse response function so that an initial model can be selected for[wi (B)/ d i (B)] , is clearly superior to both the other two proposed methods in the multiple-input case when the one-filter technique breaks down. Liu and Hanssens (1982, 306- 307) outline five steps.12 The proposed diagnostic procedure would be applied after step 5 in the fine-tuning, second-stage identification step and would be similar to what would be done had another identification procedure, such as the one-filter or two-filter procedure, been used initially. The problem to be solved is what to do next if after an initial input model and noise model is selected and estimated, using a maximum likelihood, the researcher is confronted with a situation when it appears that one or more parts of the model are not correct. For example, often there are still spikes in the correlation between one of the prewhitened inputs and the noise, indicating a possible change in the appropriate input model, [wi (B)/ d i (B)] , and autocorrelation

11 The use of this method of detecting Granger (1969) causality resulted in findings of causality or lack of causality in the same series, depending on the method of analysis. For further details on this and other points, see Stokes and Neuburger (1979). 12 The five steps of the Liu-Hanssens (1982, 306-307) procedure include: (1) building ARIMA models for all input series and choosing a common filter for all input and output series from these models; (2) using OLS to estimate the transfer function weights on the filtered series; (3) building an ARIMA model for the residuals of the model in step 2; (4) using the ARIMA model of the noise to estimate the transfer function model weights with OLS; and (5) computing the noise of the original series by using the transfer function weights from steps 2 or 4 to identify a th rational polynomial of the form [i (B) /  i (B)] for the i input series and to identify a final noise model [ (B)/  (B)] . The simplified, three-step procedure suggested by Liu and Hudak (1986a) involved: (1) asserting a simple noise model, such as AR(1), and estimating a linear transfer function with OLS to obtain a preliminary estimate of the impulse response weights; (2) building an ARIMA model for the residuals of the model estimated in step 1; (3) computing the noise of the original series by using the transfer function weights from steps 1 or 2 to th identify a rational polynomial of the form [i (B) /  i (B)] for the i input series and to identify a final noise model, [ (B)/  (B)] .. In the five-step and the three-step approaches, the final step had to be repeated many times to get the most appropriate form of the noise and input models. This chapter outlines an additional step after steps 5 or 3 that will simplify the process of the final determination of the most appropriate input and noise models. This additional step will be discussed and illustrated later.

7-19 7- 20 Chapter 7 in the noise model, indicating possible changes in [ (B)/  (B)] . Deciding the correct course to follow is complicated by the possibility that the spikes in the cross correlations may have been spurious, having arisen because of the autocorrelation in the noise, not because of something wrong with the input model. The proposed second-round identification procedure, outlined below, provides a means by which the researcher will be able to choose whether to change the noise model or the input model first. As was mentioned earlier, it can be used no matter which initial identification procedure is selected. Use of any of the identification procedures assumes that there is no feedback from the yt series to any of the X i t series. While most software that implements the one-filter and two-filter procedures calculates the cross correlations in both directions and thus gave some indication of feedback signifying that a transfer function was not appropriate, in the usual implementation of the Liu-Hanssens (1982) method, this feedback check is usually not done. Because of the potentially serious problems of feedback, it has been the author's practice to estimate a VAR model to check for feedback prior to attempting the Liu- Hanssens (1982) transfer function identification procedure. In private discussion, Liu agrees with this approach. Liu stresses that the revised, three-step LTF identification method should be used in place of the more complex original approach

In the sections below, the distribution of cross correlations is discussed first. Next, the causality diagnostic testing procedure suggested by Stokes and Neuburger (1979) is discussed in the context of transfer function model building. Finally, an example using the Box-Jenkins (1976) gas furnace data is presented.

Box and Jenkins (l976, 377), Box-Jenkins-Reinsel (1994, 414), utilizing a special case of the Bartlett (1955) general formula on the general distribution of the cross correlation function, prove that if one series, at , is white noise and the other series, xt , is not white noise and if at and xt are not related, an autocorrelation of the sample cross correlation function of xt and at at .5 lag k [ra x ( k )] "can be expected to vary about zero with standard deviation (n k ) in a systematic pattern typical of the behavior of the autocorrelation function of xt " x x (j ) . Their formula,

r[rxa ( k ), r xa ( k+ j )] = r x x ( j ) (7.3-1) implies the following four propositions (Stokes and Neuburger 1979). 1. If series xt and at are cross correlated, and both series are white noise, the sample cross correlations will indicate the true relationship between the two series.

2. If series xt and at are not cross correlated and if one series ( at ) is white noise and the other series ( xt ) is not white noise, then "in this case the cross correlations have the same autocorrelation function as the process generating" (Box and Jenkins 1976, 377) the nonwhite noise series. Equation (7.3-1) describes the distribution of the autocorrelation function of the cross correlations for this case.

3. If both series are white noise and "are not cross correlated, then the covariance between the cross correlations will be zero" (Box and Jenkins 1976, 377).

4. If neither series is white noise and the two series are not cross correlated, then from inspection of the sample cross correlations, it is impossible to distinguish between true cross correlations and spurious results arising from the autocorrelations left in the two series.

Stokes and Neuburger (1979) and Neuburger and Stokes (1979b) suggested that these four propositions could be used to assist in using the one-filter identification procedure to determine causality between xt and yt . The suggested procedure was to first filter one series, e. g., xt . Next, the xt filter was applied to yt and the two filtered series were cross correlated. The autocorrelations of the cross correlations were calculated and, using proposition 2 above, * compared with the autocorrelations remaining in filtered yt( e yt ) that were caused from using the filter identified for xt . By using the one-filter procedure with the suggested diagnostic test for spurious cross correlations, causality tests can be made without having to resort to using the two- filter procedure and having the potential problem of the downward bias of the estimated cross correlation coefficients discussed earlier. Although causality tests can now be more effectively performed, using vector autoregressive model procedures, the diagnostic procedures suggested by Stokes and Neuburger (1979) can be effectively used in second-round transfer function model building identification. The use of these tests in this application is covered below. Prior to that, a few observations on how to determine whether two autocorrelation functions are the same are in order.

Stokes and Neuburger (1979) suggested a preliminary test statistic, in conjunction with visual inspection, to determine if the two autocorrelation functions are the same. The best visual procedure is to compare the locations of the significant spikes in the two autocorrelations. A more formal, but still preliminary, procedure is to calculate the test statistic h(i), distributed as a chi-square statistic with degrees of freedom 1, which is defined as

2 2 2 h(i )= (ri - t i ) /( sr + s t ) (7.3-2)

7-21 7- 22 Chapter 7 2 where  i and  i are corresponding elements of two autocorrelation functions for lag i, and   2 and  are the corresponding variances of i and  i , respectively. Since the sum of two chi- square statistics with degrees of freedom f1 and f2 is a chi-square statistic with degrees of freedom f1 f 2 , from the h(i) statistics we can form an estimate H(k) defined as

k H(k )  h( i ) (7.3-3) i1 which is distributed as chi-square with degrees of freedom k. This statistic can be used to test whether the first k autocorrelation terms for the two autocorrelation functions are significantly different. If H(k) is not significant, it suggests that the cross correlations found are spurious, since from proposition 2 above, the autocorrelation of the cross correlations is not significantly different from the autocorrelation remaining in one of the series that was cross correlated.

The above sections have shown that when two series are cross correlated, and when one of the series is known to be white noise, the autocorrelations remaining in the other series can have influences on the sample-estimated cross correlations. If there is a relationship between the two series in question, this influence is added to the influence of the autocorrelation remaining in one of the series. When estimating a transfer function, a situation such as this frequently arises in the second stage of the identification process. In discussing the proposed second-round identification diagnostic procedure, the Liu-Hanssens (1982) first-round identification technique is assumed, although, as was discussed earlier, any of the appropriate first-round identification procedures can be used.

Assume that the Liu-Hanssens (1982) procedure was used to get an initial estimate for the impulse response function of up to k Xi t series mapping to the yt series. After inspection of the preliminary estimate of the impulse response function, an initial model is selected and estimated, using a suitable maximum likelihood estimation program as outlined in steps 1 through 5 (see footnote 10) in Liu and Hanssens (1982) or the simpler three-step procedure in Liu and Hudak

(1986a). The next task is to determine whether the appropriate input model, [wi (B)/ d i (B)] , and/or noise model, [ (B)/  (B)] , was selected. The following steps, added after Liu-Hanssens (1982) step 5, will facilitate a solution to this problem.

6. Cross correlate the noise series with each input series that has been filtered with its ARIMA model, which was developed in step 1 of the Liu-Hanssens (1982) procedure. If a common filter has been used for all input series, the test will increasingly break down if this filter does not prewhiten the input series.

7. Autocorrelate the cross correlations calculated in step 6 and compare these autocorrelations with those of the noise series. Assuming there appear to be spikes in the cross correlations and in the noise model autocorrelations, there are two possibilities: If the autocorrelations of the cross correlations are similar to the autocorrelations of the noise series, the proposed identification procedure suggests that it would be unwise to attempt a change in the input model, [ωi (B) / δi (B)], for the respective input i, since the estimated cross correlations are spurious, having apparently arisen from the autocorrelation remaining in the noise model, [Θ(B)/Φ(B)]. In this case, a change in the noise model should be attempted first. On the other hand, if the autocorrelations of the residuals were not similar to the autocorrelations of the cross correlations, a change in the input model for that input should be attempted prior to any change in the noise model.13

Step 7 should be repeated for all input series in the model. In practice, the autocorrelations of the cross correlations in the negative direction (testing for feedback, which would invalidate the use of a transfer function model) are tested separately from the cross correlations in the positive direction (testing for the appropriate specification of the input model). Often, the negative cross correlations are found to be spurious and the positive cross correlations are found to be valid. This suggests a change in the input model but the initial indication of feedback was not substantiated after further diagnostic testing.

The proposed procedure will be illustrated, using the Box-Jenkins (1976, 386) model of the gas furnace data

2 2 yt=[(w0 - w 1 B- w 3 B )/(1- d 1 B - d 2 B )] x t- 3 + [1/(1 - f 1 B - f 2 B)] e t (7.3-4)

where yt = CO2 outlet gas, xt  input gas rate. Assume that case 1 is the original model. Case 2 is the same as case 1, except that the input model has been modified such that w1= w 2 = 0 . Case 3 is the same as case 1, except that the noise model has been modified such that

[q (B)/ f (B)]=(1- q 1 B) . Case 4 combines the incorrect noise polynomial from case 2 with the incorrect input polynomial from case 3 to illustrate a situation in which both the input and the noise models are not correct.

13 The b34s commands bjiden and bjest have been modified to perform the Stokes and Neuburger (1979) identification diagnostic test automatically. Assuming k autocorrelations have been calculated, Hj for j= 1, k is calculated for the cross correlations going both directions.

7-23 7- 24 Chapter 7

Table 7.2 Setup to Illustrate CCF Diagnostic Tests

/$ Tests CCH Diagnostic tests in Stokes (1991) Chapter 7 /$ Setup for paper "Clues in the Error Process; A Second Round /$ Diagnostic Procedure for Transfer Function Modeling b34sexec options include('c:\b34slm\gas.b34')$ b34seend$ b34sexec bjiden$ var gasin gasout$ seriesn var=gasin$ seriesn var=gasout$ rauto gasin gasout$ b34seend$ b34sexec bjest $ * Check Input filter$ model gasin$ modeln p=(1,2,3) AR(.97,-.94,.5) avepa=.5$ forecast nf=24 nt=(296)$ b34seend$ b34sexec bjest iautcr ncc=54 nac=36 $ * Table 7.3 $ * Input and Noise Models are correct - Case 1 $ model gasout=gasin$ modeln p(1,2) ar=(.8,.76) avepa=53.509$ modeli var=gasin lag=3 num=(0,1,2) denom=(1,2) numc(-.53, .4,.6) denomc(.6,.2)$ modelpre var=gasin p(1,2,3) ar(1.97494,-1.3732,.3424) avepa=-.061 $ b34seend$ b34sexec bjest iautcr ncc=54 nac=36 $ * Table 7.4 $ * Input not OK ------Noise OK - Case 2 $ model gasout=gasin$ modeln p(1,2) ar=(.8,.76) avepa=53.509$ modeli var=gasin lag=3 num=(0) denom=(1,2) numc(-.53) denomc(.6,.2)$ modelpre var=gasin p(1,2,3) ar(1.97494,-1.3732,.3424) avepa=-.061 $ b34seend$ b34sexec bjest iautcr ncc=54 nac=36 $ * Table 7.5 $ * Input OK ------Noise not OK - Case 3 $ model gasout=gasin$ modeln q(1) ma=(-.8) avepa=53.509$ modeli var=gasin lag=3 num=(0,1,2) denom=(1,2) numc(-.53,.4,.6) denomc(.6,.2)$ modelpre var=gasin p(1,2,3) ar(1.97494,-1.3732,.3424) avepa=-.061 $ b34seend$ b34sexec bjest iautcr ncc=54 nac=36 $ * Table 7.6 $ * Input and Noise not OK - Case 4 $ model gasout=gasin$ modeln q(1) ma=(-.8) avepa=53.509$ modeli var=gasin lag=3 num=(0) denom=(1,2) numc(-.53) denomc(.6,.2)$ modelpre var=gasin p(1,2,3) ar(1.97494,-1.3732,.3424) avepa=-.061 $ b34seend$

The B34S setup to run the cross correlation function (CCF) diagnostic tests is given in Table 7.2. The Box-Jenkins (1976, 532-533) gas furnace data have not been listed to save space. Other problems using this data are given in Chapters 8, 12, 14 and 15. After checking GASIN and GASOUT, the first call to bjest estimated the prewhitening model for GASIN suggested by Box and Jenkins. Edited output for this step is listed next.

Autocorrelation Function

Data - VAR=GASIN Input gas rate in cu. ft / min 296 Observations

Original Series Mean of the Series = -0.56834459E-01 St. Dev. of Series = 1.0709519 Number of observations = 296 S. E. of mean = 0.6235E-01 T value of mean (against zero) = -0.9115

1- 12 0.95 0.83 0.68 0.53 0.41 0.32 0.26 0.23 0.21 0.21 0.20 0.19 St.E. 0.06 0.10 0.12 0.13 0.14 0.14 0.15 0.15 0.15 0.15 0.15 0.15 Mod. Q 271.3 480.0 620.0 705.2 755.6 786.3 807.0 822.9 836.8 850.2 862.9 874.1

13- 24 0.17 0.14 0.10 0.08 0.05 0.04 0.03 0.04 0.06 0.07 0.08 0.08 St.E. 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 0.15 Mod. Q 882.8 888.7 892.2 893.9 894.8 895.2 895.6 896.2 897.2 898.7 900.6 902.5

Mean divided by St. Error (using N in S. D. ) = 0.91304

Q Statistic 885.88 DF 24 Prob. 1.0000 Modified Q Statistic 902.52 DF 24 Prob. 1.0000

NOTE: In some cases degrees of freedom for Q and Modified Q Statistics may have to be adjusted.

Autocorrelation Function

Data - VAR=GASOUT Percent CO2 in outlet gas 296 Observations

Original Series Mean of the Series = 53.509122 St. Dev. of Series = 3.1967072 Number of observations = 296 S. E. of mean = 0.1861 T value of mean (against zero) = 287.5

1- 12 0.97 0.90 0.79 0.68 0.57 0.49 0.42 0.37 0.33 0.31 0.29 0.27 St.E. 0.06 0.10 0.12 0.14 0.15 0.16 0.16 0.17 0.17 0.17 0.17 0.17 Mod. Q 281.8 522.7 711.8 851.4 951.5 1023.2 1076.0 1116.9 1150.5 1179.5 1205.1 1227.7

13- 24 0.25 0.22 0.19 0.16 0.14 0.12 0.11 0.11 0.11 0.12 0.12 0.13 St.E. 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 0.18 Mod. Q 1246.7 1262.1 1273.7 1282.3 1288.5 1293.1 1297.0 1300.7 1304.7 1309.1 1314.0 1319.1

Mean divided by St. Error (using N in S. D. ) = 287.99

Q Statistic 1289.5 DF 24 Prob. 1.0000 Modified Q Statistic 1319.1 DF 24 Prob. 1.0000

NOTE: In some cases degrees of freedom for Q and Modified Q Statistics may have to be adjusted.

Time Series Parameter Estimation for Model 1 Data - Z = VAR=GASIN Observations 296 Differencing on Z - None Transformations Examined - None.

Univariate Model Parameters. Parameter Beginning # Type Order Value 1 Mean 0.5000 2 Autoregressive 1 1 0.9700 3 Autoregressive 1 2 -0.9400 4 Autoregressive 1 3 0.5000

Output at each iteration has been suppressed.

Residual output has been suppressed.

Initial sum of Squares = 0.1185E+03

Iteration stops - Relative parameter change < 0.4000E-02

Correlation Matrix of the Parameters. 1/Cond = 0.13471059E-02

1 2 3 4 1 1.0000 2 -0.0009 1.0000

7-25 7- 26 Chapter 7 3 -0.0003 -0.9410 1.0000 4 -0.0011 0.7899 -0.9410 1.0000

End of Estimation for Model 1

Summary of Model 1 Data - Z = VAR=GASIN Observations 296 Differencing on Z - None

Univariate Model Parameters. Parameter Estimated 95 Per Cent # Type Order Value Lower Limit t Upper Limit Std. Error 1 Mean -0.6894E-01 -0.4666 -0.3467 0.3287 0.1988 2 Autoregressive 1 1 1.975 1.864 35.74 2.085 0.5526E-01 3 Autoregressive 1 2 -1.373 -1.574 -13.71 -1.173 0.1001 4 Autoregressive 1 3 0.3424 0.2319 6.195 0.4530 0.5528E-01

Other Information and results. Residual Sum of Squares 10.434676 289 D.F. Residual Mean Square 0.36106146E-01 Number of Residuals 293 Residual Standard Error 0.19001617

Backforecasting was suppressed in Parameter Estimation.

Autocorrelation Function

Data - THE ESTIMATED RESIDUALS - MODEL 1 293 Observations

Original Series Mean of the Series = -0.34371046E-12 St. Dev. of Series = 0.18871468 Number of observations = 293 S. E. of mean = 0.1104E-01 T value of mean (against zero) = -0.3112E-10

1- 12 -0.04 0.07 0.06 -0.15 -0.01 0.06 0.02 0.00 -0.05 0.04 0.14 -0.08 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 0.5 1.9 2.9 9.2 9.2 10.3 10.4 10.4 11.2 11.7 18.0 19.9

13- 24 0.10 0.04 -0.08 0.01 0.06 -0.05 -0.08 0.02 0.01 0.03 0.04 0.00 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 22.8 23.3 25.4 25.5 26.7 27.7 29.6 29.8 29.9 30.1 30.7 30.7

Mean divided by St. Error (using N in S. D. ) = 0.31176E-10

Q Statistic 29.391 DF 20 Prob. 0.91965 Modified Q Statistic 30.680 DF 20 Prob. 0.94044

NOTE: In some cases degrees of freedom for Q and Modified Q Statistics may have to be adjusted.

The results were

2 3 (1- 1.975B + 1.373B - .3424B )GASIN -.06894 = et. (7.3-5) (35.7) (-13.7) (6.19) (-.35) e'e= 10.4347, which reduced the ACF for GASIN substantially. Case 1 is the correct model. Edited results of estimating this model follow.

Time Series Parameter Estimation for Model 1 Data - Y = VAR=GASOUT Observations 296 Differencing on Y - None Transformations Examined - None.

Noise Series. Differencing on Noise - None

Noise Model Parameters Parameter Beginning # Type Order Value 1 Mean 53.51 2 Autoregressive 1 1 0.8000 3 Autoregressive 1 2 0.7600

Input Series 1 DATA - X1 = VAR=GASIN

Differencing on X1 - None (Assumed mean of series = -0.6100E-01 )

Value of lag parameter is 3

Transfer function parameters

4 Output Lag 1 1 0.6000 5 Output Lag 1 2 0.2000 6 Input Lag 1 0 -0.5300 7 Input Lag 1 1 0.4000 8 Input Lag 1 2 0.6000

Output at each iteration has been suppressed.

Residual output has been suppressed.

Initial sum of Squares = 0.1393E+04

Iteration stops - Relative parameter change < 0.4000E-02

Correlation Matrix of the Parameters. 1/Cond = 0.12816100E-02

1 2 3 4 5 6 7 8 1 1.0000 2 -0.0458 1.0000 3 0.0765 -0.9270 1.0000 4 0.0027 -0.0058 0.0057 1.0000 5 -0.0029 0.0093 -0.0105 -0.9849 1.0000 6 0.0059 -0.0034 0.0224 -0.1148 0.1159 1.0000 7 -0.0024 0.0096 -0.0094 -0.7150 0.7240 0.5791 1.0000 8 -0.0011 0.0043 -0.0033 -0.8083 0.7349 -0.0482 0.3025 1.0000

End of Estimation for Model 1

Summary of Model 1 Data - Y = VAR=GASOUT Observations 296 Differencing on Y - None

Noise Series. Differencing on Noise - None

Noise Model Parameters Parameter Estimated 95 Per Cent # Type Order Value Lower Limit t Upper Limit Std. Error 1 Mean 53.56 53.28 373.8 53.85 0.1433 2 Autoregressive 1 1 1.531 1.436 32.12 1.627 0.4768E-01 3 Autoregressive 1 2 -0.6321 -0.7325 -12.59 -0.5316 0.5022E-01

Input Series 1

DATA - X1 = VAR=GASIN

Differencing on X1 - None (Assumed mean of series = -0.6100E-01 )

Value of lag parameter is 3

Transfer function parameters

Parameter 95 Per Cent # Type Order Value Lower Limit t Upper Limit Std. Error 4 Output Lag 1 1 0.5709 0.1417 2.661 1.000 0.2146 5 Output Lag 1 2 -0.1564E-01 -0.3179 -0.1034 0.2867 0.1512 6 Input Lag 1 0 -0.5305 -0.6818 -7.015 -0.3793 0.7562E-01 7 Input Lag 1 1 0.3683 0.6660E-01 2.441 0.6700 0.1509 8 Input Lag 1 2 0.5072 0.1888 3.186 0.8256 0.1592

Other Information and results. Residual Sum of Squares 16.593754 281 D.F. Residual Mean Square 0.59052504E-01 Number of Residuals 289 Residual Standard Error 0.24300721

Backforecasting was suppressed in Parameter Estimation.

Autocorrelation Function

Data - THE ESTIMATED RESIDUALS - MODEL 1 289 Observations

Original Series Mean of the Series = 0.19543743E-03 St. Dev. of Series = 0.23962010 Number of observations = 289 S. E. of mean = 0.1412E-01 T value of mean (against zero) = 0.1384E-01

7-27 7- 28 Chapter 7

1- 12 0.02 0.06 -0.07 -0.06 -0.05 0.12 0.03 0.03 -0.08 0.05 0.02 0.10 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 0.2 1.1 2.7 3.6 4.4 8.9 9.2 9.6 11.6 12.4 12.5 15.5

13- 24 -0.04 0.05 -0.09 -0.01 -0.08 0.00 -0.12 0.00 -0.01 0.08 0.02 -0.01 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 16.0 16.8 19.4 19.4 21.3 21.3 25.6 25.6 25.6 27.4 27.6 27.6

25- 36 0.04 -0.02 0.02 0.09 -0.12 0.06 -0.02 -0.05 0.11 0.02 0.03 0.06 St.E. 0.06 0.06 0.06 0.06 0.06 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 28.0 28.1 28.2 31.0 35.8 37.1 37.3 38.2 42.3 42.5 42.7 44.0

Mean divided by St. Error (using N in S. D. ) = 0.13865E-01

Q Statistic 26.291 DF 21 Prob. 0.80442 Modified Q Statistic 27.595 DF 21 Prob. 0.84799

NOTE: In some cases degrees of freedom for Q and Modified Q Statistics may have to be adjusted.

The estimated correct model was

2 2 GASOUTt = -((.5305 + .3683B + .5072B )/(1 -.5709B+.01564B ))GASINt-3 (-7.02) (2.44) (3.19) (2.66) (-.10)

2 + (1/(1-1.531B +.6321B ))et + 53.56 e'e = 16.59 (7.3-6) (32.12) (-12.59) (373.8) which results in no autocorrelation in the residuals. The residual ACF has been shown in Table 7.3. The estimated model agrees with Box-Reinsel-Jenkins (1994, 436) The question becomes, what happens if the model is not specified correctly? Does the ACF of the cross correlations give us any help in the identification process? The ACF of the residuals and the ACF of the left- hand14 cross correlations for cases 1 through 4 are given in Tables 7.3 through 7.6.

The results for case 1, listed in Table 7.3, show white noise for the ACF of the residuals and white noise for the ACF of the cross correlations. H(2) = 5.46 and is not significant. The cross correlations, which are not shown, show that the input model is correct. These results illustrate a correct model. The results for case 2, which has a defective input model, are shown in Table 7.4. In this case the noise model is correct and the ACF of the residuals is white noise. There is nothing to reflect into the cross correlations and they can be interpreted directly. This illustrates proposition 1. Information on how to correct the input model is contained in the cross correlations of the residual and the prewhitened input series. The fact that the two ACFs are different is shown by H(2)=6.77 being significant at the 5% level in Table 7.4. Visual inspection of the two ACFs shows that they are both quite clean, as would be expected.

The results for case 3, which contains a correct input model and an incorrect noise model, are shown in Table 7.5. This is an example of proposition 2. Here there is marked autocorrelation in the noise ACF. We note a similar pattern in the ACF of the cross correlations as the theory predicts. H(6) = 10.02 and is not significant indicating that the two ACF functions are simular. In this situation the correct action is to fix the noise model. As in the preceding case, since there was only one thing wrong with the model, the usual tests would indicate how to correct it. The

14 The left-hand cross correlations correlate the residuals with lags of the prewhitened input series. In this problem, the input series, GASIN, has been prewhitened by means of the AR(3) model suggested by Box and Jenkins (1976, 381). The estimated cross correlations and the estimated coefficients of each model are not given to save space. additional proposed test confirms this decision.

Case 4 has problems in both the noise model and the input model. The ACF of the residuals listed in Table 7.6 is not clean and is visually the same as that of the ACF of the cross correlations for lags 1-2. H(4) = 5.46 and is not significant indicating that the two ACT functions for up to lag 4 are not significantly different. This finding suggests that at least some of the information contained in the ACF of the cross correlations is coming from the noise side. In this situation it is usually best to attempt to clean up the noise ACF and get to case 2 before working on the input model. In multiple-input models, it is most important to work on cleaning up the noise before working on adjusting the input model since many of the spikes in the cross correlations are due to the cross correlations being influenced by the incorrect noise rather than by specific terms having to be added to the input model.

Table 7.3 ACF of Residuals and Cross Correlations for Case 1

______ACF Residuals (Case 1)

1- 12 0.02 0.06 -0.07 -0.06 -0.05 0.12 0.03 0.03 -0.08 0.05 0.02 0.10 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 0.2 1.1 2.7 3.6 4.4 8.9 9.2 9.6 11.6 12.4 12.5 15.5

13- 24 -0.04 0.05 -0.09 -0.01 -0.08 0.00 -0.12 0.00 -0.01 0.08 0.02 -0.01 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 16.0 16.8 19.4 19.4 21.3 21.3 25.6 25.6 25.6 27.4 27.6 27.6

25- 36 0.04 -0.02 0.02 0.09 -0.12 0.06 -0.02 -0.05 0.11 0.02 0.03 0.06 St.E. 0.06 0.06 0.06 0.06 0.06 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 28.0 28.1 28.2 31.0 35.8 37.1 37.3 38.2 42.3 42.5 42.7 44.0

ACF Left-Hand Cross Correlations (Case 1)

1- 12 0.11 -0.08 -0.03 -0.40 -0.06 0.21 -0.08 -0.01 0.02 -0.01 0.25 0.06 St.E. 0.13 0.14 0.14 0.14 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0.17 Mod. Q 0.7 1.1 1.2 10.9 11.1 13.8 14.2 14.2 14.3 14.3 18.6 18.8

13- 24 -0.09 -0.05 -0.27 -0.10 0.09 -0.24 -0.07 0.06 -0.11 0.22 0.15 -0.08 St.E. 0.17 0.17 0.17 0.18 0.18 0.18 0.19 0.19 0.19 0.19 0.19 0.20 Mod. Q 19.4 19.6 25.3 26.2 26.9 31.7 32.1 32.5 33.5 38.2 40.5 41.2

25- 27 -0.03 -0.16 -0.07 St.E. 0.20 0.20 0.20 Mod. Q 41.3 44.0 44.6

H(2) = 5.456 ______

Both input and noise models are correct. Q is the Ljung and Box (1978) statistic. The input series GASIN was filtered by the AR(3) model suggested by Box and Jenkins (1976, 381). Fifty-four cross correlations were calculated between the prewhitened input series and the residuals. These have not been listed to save space. Only the ACF of the left-hand cross correlations have been reported since feedback in the model is not at issue. H(i) is a chi-square statistic with i degrees of freedom and tests whether or not the significant (2 SEs in absolute value) autocorrelation coefficients are significantly different. The b34s printout gives the H( ) statistic for all terms, those elements greater in absolute value than 2 * SE (either or both terms) and those greater in value than 1 * SE (either or both terms).

7-29 7- 30 Chapter 7 Table 7.4 ACF of Residuals and Cross Correlations for Case 2

______

ACF Residuals (Case 2)

1- 12 0.04 0.05 -0.09 -0.08 -0.04 0.14 0.04 0.05 -0.10 0.03 0.03 0.09 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 0.5 1.2 3.6 5.6 6.0 12.2 12.7 13.4 16.4 16.6 16.8 19.5

13- 24 -0.03 0.06 -0.11 0.00 -0.06 -0.01 -0.12 -0.01 -0.01 0.09 0.01 -0.03 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 19.7 20.9 24.5 24.5 25.5 25.6 29.8 29.9 29.9 32.5 32.5 32.8

25- 36 0.04 -0.05 0.02 0.11 -0.09 0.08 -0.05 -0.08 0.11 0.04 0.05 0.08 St.E. 0.06 0.06 0.06 0.06 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 33.4 34.1 34.2 38.5 40.9 42.8 43.6 45.8 49.7 50.2 51.2 53.4

ACF Left-Hand Cross Correlations (Case 2)

1- 12 0.10 -0.09 -0.07 -0.46 0.05 0.27 0.02 0.11 -0.06 -0.13 0.14 -0.03 St.E. 0.13 0.14 0.14 0.14 0.16 0.16 0.17 0.17 0.17 0.17 0.17 0.18 Mod. Q 0.6 1.1 1.4 14.2 14.4 19.0 19.0 19.9 20.1 21.4 22.8 22.9

13- 24 -0.06 0.06 -0.26 -0.05 0.10 -0.24 -0.03 -0.01 -0.14 0.20 0.06 -0.09 St.E. 0.18 0.18 0.18 0.18 0.19 0.19 0.19 0.19 0.19 0.19 0.20 0.20 Mod. Q 23.2 23.5 28.9 29.1 30.0 35.0 35.1 35.1 37.0 40.9 41.3 42.1

25- 27 0.05 -0.25 -0.06 St.E. 0.20 0.20 0.20 Mod. Q 42.3 49.1 49.5

H(2)=6.77 ______The noise model is correct and the input model is not correct. Table 7.5 ACF of Residuals and Cross Correlations for Case 3

─────────────────────────────────────────────────────────────────────────────── ACF Residuals (Case 3)

1- 12 0.69 0.72 0.37 0.36 0.09 0.14 -0.05 0.04 -0.10 0.02 -0.07 0.04 St.E. 0.06 0.08 0.10 0.11 0.11 0.11 0.11 0.11 0.11 0.11 0.11 0.11 Mod. Q 140.7 292.5 332.1 370.0 372.5 378.4 379.2 379.6 382.4 382.5 383.9 384.3

13- 24 -0.09 -0.03 -0.16 -0.11 -0.21 -0.14 -0.18 -0.06 -0.05 0.06 0.06 0.13 St.E. 0.11 0.11 0.11 0.11 0.11 0.11 0.11 0.12 0.12 0.12 0.12 0.12 Mod. Q 386.6 386.8 394.8 398.5 411.9 417.6 427.6 428.8 429.7 430.9 432.1 437.8

25- 36 0.11 0.15 0.10 0.10 0.02 0.00 -0.04 -0.01 0.03 0.07 0.06 0.06 St.E. 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 Mod. Q 441.8 448.7 452.1 455.7 455.8 455.8 456.3 456.4 456.6 458.2 459.5 460.9

ACF Left-Hand Cross Correlations (Case 3)

1- 12 0.71 0.42 0.09 -0.04 -0.07 -0.01 -0.09 -0.11 -0.11 -0.01 0.09 0.05 St.E. 0.13 0.19 0.21 0.21 0.21 0.21 0.21 0.21 0.21 0.21 0.21 0.21 Mod. Q 28.9 39.2 39.7 39.8 40.1 40.1 40.6 41.4 42.2 42.2 42.7 42.9

13- 24 -0.09 -0.29 -0.47 -0.48 -0.40 -0.33 -0.19 -0.05 0.09 0.22 0.20 0.12 St.E. 0.21 0.21 0.22 0.24 0.25 0.27 0.27 0.28 0.28 0.28 0.28 0.28 Mod. Q 43.6 50.2 67.7 86.0 99.3 108.4 111.6 111.8 112.5 117.3 121.3 122.8

25- 27 0.01 -0.01 0.01 St.E. 0.28 0.28 0.28 Mod. Q 122.8 122.8 122.8

H(6)=10.02 ───────────────────────────────────────────────────────────────────────────────── The input model is correct and the noise model is not correct.

7-31 7- 32 Chapter 7

Table 7.6 ACF of Residuals and Cross Correlations for Case 4

─────────────────────────────────────────────────────────────────────────────────

ACF Residuals (Case 4)

1- 12 0.69 0.71 0.36 0.35 0.10 0.15 -0.04 0.04 -0.10 0.01 -0.07 0.03 St.E. 0.06 0.08 0.10 0.11 0.11 0.11 0.11 0.11 0.11 0.11 0.11 0.11 Mod. Q 142.5 293.2 332.6 370.0 372.8 379.6 380.1 380.6 383.4 383.5 385.0 385.3

13- 24 -0.09 -0.03 -0.16 -0.11 -0.20 -0.13 -0.18 -0.07 -0.06 0.05 0.05 0.12 St.E. 0.11 0.11 0.11 0.11 0.11 0.11 0.11 0.11 0.11 0.12 0.12 0.12 Mod. Q 387.7 387.9 395.6 399.1 412.0 417.7 427.7 429.2 430.3 431.1 432.0 436.5

25- 36 0.11 0.14 0.11 0.11 0.03 0.01 -0.04 -0.02 0.03 0.08 0.08 0.08 St.E. 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 Mod. Q 440.2 446.7 450.6 454.9 455.1 455.1 455.8 455.9 456.2 458.1 460.3 462.6

ACF Left-Hand Cross Correlations (Case 4)

1- 12 0.70 0.42 0.11 0.01 0.05 0.12 0.03 -0.03 -0.13 -0.10 -0.03 -0.04 St.E. 0.13 0.19 0.21 0.21 0.21 0.21 0.21 0.21 0.21 0.21 0.21 0.21 Mod. Q 28.1 38.6 39.3 39.3 39.5 40.4 40.5 40.5 41.6 42.3 42.4 42.5

13- 24 -0.15 -0.27 -0.43 -0.42 -0.37 -0.34 -0.25 -0.15 -0.04 0.10 0.09 0.04 St.E. 0.21 0.21 0.22 0.23 0.25 0.26 0.26 0.27 0.27 0.27 0.27 0.27 Mod. Q 44.2 49.6 63.8 77.7 89.0 98.7 103.9 105.8 106.0 106.9 107.7 107.8

25- 27 -0.01 0.00 0.05 St.E. 0.27 0.27 0.27 Mod. Q 107.8 107.8 108.0

H(4)=5.46 ──────────────────────────────────────────────────────────────────────────────────────────────── Both the input and the noise models are not correct.

The preceding examples illustrate that, in practice, after first-round estimation of a transfer function, it is often difficult to determine whether to change the input model or the noise model when the usual autocorrelation and cross correlation tests suggest the possibility of problems in both models. A second-round diagnostic test procedure can be easily incorporated into a time series computer program, and will provide an additional test to help detect spurious cross correlations and avoid false signals for inadequacies in the input model. Its use will significantly speed up fine tuning of a transfer function model, once the first-round identification has been done, using the Liu-Hanssens (1982) or another appropriate procedure.

7.4 Spectral Analysis

The bjiden and bjest spectral options are based on a heavily modified version of the IMSL Fortran routine ftfreq, which was available in the now obsolete IMSL version 8. For most spectral analysis it is suggested that the user use the B34S spectral command, which works the same way as the SAS proc spectra.15 While ftfreq obtains the frequency statistics from the covariance of the series, the spectral command uses the Fast Fourier Transform of the series. The spectral sentence, supported in the bjiden and bjest commands, facilitates the display of the information in the CCF. Of most interest is the estimate of the transfer function amplitude from x

15 The spectral command is documented in Chapter 15. Additional spectral capability if available under the matrix command which is discussed in Chapter 16. to y and from y to x by frequency. The user inputs the number of frequencies calculated (nfreq option), which defaults to the number of cross correlations, whether to detrend the series (detrend option), the time interval (xindsp1 option), and whether to prewhiten all the series with an AR1 model having a coefficient set by the xindsp2 option. If the spectral sentence is not present, but the spectral option is given on the bjest sentence or the rcross or pcross sentences of the bjiden command, the default options are used.

Frequency is defined as fi , where

fi = (i-1) /(2.0 * XINDSP1 * NFREQ) for i=1,...,NFREQ+1. (7.4-1)

The unsmoothed power spectrum of the input series x at frequency fi , PSx (i ) is defined as

m PSx (i ) [2.0XINDSP1/ ][ x (0) / 2.]  [[ (  x ( j )cos(( i  1) j  /( m  1)))] j1 (7.4-2)

x (m  1)cos(( i  1)  ) / 2.0]

where  x (k ) is the covariance of series xt at lag k and m=NFREQ -1. The power spectrum is smoothed by a Hamming window. Similarly, the power spectrum of yt, PS y ( i ), the cospectrum between xt and yt at frequency fi CS xy (i ) (real part of the cross spectrum) and the quadrature spectrum QSxy (i ) (imaginary part of the cross spectrum) can be calculated from the cross covariance function for xt and yt (Jenkins and Watts 1968, 344). The amplitude at frequency fi of xt and ytA xy ( i ) is defined as

2 2 Axy (i ) (CS xy )  (QS xy ) (7.4-3)

while the phase PHxy (i ) is

2 PHx y (i )= [ ARCTAN (QS x y ( i ) / CS x y ( i ))]/p (7.4-4)

if CSxy (i ) is > 0.0 and

2 PHx y (i )= [[ ARCTAN (QS x y ( i ) / CS x y ( i )) +p ]/ p (7.4-5)

if CSx y(i) < 0.0. If CSx y(i) = 0.0 and QSx y(i) >0, then PHx y(i) is set to .25, while if CSx y(i) and QSx y(i) <0, PHx y(i) is set to .75. If PHx y(i) is found to be < 0.0, then 1.0 is added to the reported value. The coherence squared at frequency f i, Kx y(i), becomes

7-33 7- 34 Chapter 7

2 Kx y (i )= [A x y ( i )] / [PS x ( i )PS y ( i )] (7.4-6)

An estimate of the transfer function amplitude from xt to yt at frequency f i, Tx y(i), is

Tx y(i) = Ax y(i) / PSx(i), (7.4-7) while an estimate of the transfer function amplitude from y to x at frequency fi is

Ty x(i) = Ax y(i) / PSy (i). (7.4-8)

The values given in equations (7.4-1) through (7.4-8) are listed and can be optionally plotted. They are especially useful in detecting the effects of prewhitening on the information in the cross correlation. The coherence squared, Kx y(i), can be interpreted as a correlation coefficient at each frequency fi. The transfer function amplitude, Tx y(i), measures the amplitude of the mapping of xt to yt at frequency i implicit in the impulse-response function, V(B).

7.6 Automatic ARIMA Model Selection

The matrix command autobj allows the user to automatically select models for series using the Box-Jenkins (1976) approach without explicitly going though the detailed identification and estimation steps. While a user-selected model might be superior, often times the autobj command is able to detect and estimate a very good model. With a modern (2002 vintage) PC it is possible to filter and forcast ~1000 series in under a minute which would facilitate development of a stock trading model with a 5 minute window.

An edited version of the autobj help file illustrates a number of the features available.

call autobj(x :options);

x series to filter.

If the user wants to impose differencing, this should be done outside the command or inside the command with the command :rdif or :sdif. Other wise using auto model building, differencing will be selected if the AR parameter is above roottol which defaults to .8

:autobuild - Automatically selects the arima model starting from a "generic" arima(1,1) model on appropriately differenced data.

:assumptions - Lists assumptions. Not ususally used.

:seasonal n - Sets the seasonal period. If this is not present seasonal differencing will not be attempted. :seasonal2 n - Sets the second seasonal period. If seasonal2 is set, seasonal must be set. Used with hourly and weekly data.

:longar n - Sets initial default AR order. Default=1. Range 0-2. This is not allowed if seasonal2 is set.

:longma n - Sets initial default MA order. Default=1. Range 0-2. This is not allowed if seasonal2 is set.

:nodif - Suppress automatic differencing selection.

:trend - Estimate a trend if there is differencing

:noest - No estimation will be performed. This option requires that the model has been saved.

:cleanmod - On the last step, the model will be cleaned of parameters that have |t| values LT droptol. This option makes a very parsimonious model.

:forcedstart - Forces a default starting value of .1 to be set. This is usually not needed.

:nosearch - Turns off spike hunting.

:spikelimit i - Sets limit to look for spikes. default = max(12,2*seasonal)

:spiketol r - Sets t for spike inclusion. Default = droptol. If this is set too low program will cycle since a term will be added which will not be significant due to the t not meeting the droptol.

:arlimit r - Sets a value to check for t of adjacent ACF terms. If r is set smaller, more likely AR terms will be added. Change this value with caution. default = 1.3.

:startvalue r - Sets default parameter start value for automatic model building. Default = .1

:print - Print results

:printres - Print residuals

:printit - Print iterations

:printsteps - Prints Model selection steps for automatic model building.

7-35 7- 36 Chapter 7

:backforecast - Use backforecasting. This option allows residuals to be calculated for all data points. It can result in instable estimation. This option sould be used with caution.

:maxtry n - Maximum tries at auto model selection Default = 4

:roottol r - Set auto model differencing tolerance. Default=.8

:droptol r - Sets drop tolerance. Default 1.7..

:eps1 r - Sets max change in relative sum of squares before iteration stops. Default = 0.0 => this criterian not used.

:eps2 r - Sets relative max change in each parameter Default = .004

:maxit i - Sets maximum number of iterations allowed. Default = 20

:nac i - Sets # autocorrelations printed. Max 999

:npac i - Sets number of partial autocorrelations printed.

Options to override auto selection of the model

Note: Specify AR and MA in this order if present.

:ar ivec - set ar orders. Can specify up to three factors. For example:

:ar index(1 2 3) index(12)

:ma ivec - set ma orders. Can specify up to three factors. For example:

:ma index(1 2 3) index(12)

:arparm rarray - Initial ar values, not usually needed.

:maparm - Initial ma values, not usually needed.

:forecast index(i1 i2)

- Sets forecast number and origin. Limit for number = 100

:smodeln - Sets model save name. If :noest is in effect, this sets the model name to used to make forecasts. The only required parameters are to supply the series and to set :autobuild. The :print option is not needed since the command produces output variables in the matrix command work space. Further information on the matrix command in found in chapter 16. The autobj command can be run from the Display Manager menus or from a script. Since the estimated model can be saved in a model file, it can be used later to prewhiten the input series when a transfer function model is identified and estimated. This can be done with a script, as will be shown later, or with the menu option on the Display Manager.

The below listed script will automatically select an ARIMA model for the GASIN series which was modeled in equation (7.3-5). Two models are run. The first model estimated forces no differencing so as to be 100% comparable to (7.3-5) while the second model estimated allows the artificial intelligence (AI) in the software to select the model. The call to rtest provides high resolution output of the ACF and PACF and additional tests. Forecasting of 10 periods from observation 290 are calculated. The :printsteps option has been turned off. The :spiketol setting forces the AI to look for parameters with |t| values GE 2 rather than the default vakue of 1.8..

b34sexec options ginclude('gas.b34'); b34srun;

b34sexec matrix; call loaddata; call load(rtest);

/$ Force no differencing

call autobj(gasin :print :nac 24 :npac 24 :nodif /$ :printsteps :forecast index(10,290) :spiketol 2.0 :autobuild ); call rtest(%res,gasout,48);

call echoon; call autobj(gasin :print :nac 24 :npac 24 /$ :printsteps :forecast index(10,290) :spiketol 2.0 :autobuild );

call rtest(%res,gasout,48);

b34srun;

Edited output from this script follows:

=> CALL AUTOBJ(GASIN :PRINT :NAC 24 :NPAC 24 :NODIF => :FORECAST INDEX(10,290) => :SPIKETOL 2.0 :AUTOBUILD )$

Time Series Parameter Estimation for Model 1 Data - Z = Series 1 - GASIN Observations 296 Differencing on Z - None Transformations Examined - None.

Univariate Model Parameters. Parameter Beginning # Type Order Value 1 Mean -0.5683E-01 2 Autoregressive 1 1 0.7806 3 Moving average 1 1 -1.160 4 Moving average 1 2 -0.3921

7-37 7- 38 Chapter 7 5 Moving average 2 2 -0.6583

Output at each iteration has been suppressed.

Residual output has been suppressed.

Initial sum of Squares 9.982056324766303

Iteration stops - Relative parameter change < 4.000000000000000E-03

Correlation Matrix of the Parameters. 1/Cond = 0.1507E-01 1 2 3 4 5 1 1.0000 2 0.0165 1.0000 3 -0.0007 0.5674 1.0000 4 -0.0007 0.5350 0.8926 1.0000 5 -0.0006 0.4253 0.4673 0.3537 1.0000

End of Estimation for Model 1

Summary of model 1 Data - Z = Series 1 - GASIN Observations 296 Differencing on Z - None

Univariate Model Parameters. Parameter Estimated 95 Per Cent # Type Order Value Lower Limit t Upper Limit Std. Error 1 Mean -0.3929E-01 -0.4441 -0.1941 0.3655 0.2024 2 Autoregressive 1 1 0.7806 0.6887 16.98 0.8726 0.4598E-01 3 Moving average 1 1 -1.160 -1.300 -16.55 -1.020 0.7008E-01 4 Moving average 1 2 -0.3922 -0.5279 -5.777 -0.2564 0.6788E-01 5 Moving average 2 2 -0.6582 -0.7619 -12.69 -0.5545 0.5186E-01

Other Information and results. Residual Sum of Squares 9.9817909 290 D.F. Residual Mean Square 3.441996854804318E-02 Number of residuals 295 Residual Standard error 0.1855261936979336 Backforecasting not used in Estimation

Autocorrelation Function

Data - THE ESTIMATED RESIDUALS - MODEL 1 295 Observations

Original Series Mean of the Series -1.022647076165406E-03 St. Dev. of Series 0.1839443759498408 Number of observations 295 S. E. of mean 1.072785386028066E-02 T value of mean (against zero) -9.532634294653340E-02

1- 12 0.00 0.00 0.04 0.02 -0.06 -0.04 0.03 -0.02 -0.05 0.04 0.13 -0.07 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 0.0 0.0 0.4 0.5 1.7 2.3 2.5 2.7 3.5 4.0 8.8 10.3

13- 24 0.10 0.05 -0.08 -0.01 0.08 -0.03 -0.10 0.01 0.03 0.04 0.04 0.00 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 13.8 14.5 16.6 16.7 18.5 18.9 22.3 22.3 22.7 23.1 23.6 23.6

Mean divided by St. Error (using N in S. D.) 9.548832495451905E-02

Partial Autocorrelations

Data - THE ESTIMATED RESIDUALS - MODEL 1 295 Observations

Original Series Mean of the Series -1.022647076165406E-03 St. Dev. of Series 0.1839443759498408 Number of observations 295 S. E. of mean 1.072785386028066E-02 T value of mean (against zero) -9.532634294653340E-02

1- 12 0.00 0.00 0.04 0.02 -0.06 -0.04 0.03 -0.02 -0.05 0.04 0.12 -0.06

13- 24 0.10 0.03 -0.09 0.01 0.08 -0.03 -0.08 0.01 0.01 0.05 0.06 -0.07

Time Series Forecasting for Model 1 Data - Z = Series 1 - GASIN Observations 296 Differencing on Z - None Transformations Examined - None.

Univariate Model Parameters. Parameter Beginning # Type Order Value 1 Mean -0.3929E-01 2 Autoregressive 1 1 0.7806 3 Moving average 1 1 -1.160 4 Moving average 1 2 -0.3922 5 Moving average 2 2 -0.6582

Number of time origins for Forecasts 1 Number of forecasts at each time origin 10

Forecast Time Origins date T= 290

Backforecasting was suppressed in this analysis.

REGULAR Forecast results in terms of THE ORIGINAL DATA ******************************************************

Model 1 Forecasts at base period 290 with 95 per cent confidence limits

Period L. Conf. Forecast U. Conf. Actual % Error 291 -0.82940722E-01 0.28068500 0.64431073 0.25300000 10.94 292 -0.54574371 0.24816109 1.0420659 0.19500000 27.26 293 -1.0420989 0.18284926 1.4077974 0.13100000 39.58 294 -1.4510513 0.13397077 1.7189929 0.17000000E-01 688.1 295 -1.7165144 0.95959839E-01 1.9084341 -0.18200000 152.7 296 -1.8717422 0.66287816E-01 2.0043179 -0.26200000 125.3 297 -1.9675733 0.43125294E-01 2.0538239 298 -2.0286756 0.25044206E-01 2.0787640 299 -2.0685693 0.10929780E-01 2.0904288 300 -2.0951407 -0.88198904E-04 2.0949643

Weights used in calculating confidence limits

J PS(J) 0 1.000000 1 1.940827 2 2.565419 3 2.766254 4 2.417519 5 1.887159 6 1.473151 7 1.149969 8 0.8976865 9 0.7007504 10 0.5470186

Note that the residual sum of squares was 9.9817909 which beats the 10.434676 obtained with the AR(3) model reported as (7.3-5). All parameters of the automatically selected model are significant except for the mean. In the next model differencing is allowed if needed.

=> CALL AUTOBJ(GASIN :PRINT :NAC 24 :NPAC 24 => :FORECAST INDEX(10,290) => :SPIKETOL 2.0 :AUTOBUILD )$

Time Series Parameter Estimation for Model 1 Data - Z = Series 1 - GASIN Observations 296 Differencing on Z - 1) 1 of order 1 Transformations Examined - None.

Univariate Model Parameters. Parameter Beginning # Type Order Value 1 Autoregressive 1 1 0.7000 2 Moving average 1 1 -0.2580 3 Moving average 1 4 0.4122 4 Moving average 1 5 0.3031 5 Moving average 2 3 0.1893

Output at each iteration has been suppressed.

Residual output has been suppressed.

Initial sum of Squares 10.33992283744978

Iteration stops - Relative parameter change < 4.000000000000000E-03

Correlation Matrix of the Parameters. 1/Cond = 0.1112 1 2 3 4 5 1 1.0000 2 0.6254 1.0000 3 0.2727 0.2050 1.0000 4 -0.0871 -0.3467 0.1294 1.0000

7-39 7- 40 Chapter 7 5 0.4324 0.2110 0.1175 0.0475 1.0000

End of Estimation for Model 1

Summary of model 1 Data - Z = Series 1 - GASIN Observations 296 Differencing on Z - 1) 1 of order 1

Univariate Model Parameters. Parameter Estimated 95 Per Cent # Type Order Value Lower Limit t Upper Limit Std. Error 1 Autoregressive 1 1 0.7000 0.5804 11.71 0.8196 0.5979E-01 2 Moving average 1 1 -0.2580 -0.4006 -3.617 -0.1153 0.7133E-01 3 Moving average 1 4 0.4122 0.3038 7.600 0.5207 0.5424E-01 4 Moving average 1 5 0.3031 0.1897 5.347 0.4165 0.5669E-01 5 Moving average 2 3 0.1893 0.6029E-01 2.934 0.3183 0.6451E-01

Other Information and results. Residual Sum of Squares 10.339923 289 D.F. Residual Mean Square 3.577827971435908E-02 Number of residuals 294 Residual Standard error 0.1891514729373236 Backforecasting not used in Estimation

Autocorrelation Function

Data - THE ESTIMATED RESIDUALS - MODEL 1 294 Observations

Original Series Mean of the Series -9.767464186524403E-04 St. Dev. of Series 0.1875336010852208 Number of observations 294 S. E. of mean 1.095582995580189E-02 T value of mean (against zero) -8.915311962606569E-02

1- 12 0.01 0.01 0.02 0.02 -0.02 -0.09 -0.07 -0.05 -0.04 -0.02 0.05 -0.09 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 0.1 0.1 0.2 0.3 0.5 3.0 4.7 5.4 5.9 6.0 6.9 9.5

13- 24 0.10 0.01 -0.13 -0.04 0.06 -0.05 -0.14 -0.03 0.02 0.04 0.01 -0.04 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 12.4 12.4 17.5 18.0 19.1 19.8 25.6 26.0 26.0 26.6 26.7 27.3

Mean divided by St. Error (using N in S. D.) 8.930512846556413E-02

Partial Autocorrelations

Data - THE ESTIMATED RESIDUALS - MODEL 1 294 Observations

Original Series Mean of the Series -9.767464186524403E-04 St. Dev. of Series 0.1875336010852208 Number of observations 294 S. E. of mean 1.095582995580189E-02 T value of mean (against zero) -8.915311962606569E-02

1- 12 0.01 0.01 0.02 0.02 -0.02 -0.09 -0.07 -0.05 -0.03 -0.01 0.06 -0.10

13- 24 0.09 -0.01 -0.15 -0.04 0.06 -0.06 -0.13 -0.03 -0.01 0.02 0.02 -0.09

Time Series Forecasting for Model 1 Data - Z = Series 1 - GASIN Observations 296 Differencing on Z - 1) 1 of order 1 Transformations Examined - None.

Univariate Model Parameters. Parameter Beginning # Type Order Value 1 Autoregressive 1 1 0.7000 2 Moving average 1 1 -0.2580 3 Moving average 1 4 0.4122 4 Moving average 1 5 0.3031 5 Moving average 2 3 0.1893

Number of time origins for Forecasts 1 Number of forecasts at each time origin 10

Forecast Time Origins date T= 290

Backforecasting was suppressed in this analysis.

REGULAR Forecast results in terms of THE ORIGINAL DATA ******************************************************

Model 1 Forecasts at base period 290 with 95 per cent confidence limits Period L. Conf. Forecast U. Conf. Actual % Error 291 -0.81795783E-01 0.28893608 0.65966795 0.25300000 14.20 292 -0.56046539 0.25461471 1.0696948 0.19500000 30.57 293 -1.1151303 0.15530641 1.4257431 0.13100000 18.55 294 -1.5949815 0.71407726E-01 1.7377969 0.17000000E-01 320.0 295 -1.9079007 0.25352687E-01 1.9586060 -0.18200000 113.9 296 -2.0857259 0.61186912E-02 2.0979633 -0.26200000 102.3 297 -2.2018618 -0.46783218E-02 2.1925051 298 -2.2923610 -0.11448147E-01 2.2694647 299 -2.3726031 -0.16187110E-01 2.3402289 300 -2.4456051 -0.19504445E-01 2.4065962

Weights used in calculating confidence limits

J PS(J) 0 1.000000 1 1.957987 2 2.628589 3 2.908712 4 2.643717 5 2.155103 6 1.813067 7 1.651679 8 1.596088 9 1.557173 1.529932 For the autobj selected model the sum of squares 10.339923 is found to be marginally better than the 10.434676 found with (7.3-5). Of interest is the process by which a model is automatically selected. The first step is to determine whether there should be differencing. The ACF is inspected and, if a seasonal order has not been supplied, the first order autocorrelation coefficient is tested against the variable roottol and if found to be greater, first differencing is set. Note earlier in the chapter it was shown that GASIN has a first order autocorrelation value of .95 suggesting differencing by this rule. If the data is seasonal, the same process is applied to the seasonal autocorrelation value. Once the appropriate level of differencing and or seasonal differencing is selected a “generic” ARMA(1,1) model is fit. The parameters :longar and :longma can be used to modify this “generic” model. The results of the generic model are used as a basis from which to add or drop parameters. If the model is seasonal, seasonal factors are tried. The switch :printsteps can be used to show the logic of the AI as alternative models are investigated. The switch :arlimit sets how sensitive the AI is a to selection of AR vs MA terms as it spike hunts. The switches :spikelimit and :spiketol can be used to modify the AI and provide user input in the search process. The autobj command can also be run in command mode where the user selects the model. The output of this command can be further processed with the matrix command. The matrix arma command provides another way to proceed for modeling. Here using IMSL routines and GMM theory it is possible to set a complex one factor model and allow the program to automatically simplify the model. This command does not really use AI and will not be discussed in this chapter. It provides an alternative ARIMA estimator to the original software. Its strength is that a long AR or MA model with many terms can be estimated. The autobj and bjest commands, in keeping with the Box-Jenkins (1976) philosophy, have A number of parameter limit of 10. We next turn to examples.

7.7 Examples of Box-Jenkins Analysis

Table 7.7 lists the data loading and bjiden and bjest commands to produce output that will replicate the Stokes-Neuburger (1979) study of the effect of money on interest rates. The B34S data command loads and builds real and nominal M1 and M2 and a variety of interest rates. The data set RES79 is distributed with the B34S system to facilitate replication of the basic paper and

7-41 7- 42 Chapter 7 investigation of ARIMA and transfer function model building. Due to space limitations, the data are not listed in Table 7.7, although the specific series studied in the example are listed in compressed form in Tables 7.8 and 7.9. The bjiden and bjest commands produce voluminous output, only a fraction of which is shown in this book.

Table 7.7 Program to Estimate the Effect of M2 on Interest Rates

/$RES79 B34sexec data noob=373 Maxlag=1 Heading=('stokes/neuburger res 79') $ * data from nber data bank. Used in stokes / neuburger res 79 $ Datacards$ 1.095e+02 1.428e+02 2.540e+00 1.000e+00 6.440e+01 3.800e-01 3.750e-01 1.097e+02 1.432e+02 2.610e+00 1.000e+00 6.430e+01 3.800e-01 3.760e-01 ...... 3.354e+02 8.812e+02 8.390e+00 6.640e+00 1.861e+02 6.070e+00 6.063e+00 3.374e+02 8.883e+02 8.700e+00 6.790e+00 1.869e+02 6.440e+00 6.448e+00 B34sreturn$ * End of 373 obs on stokes / neuburger res79 dsn $ Input fms fmscom fyaac fycp pc fygm3 fygn3 $ * Now build data and give variable descriptions $ * Raw data from jan 1947 - jan 1978 $ Label FMS = 'Money Stock M1 : Friedman ' FMSCOM = 'Money Stock M2 : Friedman ' FYAAC = 'Monetary Rates : AA new Corporate Bond ' FYCP = 'Monetary Rates : Commercial Paper ' PC = 'Consumer Price Index : All items ' FYGM3 = 'Market Yield on 3 Month Treasury ' FYGN3 = 'New issue Rate on 3 Month TR ' M1DP = 'M1 / PC ' M2DP = 'M2 / PC ' PCM1 = 'Percent Change M1 ' PCM2 = 'Percent Change M2 ' PCRM1 = 'Percent Change Real M1 ' PCRM2 = 'Percent Change Real M2 ' PCAA = 'Percent Change AA Corp Rate ' PCCPIN = 'Percent Change Commercial Paper ' PCCMYTB= 'Percent Change Three Month Treasury ' PCCNYTB= 'Percent Change Three Month New Issues '$ Build m1dp m2dp pcm1 pcm2 pcrm1 pcrm2 pcaa pccpin pccmytb pccnytb $ Gen m1dp = fms/pc $ Gen m2dp = fmscom/pc $ Gen pcm1 = (fms-lag(fms))/lag(fms) $ Gen pcm2 = (fmscom-lag(fmscom))/lag(fmscom)$ Gen pcrm1 = (m1dp-lag(m1dp)) /lag(m1dp) $ Gen pcrm2 = (m2dp-lag(m2dp)) /lag(m2dp) $ Gen pcaa = (fyaac-lag(fyaac)) /lag(fyaac) $ Gen pccpin = (fycp-lag(fycp)) /lag(fycp) $ Gen pccmytb = (fygm3-lag(fygm3)) /lag(fygm3) $ Gen pccnytb= (Fygn3-lag(fygn3)) /lag(fygn3) $ B34seend$

/$ Running the changes in nominal m2 on commercial paper /$ Res table 5 and prewhitening models table 1 /$ First look at acf's of both series of interest B34sexec bjiden list=(fmscom,fycp) nac=24$ Var fmscom fycp$ * title=('identify res79 table 1 models: dates feb 1947 - jan 1978')$ Seriesn var=fmscom name=('money stock m2 friedman')$ Seriesn var=fycp name=('commercial paper interest rate')$ Rtrans var=fmscom dif=(2,1)(1,12)$ Rauto fmscom fycp$ B34seend$

/$ now we estimate the m2 model prewhitening filter

B34sexec bjest Nac=24 $ Model fmscom $ * title=('identify res79 table 1 models: dates feb 1947 - jan 1978')$ Seriesn var=fmscom name=('money stock m2 friedman')$ Modeln p=(1,2) q=(3,4,7) dif=(2,1)$ * try a few forecasts $ forecast nf=10 nt=372$ b34seend$

/$ now we do the cross correlations

B34sexec bjiden type=transi nirw=24 iautcr $ Var fmscom fycp$ * title=('identify res79 table 1 models: dates feb 1947 - jan 1978')$ Seriesn var=fmscom name=('money stock m2 friedman')$ Seriesn var=fycp name=('commercial paper interest rate')$ Pcross=(fmscom fycp) spectral$ Modelpre var=fmscom dif=(2,1) p=(1,2) ar=(-.46005,-.45503) Q=(3,4,7) ma=(.16193,.13687,.29612) $ Output dif=(1,1)$ B34seend$

/$ now we estimate the final model reported in table 5 /$ default starting values

B34sexec bjest $ Model Fycp= fmscom$ * title=('identify res79 table 1 models: dates feb 1947 - jan 1978')$ Seriesn var=fmscom name=('money stock m2 friedman')$ Seriesn var=fycp name=('commercial paper interest rate')$ Modeln p=(1)(12) q=(2,6,14,20) $ Modeli var=fmscom num=(0,3,4,9,16,23) denom=(1)(12) dif=(2,1)$ Modelpre var=fmscom dif=(2,1) p=(1,2) ar=(-.46005,-.45503) Q=(3,4,7) ma=(.16193,.13687,.29612) $ Output dif=(1,1) $ B34seend$

/$ now we estimate the final model reported in table 5 /$ use res79 starting values to see effect

B34sexec bjest $ Model Fycp= fmscom$ * title=('identify res79 table 1 models: dates feb 1947 - jan 1978')$ Seriesn var=fmscom name=('money stock m2 friedman')$ Seriesn var=fycp name=('commercial paper interest rate')$ Modeln p=(1)(12) q=(2,6,14,20) ar=(.5)(.23) ma=(.1,.2,.3,-.2)$ modeli var=fmscom num=(0,3,4,9,16,23) denom=(1)(12) dif=(2,1) Denomc=(.54)(.68) numc=(-.03,.01,.02,.01,-.01,-.05)$ Modelpre var=fmscom dif=(2,1) p=(1,2) ar=(-.46005,-.45503) Q=(3,4,7) ma=(.16193,.13687,.29612) $ Output dif=(1,1) $ B34seend$

==

7-43 7- 44 Chapter 7

Table 7.8 Data on M2

VAR=FMSCOM MONEY STOCK M2 FRIEDMAN

Listing of Observed Series

1- 8 0.14320E+03 0.14390E+03 0.14480E+03 0.14550E+03 0.14600E+03 0.14620E+03 0.14700E+03 0.14770E+03 9- 16 0.14790E+03 0.14850E+03 0.14850E+03 0.14890E+03 0.14890E+03 0.14830E+03 0.14800E+03 0.14780E+03 17- 24 0.14780E+03 0.14800E+03 0.14820E+03 0.14810E+03 0.14800E+03 0.14780E+03 0.14750E+03 0.14730E+03 25- 32 0.14730E+03 0.14730E+03 0.14750E+03 0.14780E+03 0.14770E+03 0.14760E+03 0.14740E+03 0.14730E+03 33- 40 0.14730E+03 0.14740E+03 0.14760E+03 0.14790E+03 0.14870E+03 0.14910E+03 0.14990E+03 0.15060E+03 41- 48 0.15100E+03 0.15140E+03 0.15170E+03 0.15180E+03 0.15220E+03 0.15250E+03 0.15290E+03 0.15340E+03 49- 56 0.15370E+03 0.15420E+03 0.15450E+03 0.15500E+03 0.15550E+03 0.15630E+03 0.15700E+03 0.15810E+03 57- 64 0.15880E+03 0.16000E+03 0.16090E+03 0.16150E+03 0.16230E+03 0.16270E+03 0.16320E+03 0.16380E+03 65- 72 0.16450E+03 0.16500E+03 0.16570E+03 0.16670E+03 0.16720E+03 0.16800E+03 0.16850E+03 0.16870E+03 73- 80 0.16900E+03 0.16990E+03 0.17040E+03 0.17090E+03 0.17110E+03 0.17150E+03 0.17190E+03 0.17210E+03 81- 88 0.17260E+03 0.17290E+03 0.17330E+03 0.17380E+03 0.17430E+03 0.17480E+03 0.17470E+03 0.17620E+03 89- 96 0.17670E+03 0.17760E+03 0.17850E+03 0.17880E+03 0.17960E+03 0.18030E+03 0.18060E+03 0.18150E+03 97- 104 0.18260E+03 0.18240E+03 0.18290E+03 0.18360E+03 0.18360E+03 0.18410E+03 0.18410E+03 0.18460E+03 105- 112 0.18490E+03 0.18480E+03 0.18520E+03 0.18540E+03 0.18540E+03 0.18580E+03 0.18630E+03 0.18620E+03 113- 120 0.18670E+03 0.18690E+03 0.18690E+03 0.18770E+03 0.18790E+03 0.18840E+03 0.18880E+03 0.18950E+03 121- 128 0.18990E+03 0.19060E+03 0.19090E+03 0.19150E+03 0.19170E+03 0.19230E+03 0.19280E+03 0.19290E+03 129- 136 0.19310E+03 0.19330E+03 0.19330E+03 0.19310E+03 0.19540E+03 0.19700E+03 0.19850E+03 0.19980E+03 137- 144 0.20160E+03 0.20240E+03 0.20370E+03 0.20430E+03 0.20500E+03 0.20610E+03 0.20650E+03 0.20850E+03 145- 152 0.20860E+03 0.20920E+03 0.20990E+03 0.21060E+03 0.21110E+03 0.21200E+03 0.21150E+03 0.21140E+03 153- 160 0.21100E+03 0.21120E+03 0.21090E+03 0.21070E+03 0.20990E+03 0.20970E+03 0.21030E+03 0.21010E+03 161- 168 0.21060E+03 0.21210E+03 0.21350E+03 0.21470E+03 0.21560E+03 0.21650E+03 0.21710E+03 0.21810E+03 169- 176 0.21970E+03 0.22050E+03 0.22180E+03 0.22340E+03 0.22450E+03 0.22560E+03 0.22670E+03 0.22790E+03 177- 184 0.22920E+03 0.23070E+03 0.23140E+03 0.23320E+03 0.23490E+03 0.23690E+03 0.23870E+03 0.23940E+03 185- 192 0.24060E+03 0.24150E+03 0.24210E+03 0.24310E+03 0.24500E+03 0.24690E+03 0.24850E+03 0.25070E+03 193- 200 0.25200E+03 0.25360E+03 0.25540E+03 0.25710E+03 0.25880E+03 0.26040E+03 0.26180E+03 0.26340E+03 201- 208 0.26550E+03 0.26820E+03 0.26850E+03 0.27030E+03 0.27190E+03 0.27310E+03 0.27430E+03 0.27650E+03 209- 216 0.27840E+03 0.28030E+03 0.28210E+03 0.28450E+03 0.28640E+03 0.28870E+03 0.28990E+03 0.29290E+03 217- 224 0.29520E+03 0.29700E+03 0.29870E+03 0.30030E+03 0.30290E+03 0.30500E+03 0.30710E+03 0.31010E+03 225- 232 0.31340E+03 0.31570E+03 0.31770E+03 0.32050E+03 0.32200E+03 0.32390E+03 0.32730E+03 0.32900E+03 233- 240 0.33000E+03 0.33100E+03 0.33180E+03 0.33330E+03 0.33250E+03 0.33240E+03 0.33360E+03 0.33690E+03 241- 248 0.34140E+03 0.34490E+03 0.34640E+03 0.35040E+03 0.35460E+03 0.35800E+03 0.36120E+03 0.36410E+03 249- 256 0.36650E+03 0.36860E+03 0.37050E+03 0.37240E+03 0.37500E+03 0.37720E+03 0.37850E+03 0.38120E+03 257- 264 0.38380E+03 0.38680E+03 0.39090E+03 0.39470E+03 0.39840E+03 0.40280E+03 0.40640E+03 0.40660E+03 265- 272 0.40680E+03 0.40710E+03 0.40780E+03 0.40800E+03 0.40810E+03 0.40540E+03 0.40280E+03 0.40260E+03 273- 280 0.40240E+03 0.40320E+03 0.40330E+03 0.40350E+03 0.40270E+03 0.40600E+03 0.41100E+03 0.41350E+03 281- 288 0.41580E+03 0.42250E+03 0.42930E+03 0.43540E+03 0.43950E+03 0.44380E+03 0.44880E+03 0.45480E+03 289- 296 0.46240E+03 0.46920E+03 0.47340E+03 0.47900E+03 0.48380E+03 0.48710E+03 0.48960E+03 0.49270E+03 297- 304 0.49700E+03 0.50080E+03 0.50500E+03 0.51040E+03 0.51630E+03 0.52070E+03 0.52490E+03 0.52960E+03 305- 312 0.53460E+03 0.53990E+03 0.54610E+03 0.55170E+03 0.55670E+03 0.56230E+03 0.56880E+03 0.57500E+03 313- 320 0.58200E+03 0.58940E+03 0.59580E+03 0.60320E+03 0.60840E+03 0.61310E+03 0.62090E+03 0.62350E+03 321- 328 0.62610E+03 0.63030E+03 0.63440E+03 0.64150E+03 0.64860E+03 0.65250E+03 0.66180E+03 0.66880E+03 329- 336 0.67500E+03 0.68100E+03 0.68590E+03 0.68830E+03 0.69340E+03 0.69670E+03 0.70140E+03 0.70660E+03 337- 344 0.71040E+03 0.71310E+03 0.71460E+03 0.71930E+03 0.72580E+03 0.72870E+03 0.72990E+03 0.73280E+03 345- 352 0.73710E+03 0.74410E+03 0.74650E+03 0.74870E+03 0.75350E+03 0.75590E+03 0.76180E+03 0.76430E+03 353- 360 0.76840E+03 0.77410E+03 0.77540E+03 0.77940E+03 0.78820E+03 0.79460E+03 0.80350E+03 0.80930E+03 361- 368 0.81400E+03 0.81820E+03 0.82620E+03 0.82990E+03 0.83680E+03 0.84630E+03 0.85090E+03 0.85620E+03 369- 372 0.86590E+03 0.87350E+03 0.88120E+03 0.88830E+03 Table 7.9 Data on the Commercial Paper Interest Rates

VAR=FYCP COMMERCIAL PAPER INTEREST RATE

Listing of Observed Series

1- 8 0.10000E+01 0.10000E+01 0.10000E+01 0.10000E+01 0.10000E+01 0.10000E+01 0.10000E+01 0.10200E+01 9- 16 0.10600E+01 0.11000E+01 0.12200E+01 0.13000E+01 0.13800E+01 0.13800E+01 0.13800E+01 0.13800E+01 17- 24 0.13800E+01 0.13800E+01 0.14700E+01 0.15400E+01 0.15600E+01 0.15600E+01 0.15600E+01 0.15600E+01 25- 32 0.15600E+01 0.15600E+01 0.15600E+01 0.15600E+01 0.15600E+01 0.15600E+01 0.14300E+01 0.13800E+01 33- 40 0.13800E+01 0.13800E+01 0.13300E+01 0.13100E+01 0.13100E+01 0.13100E+01 0.13100E+01 0.13100E+01 41- 48 0.13100E+01 0.13100E+01 0.14200E+01 0.16500E+01 0.17200E+01 0.16900E+01 0.17200E+01 0.18600E+01 49- 56 0.19600E+01 0.20400E+01 0.21100E+01 0.21600E+01 0.23100E+01 0.23100E+01 0.22600E+01 0.21900E+01 57- 64 0.22200E+01 0.22500E+01 0.23000E+01 0.23800E+01 0.23800E+01 0.23800E+01 0.23500E+01 0.23100E+01 65- 72 0.23100E+01 0.23100E+01 0.23100E+01 0.23100E+01 0.23100E+01 0.23100E+01 0.23100E+01 0.23100E+01 73- 80 0.23100E+01 0.23600E+01 0.24400E+01 0.26700E+01 0.27500E+01 0.27500E+01 0.27500E+01 0.27400E+01 81- 88 0.25500E+01 0.23100E+01 0.22500E+01 0.21100E+01 0.20000E+01 0.20000E+01 0.17600E+01 0.15800E+01 89- 96 0.15600E+01 0.14500E+01 0.13300E+01 0.13100E+01 0.13100E+01 0.13100E+01 0.13100E+01 0.14700E+01 97- 104 0.16800E+01 0.16900E+01 0.19000E+01 0.20000E+01 0.20000E+01 0.21100E+01 0.23300E+01 0.25400E+01 105- 112 0.27000E+01 0.28100E+01 0.29900E+01 0.30000E+01 0.30000E+01 0.30000E+01 0.31400E+01 0.32700E+01 113- 120 0.33800E+01 0.32700E+01 0.32800E+01 0.35000E+01 0.36300E+01 0.36300E+01 0.36300E+01 0.36300E+01 121- 128 0.36300E+01 0.36300E+01 0.36300E+01 0.36300E+01 0.37900E+01 0.38800E+01 0.39800E+01 0.40000E+01 129- 136 0.41000E+01 0.40700E+01 0.38100E+01 0.34900E+01 0.26300E+01 0.23300E+01 0.19000E+01 0.17100E+01 137- 144 0.15400E+01 0.15000E+01 0.19600E+01 0.29300E+01 0.32300E+01 0.30800E+01 0.33300E+01 0.33000E+01 145- 152 0.32600E+01 0.33500E+01 0.34200E+01 0.35600E+01 0.38300E+01 0.39800E+01 0.39700E+01 0.46300E+01 153- 160 0.47300E+01 0.46700E+01 0.48800E+01 0.49100E+01 0.46600E+01 0.44900E+01 0.41600E+01 0.42500E+01 161- 168 0.38100E+01 0.33900E+01 0.33400E+01 0.33900E+01 0.33000E+01 0.32800E+01 0.32300E+01 0.29800E+01 169- 176 0.30300E+01 0.30300E+01 0.29100E+01 0.27600E+01 0.29100E+01 0.27200E+01 0.29200E+01 0.30500E+01 177- 184 0.30000E+01 0.29800E+01 0.31900E+01 0.32600E+01 0.32200E+01 0.32500E+01 0.32000E+01 0.31600E+01 185- 192 0.32500E+01 0.33600E+01 0.33000E+01 0.33400E+01 0.32700E+01 0.32300E+01 0.32900E+01 0.33400E+01 193- 200 0.32500E+01 0.33400E+01 0.33200E+01 0.32500E+01 0.33800E+01 0.34900E+01 0.37200E+01 0.38800E+01 201- 208 0.38800E+01 0.38800E+01 0.39600E+01 0.39700E+01 0.38800E+01 0.40000E+01 0.39100E+01 0.38900E+01 209- 216 0.40000E+01 0.39600E+01 0.38800E+01 0.38900E+01 0.40000E+01 0.40200E+01 0.41700E+01 0.42500E+01 217- 224 0.42700E+01 0.43800E+01 0.43800E+01 0.43800E+01 0.43800E+01 0.43800E+01 0.43800E+01 0.43800E+01 225- 232 0.43800E+01 0.43800E+01 0.46500E+01 0.48200E+01 0.48800E+01 0.52100E+01 0.53800E+01 0.53900E+01 233- 240 0.55100E+01 0.56300E+01 0.58500E+01 0.58900E+01 0.60000E+01 0.60000E+01 0.60000E+01 0.57300E+01 241- 248 0.53800E+01 0.52400E+01 0.48300E+01 0.46700E+01 0.46500E+01 0.49200E+01 0.50000E+01 0.50000E+01 249- 256 0.50700E+01 0.52800E+01 0.55600E+01 0.56000E+01 0.55000E+01 0.56400E+01 0.58100E+01 0.61800E+01 257- 264 0.62500E+01 0.61900E+01 0.58800E+01 0.58200E+01 0.58000E+01 0.59200E+01 0.61700E+01 0.65300E+01 265- 272 0.66200E+01 0.68200E+01 0.70400E+01 0.73500E+01 0.82300E+01 0.86500E+01 0.83300E+01 0.84800E+01 273- 280 0.85600E+01 0.84600E+01 0.88400E+01 0.87800E+01 0.85500E+01 0.83300E+01 0.80600E+01 0.82300E+01 281- 288 0.82100E+01 0.82900E+01 0.79000E+01 0.73200E+01 0.68500E+01 0.63000E+01 0.57300E+01 0.51100E+01 289- 296 0.44700E+01 0.41900E+01 0.45700E+01 0.51000E+01 0.54500E+01 0.57500E+01 0.57300E+01 0.57500E+01 297- 304 0.55400E+01 0.49200E+01 0.47400E+01 0.40800E+01 0.39300E+01 0.41700E+01 0.45800E+01 0.45100E+01 305- 312 0.46400E+01 0.48500E+01 0.48200E+01 0.51400E+01 0.53000E+01 0.52500E+01 0.54500E+01 0.57800E+01 313- 320 0.62200E+01 0.68500E+01 0.71400E+01 0.72700E+01 0.79900E+01 0.91800E+01 0.10210E+02 0.10230E+02 321- 328 0.89200E+01 0.89400E+01 0.90800E+01 0.86600E+01 0.78300E+01 0.84200E+01 0.97900E+01 0.10620E+02 329- 336 0.10960E+02 0.11720E+02 0.11650E+02 0.11230E+02 0.93600E+01 0.88100E+01 0.89800E+01 0.73000E+01 337- 344 0.63300E+01 0.60600E+01 0.61500E+01 0.58200E+01 0.57900E+01 0.64400E+01 0.67000E+01 0.68600E+01 345- 352 0.64800E+01 0.59100E+01 0.59700E+01 0.52700E+01 0.52300E+01 0.53700E+01 0.52300E+01 0.55400E+01 353- 360 0.59400E+01 0.56700E+01 0.54700E+01 0.54500E+01 0.52200E+01 0.50500E+01 0.47000E+01 0.47400E+01 361- 368 0.48200E+01 0.48700E+01 0.48700E+01 0.53500E+01 0.54900E+01 0.54100E+01 0.58400E+01 0.61700E+01 369- 372 0.65500E+01 0.65900E+01 0.66400E+01 0.67900E+01

The first call to bjiden calculates the ACF and PACF for various transformations of M2 (Money Stock M2 from Friedman) and FYCP (Commercial Paper Interest Rate). To save space, only the ACF and PACF of M2, (1-B) M2 and (1-B)2 M2 are shown. It is clear that second differencing is required since the ACF of (1-B)M2 does not die out. The ACF of (1-B)2 FYCP, which is not shown, does show some seasonality at lag 12 (correlation is .32) but because it does not occur at lag 24, seasonal differencing will overdifference the series. This is illustrated in the ACF of (1-B)2(1-B12 )FYCP, which was not shown to save space. The model selected was

2 2 3 4 7 (1+.4668B+.4581B )(1-B) M2 = (1-.1621B -.1372B -.2979B )et (-8.87) (-8.36) (2.74) (2.62) (5.70)

RSS = 429.21 RSE = 1.0874 MQ(24) = 24.19, (7.5-1)

7-45 7- 46 Chapter 7 which agrees with the results in Stokes and Neuburger (1979).16 The output illustrating these results follows. Output showing forecasting of M2, which is not required in the identification of a transfer function, has not been listed to save space. Note that the ACF of the residuals of the model show white noise, indicating that the ARIMA model listed in equation (7.5-1) is adequate.

Autocorrelation Function

Data - VAR=FMSCOM MONEY STOCK M2 FRIEDMAN 372 Observations

Differencing - Original Series is your data

Differences below are of order 1

Original Series Mean of the Series = 334.35780 St. Dev. of Series = 204.19863 Number of observations = 372 S. E. of mean = 10.60 T value of mean (against zero) = 31.54

1- 12 0.99 0.98 0.97 0.96 0.95 0.93 0.92 0.91 0.90 0.89 0.88 0.87 St.E. 0.05 0.09 0.11 0.13 0.15 0.17 0.18 0.19 0.20 0.21 0.22 0.23 Mod. Q 366.7 726.1 1078.5 1423.8 1762.4 2094.2 2419.3 2737.9 3050.1 3355.9 3655.5 3948.9

13- 24 0.86 0.85 0.84 0.83 0.82 0.81 0.80 0.79 0.78 0.77 0.76 0.75 St.E. 0.24 0.25 0.26 0.26 0.27 0.28 0.28 0.29 0.30 0.30 0.31 0.31 Mod. Q 4236.1 4517.3 4792.5 5062.0 5325.8 5584.0 5836.6 6083.6 6325.2 6561.2 6791.9 7017.2

Mean divided by St. Error (using N in S. D. ) = 31.581

Q Statistic 6763.9 DF 24 Prob. 1.0000 Modified Q Statistic 7017.2 DF 24 Prob. 1.0000

NOTE: In some cases degrees of freedom for Q and Modified Q Statistics may have to be adjusted.

Difference 1 Mean of the Series = 2.0083558 St. Dev. of Series = 2.2526918 Number of observations = 371 S. E. of mean = 0.1171 T value of mean (against zero) = 17.15

1- 12 0.83 0.77 0.77 0.72 0.72 0.70 0.61 0.62 0.60 0.58 0.58 0.57 St.E. 0.05 0.08 0.10 0.11 0.12 0.14 0.14 0.15 0.16 0.16 0.17 0.17 Mod. Q 257.3 476.8 700.9 895.2 1088.5 1272.6 1415.7 1560.7 1699.3 1827.9 1955.5 2080.0

13- 24 0.55 0.52 0.50 0.50 0.52 0.50 0.48 0.48 0.49 0.50 0.48 0.48 St.E. 0.18 0.18 0.19 0.19 0.20 0.20 0.20 0.21 0.21 0.21 0.21 0.22 Mod. Q 2194.9 2298.5 2396.9 2495.3 2599.2 2698.5 2790.5 2881.2 2977.2 3075.0 3167.2 3257.8

Mean divided by St. Error (using N in S. D. ) = 17.172

Q Statistic 3150.8 DF 24 Prob. 1.0000 Modified Q Statistic 3257.8 DF 24 Prob. 1.0000

NOTE: In some cases degrees of freedom for Q and Modified Q Statistics may have to be adjusted.

Difference 2 Mean of the Series = 0.17297297E-01 St. Dev. of Series = 1.2890488 Number of observations = 370 S. E. of mean = 0.6711E-01 T value of mean (against zero) = 0.2578

1- 12 -0.33 -0.22 0.17 -0.12 0.05 0.16 -0.24 0.08 -0.01 -0.03 0.01 0.04 St.E. 0.05 0.06 0.06 0.06 0.06 0.06 0.06 0.07 0.07 0.07 0.07 0.07 Mod. Q 40.8 58.5 69.2 74.8 76.0 85.4 107.8 110.3 110.3 110.6 110.7 111.1

13- 24 -0.01 -0.03 -0.06 0.00 0.10 -0.02 -0.03 -0.04 0.00 0.09 -0.05 0.03 St.E. 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 111.2 111.4 112.7 112.7 116.7 116.8 117.2 117.9 117.9 120.8 121.8 122.1

16 Slight differences between the results reported here and in Stokes and Neuburger (1979) are due to differences in the starting values and the fact that more accurate linpack inverters are now used in the bjest command. The last two bjest problems listed in Table 7.7 illustrate the effect of changes in the starting values on the estimated coefficients in a transfer function model. The important thing to note is that the ACF of the residuals is white noise for the prewhitening model for M2. Mean divided by St. Error (using N in S. D. ) = 0.25811

Q Statistic 119.86 DF 24 Prob. 1.0000 Modified Q Statistic 122.10 DF 24 Prob. 1.0000

NOTE: In some cases degrees of freedom for Q and Modified Q Statistics may have to be adjusted.

Partial Autocorrelations

Data - VAR=FMSCOM MONEY STOCK M2 FRIEDMAN 372 Observations

Differencing - Original Series is your data

Differences below are of order 1

Original Series Mean of the Series = 334.35780 St. Dev. of Series = 204.19863 Number of observations = 372 S. E. of mean = 10.60 T value of mean (against zero) = 31.54

1- 12 0.99 0.00 0.00 0.00 0.00 0.00 -0.01 0.00 0.00 -0.01 0.00 -0.01

13- 24 0.00 0.00 0.00 0.00 0.00 -0.01 -0.01 0.00 -0.01 -0.01 0.00 -0.01

Difference 1 Mean of the Series = 2.0083558 St. Dev. of Series = 2.2526918 Number of observations = 371 S. E. of mean = 0.1171 T value of mean (against zero) = 17.15

1- 12 0.83 0.25 0.30 -0.01 0.17 0.01 -0.17 0.10 0.00 0.08 0.02 0.09

13- 24 0.00 -0.10 0.02 0.03 0.13 -0.01 0.02 0.01 0.06 0.03 -0.05 0.05 Difference 2 Mean of the Series = 0.17297297E-01 St. Dev. of Series = 1.2890488 Number of observations = 370 S. E. of mean = 0.6711E-01 T value of mean (against zero) = 0.2578

1- 12 -0.33 -0.37 -0.07 -0.20 -0.03 0.13 -0.11 0.01 -0.12 -0.03 -0.12 0.00

13- 24 0.03 -0.03 -0.08 -0.14 0.03 -0.02 0.02 -0.07 -0.05 0.02 -0.08 0.05

Note that the output has been edited to save space.

Summary of Model 1 Data - Z = VAR=FMSCOM MONEY STOCK M2 FRIEDMAN Observations 372 Differencing on Z - 1) 2 of order 1

Univariate Model Parameters. Parameter Estimated 95 Per Cent # Type Order Value Lower Limit t Upper Limit Std. Error 1 Autoregressive 1 1 -0.4668 -0.5721 -8.869 -0.3615 0.5263E-01 2 Autoregressive 1 2 -0.4581 -0.5677 -8.357 -0.3484 0.5481E-01 3 Moving average 1 3 0.1621 0.4384E-01 2.742 0.2803 0.5912E-01 4 Moving average 1 4 0.1372 0.3230E-01 2.616 0.2421 0.5246E-01 5 Moving average 1 7 0.2979 0.1933 5.696 0.4025 0.5229E-01

Other Information and results. Residual Sum of Squares 429.20636 363 D.F. Residual Mean Square 1.1823867 Number of Residuals 368 Residual Standard Error 1.0873760

Backforecasting was suppressed in Parameter Estimation.

Autocorrelation Function

Data - THE ESTIMATED RESIDUALS - MODEL 1 368 Observations

Original Series Mean of the Series = 0.72895967E-01 St. Dev. of Series = 1.0775007 Number of observations = 368 S. E. of mean = 0.5625E-01 T value of mean (against zero) = 1.296

1- 12 -0.01 -0.03 -0.02 0.01 0.07 0.08 0.02 -0.01 -0.10 0.02 0.00 0.02 St.E. 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 Mod. Q 0.1 0.3 0.5 0.5 2.6 4.8 4.9 4.9 8.8 9.0 9.0 9.1

7-47 7- 48 Chapter 7 13- 24 -0.03 -0.08 -0.06 -0.04 0.10 -0.01 -0.07 -0.07 -0.02 0.07 -0.03 -0.01 St.E. 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.06 0.06 0.06 0.06 Mod. Q 9.5 12.2 13.5 14.3 18.0 18.1 20.0 22.0 22.1 23.8 24.1 24.2

Mean divided by St. Error (using N in S. D. ) = 1.2978

Q Statistic 23.170 DF 19 Prob. 0.77005 Modified Q Statistic 24.189 DF 19 Prob. 0.81098

The next step in the identification of the transfer function model is to use the prewhitening model for M2, given in equation (7.5-1), to calculate the cross correlations between prewhitened M2, called t , and filtered FYCP, called t in equation (7.2-3), to attempt to identify a model of the income effect.17 Because theory suggests that changes in money influence the level of interest rates, M2 was differenced twice and FYCP was differenced once. The cross correlations suggest an effect of a change in money on interest rates 16 periods later (see cross correlation value of . 137). The Haugh (1976) modified S statistics, S*, suggest feedback, which was noted in the original paper. Spectral analysis of the information in the cross correlations indicates that there is high-frequency feedback from interest rates to prices indicated in the column A TRANS Y-X, while the mapping of (1-B)M2 to FYCP appears to be at lower frequency.

There are problems with the above analysis. The highly significant modified Q of 1018.2 for the ACF of the FYCP series indicates it is not white noise. The H statistic is used to test whether the cross correlations are spurious. The h(i) statistics (equation 7.3-2) for the "left- hand" cross correlations, which measure the income effect, are substantially lower than the h(i) statistics for the "right-hand" cross correlations, which are testing for feedback. For the first 12 ACF values on the left, H(12) was 3.955, which is not significant, while H(12) was 23.021 for the right-hand side, which is significant. This pattern carries through if we look at only elements  the SE or elements  2 times the SE. Although the ACF of the CCF only used 24 observations in this example, and a more appropriate approach might be to calculate more cross correlations prior to performing the diagnostic tests, the tentative finding is that the indicated feedback at lags 1 and 2 is probably not spurious. This feedback problem was noted in Stokes and Neuburger (1979), who qualified their work in this regard. A better estimation method for the problem would allow for feedback such as a VAR or VARMA model (Chap. 8) or would perform a frequency decomposition of the VAR model (Chap.12). If the latter model is run between (1- B)FMSCOM and FYCP for 12 lags, most of the mapping between the series in both directions is at low frequency. Reported spectral analysis results in this chapter indicates low frequency mapping of prewhitened FMSCOM to prewhitened FYCP.

The estimated cross correlations on the left are next used to form an estimate of response weights from equation (7.2-3). These, together with the ACF of the generated noise series from equation (7.2-5), are used to specify a tentative estimate of the transfer function model.

17 The cross correlations exactly replicate Table 3 in Stokes and Neuburger (1979). The autocorrelations of the cross correlations do not exactly replicate the original paper since in the original paper, 55 cross correlations were estimated and used in the calculation of the autocorrelations, while in the output given in this book, only 24 were used. The prewhitening model used in the analysis is not exactly the one estimated in (7.5-1) to preserve compatibility with prior work which used the REAL*4 version of bjiden and bjest. See Stokes (1991) for examples of the REAL*4 estimated coefficients. Cross Correlations

Series 1 - Prewhitened VAR=FMSCOM MONEY STOCK M2 FRIEDMAN Series 2 - Prewhitened VAR=FYCP COMMERCIAL PAPER INTEREST RATE

Mean of Series 1 = 0.72234096E-01 ST. Dev. of Series 1 = 1.0775794 Mean of Series 2 = 0.65248867E-01 ST. Dev. of Series 2 = 0.48055467

Number of Lags Cross Number of Lags Cross on Series 1 Correlation on Series 2 Correlation S Left S Right Mod S Left Mod S Right

0 -0.169 0 -0.169 10.5 10.5 10.5 10.5 1 -0.094 1 -0.127 13.8 16.5 13.8 16.5 2 -0.073 2 -0.126 15.7 22.3 15.7 22.3 3 -0.014 3 -0.088 15.8 25.1 15.8 25.2 4 0.022 4 -0.033 16.0 25.5 16.0 25.6 5 -0.010 5 0.034 16.0 26.0 16.0 26.0 6 -0.013 6 0.031 16.1 26.3 16.1 26.4 7 -0.021 7 0.028 16.2 26.6 16.3 26.7 8 -0.005 8 -0.044 16.2 27.3 16.3 27.4 9 -0.063 9 0.019 17.7 27.5 17.8 27.6 10 -0.067 10 0.012 19.4 27.5 19.5 27.6 11 -0.018 11 -0.051 19.5 28.5 19.6 28.6 12 0.005 12 -0.052 19.5 29.5 19.6 29.7 13 0.045 13 -0.043 20.2 30.2 20.4 30.4 14 0.048 14 0.025 21.1 30.4 21.2 30.6 15 0.071 15 -0.054 22.9 31.5 23.2 31.7 16 0.137 16 -0.021 29.9 31.6 30.5 31.9 17 0.071 17 -0.048 31.7 32.5 32.4 32.8 18 0.080 18 -0.074 34.1 34.5 34.8 34.9 19 0.086 19 -0.063 36.8 36.0 37.7 36.5 20 0.084 20 -0.118 39.4 41.1 40.5 41.9 21 0.036 21 -0.035 39.9 41.5 41.0 42.4 22 0.003 22 0.015 39.9 41.6 41.0 42.4 23 0.077 23 -0.075 42.1 43.7 43.3 44.6 24 0.021 24 -0.083 42.2 46.2 43.5 47.3

Sum of Cross Correlations Squared for 25 Terms

0.11474913E+00 0.12556196E+00

Haugh S Statistic - See JASA June 76 Page 382

S for left side 42.228 DF 25 Chi Prob 0.983014 S for right side 35.690 DF 24 Chi Prob 0.941199 S for both sides 77.918 DF 49 CHI Prob 0.994653

Test for feedback plus instantaneous causality S for right side 46.207 DF 25 Chi Prob 0.993927

Haugh Modified S Statistic - See JASA June 76 Page 383

S for left side 43.491 DF 25 Chi Prob 0.987642 S for right side 36.820 DF 24 Chi Prob 0.954399 S for both sides 80.311 DF 49 CHI Prob 0.996825

Test for feedback plus instantaneous causality S for right side 47.337 DF 25 Chi Prob 0.995526

Note: Cross correlations on left are for series 2 on lags of series 1 Cross correlations on right are for series 1 on lags of series 2

Note: Degrees of freedom of S Statistics have to be adjusted for transfer function checking.

Spectral Analysis of

X Series - Prewhitened VAR=FMSCOM MONEY STOCK M2 FRIEDMAN Y Series - Prewhitened VAR=FYCP COMMERCIAL PAPER INTEREST RATE

X Mean = 0.72234096E-01 X Var = 1.1611773 Y Mean = 0.65248867E-01 Y Var = 0.23093279 Interval 1.

Frequency Cospectrum Quad SP Amplitude Phase A Trans X-Y A Trans Y-X Coherence Sq X Pow Spec Y Pow Spec 0.00000 -0.12314 0.59679E-01 0.13684 0.42818 0.42165 0.25810 0.10883 0.32454 0.53018 0.20833E-01 -0.11976 0.30737E-01 0.12364 0.46001 0.30368 0.22857 0.69413E-01 0.40714 0.54093 0.41667E-01 -0.88684E-01 -0.40746E-01 0.97596E-01 0.56855 0.23966 0.34133 0.81803E-01 0.40723 0.28593 0.62500E-01 -0.64057E-01 0.22537E-01 0.67906E-01 0.44616 0.23771 0.42130 0.10015 0.28567 0.16118 0.83333E-01 -0.93562E-01 0.55053E-01 0.10856 0.41535 0.45256 0.58731 0.26580 0.23987 0.18484 0.10417 -0.89832E-01 0.35063E-01 0.96432E-01 0.44077 0.36451 1.0032 0.36569 0.26455 0.96120E-01 0.12500 -0.35286E-01 0.21326E-01 0.41230E-01 0.41348 0.13823 1.1110 0.15358 0.29827 0.37111E-01

7-49 7- 50 Chapter 7 0.14583 -0.10991E-01 0.11032E-01 0.15573E-01 0.37471 0.43475E-01 0.81026 0.35226E-01 0.35821 0.19220E-01 0.16667 -0.99664E-02 0.15964E-01 0.18819E-01 0.33883 0.33980E-01 1.0170 0.34559E-01 0.55383 0.18504E-01 0.18750 0.15020E-02 0.97937E-02 0.99082E-02 0.22578 0.18474E-01 0.56197 0.10382E-01 0.53635 0.17631E-01 0.20833 0.49044E-02 -0.14519E-01 0.15325E-01 0.80185 0.45466E-01 1.4033 0.63800E-01 0.33707 0.10921E-01 0.22917 0.27451E-02 -0.36609E-01 0.36711E-01 0.76191 0.10251 2.2101 0.22657 0.35811 0.16611E-01 0.25000 -0.52529E-02 -0.20224E-01 0.20895E-01 0.70955 0.62033E-01 0.72248 0.44818E-01 0.33683 0.28921E-01 0.27083 -0.61338E-02 0.21336E-01 0.22200E-01 0.29455 0.62018E-01 0.92194 0.57177E-01 0.35796 0.24079E-01 0.29167 -0.11980E-02 0.11598E-01 0.11659E-01 0.26638 0.29304E-01 1.2642 0.37046E-01 0.39787 0.92228E-02 0.31250 0.23737E-02 0.51082E-02 0.56328E-02 0.18077 0.15775E-01 1.5039 0.23724E-01 0.35706 0.37456E-02 0.33333 -0.13919E-01 -0.55133E-02 0.14971E-01 0.56003 0.43653E-01 3.4083 0.14878 0.34295 0.43924E-02 0.35417 -0.12517E-01 -0.18407E-02 0.12652E-01 0.52324 0.33435E-01 4.2277 0.14135 0.37840 0.29926E-02 0.37500 -0.77908E-02 0.21348E-03 0.77937E-02 0.49564 0.19379E-01 2.3738 0.46003E-01 0.40216 0.32832E-02 0.39583 -0.18345E-01 0.20429E-01 0.27457E-01 0.36646 0.61145E-01 3.5691 0.21823 0.44905 0.76931E-02 0.41667 -0.75686E-02 0.90292E-02 0.11782E-01 0.36103 0.28703E-01 1.2123 0.34795E-01 0.41047 0.97189E-02 0.43750 0.88982E-03 -0.15273E-01 0.15299E-01 0.75926 0.53659E-01 2.2731 0.12197 0.28511 0.67304E-02 0.45833 -0.15724E-01 -0.15077E-01 0.21784E-01 0.62166 0.65205E-01 5.0137 0.32691 0.33409 0.43450E-02 0.47917 -0.15006E-01 -0.62174E-02 0.16243E-01 0.56251 0.40396E-01 4.4398 0.17935 0.40210 0.36586E-02 0.50000 -0.80051E-02 -0.23028E-02 0.83297E-02 0.54458 0.20012E-01 3.1316 0.62671E-01 0.41623 0.26599E-02

Autocorrelation Function

Data - Cross Correlations Series # 1 25 Observations

Original Series Mean of the Series = 0.95350282E-02 St. Dev. of Series = 0.67074947E-01 Number of observations = 25 S. E. of mean = 0.1369E-01 T value of mean (against zero) = 0.6964

1- 12 0.67 0.49 0.34 0.22 0.15 0.03 0.07 0.05 0.06 0.00 -0.11 -0.14 St.E. 0.20 0.28 0.31 0.32 0.33 0.33 0.33 0.33 0.33 0.33 0.33 0.33 Mod. Q 12.8 19.7 23.2 24.8 25.5 25.6 25.8 25.9 26.0 26.0 26.6 27.6

Mean divided by St. Error (using N in S. D. ) = 0.71077

Q Statistic 22.964 DF 12 Prob. 0.97197 Modified Q Statistic 27.553 DF 12 Prob. 0.99357

NOTE: In some cases degrees of freedom for Q and Modified Q Statistics may have to be adjusted.

Autocorrelation Function

Data - Cross Correlations Series # 2 25 Observations

Original Series Mean of the Series = -0.45598950E-01 St. Dev. of Series = 0.54251397E-01 Number of observations = 25 S. E. of mean = 0.1107E-01 T value of mean (against zero) = -4.118

1- 12 0.49 0.21 0.06 -0.08 -0.17 -0.27 -0.15 -0.03 -0.13 -0.17 -0.09 -0.05 St.E. 0.20 0.24 0.25 0.25 0.25 0.26 0.27 0.27 0.27 0.27 0.28 0.28 Mod. Q 6.8 8.2 8.3 8.5 9.5 12.1 12.9 13.0 13.6 15.0 15.4 15.5

Mean divided by St. Error (using N in S. D. ) = 4.2026

Q Statistic 12.049 DF 12 Prob. 0.55827 Modified Q Statistic 15.540 DF 12 Prob. 0.78677

NOTE: In some cases degrees of freedom for Q and Modified Q Statistics may have to be adjusted.

Autocorrelation Function

Data - Prewhitened VAR=FMSCOM MONEY STOCK M2 FRIEDMAN 368 Observations

Original Series Mean of the Series = 0.72234096E-01 St. Dev. of Series = 1.0775794 Number of observations = 368 S. E. of mean = 0.5625E-01 T value of mean (against zero) = 1.284

1- 12 -0.02 -0.03 -0.02 0.00 0.07 0.08 0.02 -0.01 -0.10 0.02 0.00 0.02 St.E. 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 Mod. Q 0.2 0.4 0.6 0.6 2.6 4.7 4.8 4.9 8.7 8.9 8.9 9.0

13- 24 -0.03 -0.08 -0.06 -0.04 0.10 -0.02 -0.07 -0.07 -0.02 0.07 -0.03 -0.01 St.E. 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.06 0.06 0.06 0.06 Mod. Q 9.4 12.1 13.4 14.1 17.8 17.9 19.8 21.7 21.8 23.6 23.9 23.9

Mean divided by St. Error (using N in S. D. ) = 1.2859

Q Statistic 22.923 DF 24 Prob. 0.47564 Modified Q Statistic 23.930 DF 24 Prob. 0.53439 NOTE: In some cases degrees of freedom for Q and Modified Q Statistics may have to be adjusted.

Autocorrelation Function

Data - Prewhitened VAR=FYCP COMMERCIAL PAPER INTEREST RATE 368 Observations

Original Series Mean of the Series = 0.65248867E-01 St. Dev. of Series = 0.48055467 Number of observations = 368 S. E. of mean = 0.2508E-01 T value of mean (against zero) = 2.601

1- 12 0.84 0.67 0.54 0.42 0.28 0.17 0.18 0.17 0.16 0.16 0.18 0.16 St.E. 0.05 0.08 0.09 0.10 0.11 0.11 0.11 0.11 0.11 0.11 0.11 0.11 Mod. Q 261.2 427.9 535.2 600.4 630.1 640.8 652.3 663.4 672.7 682.8 695.4 705.7

13- 24 0.06 -0.02 -0.08 -0.17 -0.25 -0.32 -0.36 -0.36 -0.34 -0.30 -0.26 -0.24 St.E. 0.11 0.11 0.11 0.11 0.11 0.12 0.12 0.12 0.12 0.13 0.13 0.13 Mod. Q 707.2 707.3 709.5 720.1 744.7 785.6 835.0 886.9 932.1 968.0 994.5 1018.2

Mean divided by St. Error (using N in S. D. ) = 2.6047

Q Statistic 990.32 DF 24 Prob. 1.0000 Modified Q Statistic 1018.2 DF 24 Prob. 1.0000

NOTE: In some cases degrees of freedom for Q and Modified Q Statistics may have to be adjusted.

Test to determine whether Autocorrelations of Series #S # 2 are similar to Autocorrelations of Cross Correlations

Chi Square to test for spurious Left Hand Cross Correlations - for 12 terms

1-12 0.643 1.044 1.422 1.759 1.902 2.061 2.151 2.268 2.344 2.550 3.223 3.955

Chi Square to test for spurious Right Hand Cross Correlations - for 12 terms

1-12 2.806 5.976 9.127 12.541 15.288 17.735 18.983 19.477 20.399 21.699 22.522 23.021

Test using Chi Square only for elements GE 2 SE in absolute value (either or both elements ) -- Series # 2 only

For left hand cross correlations, # elements = 5, Chi Square= 1.90194 , only Series #2 Sig, #= 5, Chi= 1.90194 For right hand cross correlations, # elements = 5, Chi Square= 15.2884 , only Series #2 Sig, #= 5, Chi= 15.2884

Test using Chi Square only for elements GE SE in absolute value (either or both elements ) -- Series # 2 only

For left hand cross correlations, # elements = 12, Chi Square= 3.95488 , only Series #2 Sig, #= 12, Chi= 3.95488 For right hand cross correlations, # elements = 12, Chi Square= 23.0205 , only Series #2 Sig, #= 12, Chi= 23.0205

Est. Impulse Response Weights Reverse Response Weights K V(K) K V(K)

0 -0.75388581E-01 0 -0.37906921 1 -0.42067419E-01 1 -0.28474283 2 -0.32340611E-01 2 -0.28273027 3 -0.63548727E-02 3 -0.19673537 4 0.97325710E-02 4 -0.74264846E-01 5 -0.45861587E-02 5 0.75400177E-01 6 -0.58746664E-02 6 0.69882701E-01 7 -0.92244983E-02 7 0.63730765E-01 8 -0.24184070E-02 8 -0.98272568E-01 9 -0.27983462E-01 9 0.43039149E-01 10 -0.29974656E-01 10 0.27400316E-01 11 -0.80314913E-02 11 -0.11519462 12 0.23166325E-02 12 -0.11738575 13 0.19952081E-01 13 -0.97071900E-01 14 0.21407677E-01 14 0.55740842E-01 15 0.31824611E-01 15 -0.12082838 16 0.61258116E-01 16 -0.47131388E-01 17 0.31521686E-01 17 -0.10834027 18 0.35550651E-01 18 -0.16597571 19 0.38421260E-01 19 -0.14215656 20 0.37498032E-01 20 -0.26417401 21 0.16129917E-01 21 -0.78367684E-01 22 0.12803120E-02 22 0.34190383E-01 23 0.34334148E-01 23 -0.16734944 24 0.93225771E-02 24 -0.18583175

Autocorrelation Function

Data - The Generated Noise Series 346 Observations

Original Series Mean of the Series = 0.15675666E-01 St. Dev. of Series = 0.29322995 Number of observations = 346 S. E. of mean = 0.1579E-01 T value of mean (against zero) = 0.9929

7-51 7- 52 Chapter 7

1- 12 0.47 0.13 0.14 0.11 -0.03 -0.22 -0.18 -0.05 -0.04 0.00 0.12 0.22 St.E. 0.05 0.06 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 77.6 83.2 89.9 94.5 94.7 112.3 124.1 124.9 125.3 125.4 130.2 147.3

13- 24 0.06 -0.03 0.02 0.00 -0.14 -0.25 -0.23 -0.22 -0.15 -0.10 0.01 0.04 St.E. 0.07 0.07 0.07 0.07 0.07 0.07 0.08 0.08 0.08 0.08 0.08 0.08 Mod. Q 148.4 148.7 148.9 148.9 155.9 178.7 197.9 215.0 223.4 227.1 227.1 227.6

Mean divided by St. Error (using N in S. D. ) = 0.99439

Q Statistic 220.21 DF 24 Prob. 1.0000 Modified Q Statistic 227.59 DF 24 Prob. 1.0000

NOTE: In some cases degrees of freedom for Q and Modified Q Statistics may have to be adjusted.

Partial Autocorrelations

Data - The Generated Noise Series 346 Observations

Original Series Mean of the Series = 0.15675666E-01 St. Dev. of Series = 0.29322995 Number of observations = 346 S. E. of mean = 0.1579E-01 T value of mean (against zero) = 0.9929

1- 12 0.47 -0.12 0.17 -0.02 -0.10 -0.23 0.02 0.05 0.01 0.08 0.12 0.09

13- 24 -0.19 0.00 -0.01 -0.02 -0.10 -0.08 -0.10 -0.14 0.06 -0.03 0.08 -0.08

The above transfer function identification suggests, after some iterations, a model of the form of

3 4 9 23 23 -1 12 2 (1-B)FYCP=(0  1 B   2 B   3 B   4 B   5 B )(1   1 B) (1   2 B )(1  B) M2 2 6 14 20 1 12  1 (7.5-2) (11 B   2 B   3 B   4 B )(1   1 B) (1   2 B ) et

The implied impulse-response function, V(B), is calculated from equation (7.2-11). The sum of the V(B) weights measures the cumulative effect of a change in M2 on the level of interest rates. After beginning negative, which economic theory suggests is due to the liquidity effect, the sum turns positive at lag 4, .042026, reaching a peak of .228235 lag 20. This positive sum confirms the income effect.18 Diagnostic tests on the residual indicate that the form of the noise model [Θ(B)/Φ(B)] is correct. Since there are no spikes in the cross correlations, the input model [ω1(B)/δ1(B)] is appropriate. The spectral analysis results TRANS X-Y and TRANS Y-X show for the model MONEY  IRATE most of the effect is at low frequencies. For the feedback model MONEY  IRATE there is substantial high frequency feedback. This is further studied in Chapter 15. The second transfer function setup in Table 7.7 differs from the first in that the default starting values are not used. The output from this example is not shown to save space. Slight differences in the estimated coefficients can be seen by an interested reader who runs the problem.

Time Series Parameter Estimation for Model 1 Data - Y = VAR=FYCP COMMERCIAL PAPER INTEREST RATE Observations 372 Differencing on Y - 1) 1 of order 1 Transformations Examined - None.

Noise Series. Differencing on Noise - None

Noise Model Parameters Parameter Beginning

18 The V(B) vector reported in Stokes and Neuburger (1979) was scaled by 117.386 to make it comparable with the V(B) calculated for real M2. Once this calculation is made, the two vectors agree in magnitude. # Type Order Value 1 Autoregressive 1 1 0.1000 2 Autoregressive 2 12 0.1000 3 Moving average 1 2 0.1000 4 Moving average 1 6 0.1000 5 Moving average 1 14 0.1000 6 Moving average 1 20 0.1000

Input Series 1

DATA - X1 = VAR=FMSCOM MONEY STOCK M2 FRIEDMAN Differencing on X1 - 1) 2 of order 1

Value of lag parameter is 0

Transfer function parameters

7 Output Lag 1 1 0.1000 8 Output Lag 2 12 0.1000 9 Input Lag 1 0 0.1000 10 Input Lag 1 3 0.1000 11 Input Lag 1 4 0.1000 12 Input Lag 1 9 0.1000 13 Input Lag 1 16 0.1000 14 Input Lag 1 23 0.1000

Output at each iteration has been suppressed.

Residual output has been suppressed.

Initial sum of Squares = 0.6391E+02

Iteration stops - Relative parameter change < 0.4000E-02

Correlation Matrix of the Parameters. 1/Cond = 0.35503166E-03

1 2 3 4 5 6 7 8 9 10 1 1.0000 2 0.0174 1.0000 3 0.4259 -0.0035 1.0000 4 0.0900 0.2706 -0.1580 1.0000 5 -0.1334 -0.0590 -0.1995 -0.1592 1.0000 6 -0.0356 -0.0653 -0.0175 -0.3358 -0.3178 1.0000 7 0.0393 -0.0802 0.0877 -0.0568 0.1525 -0.0358 1.0000 8 -0.0125 0.0760 -0.0245 0.0828 0.0328 0.0618 -0.2012 1.0000 9 0.0430 0.1297 0.0580 0.0697 0.1118 0.0419 -0.2395 0.3252 1.0000 10 -0.0540 0.0579 -0.0914 0.0458 -0.0314 -0.1180 -0.1198 0.2481 0.0995 1.0000 11 0.0168 0.0212 0.0648 0.0104 -0.0903 -0.1663 0.0047 -0.1168 0.1260 0.3951 12 0.0027 -0.1053 -0.0331 -0.0657 -0.0773 0.0220 0.1988 -0.2291 -0.3314 -0.5475 13 -0.0548 0.0268 -0.1496 -0.0189 0.0011 0.0355 -0.0993 0.5118 0.1405 0.1079 14 -0.0125 -0.0113 -0.0132 -0.0738 -0.0258 -0.0772 0.1908 -0.0100 -0.1861 -0.0163

11 12 13 14 11 1.0000 12 -0.1962 1.0000 13 -0.5188 0.1308 1.0000 14 0.0676 -0.1795 0.3147 1.0000

End of Estimation for Model 1

Summary of Model 1 Data - Y = VAR=FYCP COMMERCIAL PAPER INTEREST RATE Observations 372 Differencing on Y - 1) 1 of order 1

Noise Series. Differencing on Noise - None

Noise Model Parameters Parameter Estimated 95 Per Cent # Type Order Value Lower Limit t Upper Limit Std. Error 1 Autoregressive 1 1 0.5930 0.4916 11.69 0.6944 0.5071E-01 2 Autoregressive 2 12 0.1427 0.2557E-01 2.437 0.2599 0.5857E-01 3 Moving average 1 2 0.2248 0.1185 4.229 0.3312 0.5316E-01 4 Moving average 1 6 0.2632 0.1542 4.830 0.3722 0.5449E-01 5 Moving average 1 14 0.2297 0.1185 4.129 0.3410 0.5563E-01 6 Moving average 1 20 0.1531 0.4074E-01 2.725 0.2654 0.5617E-01

Input Series 1

DATA - X1 = VAR=FMSCOM MONEY STOCK M2 FRIEDMAN

Differencing on X1 - 1) 2 of order 1

Value of lag parameter is 0

Transfer function parameters

Parameter 95 Per Cent

7-53 7- 54 Chapter 7 # Type Order Value Lower Limit t Upper Limit Std. Error 7 Output Lag 1 1 0.5985 0.3738 5.326 0.8233 0.1124 8 Output Lag 2 12 0.8169 0.7140 15.88 0.9198 0.5145E-01 9 Input Lag 1 0 -0.2851E-01 -0.4199E-01 -4.229 -0.1503E-01 0.6740E-02 10 Input Lag 1 3 -0.4123E-01 -0.6048E-01 -4.283 -0.2198E-01 0.9626E-02 11 Input Lag 1 4 -0.4167E-01 -0.6201E-01 -4.096 -0.2132E-01 0.1017E-01 12 Input Lag 1 9 0.3181E-01 0.1135E-01 3.109 0.5227E-01 0.1023E-01 13 Input Lag 1 16 -0.3086E-01 -0.5762E-01 -2.306 -0.4094E-02 0.1338E-01 14 Input Lag 1 23 -0.1149E-01 -0.2961E-01 -1.268 0.6626E-02 0.9058E-02

Other Information and results. Residual Sum of Squares 17.321255 320 D.F. Residual Mean Square 0.54128922E-01 Number of Residuals 334 Residual Standard Error 0.23265623

Backforecasting was suppressed in Parameter Estimation.

Autocorrelation Function

Data - THE ESTIMATED RESIDUALS - MODEL 1 334 Observations

Original Series Mean of the Series = 0.18768914E-01 St. Dev. of Series = 0.22695324 Number of observations = 334 S. E. of mean = 0.1244E-01 T value of mean (against zero) = 1.509 1- 12 -0.05 -0.02 0.08 0.06 0.08 0.01 -0.11 0.04 -0.05 -0.04 0.05 0.00 St.E. 0.05 0.05 0.05 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 0.9 1.0 3.0 4.2 6.2 6.3 10.3 10.9 11.7 12.1 12.9 12.9

13- 24 -0.10 -0.01 0.06 0.06 0.02 -0.09 -0.03 0.01 -0.01 -0.09 0.07 -0.05 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 16.4 16.4 17.6 18.9 19.0 21.9 22.2 22.3 22.3 25.0 27.1 28.2

Mean divided by St. Error (using N in S. D. ) = 1.5114

Q Statistic 26.932 DF 18 Prob. 0.91972 Modified Q Statistic 28.154 DF 18 Prob. 0.94024

NOTE: In some cases degrees of freedom for Q and Modified Q Statistics may have to be adjusted.

Partial Autocorrelations

Data - THE ESTIMATED RESIDUALS - MODEL 1 334 Observations

Original Series Mean of the Series = 0.18768914E-01 St. Dev. of Series = 0.22695324 Number of observations = 334 S. E. of mean = 0.1244E-01 T value of mean (against zero) = 1.509

1- 12 -0.05 -0.02 0.07 0.07 0.09 0.02 -0.12 0.01 -0.06 -0.03 0.05 0.03

13- 24 -0.09 -0.03 0.06 0.06 0.04 -0.07 -0.06 -0.04 -0.01 -0.07 0.10 -0.02

Cross Correlations

Series 1 - PREWHITENED VAR=FMSCOM MONEY STOCK M2 FRIEDMAN Series 2 - THE ESTIMATED RESIDUALS - MODEL 1

Mean of Series 1 = 0.87228401E-01 ST. Dev. of Series 1 = 1.1263402 Mean of Series 2 = 0.18768914E-01 ST. Dev. of Series 2 = 0.22695324

Number of Lags Cross Number of Lags Cross on Series 1 Correlation on Series 2 Correlation S Left S Right Mod S Left Mod S Right

0 -0.012 0 -0.012 0.519E-01 0.519E-01 0.519E-01 0.519E-01 1 0.059 1 -0.053 1.22 0.973 1.23 0.976 2 -0.070 2 -0.140 2.86 7.53 2.87 7.58 3 -0.026 3 -0.085 3.09 9.96 3.10 10.0 4 -0.002 4 -0.140 3.09 16.5 3.11 16.7 5 -0.039 5 0.033 3.60 16.9 3.62 17.0 6 0.026 6 -0.005 3.82 16.9 3.85 17.1 7 0.068 7 0.014 5.35 17.0 5.41 17.1 8 -0.002 8 0.019 5.35 17.1 5.41 17.2 9 -0.005 9 0.010 5.36 17.1 5.42 17.3 10 -0.031 10 0.081 5.69 19.3 5.76 19.5 11 0.020 11 0.037 5.83 19.8 5.90 20.0 12 0.115 12 -0.020 10.3 19.9 10.5 20.1 13 0.062 13 -0.094 11.6 22.8 11.9 23.2 14 0.009 14 0.126 11.6 28.2 11.9 28.8 15 0.000 15 -0.123 11.6 33.2 11.9 34.0 16 -0.016 16 0.039 11.7 33.7 12.0 34.6 17 0.006 17 0.052 11.7 34.6 12.0 35.5 18 0.038 18 -0.014 12.2 34.7 12.5 35.6 19 0.058 19 0.047 13.3 35.4 13.7 36.4 20 -0.001 20 -0.199 13.3 48.6 13.7 50.4 21 -0.036 21 -0.065 13.7 50.0 14.2 51.9 22 0.002 22 0.145 13.7 57.1 14.2 59.5 23 0.102 23 0.030 17.2 57.4 17.9 59.8 24 -0.085 24 0.006 19.6 57.4 20.5 59.8

Sum of Cross Correlations Squared for 25 Terms

0.58639748E-01 0.17186043E+00

Haugh S Statistic - See JASA June 76 Page 382

S for left side 19.586 DF 25 Chi Prob 0.231792 S for right side 57.349 DF 24 Chi Prob 0.999850 S for both sides 76.935 DF 49 CHI Prob 0.993413

Test for feedback plus instantaneous causality S for right side 57.401 DF 25 Chi Prob 0.999764

Haugh Modified S Statistic - See JASA June 76 Page 383

S for left side 20.451 DF 25 Chi Prob 0.277189 S for right side 59.760 DF 24 Chi Prob 0.999931 S for both sides 80.211 DF 49 CHI Prob 0.996754

Test for feedback plus instantaneous causality S for right side 59.812 DF 25 Chi Prob 0.999889

Note: Cross correlations on left are for series 2 on lags of series 1 Cross correlations on right are for series 1 on lags of series 2

Note: Degrees of freedom of S Statistics have to be adjusted for transfer function checking.

Input Series 1 *************** Model Implied Estimated Correct Lag Impulse Response Weights Impulse Response Weights Difference Sum Implied WGT Sum Corr WGT

0 -0.28505896E-01 -0.82985907E-01 -0.54480011E-01 -0.285059E-01 -0.829859E-01 1 -0.17061564E-01 -0.40854028E-01 -0.23792464E-01 -0.455675E-01 -0.123840 2 -0.10211815E-01 -0.22782173E-01 -0.12570357E-01 -0.557793E-01 -0.146622 3 0.35117166E-01 0.13636932E-01 -0.21480233E-01 -0.206621E-01 -0.132985 4 0.62687703E-01 0.36730596E-01 -0.25957107E-01 0.420256E-01 -0.962546E-01 5 0.37520316E-01 0.90300611E-02 -0.28490255E-01 0.795459E-01 -0.872245E-01 6 0.22456942E-01 -0.23646414E-03 -0.22693406E-01 0.102003 -0.874610E-01 7 0.13441098E-01 0.55686848E-02 -0.78724132E-02 0.115444 -0.818923E-01 8 0.80448672E-02 0.49832637E-02 -0.30616035E-02 0.123489 -0.769090E-01 9 -0.26993161E-01 -0.33511101E-01 -0.65179403E-02 0.964957E-01 -0.110420 10 -0.16156150E-01 -0.40961097E-01 -0.24804947E-01 0.803395E-01 -0.151381 11 -0.96699006E-02 -0.20739298E-01 -0.11069397E-01 0.706696E-01 -0.172121 12 -0.29074739E-01 -0.98086245E-02 0.19266114E-01 0.415949E-01 -0.181929 13 -0.17402031E-01 0.19265533E-01 0.36667565E-01 0.241928E-01 -0.162664 14 -0.10415595E-01 0.26708645E-01 0.37124240E-01 0.137772E-01 -0.135955 15 0.27446953E-01 0.50761569E-01 0.23314616E-01 0.412242E-01 -0.851934E-01 16 0.81326364E-01 0.95509648E-01 0.14183284E-01 0.122551 0.103162E-01 17 0.48676068E-01 0.57185018E-01 0.85089502E-02 0.171227 0.675013E-01 18 0.29133967E-01 0.48117505E-01 0.18983538E-01 0.200361 0.115619 19 0.17437481E-01 0.53833528E-01 0.36396047E-01 0.217798 0.169452 20 0.10436812E-01 0.43469112E-01 0.33032299E-01 0.228235 0.212921 21 -0.19738064E-01 -0.53695494E-04 0.19684369E-01 0.208497 0.212868 22 -0.11813775E-01 -0.46962401E-02 0.71175348E-02 0.196683 0.208171 23 0.44184820E-02 0.35826092E-01 0.31407610E-01 0.201102 0.243998 24 -0.16379063E-01 0.85424657E-03 0.17233310E-01 0.184722 0.244852

The above example shows a marked difference in the model-implied impulse response weights, Vi(B), and the corrected impulse response weights, Vc i(B), although what to correct in the model is not that obvious since the ACF of the residuals is clean and the cross correlations between αt and the estimated residual does not show obvious spikes. The problem may be feedback, which needs the VARMA technique, or the fact that nominal instead of real M2 was used. This is the subject of chapter 8.19

19 If the noise model is changed to

7-55 7- 56 Chapter 7

7.8 IACF and ESACF Identification

The Box-Jenkins-Reinsel (1994, 196) Chemical Process data consists of 226 observartions on chemical process temperature. Alternative models suggested were ARMA(1,1,0) and ARMA(0,2,2). Another model suggested by Wei (2006, 132) ARMA(2,0,0).20 Table 7.11 explores these models as well as using the automatic detection methods in B34S and SCA. Before moving to this discussion the iacf and iacfn subroutines are shown in Tables 7.10 and 7.11. In Table 7.10 subroutine iacf uses the QR method to estimate OLS the AR(k) filter while in Table 7.11 iacfn uses the partial correlatioins. In both cases the length of the initial filter k is set as the maximum IACF value requested. If a smaller value is requested, the IACF values will be different and not appropriate since the length of the AR(k) model was not long enough to capture the procress correctly.

Table 7.10 Inverse Autocorrelation Subroutine iacf subroutine iacf(series,iacf1,n); /; /; Inverse ACF Experimental !!!!!!!!! /; /; Assume ARMA(p,q) model. Estimate ACF of ARMA(q,p) model /; /; series => series to estimate /; iacf1 => Inverse ACF /; n => N of terms. If n set too small /; AR(n) will not filter series /; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /; /; Routine built 7 June 2006 /; Routine uses logic from Wei /; x=series-mean(series); call olsq(x x{1 to n} :noint :qr); base=sumsq(%coef)+1.0; iacf1=array(n:); do i=1,n; top=-1.*%coef(i); do j=1,n-i+1; if((j+i).le.n)then;

MODELN Q=(1)(2,4,6,7,12,14,18,22) $ from

MODELN P=(1)(12) Q=(2,6,14,20) $ the e' e is lowered to 16.933259 from the the original value of 17.321255. 20 His estimated ESACF table differs in minor respected with that obtained with B34S and SCA. top=top+%coef(j)*%coef(j+i); endif; enddo; iacf1(i)=top/base; enddo; return; end;

Note: Logic from Wei (2006)

7-57 58 Chapter 7

Table 7.11 Inverse Autocorrelation Subroutine iacfn subroutine iacfn(series,iacf1,n); /; /; Inverse ACF Experimental - uses pacf following /; Bovas Abraham & Johannes Ledolter /; "A Note on Inverse Autocorrelations" /; Biometrika (1984) Vol 71 # 3 pp 609-614 eq 1-5 /; /; iacf(k) = (-ar(k) + sum (j=1,p-k) ar(j)*ar(j+k)) / /; (1.0 +sumsq(ar)) /; /; where ar = partial acf /; /; Assume ARMA(p,q) model. Estimate ACF of ARMA(q,p) model /; /; series => series to estimate /; iacf1 => Inverse ACF /; n => N of terms. If n set too small /; AR(n) will not filter series /; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /; /; Routine built 7 June 2006 /; Bug fixed 16 July 2007 /; x=series-mean(series); acf1=acf(x,n,se,pacf); base=sumsq(pacf)+1.; iacf1=array(n:); do i=1,n; top=-1.*pacf(i); do j=1,n-i+1; if((j+i).le.n)then; top=top+(pacf(j)*pacf(j+i)); endif; enddo; iacf1(i)=top/base; enddo; return; end;

Note: Logic from Abraham and Ledolter ARIMA and Transfer Function Models 59

Table 7.12 Analysis of the Box-Jenkins-Reinsel Chemical Process Data Using IACF and ESACF

/; iacf => Uses Wei setup and estimated the AR model with OLS /; Wei(2006) "Time Series Analysis" /; /; iacfn => Uses Bovas Abraham & Johannes Ledolter model using PACF /; Bovas Abraham & Johannes Ledolter /; "A Note on Inverse Autocorrelations" /; Biometrika (1984) Vol 71 # 3 pp 609-614 eq 1-5 /; /; iacf(k) = (-ar(k) + sum (j=1,p-k) ar(j)*ar(j+k)) / /; (1.0 +sumsq(ar)) /; /; where ar = partial acf /; /; %b34slet dosca=1; %b34slet dosas=0; %b34slet dorats=1; b34sexec options ginclude('b34sdata.mac') member(bj_c); b34srun; b34sexec matrix; call loaddata; call load(iacf :staging); call load(iacfn :staging); call echooff; call print('+++++++++++++++++++++++++++++':); call print('Test Case From Wei page 132 ':); call print('Note that SCA and B34S get same answers but Wei differs':); n=30; acf1=acf(chem,n,se,pacf); call iacf(chem,iacf1,n); call iacfn(chem,iacf2,n); call tabulate(acf1,pacf,iacf1,iacf2 :title 'ACF, PACF IACF iacfn'); call esacf(chem,5,9 :print); call print(' ':); call print('See what autobj gets ':); call print(' ':); call autobj(chem :print :nac 24 :npac 24 :autobuild ); call print(' ':); call print('Box-Jenkins-Reinsel (1994) page 196 ':); call print('Alternative Models ':); call autobj(chem :print :nac 24 :npac 24 :ar index(1 2) ); call autobj(chem :print :nac 24 :npac 24 :dif index(2 1) :ma index(1 2)); b34srun;

%b34sif(&dosca.ne.0)%then; b34sexec options open('sca.dat') disp=unknown unit(28)$ b34srun$ b34sexec options open('sca.cmd') disp=unknown unit(29)$ b34srun$ b34sexec options clean(28)$ b34srun$ b34sexec options clean(29)$ b34srun$ b34sexec pgmcall$ sca scafname=mydata$ pgmcards$ /$#==myrun --- these commands are required to load the b34s data. --- assign file 18. attrib access(read). external 'sca.dat'. 60 Chapter 7

call procedure is mydata. file is 18. ------iarima chem acf chem pacf chem iacf chem eacf chem stop. return /$#== b34sreturn$ b34srun$ b34sexec options close(28)$ b34srun$ b34sexec options close(29)$ b34srun$ b34sexec options dounix('sca sca.cmd > sca.out') dodos('scaw32 10000 /f:sca.cmd /p:myrun /o:sca.out') $ b34srun$ b34sexec options npageout writeout('output from sca',' ',' ') copyfout('sca.out') dodos('erase sca.cmd','erase sca.out','erase sca.dat') dounix('rm sca.cmd','rm sca.out','rm sca.dat') $ b34srun$ %b34sendif; %b34sif(&dorats.ne.0)%then; b34sexec options open('rats.dat') unit(28) disp=unknown$ b34srun$ b34sexec options open('rats.in') unit(29) disp=unknown$ b34srun$ b34sexec options clean(28)$ b34srun$ b34sexec options clean(29)$ b34srun$ b34sexec pgmcall$ rats passasts pcomments('* ', '* Data passed from B34S(r) system to RATS', '* ', "display @1 %dateandtime() @33 ' Rats Version ' %ratsversion()" '* ') $

PGMCARDS$ * correlate(inverse=iacf,partial=pacf) chem b34sreturn$ b34srun $ b34sexec options close(28)$ b34srun$ b34sexec options close(29)$ b34srun$ b34sexec options /$ dodos(' rats386 rats.in rats.out ') dodos('start /w /r rats32s rats.in /run') dounix('rats rats.in rats.out')$ B34SRUN$ b34sexec options npageout WRITEOUT('Output from RATS',' ',' ') COPYFOUT('rats.out') dodos('ERASE rats.in','ERASE rats.out','ERASE rats.dat') dounix('rm rats.in','rm rats.out','rm rats.dat') $ ARIMA and Transfer Function Models 61

B34SRUN$ %b34sendif;

%b34sif(&dosas.eq.1)%then; b34sexec options open('testsas.sas') unit(29) disp=unknown$ b34srun$ b34sexec options clean(29) $ b34seend$ b34sexec pgmcall idata=29 icntrl=29$ sas $ * sas commands next ; pgmcards$ proc arima; identify var=chem; run; b34sreturn$ b34srun $ b34sexec options close(29)$ b34srun$ b34sexec options dodos('start /w /r sas testsas' ) dounix('sas testsas' ) $ b34srun$ b34sexec options npageout noheader writeout(' ','output from sas',' ',' ') writelog(' ','output from sas',' ',' ') copyfout('testsas.lst') copyflog('testsas.log') dodos('erase testsas.sas','erase testsas.lst','erase testsas.log') dounix('rm testsas.sas','rm testsas.lst','rm testsas.log') $ b34srun$ b34sexec options header$ b34srun$ %b34sendif; b34sexec options ginclude('b34sdata.mac') member(gas); b34srun; b34sexec matrix; call loaddata; call load(iacf :staging); call load(iacfn :staging); call echooff; call print('+++++++++++++++++++++++++++++':); call print('Test Case From Wei page 132 ':); call print('Note that SCA and B34S get same answers but Wei differs':); n=34; acf1=acf(gasin,n,se,pacf); call iacf(gasin,iacf1,n); call iacfn(gasin,iacf2,n); call tabulate(acf1,pacf,iacf1,iacf2 :title 'ACF, PACF IACF iacfn'); call esacf(gasin,5,9 :print); call print(' ':); call print('See what autobj gets ':); call print(' ':); call autobj(gasin :print :nac 24 :npac 24 :autobuild ); call print(' ':); call print('Box-Jenkins-Reinsel (1994) page 196 ':); call print('Alternative Models ':); call autobj(gasin :print :nac 24 :npac 24 :ar index(1 2) ); call autobj(gasin :print :nac 24 :npac 24 :dif index(2 1) :ma index(1 2)); b34srun;

%b34sif(&dosca.ne.0)%then; b34sexec options open('sca.dat') disp=unknown unit(28)$ b34srun$ b34sexec options open('sca.cmd') disp=unknown unit(29)$ b34srun$ b34sexec options clean(28)$ b34srun$ b34sexec options clean(29)$ b34srun$ 62 Chapter 7 b34sexec pgmcall$ sca scafname=mydata$ pgmcards$

/$#==myrun --- these commands are required to load the b34s data. --- assign file 18. attrib access(read). external 'sca.dat'. call procedure is mydata. file is 18. ------iarima gasin acf gasin pacf gasin iacf gasin eacf gasin stop. return /$#== b34sreturn$ b34srun$ b34sexec options close(28)$ b34srun$ b34sexec options close(29)$ b34srun$ b34sexec options dounix('sca sca.cmd > sca.out') dodos('scaw32 10000 /f:sca.cmd /p:myrun /o:sca.out') $ b34srun$ b34sexec options npageout writeout('output from sca',' ',' ') copyfout('sca.out') dodos('erase sca.cmd','erase sca.out','erase sca.dat') dounix('rm sca.cmd','rm sca.out','rm sca.dat') $ b34srun$ %b34sendif;

%b34sif(&dorats.ne.0)%then; b34sexec options open('rats.dat') unit(28) disp=unknown$ b34srun$ b34sexec options open('rats.in') unit(29) disp=unknown$ b34srun$ b34sexec options clean(28)$ b34srun$ b34sexec options clean(29)$ b34srun$ b34sexec pgmcall$ rats passasts pcomments('* ', '* Data passed from B34S(r) system to RATS', '* ', "display @1 %dateandtime() @33 ' Rats Version ' %ratsversion()" '* ') $

PGMCARDS$ * correlate(inverse=iacf,partial=pacf) gasin b34sreturn$ b34srun $ b34sexec options close(28)$ b34srun$ b34sexec options close(29)$ b34srun$ b34sexec options /$ dodos(' rats386 rats.in rats.out ') ARIMA and Transfer Function Models 63

dodos('start /w /r rats32s rats.in /run') dounix('rats rats.in rats.out')$ B34SRUN$ b34sexec options npageout WRITEOUT('Output from RATS',' ',' ') COPYFOUT('rats.out') dodos('ERASE rats.in','ERASE rats.out','ERASE rats.dat') dounix('rm rats.in','rm rats.out','rm rats.dat') $ B34SRUN$ %b34sendif;

Edited output from running the code in Table 7.12 is given below. 64 Chapter 7

B34S 8.11C (D:M:Y) 19/ 7/07 (H:M:S) 13:51: 3 DATA STEP Box-Jenkins Series C PAGE 1

Variable Label # Cases Mean Std. Dev. Variance Maximum Minimum

CHEM 1 Chemical Process Temperature 226 22.9739 2.05949 4.24149 27.1000 18.8000 CONSTANT 2 226 1.00000 0.00000 0.00000 1.00000 1.00000

Number of observations in data file 226 Current missing variable code 1.000000000000000E+31

B34S(r) Matrix Command. d/m/y 19/ 7/07. h:m:s 13:51: 3.

=> CALL LOADDATA$

=> CALL LOAD(IACF :STAGING)$

=> CALL LOAD(IACFN :STAGING)$

=> CALL ECHOOFF$

+++++++++++++++++++++++++++++ Test Case From Wei page 132 Note that SCA and B34S get same answers but Wei differs

ACF, PACF IACF iacfn

Obs ACF1 PACF IACF1 IACF2 1 0.9776 0.9776 -0.7097 -0.5398 2 0.9441 -0.2602 0.2245 0.8356E-01 3 0.9022 -0.1570 0.1517E-01 0.5732E-01 4 0.8543 -0.9327E-01 -0.6245E-01 0.4079E-01 5 0.8024 -0.5757E-01 0.6135E-01 0.2717E-01 6 0.7476 -0.4547E-01 -0.6550E-01 0.3793E-01 7 0.6919 -0.1227E-01 0.1058 0.7087E-02 8 0.6354 -0.3752E-01 -0.1907 0.2426E-01 9 0.5788 -0.2233E-01 0.2763 0.2603E-01 10 0.5233 -0.9850E-02 -0.3018 0.8488E-02 11 0.4682 -0.3598E-01 0.2574 0.1629E-01 12 0.4134 -0.4111E-01 -0.1813 0.1819E-01 13 0.3590 -0.3802E-01 0.1067 0.2358E-01 14 0.3054 -0.2380E-01 -0.1945E-01 0.1033E-01 15 0.2525 -0.3653E-01 -0.1065 0.2258E-01 16 0.2006 -0.2704E-01 0.2383 0.1783E-01 17 0.1497 -0.3198E-01 -0.2888 -0.1345E-02 18 0.9844E-01 -0.6980E-01 0.2245 0.2420E-01 19 0.4721E-01 -0.4835E-01 -0.1202 0.2810E-01 20 -0.2991E-02 -0.2374E-01 0.4556E-01 0.1421E-01 21 -0.5213E-01 -0.3356E-01 -0.6883E-03 0.4978E-02 22 -0.1011 -0.6082E-01 -0.4721E-02 0.3926E-02 23 -0.1507 -0.7943E-01 -0.2213E-01 0.2448E-01 24 -0.1999 -0.4846E-01 0.3702E-02 0.1347E-01 25 -0.2481 -0.3703E-01 0.6766E-01 0.2254E-01 26 -0.2939 -0.1128E-01 -0.1137 0.1228E-02 27 -0.3373 -0.3132E-01 0.1190 -0.3872E-02 28 -0.3789 -0.5383E-01 -0.9549E-01 0.1181E-01 29 -0.4180 -0.3608E-01 0.4596E-01 0.5985E-02 30 -0.4541 -0.2404E-01 -0.8694E-02 0.1144E-01

The extended ar( 1 ) coefs:

(q= 0) 1.00 (q= 1) 0.98 (q= 2) 0.97 (q= 3) 0.97 (q= 4) 0.96 (q= 5) 0.95 (q= 6) 0.94 (q= 7) 0.94 (q= 8) 0.93 (q= 9) 0.92

The extended ar( 2 ) coefs:

(q= 0) 1.81 -0.82 (q= 1) 1.83 -0.84 (q= 2) 1.84 -0.85 (q= 3) 1.89 -0.90 (q= 4) 1.92 -0.93 (q= 5) 1.92 -0.92 (q= 6) 1.92 -0.93 (q= 7) 1.88 -0.89 (q= 8) 1.91 -0.92 (q= 9) 2.01 -1.01 ARIMA and Transfer Function Models 65

The extended ar( 3 ) coefs:

(q= 0) 1.79 -0.78 -0.03 (q= 1) 2.74 -2.50 0.76 (q= 2) 5.68 -7.87 3.22 (q= 3) 2.48 -1.99 0.50 (q= 4) 1.56 -0.23 -0.34 (q= 5) 1.38 0.11 -0.50 (q= 6) -3.69 9.80 -5.17 (q= 7) 1.27 0.27 -0.56 (q= 8) 5.34 -7.37 3.06 (q= 9) 0.99 0.93 -0.93

The extended ar( 4 ) coefs:

(q= 0) 1.79 -0.79 0.02 -0.03 (q= 1) 5.56 -7.53 2.92 0.09 (q= 2) 1.64 2.82 -6.16 2.73 (q= 3) 2.80 -3.31 2.13 -0.63 (q= 4) 1.45 -0.01 -0.48 0.03 (q= 5)-21.99 34.97 -3.10 -9.19 (q= 6) 1.57 1.37 -3.49 1.54 (q= 7) 0.44 -1.13 4.40 -2.76 (q= 8) 1.73 -3.05 4.56 -2.28 (q= 9) 0.89 1.07 -0.92 -0.05

The extended ar( 5 ) coefs:

(q= 0) 1.79 -0.79 -0.07 0.16 -0.10 (q= 1) 2.52 -2.10 0.51 0.14 -0.08 (q= 2) 2.83 -3.37 2.03 -0.40 -0.10 (q= 3) 2.55 -3.07 3.14 -2.31 0.69 (q= 4) 0.79 1.86 -2.91 1.84 -0.60 (q= 5) 1.53 0.47 -2.04 1.41 -0.38 (q= 6) 1.54 -2.86 2.89 1.07 -1.69 (q= 7) 1.18 -2.80 3.94 0.15 -1.52 (q= 8) 3.39 -3.26 6.69 -11.45 5.69 (q= 9) 1.05 0.88 -0.58 -0.72 0.37

The extended acf table

(q-->) 0 1 2 3 4 5 6 7 8 ------(p= 0) .98 .94 .90 .85 .80 .75 .69 .64 .58 (p= 1) .81 .66 .55 .48 .43 .38 .34 .28 .25 (p= 2) -.04 -.03 -.12 -.06 .02 -.01 .07 -.04 -.12 (p= 3) -.50 .01 -.07 -.11 -.01 .00 .03 -.03 -.10 (p= 4) -.25 -.27 -.05 -.11 -.01 .03 .00 -.02 -.09 (p= 5) -.48 .28 -.29 -.07 .04 -.05 .00 -.01 -.08

Simplified extended acf table (5% level) (q-->) 0 1 2 3 4 5 6 7 8 ------(p= 0) x x x x x x x x x (p= 1) x x x x x x x o o (p= 2) o o o o o o o o o (p= 3) x o o o o o o o o (p= 4) x x o o o o o o o (p= 5) x x x o o o o o o

Simplified Extended ACF Table (1% level)

(q-->) 0 1 2 3 4 5 6 7 8 ------(p= 0) x x x x x x x x x (p= 1) x x x x x x o o o (p= 2) o o o o o o o o o (p= 3) x o o o o o o o o (p= 4) x x o o o o o o o (p= 5) x x x o o o o o o

See what autobj gets

Time Series Parameter Estimation for Model 1 Data - Z = VAR= CHEM Observations 226 Differencing on Z - 1: 1 of order 1 Transformations Examined - None.

Univariate Model Parameters. Parameter Beginning # Type Order Value 1 Autoregressive 1 1 0.8131 66 Chapter 7

Output at each iteration has been suppressed.

Residual output has been suppressed.

Initial sum of Squares 4.013901639344329

Iteration stops - Relative parameter change < 4.000000000000000E-03

Correlation Matrix of the Parameters. 1/Cond = 1.000 1 1 1.0000

End of Estimation for Model 1

Summary of model 1 Data - Z = VAR= CHEM Observations 226 Differencing on Z - 1: 1 of order 1

Univariate Model Parameters. Parameter Estimated 95 Per Cent # Type Order Value Lower Limit t Upper Limit Std. Error 1 Autoregressive 1 1 0.8131 0.7363 21.17 0.8899 0.3841E-01

Other Information and results. Residual Sum of Squares 4.0139016 223 D.F. Residual Mean Square 1.799955892082633E-02 Number of residuals 224 Residual Standard error 0.1341624348348908 Backforecasting not used in Estimation

Autocorrelation Function

Data - THE ESTIMATED RESIDUALS - MODEL 1 224 Observations

Original Series Mean of the Series -9.019320866099221E-03 St. Dev. of Series 0.1335584351442730 Number of observations 224 S. E. of mean 8.943734334626231E-03 T value of mean (against zero) -1.008451339076604

1- 12 0.01 0.01 -0.05 -0.01 0.06 0.02 0.08 -0.02 -0.09 0.13 -0.09 0.08 St.E. 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 0.0 0.0 0.7 0.7 1.5 1.6 3.0 3.1 4.9 8.9 11.0 12.7

13- 24 -0.06 0.04 0.01 -0.04 0.17 -0.08 0.00 -0.01 0.00 0.13 0.01 -0.01 St.E. 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 13.5 13.9 13.9 14.3 21.4 22.9 22.9 23.0 23.0 27.1 27.2 27.2

Mean divided by St. Error (using N in S. D.) 1.010709911534077

Partial Autocorrelations

Data - THE ESTIMATED RESIDUALS - MODEL 1 224 Observations

Original Series Mean of the Series -9.019320866099221E-03 St. Dev. of Series 0.1335584351442730 Number of observations 224 S. E. of mean 8.943734334626231E-03 T value of mean (against zero) -1.008451339076604

1- 12 0.01 0.01 -0.05 -0.01 0.06 0.02 0.07 -0.02 -0.09 0.14 -0.10 0.07

13- 24 -0.05 0.04 0.00 -0.03 0.16 -0.09 0.01 -0.02 0.03 0.09 0.04 -0.06

Box-Jenkins-Reinsel (1994) page 196 Alternative Models

Time Series Parameter Estimation for Model 1 Data - Z = VAR= CHEM Observations 226 Differencing on Z - None Transformations Examined - None.

Univariate Model Parameters. Parameter Beginning # Type Order Value 1 Mean 22.97 2 Autoregressive 1 1 0.1000 3 Autoregressive 1 2 0.1000

Output at each iteration has been suppressed.

Residual output has been suppressed.

Initial sum of Squares 597.8891417965383 ARIMA and Transfer Function Models 67

Iteration stops - Relative parameter change < 4.000000000000000E-03

Correlation Matrix of the Parameters. 1/Cond = 0.1429E-04 1 2 3 1 1.0000 2 0.1218 1.0000 3 -0.1605 -0.9935 1.0000

End of Estimation for Model 1

Summary of model 1 Data - Z = VAR= CHEM Observations 226 Differencing on Z - None

Univariate Model Parameters. Parameter Estimated 95 Per Cent # Type Order Value Lower Limit t Upper Limit Std. Error 1 Mean 22.26 20.73 29.13 23.78 0.7639 2 Autoregressive 1 1 1.803 1.726 47.13 1.879 0.3825E-01 3 Autoregressive 1 2 -0.8151 -0.8917 -21.28 -0.7385 0.3831E-01

Other Information and results. Residual Sum of Squares 3.8533693 221 D.F. Residual Mean Square 1.743606030927628E-02 Number of residuals 224 Residual Standard error 0.1320456750873586 Backforecasting not used in Estimation

Autocorrelation Function

Data - THE ESTIMATED RESIDUALS - MODEL 1 224 Observations

Original Series Mean of the Series -1.159199023489238E-08 St. Dev. of Series 0.1311584600566039 Number of observations 224 S. E. of mean 8.783020115635518E-03 T value of mean (against zero) -1.319818249562737E-06

1- 12 -0.01 0.00 -0.06 -0.01 0.06 0.02 0.08 -0.01 -0.08 0.14 -0.09 0.09 St.E. 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 0.1 0.1 0.9 0.9 1.9 2.0 3.6 3.7 5.4 9.9 12.0 14.0

13- 24 -0.05 0.05 0.01 -0.04 0.17 -0.08 0.00 -0.01 -0.01 0.13 0.01 -0.01 St.E. 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 14.7 15.2 15.3 15.8 23.0 24.7 24.7 24.7 24.7 28.8 28.8 28.8

Mean divided by St. Error (using N in S. D.) 1.322774173197152E-06

Partial Autocorrelations

Data - THE ESTIMATED RESIDUALS - MODEL 1 224 Observations

Original Series Mean of the Series -1.159199023489238E-08 St. Dev. of Series 0.1311584600566039 Number of observations 224 S. E. of mean 8.783020115635518E-03 T value of mean (against zero) -1.319818249562737E-06

1- 12 -0.01 0.00 -0.06 -0.01 0.06 0.02 0.08 0.00 -0.08 0.14 -0.10 0.07

13- 24 -0.05 0.04 0.00 -0.03 0.16 -0.08 0.01 -0.03 0.02 0.08 0.04 -0.06

Time Series Parameter Estimation for Model 1 Data - Z = VAR= CHEM Observations 226 Differencing on Z - 1: 2 of order 1 Transformations Examined - None.

Univariate Model Parameters. Parameter Beginning # Type Order Value 1 Moving average 1 1 0.1000 2 Moving average 1 2 0.1000

Output at each iteration has been suppressed.

Residual output has been suppressed.

Initial sum of Squares 4.363424973318919

Iteration stops - Relative parameter change < 4.000000000000000E-03

Correlation Matrix of the Parameters. 1/Cond = 0.7581 1 2 68 Chapter 7

1 1.0000 2 -0.1361 1.0000

End of Estimation for Model 1

Summary of model 1 Data - Z = VAR= CHEM Observations 226 Differencing on Z - 1: 2 of order 1

Univariate Model Parameters. Parameter Estimated 95 Per Cent # Type Order Value Lower Limit t Upper Limit Std. Error 1 Moving average 1 1 0.1192 -0.1415E-01 1.788 0.2526 0.6669E-01 2 Moving average 1 2 0.1135 -0.2033E-01 1.696 0.2474 0.6693E-01

Other Information and results. Residual Sum of Squares 4.3615780 222 D.F. Residual Mean Square 1.964674775349739E-02 Number of residuals 224 Residual Standard error 0.1401668568296278 Backforecasting not used in Estimation

Autocorrelation Function

Data - THE ESTIMATED RESIDUALS - MODEL 1 224 Observations

Original Series Mean of the Series -3.502505986305938E-03 St. Dev. of Series 0.1394957447905027 Number of observations 224 S. E. of mean 9.341325996140759E-03 T value of mean (against zero) -0.3749474097952422

1- 12 0.02 0.03 -0.13 -0.08 -0.01 -0.03 0.02 -0.06 -0.13 0.09 -0.13 0.06 St.E. 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 0.1 0.2 3.8 5.2 5.2 5.4 5.6 6.3 10.3 12.4 16.3 17.2

13- 24 -0.08 0.02 -0.01 -0.05 0.15 -0.09 -0.01 -0.02 0.01 0.13 0.01 -0.01 St.E. 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.08 0.08 Mod. Q 18.8 19.0 19.0 19.6 25.4 27.5 27.5 27.6 27.6 32.0 32.0 32.1

Mean divided by St. Error (using N in S. D.) 0.3757871586853967

Partial Autocorrelations

Data - THE ESTIMATED RESIDUALS - MODEL 1 224 Observations

Original Series Mean of the Series -3.502505986305938E-03 St. Dev. of Series 0.1394957447905027 Number of observations 224 S. E. of mean 9.341325996140759E-03 T value of mean (against zero) -0.3749474097952422

1- 12 0.02 0.03 -0.13 -0.08 0.00 -0.04 0.01 -0.06 -0.14 0.10 -0.14 0.02

13- 24 -0.08 -0.01 -0.02 -0.07 0.13 -0.12 -0.02 -0.03 0.02 0.08 0.03 -0.06

B34S Matrix Command Ending. Last Command reached.

Space available in allocator 7869781, peak space used 52946 Number variables used 74, peak number used 74 Number temp variables used 6773, # user temp clean 0 output from sca Note that SCA gets close to IACFn results and replicates the B34S ESACF results

THE WORKSPACE REQUESTED EXCEEDS THE LICENSED LIMITATION. THE MAXIMUM WORKSPACE WITH 130000 WORDS IS ALLOCATED. THE SCA STATISTICAL SYSTEM ( RELEASE 8.0 ) SCA ADVANCED EDITION SOFTWARE IDENTIFICATION: HOUSTON STOKES ( 7071618 ) SOFTWARE RELEASE DATE: 4/ 1/2007 SOFTWARE RENEWAL DATE: 12/ 2/2010 COPYRIGHT (C), SCIENTIFIC COMPUTING ASSOCIATES CORP. ALL RIGHTS RESERVED

SIZE OF WORKSPACE IS 130000 SINGLE PRECISION WORDS DATE -- 7/19/2007 TIME -- 13:51: 9 --

call myrun . file 'sca.cmd' ARIMA and Transfer Function Models 69

--

assign file 18. attrib access(read). external 'sca.dat'.

--

call procedure is mydata. file is 18.

--

Input variable is CHEM . Precision is double.

CHEM , A 226 BY 1 VARIABLE, IS STORED IN THE WORKSPACE; DOUBLE PRECISION --

Input variable is CONSTANT . Precision is double.

CONSTANT, A 226 BY 1 VARIABLE, IS STORED IN THE WORKSPACE; DOUBLE PRECISION --

RETURN.

-- acf chem

NAME OF THE SERIES ...... CHEM TIME PERIOD ANALYZED ...... 1 TO 226 MEAN OF THE (DIFFERENCED) SERIES . . . 22.9739 STANDARD DEVIATION OF THE SERIES . . . 2.0549 T-VALUE OF MEAN (AGAINST ZERO) . . . . 168.0709

AUTOCORRELATIONS

1- 12 .98 .94 .90 .85 .80 .75 .69 .64 .58 .52 .47 .41 ST.E. .07 .11 .14 .17 .19 .20 .21 .22 .23 .24 .24 .25 Q 219 424 612 781 931 1062 1175 1270 1350 1415 1468 1509

13- 24 .36 .31 .25 .20 .15 .10 .05 -.00 -.05 -.10 -.15 -.20 ST.E. .25 .25 .25 .25 .25 .25 .25 .25 .25 .25 .26 .26 Q 1540 1563 1578 1588 1594 1596 1597 1597 1597 1600 1606 1616

-1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 +----+----+----+----+----+----+----+----+----+----+ I 1 0.98 + IXX+XXXXXXXXXXXXXXXXXXXXX 2 0.94 + IXXXXX+XXXXXXXXXXXXXXXXXX 3 0.90 + IXXXXXX+XXXXXXXXXXXXXXXX 4 0.85 + IXXXXXXX+XXXXXXXXXXXXX 5 0.80 + IXXXXXXXX+XXXXXXXXXXX 6 0.75 + IXXXXXXXXX+XXXXXXXXX 7 0.69 + IXXXXXXXXX+XXXXXXX 8 0.64 + IXXXXXXXXXX+XXXXX 9 0.58 + IXXXXXXXXXX+XXX 10 0.52 + IXXXXXXXXXXX+X 11 0.47 + IXXXXXXXXXXXX 12 0.41 + IXXXXXXXXXX + 13 0.36 + IXXXXXXXXX + 14 0.31 + IXXXXXXXX + 15 0.25 + IXXXXXX + 16 0.20 + IXXXXX + 17 0.15 + IXXXX + 18 0.10 + IXX + 19 0.05 + IX + 20 0.00 + I + 21 -0.05 + XI + 22 -0.10 + XXXI + 23 -0.15 + XXXXI + 24 -0.20 + XXXXXI + -- pacf chem 70 Chapter 7 ARIMA and Transfer Function Models 71

B34S 8.11C (D:M:Y) 19/ 7/07 (H:M:S) 13:51: 9 PGMCALL STEP Box-Jenkins Series C PAGE 4

NAME OF THE SERIES ...... CHEM TIME PERIOD ANALYZED ...... 1 TO 226 MEAN OF THE (DIFFERENCED) SERIES . . . 22.9739 STANDARD DEVIATION OF THE SERIES . . . 2.0549 T-VALUE OF MEAN (AGAINST ZERO) . . . . 168.0709

PARTIAL AUTOCORRELATIONS

1- 12 .98 -.26 -.16 -.09 -.06 -.05 -.01 -.04 -.02 -.01 -.04 -.04 ST.E. .07 .07 .07 .07 .07 .07 .07 .07 .07 .07 .07 .07

13- 24 -.04 -.02 -.04 -.03 -.03 -.07 -.05 -.02 -.03 -.06 -.08 -.05 ST.E. .07 .07 .07 .07 .07 .07 .07 .07 .07 .07 .07 .07

-1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 +----+----+----+----+----+----+----+----+----+----+ I 1 0.98 + IXX+XXXXXXXXXXXXXXXXXXXXX 2 -0.26 XXXX+XXI + 3 -0.16 X+XXI + 4 -0.09 +XXI + 5 -0.06 + XI + 6 -0.05 + XI + 7 -0.01 + I + 8 -0.04 + XI + 9 -0.02 + XI + 10 -0.01 + I + 11 -0.04 + XI + 12 -0.04 + XI + 13 -0.04 + XI + 14 -0.02 + XI + 15 -0.04 + XI + 16 -0.03 + XI + 17 -0.03 + XI + 18 -0.07 +XXI + 19 -0.05 + XI + 20 -0.02 + XI + 21 -0.03 + XI + 22 -0.06 +XXI + 23 -0.08 +XXI + 24 -0.05 + XI + --

iacf chem

NAME OF THE SERIES ...... CHEM TIME PERIOD ANALYZED ...... 1 TO 226 MEAN OF THE (DIFFERENCED) SERIES . . . 22.9739 STANDARD DEVIATION OF THE SERIES . . . 2.0549 T-VALUE OF MEAN (AGAINST ZERO) . . . . 168.0709 72 Chapter 7

B34S 8.11C (D:M:Y) 19/ 7/07 (H:M:S) 13:51: 9 PGMCALL STEP Box-Jenkins Series C PAGE 5

INVERSE AUTOCORRELATIONS

1- 12 -.52 .00 .01 .01 -.01 .03 -.02 -.00 .02 -.01 -.00 -.01 ST.E. .07 .07 .07 .07 .07 .07 .07 .07 .07 .07 .07 .07

13- 24 .01 -.01 .01 .02 -.03 -.01 .01 .01 .00 -.02 -.01 .02 ST.E. .07 .07 .07 .07 .07 .07 .07 .07 .07 .07 .07 .07

-1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 +----+----+----+----+----+----+----+----+----+----+ I 1 -0.52 XXXXXXXXXX+XXI + 2 0.00 + I + 3 0.01 + I + 4 0.01 + I + 5 -0.01 + I + 6 0.03 + IX + 7 -0.02 + I + 8 0.00 + I + 9 0.02 + I + 10 -0.01 + I + 11 0.00 + I + 12 -0.01 + I + 13 0.01 + I + 14 -0.01 + I + 15 0.01 + I + 16 0.02 + IX + 17 -0.03 + XI + 18 -0.01 + I + 19 0.01 + I + 20 0.01 + I + 21 0.00 + I + 22 -0.02 + XI + 23 -0.01 + I + 24 0.02 + IX + --

eacf chem

NAME OF THE SERIES ...... CHEM TIME PERIOD ANALYZED ...... 1 TO 226 MEAN OF THE (DIFFERENCED) SERIES . . . 22.9739 STANDARD DEVIATION OF THE SERIES . . . 2.0549 T-VALUE OF MEAN (AGAINST ZERO) . . . . 168.0709

THE EXTENDED ACF TABLE

(Q-->) 0 1 2 3 4 5 6 7 8 9 10 11 12 ------

(P= 0) .98 .94 .90 .85 .80 .75 .69 .64 .58 .52 .47 .41 .36

(P= 1) .81 .66 .55 .48 .43 .38 .34 .28 .25 .25 .22 .22 .20

(P= 2) -.04 -.03 -.12 -.06 .02 -.01 .07 -.04 -.12 .13 -.12 .08 -.08

(P= 3) -.50 .01 -.07 -.11 -.01 .00 .03 -.03 -.10 .01 -.05 -.03 -.06

(P= 4) -.25 -.27 -.05 -.11 -.01 .03 .00 -.02 -.09 -.01 -.04 .02 -.06

(P= 5) -.48 .28 -.29 -.07 .04 -.05 -.00 -.01 -.08 .07 .00 -.01 -.00

(P= 6) -.08 -.31 .14 .04 -.03 -.04 -.01 -.03 -.08 .07 .00 -.02 .00

SIMPLIFIED EXTENDED ACF TABLE (5% LEVEL)

(Q-->) 0 1 2 3 4 5 6 7 8 9 10 11 12 ------(P= 0) X X X X X X X X X X X X X (P= 1) X X X X X X X O O O O O O (P= 2) O O O O O O O O O O O O O (P= 3) X O O O O O O O O O O O O (P= 4) X X O O O O O O O O O O O (P= 5) X X X O O O O O O O O O O (P= 6) O X O O O O O O O O O O O --

stop. ARIMA and Transfer Function Models 73

THE CURRENT SCA SESSION IS TERMINATED. THE SIZE OF THE WORKSPACE USED IS 5757 WORDS. 74 Chapter 7

Output from RATS RATS gets close to IACF not IACFN results!

* * Data passed from B34S(r) system to RATS * display @1 %dateandtime() @33 ' Rats Version ' %ratsversion() 07/19/2007 13:51 Rats Version 6.30000 * CALENDAR(IRREGULAR) ALLOCATE 226 OPEN DATA rats.dat DATA(FORMAT=FREE,ORG=OBS, $ MISSING= 0.1000000000000000E+32 ) / $ CHEM $ CONSTANT SET TREND = T TABLE Series Obs Mean Std Error Minimum Maximum CHEM 226 22.973894 2.059489 18.800000 27.100000 TREND 226 113.500000 65.384759 1.000000 226.000000

* correlate(inverse=iacf,partial=pacf) chem Correlations of Series CHEM Autocorrelations 1: 0.9934828 0.9763049 0.9504312 0.9174963 0.8785569 0.8343817 0.7858227 0.7336554 0.6789029 0.6223326 0.5640809 12: 0.5048713 0.4448277 0.3843802 0.3235974 0.2626824 0.2017559 0.1406215 0.0799464 0.0198539 -0.0396230 -0.0985008 23: -0.1568509 -0.2140853 -0.2695353 -0.3226333 -0.3734744 -0.4221716 -0.4685199 -0.5121219

Partial Autocorrelations 1: 0.9934828 -0.8238259 -0.0281650 -0.0268474 -0.1003409 -0.0742607 -0.0054642 -0.0339562 0.0447023 -0.0359326 -0.1455727 12: 0.1000276 -0.1416306 0.0077445 -0.0979957 -0.0241597 -0.0661826 -0.1148785 0.1128002 -0.1409065 -0.0547963 -0.0901686 23: -0.0545289 0.0438428 0.0391579 -0.0671638 -0.1372601 -0.0050437 -0.0722287 0.0593734

Inverse Autocorrelations 1: -0.7070196 0.2318203 -0.0107280 -0.0399155 0.0543811 -0.0613705 0.0929097 -0.1745600 0.2665128 -0.2922837 0.2366485 12: -0.1549861 0.0955330 -0.0376682 -0.0681480 0.2063711 -0.2814876 0.2342244 -0.1268569 0.0400896 0.0122329 -0.0139613 23: -0.0227064 0.0066849 0.0671887 -0.1079331 0.1071525 -0.0883837 0.0458676 -0.0095206 ARIMA and Transfer Function Models 75

B34S 8.11C (D:M:Y) 19/ 7/07 (H:M:S) 13:51:12 DATA STEP PAGE 7

Variable Label # Cases Mean Std. Dev. Variance Maximum Minimum

TIME 1 296 148.500 85.5921 7326.00 296.000 1.00000 GASIN 2 Input gas rate in cu. ft / min 296 -0.568345E-01 1.07277 1.15083 2.83400 -2.71600 GASOUT 3 Percent CO2 in outlet gas 296 53.5091 3.20212 10.2536 60.5000 45.6000 CONSTANT 4 296 1.00000 0.00000 0.00000 1.00000 1.00000

Number of observations in data file 296 Current missing variable code 1.000000000000000E+31

B34S(r) Matrix Command. d/m/y 19/ 7/07. h:m:s 13:51:12.

=> CALL LOADDATA$

=> CALL LOAD(IACF :STAGING)$

=> CALL LOAD(IACFN :STAGING)$

=> CALL ECHOOFF$

+++++++++++++++++++++++++++++ Test Case From Wei page 132 Note that SCA and B34S get same answers but Wei differs

ACF, PACF IACF iacfn

Obs ACF1 PACF IACF1 IACF2 1 0.9525 0.9525 -0.6610 -0.6956 2 0.8341 -0.7880 0.1625 0.3478 3 0.6819 0.3390 -0.8019E-01 -0.1072 4 0.5312 0.1212 0.1586 0.2704E-01 5 0.4075 0.5896E-01 -0.6724E-01 -0.6093E-01 6 0.3182 -0.1115 -0.3519E-01 0.2292E-01 7 0.2602 0.4862E-01 0.7501E-02 -0.4072E-02 8 0.2275 0.9945E-01 0.1151E-01 -0.2205E-01 9 0.2131 0.1587E-01 0.2480E-01 0.2809E-02 10 0.2083 -0.6973E-01 0.1801E-01 -0.3472E-02 11 0.2028 -0.9434E-01 -0.1525 0.1358E-01 12 0.1893 0.4141E-01 0.2186 0.5804E-01 13 0.1673 0.8801E-01 -0.1272 -0.9680E-01 14 0.1375 -0.1353 -0.1125E-01 0.5815E-01 15 0.1048 0.5137E-01 0.2817E-01 0.9367E-02 16 0.7541E-01 0.3276E-01 0.6140E-01 -0.1750E-01 17 0.5203E-01 -0.2230E-01 -0.7779E-01 -0.2034E-01 18 0.3705E-01 0.3398E-01 -0.1874E-01 0.1402E-01 19 0.3398E-01 0.9339E-01 0.6739E-01 -0.1311E-01 20 0.4236E-01 -0.4077E-01 -0.1817E-01 -0.1234E-01 21 0.5635E-01 -0.9068E-01 -0.7633E-02 0.3488E-01 22 0.6939E-01 0.3797E-01 -0.3717E-03 -0.8464E-02 23 0.7653E-01 0.3583E-01 -0.4113E-01 -0.1168E-01 24 0.7611E-01 0.6018E-02 0.7699E-01 0.2169E-01 25 0.7011E-01 -0.4989E-02 -0.3505E-01 -0.1565E-01 26 0.6169E-01 -0.3214E-01 0.8605E-02 0.1438E-01 27 0.5396E-01 0.6324E-01 -0.5892E-01 -0.2681E-01 28 0.5036E-01 0.7794E-01 0.8026E-01 0.1595E-01 29 0.5623E-01 0.7535E-01 -0.2270E-01 -0.4447E-01 30 0.7329E-01 -0.6746E-01 -0.1752E-01 0.9639E-02 31 0.9759E-01 -0.2462E-01 -0.7198E-02 0.9301E-02 32 0.1220 0.5797E-02 0.3681E-01 0.7165E-02 33 0.1385 -0.1790E-01 -0.2975E-01 -0.1216E-01 34 0.1401 -0.5427E-01 0.8540E-02 0.1953E-01

The extended ar( 1 ) coefs:

(q= 0) 0.95 (q= 1) 0.88 (q= 2) 0.82 (q= 3) 0.78 (q= 4) 0.77 (q= 5) 0.78 (q= 6) 0.82 (q= 7) 0.87 (q= 8) 0.94 (q= 9) 0.98

The extended ar( 2 ) coefs:

(q= 0) 1.70 -0.79 (q= 1) 1.54 -0.63 (q= 2) 1.36 -0.47 (q= 3) 1.02 -0.20 76 Chapter 7

(q= 4) -0.09 0.67 (q= 5) 2.90 -1.62 (q= 6) 2.09 -0.99 (q= 7) 1.84 -0.79 (q= 8) 1.57 -0.55 (q= 9) 0.89 0.08

The extended ar( 3 ) coefs:

(q= 0) 1.97 -1.37 0.34 (q= 1) 2.29 -1.91 0.59 (q= 2) 2.33 -1.98 0.62 (q= 3) 1.84 -1.31 0.39 (q= 4) 2.21 -1.69 0.46 (q= 5) 2.32 -1.67 0.38 (q= 6) 2.47 -2.11 0.63 (q= 7) 2.90 -3.00 1.05 (q= 8) 3.12 -3.41 1.23 (q= 9) 2.26 -2.07 0.76

The extended ar( 4 ) coefs:

(q= 0) 1.93 -1.20 0.10 0.12 (q= 1) 2.39 -2.11 0.73 -0.03 (q= 2) -9.24 24.55 -21.53 6.86 (q= 3) 1.23 0.12 -0.82 0.38 (q= 4) 2.93 -3.02 1.41 -0.28 (q= 5) 1.57 -0.02 -0.88 0.34 (q= 6) 3.57 -4.65 2.46 -0.42 (q= 7) 3.45 -4.37 2.22 -0.35 (q= 8) -2.82 13.80 -16.58 6.23 (q= 9) 2.46 -2.67 1.41 -0.23

The extended ar( 5 ) coefs:

(q= 0) 1.93 -1.21 0.17 0.01 0.06 (q= 1) -0.10 2.70 -2.27 0.21 0.31 (q= 2) 1.18 -0.35 0.43 -0.72 0.35 (q= 3) 1.13 -0.81 1.62 -1.77 0.68 (q= 4) 2.35 -2.31 1.48 -0.76 0.22 (q= 5) 2.67 -3.24 2.44 -1.21 0.31 (q= 6) 3.50 -4.55 2.45 -0.47 0.02 (q= 7) 34.76 ****** 147.60 -77.10 13.04 (q= 8) 2.17 -3.46 5.28 -4.88 1.75 (q= 9) 2.25 -3.26 4.26 -3.65 1.28

The extended acf table

(q-->) 0 1 2 3 4 5 6 7 8 ------(p= 0) .95 .83 .68 .53 .41 .32 .26 .23 .21 (p= 1) .78 .50 .26 .07 -.06 -.14 -.18 -.18 -.10 (p= 2) .40 .31 .23 .09 -.09 -.08 -.07 -.10 -.10 (p= 3) -.32 -.02 .20 -.20 -.09 .09 .04 .01 -.11 (p= 4) -.38 -.03 .14 -.18 -.17 .07 .00 .01 -.09 (p= 5) .40 .31 -.07 -.19 .06 .07 .00 .07 -.01

Simplified extended acf table (5% level) (q-->) 0 1 2 3 4 5 6 7 8 ------(p= 0) x x x x x x o o o (p= 1) x x x o o o o o o (p= 2) x x x o o o o o o (p= 3) x o x x o o o o o (p= 4) x o o x x o o o o (p= 5) x x o x o o o o o

Simplified Extended ACF Table (1% level)

(q-->) 0 1 2 3 4 5 6 7 8 ------(p= 0) x x x x x o o o o (p= 1) x x x o o o o o o (p= 2) x x o o o o o o o (p= 3) x o x x o o o o o (p= 4) x o o x o o o o o (p= 5) x x o x o o o o o

See what autobj gets

Time Series Parameter Estimation for Model 1 Data - Z = VAR= GASIN Observations 296 Differencing on Z - 1: 1 of order 1 Transformations Examined - None. ARIMA and Transfer Function Models 77

Univariate Model Parameters. Parameter Beginning # Type Order Value 1 Autoregressive 1 1 0.7000 2 Moving average 1 1 -0.2580 3 Moving average 1 4 0.4122 4 Moving average 1 5 0.3031 5 Moving average 2 3 0.1893

Output at each iteration has been suppressed.

Residual output has been suppressed.

Initial sum of Squares 10.33992283744978

Iteration stops - Relative parameter change < 4.000000000000000E-03

Correlation Matrix of the Parameters. 1/Cond = 0.1112 1 2 3 4 5 1 1.0000 2 0.6254 1.0000 3 0.2727 0.2050 1.0000 4 -0.0871 -0.3467 0.1294 1.0000 5 0.4324 0.2110 0.1175 0.0475 1.0000

End of Estimation for Model 1

Summary of model 1 Data - Z = VAR= GASIN Observations 296 Differencing on Z - 1: 1 of order 1

Univariate Model Parameters. Parameter Estimated 95 Per Cent # Type Order Value Lower Limit t Upper Limit Std. Error 1 Autoregressive 1 1 0.7000 0.5804 11.71 0.8196 0.5979E-01 2 Moving average 1 1 -0.2580 -0.4006 -3.617 -0.1153 0.7133E-01 3 Moving average 1 4 0.4122 0.3038 7.600 0.5207 0.5424E-01 4 Moving average 1 5 0.3031 0.1897 5.347 0.4165 0.5669E-01 5 Moving average 2 3 0.1893 0.6029E-01 2.934 0.3183 0.6451E-01

Other Information and results. Residual Sum of Squares 10.339923 289 D.F. Residual Mean Square 3.577827971435908E-02 Number of residuals 294 Residual Standard error 0.1891514729373236 Backforecasting not used in Estimation

Autocorrelation Function

Data - THE ESTIMATED RESIDUALS - MODEL 1 294 Observations

Original Series Mean of the Series -9.767464186524414E-04 St. Dev. of Series 0.1875336010852208 Number of observations 294 S. E. of mean 1.095582995580190E-02 T value of mean (against zero) -8.915311962606577E-02

1- 12 0.01 0.01 0.02 0.02 -0.02 -0.09 -0.07 -0.05 -0.04 -0.02 0.05 -0.09 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 0.1 0.1 0.2 0.3 0.5 3.0 4.7 5.4 5.9 6.0 6.9 9.5

13- 24 0.10 0.01 -0.13 -0.04 0.06 -0.05 -0.14 -0.03 0.02 0.04 0.01 -0.04 St.E. 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 0.06 Mod. Q 12.4 12.4 17.5 18.0 19.1 19.8 25.6 26.0 26.0 26.6 26.7 27.3

Mean divided by St. Error (using N in S. D.) 8.930512846556421E-02

Partial Autocorrelations

Data - THE ESTIMATED RESIDUALS - MODEL 1 294 Observations

Original Series Mean of the Series -9.767464186524414E-04 St. Dev. of Series 0.1875336010852208 Number of observations 294 S. E. of mean 1.095582995580190E-02 T value of mean (against zero) -8.915311962606577E-02

1- 12 0.01 0.01 0.02 0.02 -0.02 -0.09 -0.07 -0.05 -0.03 -0.01 0.06 -0.10

13- 24 0.09 -0.01 -0.15 -0.04 0.06 -0.06 -0.13 -0.03 -0.01 0.02 0.02 -0.09

Box-Jenkins-Reinsel (1994) page 196 Alternative Models 78 Chapter 7

Time Series Parameter Estimation for Model 1 Data - Z = VAR= GASIN Observations 296 Differencing on Z - None Transformations Examined - None.

Univariate Model Parameters. Parameter Beginning # Type Order Value 1 Mean -0.5683E-01 2 Autoregressive 1 1 0.1000 3 Autoregressive 1 2 0.1000

Output at each iteration has been suppressed.

Residual output has been suppressed.

Initial sum of Squares 231.4369682354639

Iteration stops - Relative parameter change < 4.000000000000000E-03

Correlation Matrix of the Parameters. 1/Cond = 0.3901E-02 1 2 3 1 1.0000 2 -0.0005 1.0000 3 -0.0019 -0.9525 1.0000

End of Estimation for Model 1

Summary of model 1 Data - Z = VAR= GASIN Observations 296 Differencing on Z - None

Univariate Model Parameters. Parameter Estimated 95 Per Cent # Type Order Value Lower Limit t Upper Limit Std. Error 1 Mean -0.6415E-01 -0.3412 -0.4631 0.2129 0.1385 2 Autoregressive 1 1 1.705 1.633 47.42 1.777 0.3595E-01 3 Autoregressive 1 2 -0.7898 -0.8617 -21.97 -0.7179 0.3595E-01

Other Information and results. Residual Sum of Squares 11.829696 291 D.F. Residual Mean Square 4.065187520766594E-02 Number of residuals 294 Residual Standard error 0.2016231018699642 Backforecasting not used in Estimation

Autocorrelation Function

Data - THE ESTIMATED RESIDUALS - MODEL 1 294 Observations

Original Series Mean of the Series -1.490744649794646E-14 St. Dev. of Series 0.2005917748925079 Number of observations 294 S. E. of mean 1.171869661509956E-02 T value of mean (against zero) -1.272107896260254E-12

1- 12 0.27 0.04 -0.08 -0.21 -0.05 0.10 0.11 0.07 0.03 0.11 0.18 0.03 St.E. 0.06 0.06 0.06 0.06 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 21.6 22.0 24.1 37.5 38.3 41.3 44.7 46.3 46.6 50.5 60.0 60.3

13- 24 0.11 0.05 -0.04 0.02 0.06 -0.05 -0.08 0.01 0.05 0.07 0.07 0.02 St.E. 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 63.9 64.8 65.4 65.6 66.7 67.4 69.4 69.5 70.1 71.7 73.3 73.4

Mean divided by St. Error (using N in S. D.) 1.274276879755597E-12

Partial Autocorrelations

Data - THE ESTIMATED RESIDUALS - MODEL 1 294 Observations

Original Series Mean of the Series -1.490744649794646E-14 St. Dev. of Series 0.2005917748925079 Number of observations 294 S. E. of mean 1.171869661509956E-02 T value of mean (against zero) -1.272107896260254E-12

1- 12 0.27 -0.04 -0.09 -0.18 0.06 0.11 0.03 -0.01 0.02 0.17 0.16 -0.07

13- 24 0.12 0.07 -0.01 0.02 0.05 -0.09 -0.11 0.03 0.01 -0.02 -0.03 -0.03

Time Series Parameter Estimation for Model 1 Data - Z = VAR= GASIN Observations 296 Differencing on Z - 1: 2 of order 1 ARIMA and Transfer Function Models 79

Transformations Examined - None.

Univariate Model Parameters. Parameter Beginning # Type Order Value 1 Moving average 1 1 0.1000 2 Moving average 1 2 0.1000

Output at each iteration has been suppressed.

Residual output has been suppressed.

Initial sum of Squares 17.17950796539780

Iteration stops - Relative parameter change < 4.000000000000000E-03

Correlation Matrix of the Parameters. 1/Cond = 0.5561 1 2 1 1.0000 2 0.2849 1.0000

End of Estimation for Model 1

Summary of model 1 Data - Z = VAR= GASIN Observations 296 Differencing on Z - 1: 2 of order 1

Univariate Model Parameters. Parameter Estimated 95 Per Cent # Type Order Value Lower Limit t Upper Limit Std. Error 1 Moving average 1 1 -0.2928 -0.4098 -5.003 -0.1757 0.5852E-01 2 Moving average 1 2 -0.3677E-01 -0.1539 -0.6277 0.8039E-01 0.5858E-01

Other Information and results. Residual Sum of Squares 15.003194 292 D.F. Residual Mean Square 5.138080238795792E-02 Number of residuals 294 Residual Standard error 0.2266733385026962 Backforecasting not used in Estimation

Autocorrelation Function

Data - THE ESTIMATED RESIDUALS - MODEL 1 294 Observations

Original Series Mean of the Series -3.708252251615509E-04 St. Dev. of Series 0.2259007206908934 Number of observations 294 S. E. of mean 1.319726101594906E-02 T value of mean (against zero) -2.809865052402947E-02

1- 12 0.00 -0.02 -0.12 -0.30 -0.13 -0.01 -0.01 -0.01 -0.05 0.04 0.15 -0.06 St.E. 0.06 0.06 0.06 0.06 0.06 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 0.0 0.1 4.2 31.4 36.5 36.5 36.5 36.6 37.5 38.0 44.7 45.6

13- 24 0.09 0.03 -0.08 0.00 0.05 -0.07 -0.10 0.01 0.02 0.05 0.06 0.01 St.E. 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 0.07 Mod. Q 48.3 48.6 50.8 50.8 51.5 53.0 56.0 56.0 56.1 56.8 57.8 57.8

Mean divided by St. Error (using N in S. D.) 2.814655959637091E-02

Partial Autocorrelations

Data - THE ESTIMATED RESIDUALS - MODEL 1 294 Observations

Original Series Mean of the Series -3.708252251615509E-04 St. Dev. of Series 0.2259007206908934 Number of observations 294 S. E. of mean 1.319726101594906E-02 T value of mean (against zero) -2.809865052402947E-02

1- 12 0.00 -0.02 -0.12 -0.31 -0.16 -0.06 -0.12 -0.18 -0.22 -0.10 0.04 -0.21

13- 24 -0.08 -0.02 -0.08 -0.08 0.02 -0.07 -0.17 -0.06 -0.03 -0.05 -0.06 -0.10

B34S Matrix Command Ending. Last Command reached.

Space available in allocator 7869781, peak space used 66744 Number variables used 74, peak number used 83 Number temp variables used 8617, # user temp clean 0 output from sca 80 Chapter 7

THE WORKSPACE REQUESTED EXCEEDS THE LICENSED LIMITATION. THE MAXIMUM WORKSPACE WITH 130000 WORDS IS ALLOCATED. THE SCA STATISTICAL SYSTEM ( RELEASE 8.0 ) SCA ADVANCED EDITION SOFTWARE IDENTIFICATION: HOUSTON STOKES ( 7071618 ) SOFTWARE RELEASE DATE: 4/ 1/2007 SOFTWARE RENEWAL DATE: 12/ 2/2010 COPYRIGHT (C), SCIENTIFIC COMPUTING ASSOCIATES CORP. ALL RIGHTS RESERVED

SIZE OF WORKSPACE IS 130000 SINGLE PRECISION WORDS DATE -- 7/19/2007 TIME -- 13:51:19 --

call myrun . file 'sca.cmd'

--

assign file 18. attrib access(read). external 'sca.dat'.

--

call procedure is mydata. file is 18.

--

Input variable is TIME . Precision is double.

TIME , A 296 BY 1 VARIABLE, IS STORED IN THE WORKSPACE; DOUBLE PRECISION --

Input variable is GASIN . Precision is double.

GASIN , A 296 BY 1 VARIABLE, IS STORED IN THE WORKSPACE; DOUBLE PRECISION --

Input variable is GASOUT . Precision is double.

GASOUT , A 296 BY 1 VARIABLE, IS STORED IN THE WORKSPACE; DOUBLE PRECISION --

Input variable is CONSTANT . Precision is double.

CONSTANT, A 296 BY 1 VARIABLE, IS STORED IN THE WORKSPACE; DOUBLE PRECISION --

RETURN.

--

acf gasin

NAME OF THE SERIES ...... GASIN TIME PERIOD ANALYZED ...... 1 TO 296 MEAN OF THE (DIFFERENCED) SERIES . . . -0.0568 STANDARD DEVIATION OF THE SERIES . . . 1.0710 T-VALUE OF MEAN (AGAINST ZERO) . . . . -0.9130

AUTOCORRELATIONS

1- 12 .95 .83 .68 .53 .41 .32 .26 .23 .21 .21 .20 .19 ST.E. .06 .10 .12 .13 .14 .14 .15 .15 .15 .15 .15 .15 Q 271 480 620 705 756 786 807 823 837 850 863 874

13- 24 .17 .14 .10 .08 .05 .04 .03 .04 .06 .07 .08 .08 ST.E. .15 .15 .15 .15 .15 .15 .15 .15 .15 .15 .15 .15 Q 883 889 892 894 895 895 896 896 897 899 901 903

-1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 ARIMA and Transfer Function Models 81

+----+----+----+----+----+----+----+----+----+----+ I 1 0.95 + IXX+XXXXXXXXXXXXXXXXXXXXX 2 0.83 + IXXXX+XXXXXXXXXXXXXXXX 3 0.68 + IXXXXX+XXXXXXXXXXX 4 0.53 + IXXXXX+XXXXXXX 5 0.41 + IXXXXXX+XXX 6 0.32 + IXXXXXX+X 7 0.26 + IXXXXXXX 8 0.23 + IXXXXXX+ 9 0.21 + IXXXXX + 10 0.21 + IXXXXX + 11 0.20 + IXXXXX + 12 0.19 + IXXXXX + 13 0.17 + IXXXX + 14 0.14 + IXXX + 15 0.10 + IXXX + 16 0.08 + IXX + 17 0.05 + IX + 18 0.04 + IX + 19 0.03 + IX + 20 0.04 + IX + 21 0.06 + IX + 22 0.07 + IXX + 23 0.08 + IXX + 24 0.08 + IXX + -- pacf gasin

NAME OF THE SERIES ...... GASIN TIME PERIOD ANALYZED ...... 1 TO 296 MEAN OF THE (DIFFERENCED) SERIES . . . -0.0568 STANDARD DEVIATION OF THE SERIES . . . 1.0710 T-VALUE OF MEAN (AGAINST ZERO) . . . . -0.9130

PARTIAL AUTOCORRELATIONS

1- 12 .95 -.79 .34 .12 .06 -.11 .05 .10 .02 -.07 -.09 .04 ST.E. .06 .06 .06 .06 .06 .06 .06 .06 .06 .06 .06 .06

13- 24 .09 -.14 .05 .03 -.02 .03 .09 -.04 -.09 .04 .04 .01 ST.E. .06 .06 .06 .06 .06 .06 .06 .06 .06 .06 .06 .06

-1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 +----+----+----+----+----+----+----+----+----+----+ I 1 0.95 + IXX+XXXXXXXXXXXXXXXXXXXXX 2 -0.79 XXXXXXXXXXXXXXXXX+XXI + 3 0.34 + IXX+XXXXX 4 0.12 + IXXX 5 0.06 + IX + 6 -0.11 XXXI + 7 0.05 + IX + 8 0.10 + IXX+ 9 0.02 + I + 10 -0.07 +XXI + 11 -0.09 +XXI + 12 0.04 + IX + 13 0.09 + IXX+ 14 -0.14 XXXI + 15 0.05 + IX + 16 0.03 + IX + 17 -0.02 + XI + 18 0.03 + IX + 19 0.09 + IXX+ 20 -0.04 + XI + 21 -0.09 +XXI + 22 0.04 + IX + 24 0.01 + I + -- iacf gasin

NAME OF THE SERIES ...... GASIN TIME PERIOD ANALYZED ...... 1 TO 296 MEAN OF THE (DIFFERENCED) SERIES . . . -0.0568 STANDARD DEVIATION OF THE SERIES . . . 1.0710 T-VALUE OF MEAN (AGAINST ZERO) . . . . -0.9130

INVERSE AUTOCORRELATIONS 82 Chapter 7

1- 12 -.68 .20 -.08 .14 -.07 -.02 .02 .01 .00 .03 -.13 .19 ST.E. .06 .06 .06 .06 .06 .06 .06 .06 .06 .06 .06 .06

13- 24 -.13 .01 .05 .01 -.07 .02 .06 -.06 .01 .01 -.00 -.00 ST.E. .06 .06 .06 .06 .06 .06 .06 .06 .06 .06 .06 .06

-1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 +----+----+----+----+----+----+----+----+----+----+ I 1 -0.68 XXXXXXXXXXXXXX+XXI + 2 0.20 + IXX+XX 3 -0.08 +XXI + 4 0.14 + IXXX 5 -0.07 +XXI + 6 -0.02 + XI + 7 0.02 + I + 8 0.01 + I + 9 0.00 + I + 10 0.03 + IX + 11 -0.13 XXXI + 12 0.19 + IXX+XX 13 -0.13 XXXI + 14 0.01 + I + 15 0.05 + IX + 16 0.01 + I + 17 -0.07 +XXI + 18 0.02 + I + 19 0.06 + IXX+ 20 -0.06 + XI + 21 0.01 + I + 22 0.01 + I + 23 0.00 + I + 24 0.00 + I + --

stop.

THE CURRENT SCA SESSION IS TERMINATED. THE SIZE OF THE WORKSPACE USED IS 7501 WORDS. ARIMA and Transfer Function Models 83

Output from RATS

* * Data passed from B34S(r) system to RATS * display @1 %dateandtime() @33 ' Rats Version ' %ratsversion() 07/19/2007 13:51 Rats Version 6.30000 * CALENDAR(IRREGULAR) ALLOCATE 296 OPEN DATA rats.dat DATA(FORMAT=FREE,ORG=OBS, $ MISSING= 0.1000000000000000E+32 ) / $ TIME $ GASIN $ GASOUT $ CONSTANT SET TREND = T TABLE Series Obs Mean Std Error Minimum Maximum TIME 296 148.500000 85.592056 1.000000 296.000000 GASIN 296 -0.056834 1.072766 -2.716000 2.834000 GASOUT 296 53.509122 3.202121 45.600000 60.500000 TREND 296 148.500000 85.592056 1.000000 296.000000

* correlate(inverse=iacf,partial=pacf) gasin Correlations of Series GASIN Autocorrelations 1: 0.95253779 0.83413209 0.68168550 0.53072632 0.40665092 0.31701543 0.25879154 0.22614739 0.21205906 0.20800318 0.20335891 12: 0.19057651 0.16912656 0.13928934 0.10580423 0.07518448 0.05067245 0.03498821 0.03177600 0.04055349 0.05532114 0.06936547 23: 0.07758285 0.07813073 0.07267261 0.06411299 0.05553218 0.05077777 0.05566864 0.07252808 0.09760733 0.12365399 0.14230951 34: 0.14629682

Partial Autocorrelations 1: 0.9525378 -0.7898430 0.3423794 0.1229630 0.0571043 -0.1159521 0.0538760 0.1030095 0.0144556 -0.0712140 -0.0971759 12: 0.0456839 0.0880063 -0.1440387 0.0475197 0.0463518 -0.0183938 0.0229140 0.0945437 -0.0351884 -0.0918057 0.0389534 23: 0.0341091 0.0072860 -0.0086676 -0.0347988 0.0637747 0.0909151 0.0710791 -0.0679597 -0.0244980 0.0149901 -0.0206180 34: -0.0568937

Inverse Autocorrelations 1: -0.6684529 0.1755190 -0.0829191 0.1529548 -0.0667278 -0.0310419 0.0076792 0.0082426 0.0220864 0.0275123 -0.1577110 12: 0.2144422 -0.1240967 -0.0065501 0.0236323 0.0605374 -0.0780930 -0.0149263 0.0670512 -0.0213067 -0.0098809 0.0070040 23: -0.0435674 0.0735187 -0.0344530 0.0121360 -0.0604066 0.0787326 -0.0219495 -0.0166064 -0.0080162 0.0367845 -0.0293580 34: 0.0083553

Note that while the ACF for chem agrees with Wei (2006), the PACF does not. ACF, PACF, ˆ(j ) IACF and ESACF are tested with SCA. Note that the extended AR coefficients are fm from (j ) (7.1-32) while the ESACF values are the autocorrelation of yt from (7.1-34). Based on the pattern, an AR(2) model is suggested, although the automatic identification procdedures of B34S and SCA suggest an ARIMA(1,1,0) model that produces an e' e = 4.0139 . An estimated AR(2), or ARIMA(2,0,0), model produced e' e = 3.8534 while an ARIMA(2,2) produced a still worse e' e = 4.36157 . The SCA output listed verifies the ESACF values produced by B34S. As indicated above, the IACF values of the programs SCA, RATS and B34S are quite different. This appears to be due to whether an AR(p) model is used to capture the structure in the series or the PACF is used and in addition the number of lags (p) used. The B34S implementation of the IACF is in two subroutines that allow user modifications as needed. 84 Chapter 7

7.9 Conclusion

OLS and ARIMA models were shown to be special cases of the more general transfer function model. The identification procedure for ARIMA and transfer function models has been discussed and illustrated with the gas furnace data and a macroeconomics problem, suggested by Stokes and Neuburger (1979), involving the relationship between interest rates and M2. Feedback was found between these series. A major problem in time series analysis is detecting spurious cross correlations that arise from the autocorrelation remaining in one or both of the series cross correlated. A detailed diagnostic test involving autocorrelating the cross correlations has been discussed and illustrated, using the above two data sets.

Recommended publications