18.0 BJIDEN Command The BJIDEN command allows the identification of ARIMA and TRANSFER function Box-Jenkins Models. Basic references include: - Box, George and Gwilym Jenkins, "Time Series Analysis, Forecasting and Control", Revised Edition Holden Day 1976. - Pack, David, "A Computer Program for the Analysis of Time Series Models Using the Box-Jenkins Philosophy. The B34S MATRIX command also has BJ capability including automatic BJ model identification and estimation. General form of the command. B34SEXEC BJIDEN parameters options $ VAR Xvar1 Xvar2 $ SERIESN VAR=Xvar1 NAME=(' ' )$ RTRANS parameters $ RAUTO Xvar1 Xvar2 $ RCROSS = ( Xvar1 Xvar3)(Xvar2 Xvar4) $ MODELPRE parameters options $ OUTPUT parameters options $ SPECTRAL options parameters $ PCROSS = (Xvar1 Xvar2)(Xvar3 Xvar4) $ MODELN options parameters $ STARTVALUE options parameters $ BISPEC options parameters$ TRISPEC options parameters$ POLYSPEC options parameters$ REVERSE options parameters$ B34SEEND$ The BJIDEN sentence has a parameter TYPE=key where key is set as either ARIMAI, TRANSI or STARTVAL. If TYPE=ARIMAI, for ARIMA model identification, required sentences are VAR and one or more of RAUTO or RCROSS. If TYPE=TRANSI, for transfer function model identification, required sentences are VAR, MODELPRE, OUTPUT. If TYPE=STARTVALUE, for calculation of starting values, the required sentence is STARTVAL. Unless otherwise noted, all real data input is limited to 8 digits including the constant. Options for BJIDEN sentence. CPLOT - Causes all variables listed with PLOT parameter to be plotted using compressed (one page) plot option. CPLOT is the default. EPLOT - Causes all variables listed with PLOT parameter to be plotted using extended (more than one page) plot option. IAUTCR - Causes autocorrelations of cross correlation to be calculated. IWTPCC - Causes cross correlations to be plotted. MPRINT - Suppresses printing of autocorrelations. MPRCCF - Suppresses printing of cross correlations. MCSE - Suppresses SE calculations. IWTPA - Give plots of autocorrelations. IWBF - Uses backforecasting to generate prewhited series. IWPREW - Use Liu-Hanssens method of identifying transfer function model. Parameters for BJIDEN sentence. TYPE=key key = ARIMAI for ARIMA model identification. key = TRANSI for transferfunction model identification. key = STARTVALUE for starting values calculation. The default for key is ARIMAI. Note that the key values ARIMAI, TRANSI and STARTVALUE can also be specified as either options or parameters. LIST=(Xvar1 Xvar2) Specifies the variables mentioned in VAR sentence to list. PLOT=(Xvar1 Xvar2) Specifies the variables mentioned in VAR sentence to plot. NAC= n1 Max # of autocorrelations desired. Max = 150. Default=24. NPAC= n2 Max # of partial autocorrelations. Must be LE NAC. Default=NAC. NAPL= n3 Sets number of autocorrelations and partial autocorrelations printed per line. Max=12. Default=12. NCHI= n4 Sets # of autocorrelations used to calculate chi square. NCHI must be LE NAC. If NCHI not specified, NCHI defaults to min(NAC, 24). NCC = n5 Sets maximum number of raw cross correlations. Max=54. Default=24. NIRW= n6 Sets # of prewhitened cross correlations calculated. Max = 54. Default=24. NWTGN= n7 Sets # of estimated impulse response weights used to calculate an estimate of the noise. NWTGN must be LE NIRW. Default=NIRW. IRWCNT=n8 Saves impulse response weights on unit IRWUNI with name SDATAn8. The BJIDEN TYPE=STARTVALUE will read these weights. If more than one set was saved, the name will be SDATAk where k = n8 + 1 etc. IRWUNI=n9 Sets unit to save impulse response weights in SCA format with name set by IRWCNT parameter. Default=9. Must be set =0, =9 or GT 25. Note this file format is not an FSV format. It must be read with the SCAIO command NOT the SCAINPUT command. IBEGIN=n10 Sets initial observation for analysis. Default=1. IEND=n11 Sets last observation for analysis. Default=NOOB. irsav=n12 Sets unit (usually 44) for saving of INPUT, OUTPUT prewhitened input (PW_INPUT and filtered output FILTEROUT. VAR sentence. VAR Xvar1 Xvar2 Xvar3 $ Used to specify up to 6 variables. If TYPE=TRANSI in BJIDEN sentence, and K series were supplied in VAR sentence, then there must be K-1 MODELPRE VAR=Xvar1 sentences to specify a prewritening model for each potential right hand variable. If the two filter method of identification is desired, then specify the last two variables the same. SERIESN sentence. SERIESN VAR=Xvar1 NAME=('Up to 65 characters here') $ The SERIESN sentence allows the user to optionally supply a longer name for the series than the variable name. If the SERIESN sentence is used, the parameters VAR and NAME must be supplied. It is recommended that the SERIESN sentence be used. RTRANS sentence. RTRANS VAR = Xvar1 PLAM=r1 DIF=(n1 n2)(n3 n4) TM=r3 $ The RTRANS sentence allows the user to optionally transform the data for the RAUTO and RCROSS sentences. It the parameter VAR is set, the RTRANS sentence sets PLAM and TM for that variable. If the VAR sentence is not used, the RTRANS sentence sets the differencing for all series. Parameters for RTRANS sentence. VAR=Xvar Optionally sets variable name. PLAM=r1 If r1 = 1.0, the data is unchanged. This is the default. If r1 = 0.0, the newseries = ln(oldseries + TM). If r1 NE 0 and NE 1, newseries = (oldseries + TM)**r1. TM = r2 Specifies constant to add to data to allow transform. DIF=(n1 n2)(n3 n4) Specifies differencing. First integer in ( ) is the number of differences, the second integer is the order of the differences. In the first ( ), n1 is limited to a max of 2. If DIF=(2 1)(1 12), the ACF will be calculated on 5 series: raw series, first differenced series, second differenced series, first and seasonally differenced series and second and seasonally differenced series. There is a max of 3 seasonal factors. RAUTO sentence. RAUTO Xvar1 Xvar2 $ The RAUTO sentence specifies what variables listed on the VAR card should be autocorrelated. RCROSS sentence. RCROSS=(Xvar1 Xvar3)(Xvar2 Xvark) option $ The RCROSS sentence lists variables for which cross correlations are desired. If SPECTRAL is specified as an option, spectral analysis is also done and spectral output will be listed, unless the SPECTRAL sentence is given to call for plots and other output. PCROSS sentence. PCROSS=(Xvar1,Xvar2)(Xvar3,Xvar6) option$ The PCROSS sentence is required if TYPE=TRANSI on BJIDEN sentence. The PCROSS sentence sets the variables to use for prewhitened cross correlation analysis. If the second series inside the ( ) is the last series listed on the VAR sentence, one filter cross correlations will be performed using the filter listed for the first series. While this filter will be applied to the second series, the differencing and transformations listed on the OUTPUT sentence will be used on the secods series. If the second series is not the last series on the VAR sentence, two filter cross correlation analysis will be done. If SPECTRAL is specified as an option, spectral analysis is also done and spectral output will be listed, unless the SPECTRAL sentence is given to call for plots and other output. BISPEC sentence. The BISPEC sentence performs various nonlinearity, gaussianity and martingale tests suggested by Hinich. Any transformations called for on the BISPEC sentence are only for these tests and have no effect on any other options in other sentences in the command. The BISPEC sentence tests at which frequencies there is evidence of nonlinearity and whether there is memory (there is a Martingale). The form of the BISPEC sentence in the BTEST and BTIDEN commands is the same. To save space, detail for this sentence is listed only under the BTIDEN command help file. If the BISPEC sentence is given with no options or parameters, gaussianity and nonlinearity tests will be performed. TRISPEC sentence The TRISPEC command performs 4th order nonlinearity tests suggested by Hinich. Further detail on this sentence is listed under the BTIDEN command. POLYSPEC sentence The POLYSPEC command performs various nonlinearity tests suggested by Hinich within the sample. Further detail on this sentence is listed under the BTIDEN command. REVERSE sentence The REVERSE sentence performs various Time reversability tests suggested by Hinich and Rothman. Further detail in this sentence is listed under the BTIDEN command. SPECTRAL sentence. SPECTRAL options parameters. The SPECTRAL sentence is used to control spectral analysis of series listed on the RCROSS or PCROSS sentences. If the SPECTRAL sentence is not supplied, spectral values will only be listed. Options on the SPECTRAL sentence. DETREND - Set to detrend the series prior to spectral analysis. PUNCHE - Punches all spectral quantities on UNIT in format 5E16.8. PUNCHA - Punches all spectral qunatities on UNIT in format 10A4. Parameters on the SPECTRAL sentence, NFREQ = n1 Sets # of frequencies. Defaults to NCC. XINDSP1= r1 Sets constant time interval. Default = 1.0 . Max of 5 digits allowed. XINDSP2= r2 If set, prewhitens all series with an AR(1) model with coef = r2. Max of 5 digits allowed. PLOT=(key1, key2) Controls plotting of spectral quantities. Keywords supported with PLOT parameter. COSPEC - Plot cospectrum. QSPEC - Plot quadrature spectrum. ACROSSPEC - Plot Amplitude of cross spectrum. PHASESPEC - Plot phase spectrum. ATRANSXY - Plot amplitude of transfer function from series X to Y. ATRANSYX - Plot amplitude of transfer function from series Y to X. COHSQ - Plot coherency square. POWERSPX - Plot power spectrum for X. POWERSPY - Plot power spectrum for Y. UNIT = n2 Unit for punching. Default = 7. MODELPRE sentence. The MODELPRE sentence allows the user to input the prewritening model, estimated in a prior run, to filter the X series and be applied to the Y series. If NSERIE series are listed in the VAR sentence and TYPE=TRANSI, there must be NSERIE - 1 MODELPRE sentences and one OUTPUT sentence. Variables to prewhiten and cross correlate are listed on the PCROSS sentence. The one filter method will be used if in the PCROSS sentence the second of the two series within the ( ) is the last series listed on the VAR sentence. If this is not the case, the two filter method of analysis will be used. Differencing for the Y series (the series filtered with the X series filter) will be input on the OUTPUT sentence. If the Liu-Hanssons option has been set (IWPREW), an initial common filter is specified on the MODELPRE sentences, in place of the prewhitening model, for each input series. The autoregressive (P) and moving average must be supplied the same while the transformation parameters, differencing factors, mean and trend should not be the same as thoes supplied in the prewhitening model, i. e. they do not have to be the same. MODELPRE sentence parameters. VAR=Xvar - Sets series name. VAR is a required parameter. P=(n1,n2)(n3,n4) - Inputs orders of AR model. Q=(n5,n6)(n7,n8) - Inputs orders of MA model. AR=(r1,r2)(r3,r4) - Inputs values for AR coefficients. MA=(n5,n6)(n7,n8) - Inputs values for MA coefficients. Note: The max number of coefficients in P and Q is limited to 10 in this release. The total number of factors in P and Q (# of ( ) ) is 6. DIF=(n1,n2)(n3,n4) - Specifies differencing operators. The first term inside ( ) is the number of differences, the second term is the order of differencing. There is a max of three differencing factors. AVEPA=r1 - Sets average for series. Assumed= 0.0 if no differencing, not needed if there is differencing. PLAM=r2 If r2 = 1.0, the data is unchanged. This is the default. If r2 = 0.0, the newseries = ln(oldseries + TM). If r1 NE 0 and NE 1, newseries = (oldseries + TM)**r1. TM = r3 Specifies constant to add to data to allow transform. TREPA=r4 Specifies trend estimate for series. OUTPUT sentence. The output sentence specifies transformations to be applied to the output series (Y series) or last series mentioned on the VAR sentence. When doing one filter cross correlation analysis, the OUTPUT sentence parameters are used instead of the parameters listed on the MODELPRE sentence. OUTPUT sentence parameters. DIF=(n1,n2)(n3,n4) - Specifies differencing operators. The first term inside ( ) is the number of differences, the second term is the order of differencing. There is a max of three differencing factors. AVEPA=r1 - Sets average for series. Assumed= 0.0 if is no differencing, not needed if there is differencing. PLAM=r2 If r2 = 1.0, the data is unchanged. This is the default. If r2 = 0.0, the newseries = ln(oldseries + TM). If r1 NE 0 and NE 1, newseries = (oldseries + TM)**r1. TM = r3 Specifies constant to add to data to allow transform. MODELN sentence. The MODELN sentence is used to optionally supply differencing on estimated noise. MODELN sentence parameters. DIF=(n1,n2)(n3,n4) - Specifies differencing operators. The first term inside ( ) is the number of differences, the second term is the order of differencing. There is a max of three differencing factors. Example: Input model (1- .5B**2)((1-B)**2)Y = (1-.7B**5)e. MODELPRE VAR=Y P=(2) Q=(5) AR=.5 MA=.7 DIF=(2,1)$ STARTVALUE sentence. The STARTVALUE sentence is used to analyse estimated impulse response weights and obtain starting values for alternative models. The STARTVALUE sentence is required if TYPE=STARTVALUE on the BJIDEN sentence. Impulse response weights are saved using the IRWCNT parameters on the BJIDEN sentence of a previous BJIDEN TYPE=TRANSI sentence. For further detail, see IRWCNT and IRWUNT parameters on BJIDEN sentence. STARTVALUE sentence parameters RUFILE=key - Sets SCA file name. For example if IRWCNT=8, the response weights were saved on UNIT with the name SDATA8. To read this file set RUFILE=SDATA8. The default is SDATA1. NTERMS=(n1,n2,n3) - Sets up to 100 numerator orders. Required. DTERMS=(n4,n5,n6) - Sets up to 100 denominator terms. PRINT=(key1,key2) - If key = HA will print H and A matrix. For detail see Box and Jenkins. key = RW will print response weights to check input. Note that PRINT accepts up to 2 arguments. IUNRW=i - Sets the file inout unit. Usually not set. If this is used, IRWUNI must be set on step that creates SCA save file for response weights. It this is not used, unit=9 is used. ******************** Sample Jobs: Simple ACF of two series series. b34sexec bjiden type=arimai list=(gasin gasout) plot=(gasin gasout) nac=24 $ var gasin gasout$ seriesn var=gasin name=('series # 1 from bj gas input ') $ seriesn var=gasout name=('series # 2 from bj gas output') $ rtrans dif=(2 1)(1 12) $ rauto gasin gasout $ b34seend$ Simple BJ transfer function model identification using prewhitening model on X series. Spectral analysis is done on prewhitened and raw series. Estimated impulse response series are saved as SDATA5 and used to calculate starting values for two models using STARTVALUE option. b34sexec bjiden type=transi ncc=50 irwcnt=5$ var gasin gasout$ seriesn var=gasin name=('series # 1 from bj gas input') $ seriesn var=gasout name=('series # 2 from bj gas output') $ modelpre var=gasin p=(1,2,3) ar=(1.97494,-1.3732,.3424) avepa=-.061 $ output var=gasout avepa=53.507996 $ rcross=(gasin,gasout) spectral $ pcross=(gasin,gasout) spectral $ spectral nfreq=50 plot=(atransxy atransyx) $ b34seend$ b34sexec bjiden type=startvalue$ startvalue nterms=(1,2,3,4,5) dterms=(1,2,3) rufile=sdata5 print=(h,rw)$ b34seend$ b34sexec bjiden type=startvalue$ startvalue nterms=(1,2,3) dterms=(1,2,3) rufile=sdata5$ b34seend$