<Root level> Procedures |
Many of the capabilities of RATS are made available through the use of procedures. Procedures are text files of RATS instructions which function much like a built-in instruction, but with greater flexibility. Consider, for instance, a Dickey-Fuller test. This is just a simple linear regression with a specific set of variables. A augmented Dickey-Fuller test with lags chosen by some means requires a set of linear regressions. There is no great advantage to having this "hard-coded" into a RATS instruction (like LINREG itself) since the calculation is quite straightforward. The advantage of providing the D-F test through a procedure is that it's easy to modify either by you, or by us.
The RATS distribution includes over 300 procedures, with more created all the time. Because procedures are so important to the use of RATS, it's important for the program to be able to find the most current versions. RATS maintains a set of search directories. This is generally set up properly when you first install the program, but you can change the directory, or add additional ones for your own procedures.
If you execute a procedure with (say)
@dfunit lgdp
RATS will automatically search for a file whose name matches that of the procedure, with a .SRC extension, so in this case dfunit.src. The search path(s) are set in the program's preferences in the Procedures Directories field on the Directories tab. If you have more than one directory listed, it will start with the first, then, if it's not found, move to the next. By putting your own directory above the standard one, you can use an altered copy before the distribution one.
Executing a Procedure
The basic syntax for executing a procedure is:
@procedure_name( options ) parameters
# < supplementary cards > (if needed)
Everything is the same as a standard RATS instruction except two things:
•The procedure name is preceded by @.
•You can’t abbreviate the procedure name.
The following uses the procedure @DFUNIT (Dickey–Fuller Unit root test) to do unit root tests on the series TBILL using several sets of options:
@dfunit(det=constant) tbill
@dfunit(det=constant,maxlags=6,method=gtos) tbill
@dfunit(det=constant,maxlags=6,method=aic) tbill
Loading the Procedure
To use a procedure or function stored on a separate file, you need to have RATS execute the instructions that define the procedure. In most cases, RATS can do this automatically, by searching for a file with a .src extension whose name matches the name of the procedure. Otherwise, you can compile procedures stored on a file using the SOURCE instruction:
source name of file with PROCEDURE or FUNCTION
If RATS can’t load a procedure:
•Check to make sure you did a full installation, including all of the files supplied with RATS. "Installing RATS" for details.
•Check the “Procedure Directory” setting on the “Directories” tab in the preferences. In order for RATS to find procedure files automatically, this should point to the directory containing your procedures. See "Where to Find It" for Windows or Macintosh.
•If you know where the procedure file is installed on your computer, include a SOURCE instruction (with a complete path and filename) prior to the procedure call to source in the procedure.
•You may be running an out-of-date version of RATS that did not include the procedure in question. If you do Help—Update Procedures..., RATS will list all procedures that have been added or changed since your version was released and that can be used on what you are running. You can do Help—About RATS to check which version you are using. See "Updates" or email sales@estima.com for information on updating. If you are using a network license at a company or university, your institution may already have the most recent version available—check with your system support staff.
•If all else fails, you should be able to download the procedure using the “Procedure Browser” on the “Resources” section of our website.
Procedure Listing
The most important of the procedures are listed in this section alphabetically with (for most) links to a description of their use. For other procedures (or even for the ones shown here), you can open the .SRC file and read the comments to see how they work.
Generates Arellano-Bond set of instruments |
|
Performs autocorrelation analysis on a series |
|
Computes autocorrelations from partial autocorrelations |
|
Selects optimal lag length to be used for an ADF test |
|
Anderson-Darling test for normality |
|
Andrews-Guggenberger estimate of fractional difference |
|
Andrews-Ploberger Structural Break Test |
|
Andrews-Ploberger Structural Break Test for GARCH/Maximum Likelihood |
|
Computes Information Criteria for AR models using Yule-Walker or Burg |
|
Tests a series for ARCH effects |
|
Sets up a DLM based upon an ARMA model |
|
Graphs the spectral density for an input ARMA model |
|
Estimates factors in a factor model using Bai-Ng formulas |
|
Bai-Perron Test for Multiple Structural Changes |
|
Bayesian Unit Root test |
|
Battery of independence tests |
|
Brock-Decher-Scheinkman test for i.i.d. |
|
Computes parameters required for beta distribution |
|
Hinich bi-correlations test for autocorrelation |
|
Automated ARIMA model selection |
|
Aids in selection of differencing operations |
|
@BJEST |
Estimates an ARIMA model |
Estimates and forecasts an ARIMA model |
|
Box-Jenkins identification tool |
|
@BJTHEIL |
Computes Theil U statistics for an ARIMA model |
Aids in selection of preliminary transformation |
|
Band pass filter using Baxter-King method |
|
Beveridge-Nelson decomposition |
|
Does Breusch-Pagan (and related) tests for random effects |
|
Does Monte Carlo draws from a VAR with BQ factorization |
|
Breitung test for unit roots in panel data |
|
Bry-Boschan business cycle dating (Pagan-Harding for quarterly data) |
|
Black-Scholes option pricing procedure |
|
Builds up a prior for a linear equation one element at a time. |
|
Builds up a prior for a Bayesian VAR |
|
@CANCORR |
Computes canonical correlations for two sets of series |
Identifying turning points and cyclical phases of a series |
|
Band pass filter using Christiano-Fitzgerald method |
|
Chow-Denning multiple variance ratio test |
|
@CHOWLIN |
Distributes a series to a higher frequency using related series (obsolete: use @DISAGGREGATE instead) |
Decomposes a series into trend, seasonal, irregular |
|
Conditional forecasting procedure |
|
Corrado non-parametric event test |
|
@CORRINTEGRAL |
Computes a correlation integral for a series |
Computes and graphs cross correlations of two series |
|
Computes and graphs phase and coherence |
|
Complex series symmetrizer |
|
Durbin’s Cumulated Periodogram for serial correlation |
|
Computes and displays CUSUM and CUSUMQ tests |
|
Stability tests on a covariance matrix of series |
|
@CXLOGDENSITY |
Computes Whittle likelihood using complex matrices |
@CXLOGDENSITYCV |
Computes concentrated multivariate Whittle likelihood using complex matrices |
@DENTON |
Distributes a series to a higher frequency using proportional Denton method (obsolete: use @DISAGGREGATE instead) |
Dickey-Fuller unit root test |
|
General disaggregation (interpolation/distribution) procedure |
|
Distribution from one frequency to a higher frequency |
|
Computes a Divisia index |
|
Impulse Reponse Function from a State-Space model |
|
Diebold-Mariano Forecast Comparison Test |
|
Computes Autoregressive Representations using Durbin-Levinson recursion |
|
@EBA |
Extreme Bounds Analysis, from Granger and Uhlig |
@EGCRTVAL |
Computes "exact" critical values for Dickey-Fuller unit root and Engle-Granger cointegration tests. |
Engle-Granger test for Cointegration |
|
Engle-Granger test for Cointegration on 1st stage residuals |
|
Computes empirical likelihood for a set of moment conditions |
|
Enders/Granger threshold unit root tests |
|
Enders-Siklos test for cointegration with threshold effect |
|
Creates an ACF from an ARMA equation |
|
Elliott-Rothenberg-Stock unit root tests |
|
Computes exact (limit) inverse with “infinite” components |
|
General Nyblom fluctuations test |
|
Estimates cointegrating vectors using Fully Modified Least Squares |
|
Factors covariance matrix with specific vector column/row |
|
Computes and graphs the gain and phase of a pair of series |
|
Computes parameters required for gamma distribution |
|
@GARCHFORE |
Univariate GARCH forecasting procedure |
Generates weights and grid points for Gauss-Hermite numerical integration |
|
@GEDDRAW |
Generates draws for a generalized error distribution |
@GENCOMBOS |
Generate all combinations of a set of integers |
Local to unity GLS detrending routine |
|
Automated ARIMA model selection (seasonal models) |
|
Granger-Newbold forecast comparison test |
|
Geweke-Porter-Hudak estimate of fractional differencing |
|
Graphs a RECTANGULAR array of series on separate graphs |
|
Gregory-Hansen test for cointegration with breaks |
|
Generates a series with an equally spaced grid |
|
Hadri test for unit roots in panel data |
|
Generates Halton sequences |
|
@HANNANRISSANEN |
Estimates an ARIMA model using the Hannan-Rissanen algorithm |
Performs a HEGY seasonal unit root test for quarterly data |
|
@HILLGEV |
Estimates tail index for a distribution using Hill’s method |
@HINICHTEST |
Hinich bispectrum test for linearity and Gaussianity |
Histogram procedure |
|
@HJBOUNDS |
Computes Hansen-Jagannathan bounds for a set of returns |
Hodrick-Prescott filter (obsolete) |
|
Harris-Tzavalis unit root test for panel data |
|
Computes a Hurst exponent |
|
Inclan-Tiao test for breaks in variance |
|
@IMHOF |
Computes CDF for quadratic form in Normal(0,1) variables. Obsolete—use functions %QFORMPDF or %QFORMDPDF functions. |
Corrects signs of columns in a factor matrix |
|
Interpolation from one frequency to a higher one |
|
Computes parameters required for inverse chi-squared distribution |
|
Computes parameters required for inverse gamma distribution |
|
Im, Pesaran and Shin panel unit root test |
|
Used to build up a set of zero-valued restrictions for impulse responses impact and higher steps |
|
Johansen ML Cointegration analysis |
|
KPSS (Kwiatowski, Phillips, Schmidt, and Shin) stationarity test |
|
@KSCPOSTDRAW |
Draws from posterior density needed in stochastic volatility model |
Creates table of the roots of a lag polynomial |
|
Levin-Lin-Chu test for unit roots in panel data |
|
Limited information maximum likelihood estimation |
|
Creates matrices for local (level or trend) DLM |
|
Calculates initial guesses for component variances in a local level/trend |
|
Local smoothing regression |
|
@LOGMVSKEWT |
Function for log density of multivariate skew-t distribution |
Computes parameters required for log normal distribution |
|
Function for log density of skew-GED distribution |
|
Function for log density of skew-GED distribution for use with GARCH with DENSITY option. |
|
Function for log density of skew-t distribution |
|
Function for log density of skew-t distribution for use with GARCH with DENSITY option. |
|
Lumsdaine-Papell unit root test with structural breaks |
|
Estimates a dynamic FE model with correction for bias |
|
Lee-Strazicich unit root tests with one or more structural breaks |
|
Computes Information Criteria for MA models using innovations algorithm |
|
@MACKINNONCV |
Computes Mackinnon’s Critical values for DF and EG tests |
Performs Mann-Whitney test for comparison of samples |
|
Functions supporting Markov Chain Models (obsolete use @MSSETUP instead) |
|
@MATPEEK |
Extracting/inserting information from/into rectangular arrays (obsolete: use %XSUBMAT and %PSUBMAT functions instead) |
Organizes tables of FEVD’s with confidence bands |
|
Organizes graphs of IRF’s with confidence bands |
|
Performs a McLeod-Li test for 2nd order dependence |
|
Calculates sample statistics from MCMC realizations |
|
Organizes error bands for IRF’s based upon MC results |
|
Does Monte Carlo draws from a VAR to generate IRF’s |
|
Mean group estimator for panel data |
|
@MEPLOT |
Does Mean Excess Return plots |
Computes and graphs a spectrum using Maximum Entropy Method |
|
@MHEGY |
Implements the monthly version of the “HEGY” tests |
Mixed estimation of a single equation |
|
Mixed estimation of an equation with a Bayesian prior |
|
Monte Carlo Integration of VAR Impulse Response confidence bands |
|
@MSEMSETUPSTD |
Markov switching procedures for EM estimation |
Markov switching linear regression procedures |
|
Markov switching general support procedures |
|
Markov switching linear systems regression procedures |
|
Markov switching VAR setup procedures |
|
Multiple structural change analysis per Bai-Perron |
|
Multivariate test for ARCH |
|
@MVBNDECOMP |
Multivariate Beveridge-Nelson decomposition via a VAR |
Multivariate GARCH forecasting |
|
Extracts a VECH representation from GARCH estimates |
|
Creates a Tiao-Box cross correlation matrix |
|
Multivariate Jarque-Bera normality test |
|
Hosking’s Multivariate Q statistic |
|
Generates dummies based upon NBER cycle dates |
|
Computes Hodrick standard errors |
|
@PACF2AR |
Generates coefficients for an AR from input covariances |
Panel data unit root/cointegration testing procedure (Pedroni tests) |
|
Panel data group mean DOLS |
|
Panel data group mean FMOLS |
|
Does analysis of up to two threshold breaks in a fixed effects panel model |
|
Polynomial Distributed Lags regression |
|
@PDLREG |
Polynomial Distributed Lags regression |
Compute various unit root tests with breaks |
|
Compute various Perron-Ng “M” unit root tests |
|
Perron-Rodriguez unit root test allowing for break at unknown date |
|
Sum of coefficients of a MA representation for a series |
|
@PHILLIPSHANNAN |
Phillips-Hannan Efficient estimator for multivariate regressions |
@POLYMULT |
Multiplies lag polynomial coefficients. Obsolete: use %POLYMULT function instead. |
Phillips-Ouliaris-Hansen test for Cointegration |
|
Phillips-Ouliaris-Hansen test for Cointegration on 1st stage residuals |
|
Phillips-Perron Unit Root test |
|
Extracts principal components |
|
Principal components-based factor analysis |
|
@PRJCONDITIONAL |
Predicted probabilities for conditional logit model |
@PRJMULTINOMIAL |
Predicted probabilities for multinomial logit model |
@PRJPOISSON |
Predictions and marginal effects for Poisson count model |
Graphs a Q plot against a hypothesized distribution |
|
@QUARTIMAX |
Does factor rotation using quartimax criterion |
Random draw from a distribution approximated across grid of points |
|
@RANMIXTURE |
Random draws from a mixture of Normals |
@RANNORMALTRUNC |
Random draws from a truncated Normal (procedure). Obsolete: use %RANTRUNCATE function instead. |
Regression post-processing, fancy graph of actual/fitted/resids |
|
Displays an analysis of variance table from most recent regression |
|
Displays a table of confidence intervals from most recent regression |
|
Computes and graphs autocorrelations from residuals |
|
Computes information criteria for most recent regression |
|
Computes the exact significance level for the Durbin-Watson |
|
Performs structural break test with bootstrapped p-values |
|
Computes partial correlations between the regressors and dep var. |
|
Panel-corrected standard error calculation |
|
@REGRECURSIVE |
Regression post-processing, computes recursive resids, does tests (largely obsolete—use RLS instruction instead). |
Performs Ramsey RESET test on regression |
|
Creates a TeX equation from the most recent regression |
|
@REGTREE |
Performs a CART (Classification and Regression Trees) analysis |
@REGWHITENNTEST |
Performs White neural network test on regression |
Performs White heteroscedasticity test on regression |
|
Performs Wu (or Durbin-Wu-Hausman) specification test on regression |
|
Semiparametric fractional differencing parameter estimation |
|
Robust LM test for orthogonality of residuals and input series |
|
Computes rolling regressions for least squares |
|
@RRGQTEST |
Computes a Goldfeld-Quandt test on recursive residuals |
R/S Statistic (classical or Lo’s modified) |
|
Computes a run test for a two-state series |
|
Creates the matrices for the seasonal component of a DLM |
|
Factor covariance matrix with short and long run restrictions |
|
Forecasting using spectral techniques |
|
Computes/graphs spectral density |
|
@SPLOM |
Produces an NxN matrix of SCATTER plots |
Computes various “Schmidt-Phillips” tests (TAU) for a unit roots |
|
Multivariate spectral density of a state space model |
|
Perfoms Hansen’s stability test for OLS |
|
Performs a standard battery of specification tests for a state space model |
|
Test for linearity vs. LSTAR or ESTAR |
|
Backwards stepwise reduction of a probit model |
|
@STOCKWAT |
Stock-Watson and Dickey-Fuller Unit Root Tests |
Computes structural residuals from standard residuals |
|
Sets up Gibbs sampler for SUR model |
|
Computes a GLS matrix weighted estimator for a panel data set |
|
Estimates cointegrating vectors using dynamic OLS |
|
Tests cointegration rank using common trends analysis |
|
Estimates a threshold autoregression, tests for threshold effect |
|
Hansen’s Test for Threshold Break |
|
@TLOOKUP |
Provides a procedure for doing table lookups |
@TSAYNLTEST |
Tsay test for neglected non-linearities |
Tsay arranged regression test for threshold autoregression (TAR) |
|
Tse test for constant correlation in MV-GARCH model |
|
Time-varying VAR setup routine |
|
Forecast errors for a univariate model |
|
@UHLIGFUNCS |
Computes criteria for Uhlig sign-restricted shocks |
Computes required parameters for uniform distribution |
|
Extracts unique values from a series |
|
Sets up a parallel system for bootstrapping a VAR |
|
@VARCALC |
Does a direct calculation of a simple OLS VAR |
@VARFPE |
Minimum FPE representation for the equations in a VAR |
Computes a state space representation to its implied VAR |
|
@VARIMAX |
Does factor rotation using varimax criterion |
Organizes graphs of Impulse responses for an estimated VAR |
|
@VARIRFDELTA |
Computes the covariance matrix of an IRF using the delta method |
@VARLAGMD |
Computes the sums of the VAR lag coefficients (obsolete, use %MODELLAGSUMS function) |
Selects lag length for a VAR model |
|
@VARMADLM |
Routines for analyzing a VARMA using DLM |
@VARSPECTRUM |
Multivariate spectral density of a Vector Autoregression |
Variance ratio random walk test procedure |
|
Heteroscedasticity-robust serial correlation test |
|
@WHITTLETEST |
Implements Whittle test for independence of state sequences |
@YULELAGS |
Computes Information Criteria for AR models using Yule-Walker (obsolete: use @ARAutoLags instead). |
Estimates a VAR on stationary data using Yule-Walker Equations |
|
Zivot-Andrews Unit Root Test |
Copyright © 2024 Thomas A. Doan