20.0 BTIDEN Command
The BTIDEN command is to used to identify a VAR, VARMA or VMA
model. Basic references are:
- Tiao, G., G. Box, M. Grupe, G. Hudak, W. Bell, I Chang,"The
Wisconsin Multiple Time Series (WMTS-1) Program, A Preliminary
Guide," unpublished technical report, Department of
Statistics, University of Wisconsin.
- Tiao, G. and G. E. P. Box, "Modeling Multiple Time Series with
Applications," Journal of the American Statistical Association,
1981, Vol 76, pp 802-816.
- Box, G., G. Tiao, "A Canonical Analysis of Multiple Time Series,"
Biometrika, 1977, Vol. 64, pp. 355-366.
- Hinich, Melvin, "Testing for Gaussianity and Linearity of a
Stationary Time Series," Journal of Time Series Analysis, Vol. 3,
No. 5., 1982, pp. 169 - 176.
- Hinich, Melvin and Douglas Patterson, "Evidence of Nonlinearity
in Daily Stock Returns," Journal of Business and Economic
Statistics, Vol. 3, No. 1, January 1985, pp. 69 - 77.
- Hinich, Melvin, Ashley, Richard and Patterson, Douglas,
"A Diagnostic Test for Nonlinear Serial Dependence in Time Series
Fitting Errors," Journal of Time Series Analysis, Vol. 7,
No. 3, 1986, pp 165 - 178.
- Hinich, Melvin , Patterson, Douglas, "A Bispectrum Based Test on
the Stationary Martingale Model," unpublished manuscript dated 13
August 1986.
- Hinich, Melvin, Wolinsky, M. A. , "A Test for Aliasing Using
Bispectral Estimates," Journal of the American Statistical
Association, Vol. 83, No. 402, June 1988, pp. 499 - 502.
- Dalle Molle, John & Melvin Hinich, "Trispectral Analysis",
unpublished manuscript Applied Research Laboratories, The
University of Texas at Austin, 1991.
- Hinich, Melvin., "Testing for Dependence in the Input to a
Linear Time Series Model," unpublished manuscript dated 28 May
1993 published in Nonparametric Statistics 6, 205-221.
- Ramsey, James and Philip Rothman., "Time Irreversibility and
Business Cycle Asymmetry," Journal of Money Credit and Banking,"
Vol. 28, No. 1 (February 1996), 1-12
- Hinich, Melvin and Philip Rothman., "Frequency-Domain Test of
Time Reversibility," Macroeconomic Dynamics, Vol. 2, 1998, 72-88.
- Rothman, Philip., "Fortran Programs for Running the TR Test: A
Guide and Examples," in Studies in Nonlinear Dynamics and
Econometrics, Vol. 1, No. 4 (January 1997), 203-208
Form of BTIDEN command.
B34SEXEC BTIDEN options parameters $
TITLE=(' ') $
SERIESN VAR=Xvar1 NAME=(' ') DIF=( )( ) TM=r1 PLAM=r2$
BISPEC options parameters $
TRISPEC options parameters $
POLYSPEC options parameters $
REVERSE options parameters $
IDEN options parameters $
ESTVAR options parameters $
B34SEEND$
A BTIDEN command must specifiy either the IDEN or the ESTVAR
sentences, but not both. The IDEN sentence is used to perform cross
correlation analysis. If the IDEN sentence is present, the maximum
number of series is 5. The ESTVAR is used to estimate a VAR model. The
maximum number of series here is 30. In the BTIDEN paragraph, a SERIESN
sentence must be supplied for each series loaded. The BISPEC, POLYSPEC
and TRISPEC sentences allow nonlinear tests for be performed following
Hinich.
BTIDEN sentence parameters.
IBEGIN=n1 Sets beginning observation. Defaults to 1.
IEND=n2 Sets ending observation. Defaults to NOOB.
NSTDER=r1 Sets number of standard errors for ACF and CCF +, - .
plots. Default = 2. NSTDER must be specified as LE 5
digits and GE 0.0 .
TITLE sentence.
TITLE=('Any title here up to 80 characters')$
The TITLE sentence is optional.
SERIESN sentence.
The SERIESN sentence controls variable input, and optionally
additional variable naming and transformation.
Parameters for SERIESN sentence.
VAR=Xvar Specify input variable. This parameter must be supplied.
NAME=(' A max of 65 characters additional name description here')
TM=r1 Specifies a constant to add to the data.
PLAM=r21 Specifies Box - Cox Transformation. If PLAM is not set,
the data is unchanged. If PLAM is set to 0.0,
XNEW=DLOG(XOLD + TM). If PLAM GE .0001
XNEW=(XOLD + TM) ** PLAM.
DIF=(n1,n2)(n3,n4) Specifies differencing. There is a max of two
differencing factors (). The first integer in
( ) is the number of differences, the second
integer is the order of the difference. For
example DIF=(1,1)(1,12) is first differencing
and seasonal differencing.
20.1 Hinich Nonlinearity Tests on One Series
Note: The BISPEC sentence can be called from the following commands:
BJIDEN, BJEST, BTIDEN, BTEST, RR, REG, ROBUST, MARS, PISPLINE.
BISPEC sentence.
The BISPEC sentence performs various nonlinearity and 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 bispectrum
tests at which frequencies there is evidence of nonlinearity, lack of
gaussianity and whether the process follows a martingale process. The
BISPEC sentence is the same for the BTIDEN, MARS, REG, ROBUST, BJIDEN,
BJEST and BTEST paragraphs.
The BISPEC sentence calls up a number of programs for analysis.
- BISP is the basic program to test for gaussianity and
nonlinearity using the Hinich (1982) tests.
- NBISP is similar to BISP except that it uses a block read feature
to allow unlimited numbers of observations. The output also has a
few additional features. For small observations, BISP is more
accurate since it does not use the block read approach. Unless
the block size selected goes into the number observations evenly,
not all observations will be used in the analysis. If aliasing
is suspected use the PD region. Otherwise use IT and OT for
transients. To test for aliasing change sampling rate and
observe what happens to spectrum. If spectrun tapers off at
high frequency, this is consistent with no aliasing problem.
Aliasing is a frequency counterpart to aggregation bias.
- OLDMARTIN uses a block read option to test for Martingales. The
MARTIN test should not be run unless the data is white noise. An
appropriate way to test for white noise is by use of the ACF.
If residual is independent, then it follows a MD and is white.
If residual is a MD this means that the differnece between the
actual data and the conditional expectation is not predictable
by past information. The error variance may or may not be
predictable (See ARCH models). White noise only means that
ACF is clean. It is not recommended that OLDMARTIN be used since
the MARTIN program, discussed below, is far superior in power
and ease of use.
- MARTIN allows testing whether the Martingale assumption is
violated. A process X(t) is a Martingale if E(X(t+1)) = X(t).
The martin test is called by the command IMART. If only this
command is given, the blocksize used (LBL) will be set as
LBL =2 * IDINT(.9D+00 * DSQRT(NOB)) and the test will be run.
If NBD is set > 1, then the test will be calculated with
blocksizes LBL, LBL+NBD, LBL + (2*NBD), ..., LBU, where
LBU =2 * IDINT(1.1D+00* DSQRT(NOB)). The V paramater allows
the user to set the integer V notch size MV as
IDINT(.01D+00 * V * DFLOAT(LB) + .5d+00).
- CLIP allows data clipping for all programs to reduce kurtosis.
Two types of clipping are possible.
- Hinich (1993) suggests a normally distributed V statistic to test
for second order dependence and a normally distributed H
statistic to test for third order dependence. V and H can be
calculated for the complete sample, or for overlapping or
non overlapping window subsets. The autocorrelation function of
the V and H statistics for the subset periods can be used to
detect possible recurring periods of nonlinearity.
- Hinich (1994?) has suggested a number of tests for nonlinearity
within the sample. These are called with the POLYSPEC sentence.
- Tests developed by Melvin Hinich for bivariate nonlinearity
analysis are called from the MVNLTEST command documented
in section 41.0.
- The BISPEC sentence controls calculation of Dickey-Fuller tests,
Phillips-Perron Tests and Engle Lagrangian Multiplier tests
- As implemented, the Tsay test should be applied to prewhitened
data such as residuals not raw series.
Overview of some uses of BISPEC command.
BISPEC IOLDSP $ will give default gaussianity and linearity
tests.
BISPEC IAUTO$ will give gaussianity and linearity tests
over a range of M values.
BISPEC IAUTO ITURNO $ will turn off all output but summary tables.
BISPEC INEWSP IMART INAUTO IAUTO ITURNO $ will turn on
all three
programs and
give summary
tables.
BISPEC IAUTO ITURNO IMART NBD=1 V=.1$ Gives gaussianity,
linearity and martingale
tests and reduces output.
BISPEC VHTEST$ Gives V and H bicovariance
tests for complete sample.
BISPEC VHTEST VHWINDOW$ Gives V and H bicovariance
tests for complete sample
and for windows.
BISPEC DF ADF(1,2,3) ADFT(1,2,3)$ Gives various Dickey-Fuller
tests for complete sample.
BISPEC PP APP(1,2,3) APPT(1,2,3)$ Gives various Phillips-
Perron tests for complete
sample.
BISPEC LM(1,2,3)$ Gives various Engle
Lagrangian multipler tests
for complete sample.
Options for BISPEC sentence.
IAUTO - Searches over values (ILOW - IUPP) of M and calculates all
indicated tests using BISP program. This tests the
sensitivity of the test to the value of M.
ISMOO - Smooths the estimated spectrum (estimated with BISP) with
a cosine bell in frequency domain. If ISMOO is not set
each spectral estimate will be set = to variance of
series. It is important to set ISMOO if the estimated
series is not white because in this situation the spectrum
is not flat. If ISMOO is set see also NWD value.
FREQ - Gives frequency values in BISP program. This is the
default.
PERIOD - Gives period values in BISP program.
IOLDSP - Turns on BISP program.
INEWSP - Turns on NBISP program.
IMART - Turns on new MARTIN program.
IOMART - Turns on old MARTIN program.
NYVAR - To normalize bispectrum in NBISP by spectrum. If this
option is selected the NNW parameter sets the width of the
cosine bell used to smooth the spectrum. If NYVAR is not
present, the bispectrum is normalized by the sample
variance.
NISUM - Give summary output from NBISP in condensed form on unit
37. Note. This option is rarely needed.
NIBIT - Give bispec estimates from NBISP program.
NIPERD - Give output from NBISP program by period instead of
frequency.
INAUTO - Estimate NBISP for NLB going from ILNLB to IUNLB. If this
option is used, the user may want to turn off output with
the ITURNO option.
ITURNO - Turns off all but summary tables if IAUTO, INAUTO or
IMAUTO was specified. Output is "turned off" by diecting
it to unit 7 which has been made a DUMMY file in B34S JCL.
BDS - Turn on BDS test for default options of BDS which are:
BDSEPS=.5, BDSORDER=5
TSAY - Turn on TSAY (1986) nonlinearity test for default order
which is TSAPORDER=3.
------- Old Martin Program options ----------
MIBISW - Output the bispectrum from the old MARTIN program.
IMAUTO - Estimate the MATRIN program for MLB going from ILMLB to
IUMLB and MV going from ILMV to IUMV. If this option is
used, the user may want to turn off output with the ITURNO
option.
Parameters for BISPEC sentence.
CLIP=r1 Sets the data clip value that will transform all series
prior to running tests to reduce kurtosis. This
transformation reduces bias in the Hinich tests but
reduces their power. Assume clip = 2.0. This means
that (x(t)-mean(x)) + (2.0 * sd) and (x(t)-mean(x)) -
(2.0 * sd) are upper and lower bounds on the data. If
clip is set =2.0, then the 2% is clipped from the
extreams of the data.
------- BISP parameters ------------
ILOW=n1 Sets lower value of M for BISP program. Default =
SQRT(NOOB/3) where NOOB is the number of observations in
the series.
IUPP=n2 Sets upper value for M for BISP program. Default =
SQRT(N).
M=n3 In BISP program M**2 = the number of terms averaged to
estimate the bispectrum at the center of the square. M
large means that the bandwidth is large and the resolution
is small. The variance is reduced by a large M, but there
will be too few terms to sort for the linearity test. If M
is small, there are a lot of terms to sort, but the
variance may be too large and the chi square approximation
will not be good since there are fat tails. Default =
SQRT(N).
NWD=n4 Sets width of smoothing cosin for BISP program. Default =
3*M. NWD must be in range 0 < NWD < (N/4) . For further
see ISMOO option.
ISAVE=n5 Sets unit to save M G and L if IAUTO is in effect. This
command is designed to be use to determine SIZE of
Hinich (1982) test. It is not a command intended for
the general user.
--------- NBISPEC parameters ----------------
NLB =n6 Sets the blocksize for NBISP program. Default=SQRT(N). NLB
must be even. (M/N) = (1/NLB). Max = 256. The NBISP
program reads NLB observations at a time. If NLB does not
go into N evenly, not all observations are used.
NNW =n7 Sets width of smoothing cosin for NBISP program. Must be
odd. If not odd, resets to NNW-1. See also NYVAR option.
ILNLB=n8 Lower bound for NLB search for NBISP program. Used if
INAUTO has been set. Default = .9 * SQRT(N) -1 (must be
even).
IUNLB=n9 Upper bound for NLB search for NBISP program. Used if
INAUTO has been set. Default = 1.3* sqrt(n) + 1 (must be
even).
PVAL=r2 Probability value for NBISP program. Default = .05. User
must input a max of 5 digits in range 0 < PVAL < .9999.
--------- New Martin parameters --------------
NBD =n10 Sets blocksize delta for the new martin program. Default
is nob + 1 or one pass.
V = r2 Sets V notch parameters for new martin program.
--------- Old Martin paramaters --------------
MLB =n11 Sets blocksize for MARTIN program. Default = SQRT(N). MLB
must be even. Max = 128. If MLB does not divide into N
evenly, observations will be lost.
MV = n12 V notch for the MARTIN program. 0 < MV < 32. The V notch
is used to remove matringale terms in the second part of
the MARTIN test. Default = .1 * MLB. Suggested range .1 -
.2 of MLB
ILMLB=n13 Lower bound of MLB for MARTIN program. Used if IMAUTO has
been set. Default = .9 * SQRT(N) -1. (ILMLB must be even).
IUMLB=n14 Upper bound for MLB for MATRIN program. Used if IMAUTO has
been set. Default = 1.3 * SQRT(N) + 1. (IUMLB must be
even).
ILMV=n15 Sets lower bound for MV in MARTIN program. Default=1.
Minimum value = 1. ILMV is only used if IMAUTO has been
set.
IUMV=n16 Sets upper bound for MV in MATRIN program. Default= MLB/2.
Max value = 31. IUMV is only used if IMAUOT has been set.
---------- V, H, unit root and ARCH tests
LM This is the same as LM(1). If LM is present, cannot
use form LM( ).
LM(n) Calculates Engle(1982) Lagrange multiplier test.
Up to 10 lags can be set. Output includes lamda
and the chi squared probability. Tests runs
e(t)**2 = f(e(t-1)**2,...,e(t-n)**2) for up
to 10 distinct lags.
ACF(n) Calculates the autocorrelation function of the variable.
Max n = 999
PACF(n) Calculates the partial autocorrelation function of the
variable. Max of n is the n in the ACF.
ACFVARSQ(n) Calculates the Autocorrelation function of the variable
squared. This is used to test the residuals for ARCH
effects. Max n = 999
PACFVARSQ(n) Number of terms for partial autocorrelation function
of the variable squared. Max of n is the n in ACFVARSQ.
TUNITROOT Uses t statistic form of Dickey-Fuller and Phillips
Perron test. This is the default.
ZUNITROOT Uses z statistic form of Dickey-Fuller and Phillips
Perron test.
DF Calculates Dickey-Fuller test of form y(t)=f(y(t-1))
Uses Case I of table B.6 or B.5 depending whether
TUNITROOT or ZUNITROOT is in effect.
ADF( ) Calculates augmented Dickey-Fuller test of form
y(t)=f(a, y(t-1), (y(t-1)-y(t-2),,,) depending on
lags set. A max of 10 distinct lags can be used.
Lag orders are in range (1,...,(T-2)). If ADF( ) is
supplied, in addition lag 0 is given. This corresponds
to the RATS command @DFUNIT(TTEST,LAG=0) series.
Uses Case II of table B.6 or B.5 depending whether
TUNITROOT or ZUNITROOT is in effect.
ADFT( ) Calculates augmented Dickey-Fuller with trend test of form
y(t)=f(a, t, y(t-1), (y(t-1)-y(t-2),,,) depending on
lags set. A max of 10 distinct lags can be used.
Lag orders are in range (1,...,(T-2)). If ADFT( ) is
supplied, in addition lag 0 is given. This corresponds to
the RATS command @DFUNIT(TTEST,TREND,LAG=0) series.
Uses Case IV of table B.6 or B.5 depending whether
TUNITROOT or ZUNITROOT is in effect.
PP Calculates Phillips-Perron test of form y(t)=f(y(t-1))
Uses Case I of table B.6 or B.5 depending whether
TUNITROOT or ZUNITROOT is in effect. Zero lags are
assumed for the calculation of lamda squared.
APP( ) Calculates augmented Phillips-Perron test of form
y(t)=f(a, y(t-1)) and uses alternate lags for obtaining
lamda squared. A max of 10 distinct lags can be used.
Lag orders are in range (1,...,(T-2)). If APP( ) is
supplied, in addition lag 0 is given. This corresponds to
the RATS command @PPUNIT(TTEST,LAGS=0) series.
Uses Case II of table B.6 or B.5 depending whether
TUNITROOT or ZUNITROOT is in effect.
APPT( ) Calculates augmented Phillips-Perron with trend test of
form y(t)=f(a, t, y(t-1)) and users alternative lags for
obtaining lamda squared. A max of 10 distinct lags can be
used. Lag orders are in range (1,...,(T-2)). If APPT( ) is
supplied, in addition lag 0 is given. This corresponds to
the RATS command @PPUNIT(TTEST,TREND,LAGS=0) series.
Uses Case IV of table B.6 or B.5 depending whether
TUNITROOT or ZUNITROOT is in effect.
Notes on Phillips-Perron tests. The B34S uses the Hamilton (1994)
formulas in calculating the Phillips-Perron test. If the command
B34SEXEC OPTIONS DEBUGSUBS(RATSPP)$ B34SEEND$
is placed in the command stream prior to calling the Phillips-Perron
test, the corrected RATS formulas will be used. For further detail see
Stokes (1997 Chapter 12 footnote 14).
VHTEST Calculates V and H test for complete sample.
VHWINDOW Calculates V and H test for windows of data. Unless
the parameter WINDOW is supplied, the default window will
be MAX0(12,NOB/30). Unless set, NAC will default to
(# V and H values)/4 and NPAC will default to 0.
If LM, DF, PP etc are set, these will be calculated
also.
VHSAVE Saves V and H data in SCA FSAVE file on unit ISCAU having
name SCADSN. Series saved are WINDOWNM, OBSSTART, OBSEND,
V_STAT, H_STAT, CENTER. If LM( ), DF, ADF( ), ADFT( ),
PP, APP( ), APPT( ) are set, these will be saved also
with the names LM001 ... DF001... PP001 etc.
PLOTACF Plots ACF and PACF
LISTVH List V and H statistics.
ICLIPP Uses individual clipping for each window. If this is not
supplied, clipping is done for the complete sample and
then broken up for each window.
C=r1 Sets number of lags to use. Default = .4. The number of
lags L = NOB**C.
WINDOW=n1 Sets number of observations in the window. Default is
MAX0(12,NOB/30). WINDOW can never be set < 12 or greater
that NOB.
POVERL=r2 Sets percent overlap for windows. Default = .5.
ISCAU=n2 Sets SCA FSAVE unit for use with VHSAVE. Default = 44.
SCADSN=k Sets SCA FSAVE DSN prefix. A Max of 5 characters
is allowed. Default VHSAV1..VHSAVk.
NAC=n3 Sets number of autocorrelations to calculate on windows.
Default is MIN0(NWIN/2,150) where NWIN = the number of
observations in the window.
NPAC=n4 Sets number of partial autocorrelations to calculate.
NAPL=n5 Sets number of acf's to print per line. Max = 12. Default
= 12.
CLIPP=r3 Sets clip percentage for V and H statistic. Default = 0.0.
r3 must be LT 50.00.
WINDOWU=n5 Sets upper limit for window. For further detail see
WINDOW above.
NWINDOW=n6 Sets number of sets of windows. If WINDOWU > WINDOW and
NWINDOW = 0, then NWINDOW defaults to 3.
TRISPEC sentence.
The TRISPEC sentence provides tests of nonlinearity and
Gaussianity using the trispectrum. In words, the linearity tests whether
in fact E[x(t),x(t+k),x(t+j),x(t+l)] = 0 where k > 0, l > 0, j > 0 and
j NE k NE l. The subroutines used in the TRISPEC sentence were developed
by Melvin Hinich and J. W. Dalle Molle.
TRISPEC sentence options.
SPNORM - Normalize by spectrum. This option should be used
if the series in not second order white. The default
is to normalize by variance. If SPNORM is set and
TWIND is not set, then no smoothing is done.
SPECOUT - Output the spectrun on unit SPUNIT.
SPECOUT2 - Output the spectrun & spectogram on unit SPUNIT.
NOSIGTRI - Turn off the default option of output showing
trispectrum values that are significant at the TPV
level. If this option is not used, the user can see
at what periods or frequencies the 4th order
linearity assumption is rejected.
FREQOUT - The default is to output in periods. FREQOUT will
output in frequency units.
TRIOUT - Output all trispectrum values on unit TRUNIT.
SUMOUT - Output summary statistics on unit SUMUNIT.
TRISPEC sentence parameters.
SPUNIT=n1 - Sets unit for spectrum values. Default = 51.
This option is needed if SPECOUT or SPECOUT2
are supplied.
TRUNIT=n2 - Sets unit for trispectrum values. Default = 52.
This options is needed if TRIOUT option is used.
SUMUNIT=n3 - Sets unit for summary output. Default = 6. This
option is needed if SUMOUT is supplied.
TLB=n4 - Sets block length for trispectrum calculation. The
default is to set n4 = NOOB**(1/3). n4 should be GE
6. This implies that meaningful analysis requires
the sample size be GE 216.
TPV=r1 - Sets probability value to use for significant
trispectrum values. Default = .005.
PTAP=r2 - Sets percent taper. Default = 0.0. r2 must be set in
range 0.0 LE PTAL LE 25.
TWIND=n5 - Sets smoothing window width. Needed if SPNORM is
set. If SPNORM is set and TWIND is not set, then
no smoothing is done.
TUNITS=n6 - Sets units. This is needed to meaningful period
numbers. If FREQOUT option is used, TUNITS is not
needed. Default = 1.
The usual setting is
TRISPEC $
If clipping is desired, but the bispectrum linearity tests are not
desired, the commands should be
BISPEC IOLDSP CLIP=5.0 $ TRISPEC $
If both bispectrum and trispectrum Gaussianity and Linearity tests are
desired, then use the commands
BISPEC ITURNO IAUTO$ TRISPEC$
POLYSPEC sentence options.
LISTSPEC - Lists log spectrum by window
LISTBISP - Lists Seven Fractiles (10%, 20%, 40%, 60%, 80%,
90%, 99%) of Normalized Bispectrun by window. Z
Values for each fractile are also supplied. The
top 2% Normalized Bispectral Values and Phases are
also supplied. If the process is Gaussian the
Bispectrum should vanish.
LISTCUM2 - Lists Seven Fractiles (10%, 20%, 40%, 60%, 80%,
90%, 99%) of Normalized Cum2 values by window. Z
Values for each fractile are also supplied. The
top 2% Normalized Cum2 Values and Phases are
also supplied. These measure autocorrelation in
that window of the series.
SAVESPEC - Will save estimates of the log spectrum for up to
98 windows in an SCA FSAVE file having SCA data
set name POLYSCADSN on unit POLYSCAU. A second
file having the primary suffex MSD is also created
containing OBS, NBEGIN, NEND, MEAN, STANDEV, SKEWNESS
KERTOSIS, C6, SAMPLMAX, DSAMPLMIN for each window.
TSAMPLEU - Sets the sample as a time series. This is the
default. The parameter SAMPLEU sets the sampling
interval.
FSAMPLEU - Sets the sample as a frequency. If this option
is set, then the parameter SAMPLEU sets the
sampling rate as a multiple of KHz.
NNBISPCUM - If specified, the bispectrum and the cum2 are
not normalized by products of the spectral estimates
but by the variance. This is used if the data is
known to be white (flat spectrum).
POLYSPEC sentence parameters.
POLYLW=n1 Sets window. The block length LB = POLYLW**POLYC.
Default = 0. If POLYLW = 0, the complete sample
is used, unless N < 250. If POLYLW > 0, then
POLYLW must be set GE 250. Given POLYC = .4 (the
default) this would imply a block length of 9.
If the user selects POLYLW such that given the
number of observations in the sample, there
would be more than 99 windows, POLYLW will be
adjusted. If POLYLW is set such that it does not
go into the number of observations evenly, then
data at the end of the series will not be used.
POLYC=r1 Sets window / block conversion. 0 LE POLYC LE .5.
Default = .40.
POLYSRATE=r2 If TSAMPLE is set above, r2 is the sampling rate.
If FSAMPLE is set above, r2 is the sampling rate as
a multiple of KHz. Default = 1.0 .
POLYSRATEU=k1 Sets Data unit. A max of 5 characters can be
supplied. Default = obs.
POLYFL=r3 Sets lower frequency for analysis. Default = 0.0.
POLYFU=r4 Sets upper frequency for analysis. Default = .5
POLYFL and POLYFU, if set inside interval 0.0 - .5,
allow the analysis to be restricted to a subset
of the frequencies.
POLYTAP=r5 Sets taper block for side lobe reduction.
Default = 0.0
POLYTH=r6 Sets threshold for test statistic. Default = .9
POLYTRIM=r7 Sets % of the data to be trimmed. Default = 0.0.
POLYTRIM must be in the range 0.0 - 25.0.
POLYSCADSN=k2 Sets SCA DSN name. A max of 5 characters can be
set. Default = POLYS. If the SAVESPEC option is
set, the spectrums for each of the POLYLW windows
are saved with names SPEC_01 ... SPEC_...
POLYSCAU=n2 Sets SCA FSAVE file unit number. Default = 44.
POLYSRATE=r1 Sets sampling rate. Default = 1.0
POLYSRATEU=k1 Sets sampling rate unit. Default = obs.
NWD=n3 Sets smoothing window. Smoothing will be performed
if NWD > 2. If NWD is even, it will be set to the
next highest odd number.
SAMPLEU=r2 If TSAMPLE is in effect, sets the # of samples per
unit. If FSAMPLE is in effect, sets sampling rate
as a multiple of KHz.
Examples of POLYSPEC sentence usage.
Example 1. Assume 5000 observations. The command
polyspec polylw=1000 listspec listbisp listcum2 savespec$
will analyse 5 windows of 1000 each. The spectrun,
bispectrum and CUM2 will be listed. In addition
The spectrums will be saved on unit 44 in SCA dataset
POLY with names SPEC_01, SPEC_02, SPEC_03, SPEC_04,
SPEC_05.
REVERSE sentence
The REVERSE sentence performs various time reversibility tests
suggested by Hinich and Rothman, using the TR1 and TR2 programs, and
Hinich using the CUMSPEC program.
Rothman related commands.
The TR1 program is designed to calculate Ramsey and Rothman (1996)
standardized TR test statistics for a raw series. An ARMA model is
fitted to the series to estimate the standard deviation of the
statistics. The Rothman(1994) portmanteau test is also calculated.
The TR2 program is designed to calculate the TR test for residuals using
equation (10) of Ramsey and Rothman (1996). If the series is not white
noise, it can be filtered. The Rothman (1994) portmanteau test is also
calculated. A Monti Carlo simulation is run to estimate the p-values of
the maximum (in absolute value) of the standardized TR test statistics
and of the portmanteau statistic.
TR1(k) - Gets the order of the TR1 Test.
TR2(k) - Gets the order of the TR2 Test.
TR1 or TR2 is required
iprintarma - Prints the ARMA estimation results. This
is rarely needed.
ar(i1) - Sets the orders of the ar filter.
ma(j1) - Sets the orders of the ma filter.
If TR1 ARMA model used to get sd.
If TR2 ARMA model used to filter data.
tran(key) - Provides optional transformations of the data.
Key can be set as:
raw - Use raw data. This is the default.
log - Use log of data.
diflog - First difference of log of data
dif - First difference of data
logdt - Log detrended data
rawdt - Raw detrended data
iseed(ii) - Sets the seed. This option is not usually set. It is
useful only in replication testing.
maxbc(i) - Maximum number of backforecasts.
tolbc(r) - Convergence of backforecasting algorithm.
tolss(r) - Convergence of nonlinear least squares.
May have to be set > 0.0. Must be in range 0 -.9999
maxit(i) - Sets maximum iterations for simulations.
Default = 100.
maxit2(j) - Sets maximum iterations for arma modeling.
Default = 200.
rerror(d) - Sets the relative error for arma termination.
Default = 0.0
Examples of Reverse Test using Rothman
b34sexec options ginclude('b34sdata.mac') member(rothtr1);
b34srun;
b34sexec btiden;
title('Rothman TR1 Test Data');
seriesn var=nomgnp;
iden;
reverse TR1(5) ar(1) tran(logdif) iseed(25443332) maxit(100);
b34srun;
b34sexec options ginclude('b34sdata.mac') member(rothtr2);
b34srun;
b34sexec btiden;
title('Rothman TR2 Test Data');
seriesn var=gnpdefl;
iden;
reverse TR2(5) ar(1) tran(logdif) iseed(25443332) maxit(100) ;
b34srun;
Commands Related to Hinich-Rothman(1998) Frequency Domain Test
hr1998 - This is required to perform test.
period - Sampling rate in periods. This is the default.
freq - Sampling rate in kHz.
bandpass - Remove 0 fl and fu to .5 frequencies
sr=r1 - Sampling rate. Default = 1. If Freq in
effect sampling rate in multiple of
milsec (1/khz)
rb=r2 - Sets resolution bandwidth in hz.
Default = 5.
sb=r3 - Sets spectral smoothing bandwidth in
hz. SB > RB. If SB not set => spectrun
not smoothed.
norm(key) - key = divide => divide bispectrun at
(f1,f2)by
sqrt[S(f1)S(f2)S(f1+f2)]
no => do not normalize
bispectrum. Here
bispectrum divided by
cube of sample SD. This
option is used if
series is white noise.
filter => Filter out frequency
components in range
(0,fl) and above fu.
fl=r4 - Lower frequency for analysis.
Default = 0. Note: fl must never be set
lt 0.0.
fu=r5 - Upper frequency for analysis.
Default = .475, the upper limit.
pt=r6 - % taper of frames for sidelong
reduction. Range 0.0 LE pt LT 25.
Default = 0.0.
Examples of Reverse Test using Hinich-Rothman 1998
b34sexec options ginclude('b34sdata.mac') member(rothtr1);
b34srun;
b34sexec btiden;
title('Hinich-Rothman (1998) Test on TR1 Data');
seriesn var=nomgnp;
iden;
reverse hr1998 rb(9.5);
b34srun;
b34sexec options ginclude('b34sdata.mac') member(rothtr2);
b34srun;
b34sexec btiden;
title('Hinich-Rothman (1998) Terst on TR2 Data');
seriesn var=gnpdefl;
iden;
reverse hr1998 rb(9.5);
b34srun;
IDEN sentence.
The IDEN sentence is used to specify control values for VAR, VARMA
and VMA cross correlation identification.
IDEN sentence options.
ISOP - Plot original data.
ITSP - Plot transformed data.
IDSP - Plot differenced data.
ISACF - Plot series ACF. Note that LAGRHO must be set > 0.
ISCCF - Plot series cross correlations. LAGRHO must be set > 0.
IVALUE - Give both numerical and significant indicators for cross
correlations. The default is only significant indicators.
MQSTAT - Gives Multivariate Q Statistic.
IDEN sentence parameters.
LAGRHO=n1 Sets number of cross correlation matrices. Max = 120.
IPER=n2 Sets markings on x axis for plots. Default is markings
every 10 periods. If n2=12, markings will be
1,2,...,9,0,A,B. The range for n2 is 0 - 36 where 0
means markings every 10 periods.
ESTVAR sentence.
The ESTVAR sentence controls estimation of VAR models.
ESTVAR sentence options.
IPRINT - Print CCF matrix. Note IVALUE must be set.
ICANON - Gives output associated with canonical analysis.
PHICOR - Gives correlation form of (X'X)**-1 with each AR fit.
This information can be used to construct the
correlation matrix of the Phi estimates.
ILARF - Reduces output by printing the last AR fit only. The
default option will print AR(1) .... AR(MAX) in turn.
RESIDUALS - Will list or optionally punch residuals. (See IRES
parameter below.) If the ILARF option is in effect,
only the last set of residuals is listed and/or
punched.
GRANGER - Will print matrix of F tests and a matrix of the sign-
ificance of these F statistics to test Granger
causality. If F(i,j) is significant, it implies that
lags of the jth variable Granger causes the ith
variable. GRANGER options not allows if LAGS( ) used.
ISACF - Plot residual ACF. Note that IVALUE must be set.
ISCCF - Plot residual CCF. Note that IVALUE must be set.
Note: ISACF and ISCCF make a great deal of output.
MQSTAT - Gives Multivariate Q Statistic.
ESTVAR sentence parameters.
P=n1 Maximum lag on non seasonal operator.
PS=n2 Maximum lag on seasonal operator.
S= n3 Seasonal factor.
LAGS=(n4,n5, ) Up to 99 can be specified.
NUMIRF=n4 Sets number of impulse response function terms to
calculate after last VAR step.
Note: For further detail see IRF under Matrix Command
This option calculates the Transfer Function Impulse Response
Function (TFIRF) of a VAR Model. This is not the VMA from.
Assume A(L)X=e
Transformed model is: X = PSI(L)e
where PSI(L) = INV(A(L))
-------------------------------------------------------
This is in contrast to the Transfer function form of the model
tirf that is calculated by normalizing by diagonal polynomial.
Assume VAR Model for 2 Series X1 & X2:
Orig. eq: 1 b11(L)X1 + b12(L)X2 = e1
Orig. eq: 2 b21(L)X1 + b22(L)X2 = e2
Trans. eq: 1 X1 + [b12(L)/b11(L)]X2 = [1/b11(L)]e1
Trans. eq: 2 X2 + [b21(L)/b22(L)]X1 = [1/b22(L)]e2
If 1 to k-1 cols are multiplied by -1 we get the
alternative tirf form
Alt. eq: 1 X1 = -[b12(L)/b11(L)]X2 + [1/b11(L)]e1
Alt. eq: 2 X2 = -[b21(L)/b22(L)]X1 + [1/b22(L)]e2
For one variable case [1/b11(L)] is psi(L)
---------------------------------------------------------------
Note: If P=PS=0, the LAGS parameter must be given. It allows user to
specify specific lags. If P NE 0 and PS NE 0, then ((P+1)*(PS+1)-1) must
be LE 99.
OUTPUT=key If Key = BRIEF only preliminary output, stepwise AR
summary and a table summarizing the
significant partial AR coefficients by
lag is given.
If key=NORMAL full output is given.
If key=EXPANDED full output in expanded form is given.
This is will occur automatically if
there is more than 5 series and key =
NORMAL.
LAGRHO=n7 Sets number of residual cross correlation matrices.
LAGRHO defaults to 12. LAGRHO must be in range
12 - 120.
IVALUE=(n1,n2) Sets number of AR fits after which values in the
residual correlation matrix are given. The default
gives none. For example IVALUE=(1,3,5) gives
residual CCF after AR(1), AR(3) and AR(5).
ISCAU=n8 Saves estimated coefficients in SCA SAVEFILE in
unit n8 which must be LRECL=80,RECFM=FB. The SCA
SAVEFILE can be read into SAS using the PROC
LINKSCA. For more information about PROC LINKSCA,
get into SAS and give SAS command HELP LINKSCA; .
If n8 is LT 0, file will be rewound. Otherwise
dataset is added to file.
SCAP=key Sets SCA SAVEFILE data set prefix. The default =
MOD. Successive AR matrices are saved with DSN name
MOD1 ... MODK where K is the maximum lag. In each
dataset, the AR matrices are stored with AR_ where
_ gives the order. The maximum number of characters
in key is 6.
IRES=n9 Controls residual output on unit 44 in SCA FSAVE
format. If RESIDUALS option is set and n9 > 0,
residuals are only outputed to a file with name
RESIDUAL. If RESIDUALS is set and n9 < 0, then
residuals are listed and punched. Series listed
are OBSNUM, RESID1, RESID2,.. SERIES1, SERIES2,..
YHAT1, YHAT2 ....
If ILARF is not in effect, the residuals and data
for each AR fit will be added to unit 44.
Note: Residual = actual - forecast.
************************
Sample jobs.
Identify cross correlations for B-J Gas data and optionally do
BISPEC tests. For + , - . plots, 2.5 standard errors are used.
B34SEXEC BTIDEN NSTDER=2.5 $
TITLE=('Idenfication run with Gas Data') $
SERIESN VAR=GASIN NAME=('B-J GAS INPUT DATA') $
SERIESN VAR=GASOUT NAME=('B-J GAS OUTPUT DATA')$
IDEN LAGRHO=36 ISACF ISCCF $
BISPEC $
B34SEEND$
Estimate a VAR model with gas data for up to 6 lags.
B34SEXEC BTIDEN$
TITLE=('Identification run with Gas Data') $
SERIESN VAR=GASIN NAME=('B-J GAS INPUT DATA') $
SERIESN VAR=GASOUT NAME=('B-J GAS OUTPUT DATA')$
ESTVAR P=6 OUTPUT=NORMAL$
BISPEC $
B34SEEND$