Below is a list of all the procedures and example programs available on our website (excluding the Textbook Examples).

File Name Description
ablags.src

ABLags generates a VECT[SERIES] with the expanded panel data instruments for doing Arellano-Bond instrumental variables estimation. Arellano, M. and S. Bond (1991). "Some Tests of Specification for Panel Data: Monte Carlo Evidence and an Application to Employment Equations.” Review of Economic Studies, Vol. 58, 277-297. See also arellano.prg.

Written by:  Estima
Topics:GMM;Panel
References:Arellano;Bond
Requires:Version 5.00
acf.src

ACF performs an autocorrelation analysis on a series. This is a simpler routine than the related BJIDENT and REGCORRS procedures.

Written by:  Estima
Topics:ARIMA
Requires:Version 7.00
Also available for version 5.10 with fewer features
acf2pacf.src

This computes a series of partial autocorrelations from a series of autocorrelations.

Written by:  Estima
Topics:ARIMA
Requires:Version 5.00
acfmorin.src

Takes as input a set of AR and MA coefficients, and generates the corresponding theoretical autocorrelations. Updated November 10, 1997, it can now produce autocovariances as well, and allows skipping beginning and ending items in the input vector. (Note: This procedure file was renamed from ACF.SRC to ACFMORIN.SRC in July, 2005 to avoid confusion with a newer ACF.SRC written by Estima and included with RATS starting with Version 6.10)

Written by:  Norman Morin
Topics:ARIMA
References:McLeod
Requires:Version 5.00
adaptive.rpf

Demonstrates adaptive kernel estimation: a two-step procedure for adjusting the estimates of a linear model based upon the an estimated density for the residuals. Uses the DENSITY instruction for computing the density and MCOV instruction for computing the adjustment matrices.

Written by:  Estima
Topics:Example programs;Regression;Nonparametric
Requires:Version 8.00
adfautoselect.src

This selects the optimal lag length for an ADF unit root test (it does not do the UR test itself--see the Unit Root section for testing proceudres). This uses features of RATS 6.0 to report the results in a convenient format. It is largely based on a procedure found in Norman Morin's URADF.SRC file. Note: The filename was renamed from ADFAUTO.SRC (to match the name of the procedure itself) in August, 2005.

Written by:  Estima;Norman Morin
Topics:Unit root
Requires:Version 7.30
Also available for versions 7.00,6.00 with fewer features
adsjbes2009.zip

Replication file for Aruoba, Diebold and Scotti(2009), "Real-Time Measurement of Business Conditions," Journal of Business and Economic Statistics, vol 27, no 4, 417-427.
Instead of brute force with a huge state vector, this uses aggregator states to handle the lags of the indicator for the two flow variables. The authors have an update on the ADS website that describes this.

Written by:  Estima
Topics:Paper results;State-space models
References:Aruoba;Diebold;Scotti
Requires:Version 7.30
adtest.src

This implements the Anderson-Darling test for normality.

Written by:  Estima
Topics:Normality
References:Anderson;Darling
Requires:Version 7.30
Also available for versions 5.10,5.00 with fewer features
agfractd.src

Estimates the fractional difference power for a series using the bias-reduced technique from Andrews and Guggenberger(2003), "A Biased-Reduced Log-periodogram Regression Estimator for the Long-Memory Parameter", Econometrica, vol 71, no. 2, 675-712.

Written by:  Estima
Topics:Spectral;Long memory
References:Andrews;Guggenberger
Requires:Version 7.30
Also available for versions 5.10,5.00 with fewer features
akaike.rpf

Calculates and displays Akaike Information Criteria and Schwarz Bayesian Criteria for distributed lag models.

Written by:  Estima
Topics:Example programs;Information criteria;Distributed lags
Requires:Version 8.00
andrews.prg

is a (partial) example program demonstrating a technique for selecting a valid set of instruments for a GMM where some of the moment conditions are suspected of being incorrect. Based on a recent Econometrica paper by Donald Andrews. See August, 1999 RATSLetter for details.

Written by:  Estima
Topics:Example programs;GMM
References:Andrews
Requires:Version 5.00
apbreaktest.src

Andrews-Ploberger, Andrews-Quandt tests for structural break in a linear regression using Hansen's p-values. Andrews, Donald W. K. and Werner Ploberger, "Optimal Tests When a Nuisance Parameter is Present Only Under the Alternative", Econometrica, 1994.

Written by:  Estima
Topics:Stability tests;Structural breaks
References:Andrews;Ploberger;Quandt;Hansen(Bruce)
Requires:Version 7.30
Also available for versions 6.00,5.10 with fewer features
apgradienttest.src

Andrews-Ploberger, Andrews-Quandt tests for structural break in a general maximum likelihood.
Andrews, Donald W. K. and Werner Ploberger, "Optimal Tests When a Nuisance Parameter is Present Only Under the Alternative", Econometrica, 1994.

Written by:  Estima
Topics:Stability tests;Structural breaks
References:Andrews;Ploberger;Hansen(Bruce)
Requires:Version 7.30
ar1.rpf

Estimates a linear regression model with AR1 errors using a variety of techniques (Cochrane-Orcutt, Hildreth-Lu, maximum likelihood).

Written by:  Estima
Topics:Example programs;Regression;Serial correlation
Requires:Version 8.00
arautolags.src

Computes an information criterion for various lags of AR processes using the Burg or Yule estimates of the partial autocorrelations. Identifies the best choice for the given criterion.

Written by:  Estima
Topics:ARIMA
Requires:Version 7.30
Also available for version 6.10 with fewer features
archtest.src

Tests for ARCH effects in a series. Can do a single test for a set number of lags, or a sequence with different numbers of lags.

Written by:  Estima
Topics:ARCH-GARCH
References:Engle
Requires:Version 7.30
Also available for versions 5.10,5.00 with fewer features
arellano_bond_restud1991.zip

Replication file for Arellano and Bond(1991), "Some Tests of Specification for Panel Data: Monte Carlo Evidence and an Application to Employment Equations", Review of Economic Studies, vol 58, no. 2, 277-97.

Written by:  Estima
Topics:Paper results;GMM;Panel
References:Arellano;Bond
Requires:Version 8.10
arellano.rpf

Estimates a dynamic panel data model using Arellano-Bond GMM estimation. Arellano, M. and S. Bond (1991). "Some Tests of Specification for Panel Data: Monte Carlo Evidence and an Application to Employment Equations.” Review of Economic Studies, Vol. 58, pp. 277-297. See also ablags.src

Written by:  Estima
Topics:Example programs;GMM;Panel
References:Arellano;Bond
Requires:Version 8.00
arfsim.src

Procedure for generating true simulations from ARFIMA(0,d,0) using the Davies and Harte Method. Written by Rob Schoen. You can download the Zipped file ARFSIM.ZIP which includes the ARFIMA simulation procedure, a required Gamma function procedure, and a short example progra, or download the individual text files: ARFSIM.SRC, XGAMMA.SRC, and ARFSIM.PRG (example program).

Written by:  Rob Schoen
Topics:ARIMA;Long memory
References:Davies;Harte
Requires:Version 5.00
argarchsim.rpf

Demonstrates simulation of a univariate (conditionally Normal) AR(1)-GARCH(1,1) model

Written by:  Estima
Topics:Example programs;ARCH-GARCH
Requires:Version 8.00
arima.rpf

Estimates, tests and forecasts ARIMA models. Demonstrates the BOXJENK and UFORECAST instructions, BJTRANS, BJIDENT, BJAUTOFIT and REGCORRS procedures.

Written by:  Estima
Topics:Example programs;ARIMA
Requires:Version 8.00
armadlm.src

Sets up the transition equation matrices for a state-space representation of an ARMA mode. The procedure takes an input ARMA equation you supply and sets up appropriate "A" and "SW" matrices.
Jones(1980), "Maximum Likelihood Fitting of ARMA Models", Technometrics, 389-395.

Written by:  Estima
Topics:ARIMA;State-space models
References:Jones
Requires:Version 5.00
armagibbs.rpf

Example of analysis of an ARMA model using Gibbs sampling (Independence Chain Monte Carlo).

Written by:  Estima
Topics:Example programs;ARIMA;Bayesian methods
Requires:Version 7.30
armaspectrum.src

This produces a graph of the spectral density for an input ARMA model, where the model is in the form of an equation. (Renamed and revised from the older ARMASPEC.SRC file).

Written by:  Estima
Topics:ARIMA;Spectral
Requires:Version 7.00
Also available for version 6.10 with fewer features
armax.prg

Estimates ARMA models with extra regressors (ARMAX models).

Written by:  Estima
Topics:Example programs;ARIMA
Requires:Version 5.00
autobox.rpf

Uses @BJDIFF and @GMAUTOFIT to do an automated choice for the differencing and seasonal ARIMA specification for a series, then uses BOXJENK to estimate the chosen model, allowing for automated outlier detection.

Written by:  Estima
Topics:Example programs;ARIMA
Requires:Version 8.00
bai_lumsdaine_stock_restat1998.zip

Replication file for Bai, Lumsdaine and Stock(1998), "Testing For and Dating Common Breaks in Multivariate Time Series", Review of Economic Studies, vol 65, no 3, 395-432
Calculates break statistics on a multivariate models with a common break across all equations.

Written by:  Estima
Topics:Paper results;VAR;Structural breaks
References:Bai;Lumsdaine;Stock
Requires:Version 7.00
bai_perron_jae2003.zip

Replication file for empirical examples from Bai & Perron(2003), "Computation and analysis of multiple structural change models," Journal of Applied Econometrics, vol. 18, no. 1, pages 1-22.

Written by:  Estima
Topics:Stability tests;Structural breaks;Paper results
References:Bai;Perron
Requires:Version 7.20
Also available for versions 7.10,7.00 with fewer features
baillie_bollerslev_jbes1989.zip

Replication file for Baillie and Bollerslev, "The Message in Daily Exchange Rates: A Conditional Variance Tale", JBES 1989, vol 7, pp 297-305 which estimates univariate GARCH models with day-of-the-week effects.

Written by:  Estima
Topics:Paper results;ARCH-GARCH
References:Baillie;Bollerslev
Requires:Version 7.30
bailliebw1996.zip

Replication of Baillie, Bollerslev and Mikkelson(1996), "Fractionally Integrated Generalized Autoregressive Conditional Heteroskedasticity", Journal of Econometrics, vol 74, pp 3-30.
Demonstrates the DIFFERENCE instruction with the FRACTION option.

Written by:  Estima
Topics:Paper results;ARCH-GARCH;Long memory
References:Baillie;Bollerslev;Mikkelson
Requires:Version 9.00
Also available for version 6.10 with fewer features
baing.src

Estimates the required number of factors in a linear factor model using the formulas in Bai and Ng(2002), "Determining the Number of Factors in Approximate Factor Models", Econometrica, vol 70, 191-222.

Written by:  Estima
Topics:Factor models;Financial
References:Bai;Ng
Requires:Version 7.30
Also available for version 6.10 with fewer features
baiperron.src

This does multiple structural change analysis as described in Bai and Perron (2003), "Computation and Analysis of Multiple Structural Change Models", Journal of Applied Econometrics, vol. 18, 1-22.

Written by:  Estima
Topics:Stability tests;Structural breaks
References:Bai;Perron
Requires:Version 7.30
Also available for versions 7.10,5.10 with fewer features
balcilarguptamiller_ee2015.zip

Replication of Balcilar, Gupta, Miller(2015), "Regime switching model of US crude oil and stock market prices: 1859 to 2013", Energy Economics, vol 49, 317-327.

Analysis of a Markov Switching Vector Error Correction Model (MSVECM).

Written by:  Estima
Topics:Paper results;Switching models;Bayesian methods
References:Balcilar;Gupta;Miller
Requires:Version 8.10
balke_restat2000.zip

Replication file for Balke(2000), "Credit and Economic Activity: Credit Regimes and Nonlinear Propagation of Shocks," Review of Economics and Statistics, vol 82, 344-349.
This estimates a threshold VAR and computes impulse responses using bootstrapping of residuals.

Written by:  Estima
Topics:Paper results;Threshold;VAR;Bootstrapping
References:Balke
Requires:Version 8.20
balkefombyier1997.zip

Replication of Balke and Fomby(1997), "Threshold Cointegration," International Economic Review, vol 38, no 3, 627-45.

Written by:  Estima
Topics:Paper results;Threshold;Cointegration
References:Balke;Fomby
Requires:Version 7.00
basicforecast.rpf

Example of simple forecast procedures.

Written by:  Estima
Topics:Example programs
Requires:Version 8.00
basics.prg

Demonstrates transformations (SET and FILTER instructions), time series and scatter graphics (GRAPH and SCATTER), multiple linear regression (LINREG), hypothesis testing instructions (EXCLUDE, TEST and RESTRICT), simple forecasting (UFORECAST).

Written by:  Estima
Topics:Example programs
Requires:Version 7.00
Also available for versions 6.00,5.00 with fewer features
bauwens_laurent_jbes2005.zip

Replication file for Bauwens and Laurent(2005), "A New Class of Multivariate Skew Densities, With Application to Generalized Autoregressive Conditional Heteroscedasticity Models," JBES, vol 23, 346-354.

Written by:  Estima
Topics:Paper results;ARCH-GARCH
References:Bauwens;Laurent
Requires:Version 8.00
bayestst.src

Tests series for a unit root using the Bayesian procedure outlined in C. Sims, "Bayesian Skepticism on Unit Root Econometrics", J. of Economic Dynamics and Control, 1988 no. 2/3.

Written by:  Estima
Topics:Unit root;Bayesian methods
References:Sims
Requires:Version 5.10
Also available for version 5.00 with fewer features
bbeqje2005.zip

Replication for Bernanke, Boivin & Eliasz (2005), "Measuring the Effects of Monetary Policy: A Factor-augmented Vector Autoregressive (FAVAR) Approach," The Quarterly Journal of Economics, vol. 120(1), pages 387-422.

Written by:  Estima
Topics:Paper results;Bayesian methods;VAR
References:Bernanke;Boivin;Eliasz
Requires:Version 7.30
bdindtests.src

Performs the battery of independence tests used extensively in Brockwell and Davis (2002), "Introduction to Time Series and Forecasting" 2nd ed, Springer.

Written by:  Estima
Topics:Dependence tests
Requires:Version 7.30
bdstest.src

Computes the Brock, Dechert, & Scheinkman Test (BDS) test for i.i.d., "A test of independence based on the correlation dimension" (working paper title). Included in Brock, Hsieh and LeBaron, "Nonlinear Dynamics,Chaos,and Instability", MIT Press, 1993, Chap. 2.

Written by:  Ishigami;Estima
Topics:Dependence tests
References:Brock;Decher;Scheinkman
Requires:Version 5.10
Also available for version 5.00 with fewer features
bernankemihovqje1998.zip

Replication files for Bernanke & Mihov(1998), "Measuring Monetary Policy", QJE, vol 113, no 3, 869-902 (monthly data calculations).
This includes maximum likelihood estimation of structural VAR's, Markov switching estimate of an SVAR and Monte Carlo integration of a just identified SVAR.

Written by:  Estima
Topics:Paper results;VAR
References:Bernanke;Mihov
Requires:Version 7.00
betaparms.src

Returns a 2-vector with the two parameters for a Beta distribution with the given mean and standard deviation

Written by:  Estima
Topics:Bayesian methods
Requires:Version 5.10
Also available for version 5.00 with fewer features
betas.rpf

Estimates beta coefficients for a large number of stocks. Demonstrates use of looping instructions.

Written by:  Estima
Topics:Example programs;Financial
Requires:Version 8.00
bicorrtest.src

Computes the "C" and "H" portmanteau statistics for autocorrelation and third order dependence, from Hinich, M. (1996). "Testing for dependence in the input to a linear time series model." Journal of Nonparametric Statistics, 6, 205-221.

Written by:  Estima
Topics:Dependence tests
References:Hinich
Requires:Version 8.00
Also available for version 6.00 with fewer features
bif.src

Given unusual events that do not fit adequately into a specified model and that manifiest themselves as high leverage points or as outliers, BIF implements the Bounded Influence Function Regression, a robust estimation proposed by Krasker, Ku, and Welsch (1983). This method downweights the influence of potentially influential observations avoiding relatively large contribution to the values of the estimates.

Written by:  Diego Vasquez
Topics:Estimators;Robust
References:Krasker;Ku;Welsch
Requires:Version 5.00
bivariatehp.rpf

Example of a bivariate HP filter.

Written by:  Estima
Topics:Example programs;State-space models
Requires:Version 8.00
bjautofit.src

BJAutofit chooses the minimum AICC or BIC model for the dependent variable. It uses maximum likelihood estimation to ensure that the estimates are done over a consistent time interval.

Written by:  Estima
Topics:ARIMA
Requires:Version 7.30
Also available for version 6.10 with fewer features
bjdiff.src

Generates a table of Schwarz criteria for various combinations of differencings and mean extractions, as a preliminary step in Box-Jenkins modeling.

Written by:  Estima
Topics:ARIMA
Requires:Version 7.30
Also available for version 6.00 with fewer features
bjest.src

Updated version of BJEST procedure included with RATS (for estimating ARIMA models). This version features more options and improved graphics.

Written by:  Estima
Topics:ARIMA
Requires:Version 5.10
Also available for version 5.00 with fewer features
bjfore.prg

Demonstrates forecasting with ARIMA models.

Written by:  Estima
Topics:ARIMA
Requires:Version 5.00
bjfore.src

Estimates and forecasts an ARIMA model

Written by:  Estima
Topics:ARIMA;Forecasting
Requires:Version 5.10
Also available for version 5.00 with fewer features
bjident.src

Computes and graphs autocorrelations and partial autocorrelations of a series and its differences to aid in choosing an ARIMA model

Written by:  Estima
Topics:ARIMA
Requires:Version 7.30
Also available for versions 7.00,5.10,5.00 with fewer features
bjornland_leitemo_jme_2009.zip

Replication file for Bjørnland, Hilde C. and Kai Leitemo (2009), "Identifying the Interdependence between US Monetary Policy and the Stock Market". Journal of Monetary Economics, vol 56, pp 275-282.
Demonstrates use of the SHORTANDLONG procedure on a model with five variables, including Monte Carlo integration of the impulse responses.

Written by:  Estima
Topics:Paper results;VAR
References:Bjornland;Leitemo
Requires:Version 8.00
bjtheil.src

This computes Theil U statistics for a Box-Jenkins ARIMA model.

Written by:  Estima
Topics:ARIMA;Forecasting
Requires:Version 5.00
bjtrans.src

This does offset graphs of the levels, square root and log of an input series to help determine which preliminary transformation is appropriate.

Written by:  Estima
Topics:ARIMA
Requires:Version 6.00
bkfilter.src

Implements a band pass filter on a series using the methods of Baxter and King (1999) "Measuring business cycles: Approximate band-pass filters for economic time series", Review of Economics and Statistics, vol 81, no. 4, 575-593. Revised and updated by Estima, and renamed as BKFILTER (to avoid confusion with other band pass filtering procedures).

Written by:  Alan Taylor
Topics:Detrending;Filtering
References:Baxter;King
Requires:Version 6.00
blanchardquahaer1989.zip

Replication for Blanchard and Quah(1989), "The Dynamic Effects of Aggregate Demand and Supply Disturbances", AER, vol 79, no. 4, pp 655-673. Demonstrates several topics in VAR's: historical decomposition, recovery of structural shocks, long-run restrictions.

Written by:  Estima
Topics:Paper results;VAR
References:Blanchard;Quah
Requires:Version 7.00
blockboot.src

BlockBoot is an alternative to the BOOT instruction which does block draws. You use the output "boot" SERIES[INTEGERS] to do the resampling that you require. The BOOT instruction in RATS version 6.30 and later includes options for doing the same thing (and more).

Written by:  Estima
Topics:Simulations;Bootstrapping
Requires:Version 5.10
blsunit1.src

Recursive minimum unit root test. Banerjee, Lumsdaine and Stock(1992), "Recursive and sequential tests of the unit-root and trend-break hypothesis: theory and international evidence", JBES, vol. 10, 271-287.

Written by:  Vincent Labhard
Topics:Unit root
References:Banerjee;Lumsdaine;Stock
Requires:Version 5.00
blsunit2.src

Rolling minimum unit root test. Based largely on a 1992 paper by Banerjee, Lumsdaine, and Stock.

Written by:  Vincent Labhard
Topics:Unit root
References:Banerjee;Lumsdaine;Stock
Requires:Version 5.00
blsunit3.src

Sequential minimum unit root test. Based largely on a 1992 paper by Banerjee, Lumsdaine, and Stock.

Written by:  Vincent Labhard
Topics:Unit root
References:Banerjee;Lumsdaine;Stock
Requires:Version 5.00
bndecomp.src

Performs the Beveridge-Nelson decomposition on a single series. (See MVBNDECOMP.SRC for multivariate decomposition).
Beveridge and Nelson(1981), "A New Approach to Decomposition of Economic Time Series into Permanent and Transitory Components", J. of Monetary Economics, vol 7, 151-174. The algorithm used is from Newbold(1990), "Precise and Efficient Computation of the Beveridge-Nelson Decomposition of Economic Time Series," J. of Monetary Economics, vol 26, 453-7.

Written by:  Phil Meguire;Estima
Topics:Detrending;Filtering
References:Beveridge;Nelson;Newbold
Requires:Version 6.10
bollerslev_mikkelson_joe1996.zip

Replication file for Bollerslev and Mikkelson(1996), "Modeling and pricing long memory in stock market volatility", Journal of Econometrics, vol 73, pp 151-184.
This estimates FIGARCH and FIEGARCH models (fractionally integrated GARCH and fractionally integrated EGARCH)

Written by:  Estima
Topics:Paper results;ARCH-GARCH;Long memory
References:Bollerslev;Mikkelson
Requires:Version 7.00
bonds.rpf

Estimates a term structure from a set of bond yields. Demonstrates estimation with a function which can't be written in closed form.

Written by:  Estima
Topics:Example programs;Financial
Requires:Version 8.00
bondspline.rpf

Estimates a yield curve using a cubic spline approximation to the discount function, as described in McCulloch(1971), "Measuring the Term Structure of Interest Rates", Journal of Business, vol 44, pp 19-31.

Written by:  Estima
Topics:Example programs;Financial
References:McCulloch
Requires:Version 8.00
bootarma.rpf

Demonstrates bootstrapping of an ARMA Model.
Reference: David S. Stoffer and Kent D. Wall(1991), "Bootstrapping State-Space Models: Gaussian Maximum Likelihood Estimation and the Kalman Filter", Journal of the American Statistical Association, Vol. 86, No. 416, pp. 1024-1033

Written by:  Estima
Topics:Example programs;Bootstrapping;ARIMA
References:Stoffer;Wall
Requires:Version 8.00
bootcointegration.rpf

Example of bootstrapping an FMOLS estimate of cointegrating vectors. Based upon the technique described in Li and Maddala, "Bootstrapping cointegrating regressions", J. of Econometrics 80 (1997) pp 297-318

Written by:  Estima
Topics:Example programs;Bootstrapping;Cointegration
References:Maddala;Li
Requires:Version 5.00
bootfgls.rpf

Example of bootstrapping linear model with estimated heteroscedasticity correction.

Written by:  Estima
Topics:Example programs;Bootstrapping
Requires:Version 9.10
boots.src

Used with MODES.SRC, this bootstraps series and tests against an alternative number of modes. Requires MBKERNEL.SRC (a stripped-down version of the KERNEL.SRC procedure). Also available are MBDEMO.PRG and GDPQ.RAT, a sample program and data file. Or download MODES.ZIP which contains all of the above.

Written by:  Guido Travaglini
References:Silverman;Efron;Tibshirani
Requires:Version 5.00
bootsimple.rpf

Tests the mean of a sample using bootstrapping. Demonstrates the BOOT instruction.

Written by:  Estima
Topics:Example programs;Bootstrapping
Requires:Version 8.00
bootspectrum.rpf

Example of bootstrapping a spectral density. Algorithm from Franke and Hardle(1992) "On Bootstrapping Kernel Spectral Estimates", Annals of Statistics, vol. 20, no 1, 121-145.

Written by:  Estima
Topics:Example programs;Bootstrapping;Spectral
References:Franke;Hardle
Requires:Version 8.00
bootvar.rpf

Example of bootstrapping a simple VAR to get error bands on the impulse responses.

Written by:  Estima
Topics:Example programs;VAR;Bootstrapping
Requires:Version 9.00
Also available for version 8.00 with fewer features
bootvecm.rpf

Does a parametric bootstrap (to get error bands for an IRF) of a VECM with known cointegrating vector.

Written by:  Estima
Topics:Example programs;Cointegration;Bootstrapping
Requires:Version 8.00
boxcox.prg

Shows several methods for estimating a Box-Cox model by maximum likelihood. Demonstrates MAXIMIZE, NLLS with the JACOBIAN option and a grid search using FIND.

Written by:  Estima
Topics:Example programs;Nonlinear estimation
References:Box;Cox
Requires:Version 6.10
Also available for versions 6.00,5.00 with fewer features
bppaneltests.src

Tests the residuals from a least squares regression for presence of random effects using variants of the Breusch-Pagan LM test. It produces the standard BP test (which has chi-squared asymptotics), the Honda one-sided form (which has N(0,1) asymptotics) and the SLM (standardized Lagrange Multiplier) which is similar to the Honda test but uses small-sample corrections for the mean and standard deviation.

Written by:  Estima
Topics:Panel
References:Breusch;Pagan
Requires:Version 7.30
bqdodraws.src

Alternate to MCVARDoDraws which does Monte Carlo draws for a 2-variable BQ factorization.
Blanchard and Quah(1989), "The Dynamic Effects of Aggregate Demand and Supply Disturbances", AER, vol 79, no. 4, pp 655-673.

Written by:  Estima
Topics:VAR;Bayesian methods;Monte Carlo
References:Blanchard;Quah
Requires:Version 7.00
breitung.src

Implements panel unit root tests from Breitung(2000), "The local power of some unit root tests for panel data", from Baltagi, Fomby, Hill (eds), "Nonstationary Panels, Panel Cointegration, and Dynamic Panels (Advances in Econometrics, Volume 15)", Emerald Group Publishing, pp.161-177

Written by:  Estima
Topics:Panel;Unit root
References:Breitung
Requires:Version 8.10
bryboschan.src

Implements the Bry-Boschan (NBER) Business Cycle Dating Algorithm. Can be applied to either monthly data (Bry-Boschan) or quarterly data(Pagan-Harding).
Bry and Boschan (1971). "Cyclical Analysis of Time Series: Selected Procedures and Computer Programs", NBER, New York.
Pagan and Harding (2002) "Dissecting the cycle: a methodological investigation", Journal of Monetary Economics, Volume 49, Issue 2, 365-381.

Written by:  Estima
Topics:Business cycles
References:Bry;Boschan;Pagan;Harding
Requires:Version 8.30
Also available for version 7.00 with fewer features
bsoption.src

BSOPTION computes the value of an option using the Black-Scholes formula. See e.g. Campbell, Lo and MacKinlay, "The Econometrics of Financial Markets", Princeton University Press, 1997. This is the same procedure file that is included with RATS. Revised in March, 2007, to use options, rather than a list of parameters.

Written by:  Estima
Topics:Financial
References:Black;Scholes
Requires:Version 5.00
burnsidejbes1994.zip

Replication of Burnside(1994), "Hansen-Jagannathan Bounds as Classical Tests of Asset-Pricing Models," Journal of Business & Economic Statistics, vol. 12, no 1, pages 57-79.

Written by:  Estima
Topics:Paper results;Financial
References:Burnside
Requires:Version 7.00
cagan.rpf

Estimates a dynamic model using the combination of DSGE and DLM. RATS Version 8, User's Guide, Example 10.4.

Written by:  Estima
Topics:Example programs;State-space models;DSGE
Requires:Version 9.20
Also available for version 8.00 with fewer features
camacho_jel2011.zip

Replication file for Camacho(2011), "Markov-switching models and the unit root hypothesis in real U.S. GDP", Economics Letters, vol. 112, 161-164

Written by:  Estima
Topics:Paper results;Switching models;Unit root
References:Camacho
Requires:Version 8.00
campbellammerjof1993.zip

Replication for Campbell and Ammer(1993), "What Moves the Stock and Bond Markets? A Variance Decomposition for Long-Term Asset Returns", J of Finance, vol 48, pp 3-37.

Written by:  Estima
Topics:Paper results;Financial;VAR
References:Campbell;Ammer
Requires:Version 7.00
cancorr.src

Computes the canonical correlations and related statistics for two sets of series, possibly conditioning on the third set.

Written by:  Estima
Topics:Factor models
Requires:Version 7.00
canmodel.rpf

Demonstrates process for selecting the prior in a Bayesian VAR. Example of the SPECIFY instruction in SYSTEM definition, including standard symmetric priors and a general prior.

Written by:  Estima
Topics:Example programs;VAR;Bayesian methods
Requires:Version 8.00
cappiello_engle_sheppard_jfe2006.zip

Example of two-step estimates of various DCC models. This is the technique described in Cappiello, Engle & Sheppard(2006), "Asymmetric Dynamics in the Correlations of Global Equity and Bond Returns," Journal of Financial Econometrics, vol. 4, no 4, pages 537-572 applied to a different data set.

Written by:  Estima
Topics:Paper results;ARCH-GARCH
References:Cappiello;Engle;Sheppard
Requires:Version 7.10
Also available for version 7.00 with fewer features
carstensenjbes2006.zip

Replication file for Kai Carstenson(2006), "Stock Market Downswing and the Stability of European Monetary Union Money Demand", JBES, vol 24, number 4, pp 395-402. Includes procedure and data files. Demonstrates FM OLS techniques and a Hansen stability test.

Written by:  Carstensen
Topics:Paper results;Stability tests;Cointegration
References:Carstensen
Requires:Version 6.10
casskoopmans.rpf

Solves the Cass-Koopmans growth model.
RATS Version 8, Reference Manual, Example from DSGE

Written by:  Estima
Topics:Example programs;DSGE
References:Cass;Koopmans
Requires:Version 8.00
catsmisc.src

Updated CATS file for use with CATSIRFS.PRG.

Written by:  Estima
Topics:CATS
Requires:Version 5.00
causal.rpf

Demonstrates several forms of bivariate causality tests, including the standard lag exclusion Granger method, Sims and Geweke-Meese-Dent versions of the distributed lag method.

Written by:  Estima
Topics:Example programs;VAR
References:Granger;Sims;Geweke;Meese;Dent
Requires:Version 8.00
cecchetirich_jbes2001.zip

Replication files for Cecchetti and Rich(2001), "Structural Estimates of the U.S. Sacrifice Ratio," JBES, vol. 19, no 4, 416-427.
This examines three different small structural VAR's of the US economy and uses them to estimate the "sacrifice ratio" of GDP lost to disinflation. Using bootstrapping, it shows that the sacrifice ratio is poorly estimated when uncertainty in the VAR is taken into account.
svar2 is for the Cecchetti (2 variable) model
svar3 is for the Shapiro-Watson (3 variable) model
svar4 is for the Gali (4 variable) model

Written by:  Estima
Topics:Paper results;VAR;Bootstrapping
References:Ceccheti;Rich
Requires:Version 9.00
cfeat.src

Program for the determination of the turning points of the time series, calculation of the duration and amplitude of the expansions and recessions. The expansion (recession) is defined as a timespan between a cyclical trough (peak) and peak (trough). The amplitude hence is the absolute distance between trough (peak) and peak (trough).

Written by:  K.A.Kholodilin;Estima
Topics:Business cycles
Requires:Version 7.30
Also available for version 5.10 with fewer features
cffilter.src

This implements a generalized version of the Baxter-King bandpass filter developed by Christiano and Fitzgerald(2003), "The Band Pass Filter", International Economic Review, vol. 44, no. 2, 435-465. (Renamed from BPASS.SRC in July, 2005, to avoid confusion with other band pass filter procedures).

Written by:  Estima
Topics:Detrending;Filtering
References:Christiano;Fitzgerald
Requires:Version 6.10
chanmaheujbes2002.zip

Replication file for Chan and Maheu(2002), "Conditional Jump Dynamics in Stock Market Returns", JBES, vol 20, no. 3, 377-389. This does constant and time-varying intensity (ARJI) models.

Written by:  Estima
Topics:Paper results;ARCH-GARCH
References:Chan(W.H.);Maheu
Requires:Version 6.20
chanmcaleer_afe2003.zip

Replication file for Felix Chan & Michael McAleer(2003), "Estimating smooth transition autoregressive models with GARCH errors in the presence of extreme observations and outliers," Applied Financial Economics, vol. 13, no 8, 581-592.

Written by:  Estima
Topics:Paper results;ARCH-GARCH;Threshold
References:Chan(Felix);McAleer
Requires:Version 8.00
chankarolyi.rpf

Example of GMM with multiple conditions using NLSYSTEM.
Based upon the model from Chan, Karolyi, Longstaff and Sanders(1992), "An Empirical Comparison of Models of the Short-Term Interest Rate" Journal of Finance, vol 47, no 3, 1209-1227.

Written by:  Estima
Topics:Example programs;Financial
References:Chan(K.C.);Karolyi;Longstaff;Sanders
Requires:Version 8.00
chow1.rpf

Demonstrates several ways to compute a "Chow" test for structural break at a known point with two or more samples. Shows the use of multiple LINREG's for the split samples, and also the use of the SWEEP instruction with GROUP for more complicated sample splits.

Written by:  Estima
Topics:Example programs;Stability tests
References:Chow(Gregory)
Requires:Version 8.00
chow2.rpf

This demonstrates a "Chow" tests for sample split at a known location using a single regression with variables dummied out over the interval.

Written by:  Estima
Topics:Example programs;Stability tests
References:Chow(Gregory)
Requires:Version 8.00
chowdenning.src

Computes the multiple variance ratio statistic from Chow, K.V. and Denning, K. (1993) "A simple multiple variance ratio test", Journal of Econometrics, 58, 385-401

Written by:  Estima
Topics:Dependence tests;Financial
References:Chow(K.V.);Denning
Requires:Version 6.00
chowlin.src

ChowLin distributes a series, changing the frequency to a higher one while maintaining the sum over each period, using the Chow-Lin(1971) or related procedure. The newer procedure disaggregate.src is a better choice.
Chow and Lin(1971), "Best Linear Unbiased Interpolation, Distribution and Extrapolation of Time Series by Related Series", Review of Economics and Statistics, vol 53, 372-375.
Fernandez(1981), "A Methodological Note on the Estimation of Time Series", Review of Economics and Statistics, vol 63, 471-478.
Litterman(1983), "A Random Walk, Markov Model for the Distribution of Time Series", JBES, vol 1, 169-173.

Written by:  Estima
Topics:Interpolation
References:Chow(Gregory);Lin
Requires:Version 6.20
Also available for version 6.10 with fewer features
chowtest.rpf

Example of Chow tests in linear model

Written by:  Estima
Topics:Example programs;Stability tests
References:Chow(Gregory)
Requires:Version 8.00
ckls_jof1992.zip

Replication files for Chan, Karolyi, Longstaff and Sanders(1992), "A Empirical Comparison of Models of the Short-Term Interest Rate" Journal of Finance, vol 47, no 3, 1209-1227.
This includes both the original analysis and an alternative that uses a common weight matrix for all the restricted models.

Written by:  Estima
Topics:Paper results;Financial
References:Chan(K.C.);Karolyi;Longstaff;Sanders
Requires:Version 7.00
clarkforetest.src

This procedure calculates Clark and McCracken's MSE-t, MSE-F, ENC-t, and ENC-F forecast performance tests. (Clark and McCracken, 2001 and McCracken, 2004). Additional documentation is available in the file CLARKFORETESTDOC.PDF

Written by:  Clark;Nakata
Topics:Forecasting;Tests(other)
References:Clark;McCracken
Requires:Version 6.00
classicaldecomp.src

Does a classical decomposition of a series into trend-cycle, seasonal and irregular components. The seasonals are assumed to be constant across the data range.

Written by:  Estima
Topics:Detrending;Filtering
Requires:Version 6.20
Also available for version 6.10 with fewer features
cochran2.src

Procedures for computing various measures of persistence proposed by Cochrane in his 1988 JPE article.

Written by:  Francisco Goerlich
Topics:Dependence tests
References:Cochrane
Requires:Version 5.00
cochrane.src

Procedures for computing various measures of persistence proposed by Cochrane(1988), "How Big is the Random Walk in GNP?", JPE, vol 96, 893-920.

Written by:  Francisco Goerlich
Topics:Dependence tests
References:Cochrane
Requires:Version 5.00
cointpo.src

Computes Phillips-Ouliaris multivariate cointegration statistic.

Written by:  Francisco Goerlich
Topics:Cointegration
References:Phillips;Ouliaris
Requires:Version 5.00
cointtst.rpf

Demonstrates several types of tests for cointegration. 1. Dickey-Fuller (using DFUNIT.SRC) test on a (hypothesized) cointegrating vector. 2. Engle-Granger test (using EGTEST.SRC) with an estimated cointegrating vector. 3. Johansen LR test (using JOHMLE.SRC)

Written by:  Estima
Topics:Example programs;Cointegration
Requires:Version 8.00
condition.rpf

Example of conditional forecasting and simulation in a VAR

Written by:  Estima
Topics:Example programs;Forecasting;VAR
Requires:Version 8.00
condition.src

Updated version of the conditional forecasting procedure that has been included with RATS for many years (see Section 10.14 of the RATS 6 User's Guide). This version allows more general linear constraints on the values of future endogenous variables.

Written by:  Estima
Topics:Forecasting;VAR
Requires:Version 7.00
Also available for versions 5.10,5.00 with fewer features
constant.rpf

Demonstrates a variety of tests for parameter constancy in a linear regression. 1. Does a Hansen/Nyblom fluctuations test, using the STABTEST.SRC procedure. 2. Does a Chow predictive test 3. A CUSUM test using the RLS instruction. 4. Sequential F-tests displayed graphically.

Written by:  Estima
Topics:Example programs;Stability tests
Requires:Version 8.00
consumer.rpf

Estimates a consumer demand model using non-linear systems estimation (NLSYSTEM instruction). Demonstrates the use of named PARMSETS created with NONLIN, "adding" them to impose restrictions on the model's parameters.

Written by:  Estima
Topics:Example programs;Regression;Nonlinear estimation
Requires:Version 8.00
copula.rpf

Demonstrates use of a copula as an alternative to a multivariate GARCH model

Written by:  Estima
Topics:Example programs;ARCH-GARCH
Requires:Version 9.00
corrado.src

Computes the non-parametric test statistic from Corrado (1989), "A Non-Parametric Test for Abnormal Security-Price Performance in Event Studies. Journal of Financial Economics, vol. 23, 385-395.

Written by:  Estima
Topics:Financial
References:Corrado
Requires:Version 6.10
corrintegral.src

Computes a correlation integral for a series.

Written by:  Estima
Topics:Dependence tests
Requires:Version 5.10
Also available for version 5.00 with fewer features
crosscorr.src

CrossCorr computes and graphs cross correlations of two series, presenting the information as a 2x2 matrix of graphs, with the autocorrelations of the two series, lag and lead cross correlations in separate graphs. (File was renamed from CROSSCOR.SRC in July, 2005)

Written by:  Estima
Topics:ARIMA
Requires:Version 5.10
Also available for version 5.00 with fewer features
crosspec.src

Computes and optionally graphs the estimated coherence, phase and gain of a pair of series.

Written by:  Estima
Topics:Spectral
Requires:Version 7.00
Also available for versions 5.10,5.00 with fewer features
cseriessymm.src

Symmetrizes the complex series cs

Written by:  Estima
Topics:Spectral
Requires:Version 5.00
cumpdgm.rpf

Demonstrates use of the CUMPDGM.SRC procedure for the Durbin cumulated periodogram test for white noise.

Written by:  Estima
Topics:Example programs;Spectral;Dependence tests
Requires:Version 8.00
cumpdgm.src

Performs a Durbin's Cumulated Periodogram for serial correlation. Durbin(1969), "Tests for Serial Correlation in Regression Analysis Based on the Periodogram of Least Squares Residuals", Biometrika, 1-16.

Written by:  Estima
Topics:Spectral;Dependence tests
References:Durbin;Kolmogorov;Smirnov
Requires:Version 7.30
Also available for versions 7.10,5.00 with fewer features
cushman_zha_jme1997.zip

Replication file for Cushman and Zha(1997), "Identifying monetary policy in a small open economy under flexible exchange rates," Journal of Monetary Economics, vol 39, no 3, 433-448.
This estimates a structural near-VAR, with one block of variables taken as exogenous.

Written by:  Estima
Topics:Paper results;VAR;Bayesian methods
References:Cushman;Zha
Requires:Version 8.00
cusumtests.src

Performs CUSUM and CUSUMQ tests of the input series, which should be a series of recursive residuals.
Brown, Durbin & Evans(1975), "Techniques for Testing the Constancy of Regression Relationships over Time", JRSS-B, vol 37, 149-192.
Edgerton & Wells(1994), "Critical Values for the Cusumsq Statistic in Medium and Large Sized Samples," Oxford Bulletin of Economics and Statistics, vol. 56, no 3, 355-365.
Zeileis(2004), "Alternative Boundaries for CUSUM tests", Statistical Papers, vol 45, no 1, 123-131.

Written by:  Estima
Topics:Stability tests
References:Brown;Durbin;Evans
Requires:Version 7.00
Also available for version 6.00 with fewer features
cvmodel.rpf

Demonstrates the use of the CVMODEL instruction for estimating structural VAR's.

Written by:  Estima
Topics:Example programs;VAR
Requires:Version 8.00
cvstabtest.src

Performs the special case of the Nyblom test for the case of a complete covariance matrix. Note that while this should have the correct asymptotic distribution under the null (under fairly typical assumptions in addition to stability), the argument for it being UMP against an alternative of martingale behavior won't hold because the covariance matrix is constrained to be positive definite.

Written by:  Estima
Topics:Stability tests
References:Nyblom
Requires:Version 7.30
Also available for version 6.10 with fewer features
cxlogdensity.src

This is a generalization of 0gDensity to complex matrices for use in multivariate Whittle likelihood estimation. It computes the frequency-by-frequency log likelihood. Use %CXLogDensityCV for the concentrated Whittle log likelihood.

Written by:  Estima
Topics:Spectral
Requires:Version 6.00
cxlogdensitycv.src

This is a generalization of 0gDensityCV to complex matrices for use in multivariate Whittle likelihood estimation. This computes the concentrated log likelihood. Use %CXLogDensity for the frequency-by-frequency log likelihood.

Written by:  Estima
Topics:Spectral
Requires:Version 6.00
denhaan_jme_2000.zip

Replication of Wouter J. den Haan(2000), "The comovement between output and prices," Journal of Monetary Economics, vol 46, no 1, 3-30.

Written by:  Estima;Den Haan
Topics:Paper results;VAR
References:Den Haan
Requires:Version 7.00
Also available for version 5.00 with fewer features
dennismd2007.zip

Replication file for Dennis(2007), "Optimal Policy in Rational Expectations Models: New Solution Algorithms", Macroeconomic Dynamics, vol 11, 31-55.
Demonstrates use of the DSGEControl procedure.

Written by:  Estima
Topics:Paper results;DSGE
References:Dennis
Requires:Version 7.30
density.src

A procedure for computing the non-parametric density function of a series using a standard normal kernel. Superseded by the introduction of the built-in DENSITY command in RATS Version 5.0, but useful for users with older versions.

Written by:  Gunnar Bardsen
Topics:Outdated
Requires:Version 5.00
denton.src

Implements the proportional Denton method of benchmarking, distributing the sum from a low frequency series based upon the period-to-period rates of change of a (single) higher frequency series. This is designed to be used when the two series are closely related, with the more frequent series being a noisier measure of the less frequent one. The newer procedure disaggregate.src does the same calculation and more.

Written by:  Estima
Topics:Interpolation
Requires:Version 7.00
dfunit.src

Procedure for computing (augmented) Dickey-Fuller Unit Root tests. Dickey and Fuller(1979), "Distribution of the Estimators for Time Series Regressions with a Unit Root", J.A.S.A., 427-431.

Written by:  Estima
Topics:Unit root
References:Dickey;Fuller;MacKinnon
Requires:Version 7.30
Also available for versions 7.20,5.10,5.00 with fewer features
dieboldyilmaz_ej2009.zip

Replication files for Diebold and Yilmaz(2009), "Measuring Financial Asset Return and Volatility Spillovers, with Application to Global Equity Markets," Economic Journal, vol. 119, no. 534, 158-171.
This includes examples for the author's later "generalized spillover" measures.

Written by:  Estima
Topics:Paper results;VAR
References:Diebold;Yilmaz
Requires:Version 8.00
dieboldyilmaz_ijf2012.zip

Replication file for Diebold and Yilmaz(2012), "Better to give than to receive: Predictive directional measurement of volatility spillovers," International Journal of Forecasting, vol. 28, no 1, 57-66.

Written by:  Estima
Topics:Paper results;VAR
References:Diebold;Yilmaz
Requires:Version 9.00
digamma.src

Computes DiGamma and TriGamma functions, which are the first and second derivatives of the log gamma function. Built-in functions for computing these (0IGAMMA and %TRIGAMMA) are now available in RATS beginning with version 6.02.

Written by:  Estima
Topics:Outdated
References:Abramowitz;Stegun
Requires:Version 5.10
disaggregate.src

Does a temporal disaggregation of a series, changing the frequency to a higher one while maintaining the sum, average or final value over each period of the levels. This can handle a variety of models both for the noise term and linear, log-linear and multiplicative relationships. It does the work previously handled by the CHOWLIN, INTERPOL and DISTRIB procedures.

Written by:  Estima
Topics:Interpolation
References:Chow;Lin;Litterman;Fernandez;Denton;Boot;Feibes;Lisman
Requires:Version 7.30
Also available for version 7.00 with fewer features
distrib.src

DISTRIB computes a distribution of a series, changing the frequency to a higher one while maintaining the sum each original period, e.g. producing a monthly "GNP" estimate from quarterly GNP. The newer procedure DISAGGREGATE.SRC can do the same calculation and quite a bit more.

Written by:  Estima
Topics:Interpolation
Requires:Version 5.10
Also available for version 5.00 with fewer features
distriblag.rpf

Demonstrates various techniques for estimating distributed lags.
RATS Version 8, User's Guide, Example 2.5

Written by:  Estima
Topics:Example programs;Distributed lags
Requires:Version 8.00
divisia.src

Computes a Divisia index.

Written by:  Estima
Requires:Version 5.10
Also available for version 5.00 with fewer features
dlmcycle.rpf

Estimation of a state-space model with a common growth cycle

Written by:  Estima
Topics:Example programs;State-space models
Requires:Version 8.00
dlmest.prg

Demonstrates estimation of the free parameters in a state-space model using the instruction DLM.

Written by:  Estima
Topics:Example programs;State-space models
Requires:Version 6.10
Also available for version 5.00 with fewer features
dlmexam1.rpf

Example of Kalman smoothing in a simple state-space model.

Written by:  Estima
Topics:Example programs;State-space models
Requires:Version 8.00
dlmexam2.rpf

Example of Kalman filtering and out-of-sample forecasting in a simple state-space model.

Written by:  Estima
Topics:Example programs;State-space models
Requires:Version 8.00
dlmexam3.rpf

Example of unconditional simulation in a simple state-space model.

Written by:  Estima
Topics:Example programs;State-space models
Requires:Version 8.00
dlmexam4.rpf

Example of conditional simulation for a simple state-space model.

Written by:  Estima
Topics:Example programs;State-space models
Requires:Version 8.00
dlmgls.src

Estimates a linear regression by GLS, where the error process is described by a state space model, like those used by the RATS instruction DLM.

Written by:  Estima
Topics:Estimators;State-space models
Requires:Version 6.20
Also available for version 5.10 with fewer features
dlmirf.src

Computes and graphs impulse responses and error decompositions for the states in a state space model. The transition equation takes the form Y(t)=AY(t-1)+Fw(t) where F is an nxp matrix, where p is the number of fundamental shocks. The covariance matrix of w is assumed to be the identity.

Written by:  Estima
Topics:State-space models
Requires:Version 7.30
Also available for version 6.00 with fewer features
dlmirfexample.rpf

Example of the use of the @DLMIRF procedure for doing impulse responses in a state-space model.

Written by:  Estima
Topics:Example programs;State-space models
Requires:Version 8.00
dmariano.src

Computes Diebold-Mariano Forecast Comparison test, or, optionally, the Modified Diebold-Mariano test.
Diebold and Mariano(1995), "Comparing Predictive Accuracy," JBES, v.13, no.3, 253-63.
Harvey, Leybourne, Newbold(1997), "Testing the equality of prediction mean squared errors", International Journal of Forecasting, vol 13, pp 289-291.

Written by:  Estima
Topics:Forecasting
References:Diebold;Mariano;Harvey;Leybourne;Newbold
Requires:Version 7.30
Also available for version 5.10 with fewer features
dols.src

Implements Stock and Watson's Dynamic OLS estimation of Cointegrating Vectors. We recommend that you download DOLS.ZIP a PK-Zip archive which includes the procedure, a read-me file, an example program and two datafiles. If you just want the procedure file, download DOLS.SRC.

Written by:  Ken Hirayama
Topics:Cointegration;Outdated
References:Stock;Watson
Requires:Version 5.00
dra_joe_2006.zip

Replication file for Diebold, Rudebusch & Aruoba (2006), "The macroeconomy and the yield curve: a dynamic latent factor approach," Journal of Econometrics, vol. 131(1-2), pages 309-338.

Written by:  Estima
Topics:Paper results;State-space models;Financial
References:Diebold;Rudebusch;Aruoba
Requires:Version 7.30
Also available for version 7.00 with fewer features
dsgecontrol.src

Procedure for doing optimal control on a linear rational expectations model. Algorithm from Dennis(2007), "Optimal Policy in Rational Expectations Models: New Solution Algorithms", Macroeconomic Dynamics, vol 11, 31-55.

Written by:  Estima
Topics:DSGE;State-space models
References:Dennis
Requires:Version 7.30
dsgehistory.rpf

Example of computation of the historical decomposition for a DSGE model.

Written by:  Estima
Topics:DSGE;State-space models;Example programs
Requires:Version 9.00
dsgekpr.rpf

Example of solution of a non-linear DSGE model
This uses the model from King, Plosser and Rebelo, but with the date conventions used by Uhlig and Sims, rather than KPR's.

Written by:  Estima
Topics:Example programs;DSGE;State-space models
Requires:Version 8.00
dsgetool.src

Computes the solution to a linear rational expectations model input in the canonical form given in Sims, "Solving Linear Rational Expectations Models", Computational Economics, October, 2002.

Written by:  Estima
Topics:DSGE
References:Sims
Requires:Version 6.10
dueker_jbes1997.zip

Replication file for Dueker(1997), "Markov Switching in GARCH Processes and Mean-Reverting Stock-Market Volatility," J of Business & Economic Statistics, vol. 15, no 1, 26-34.
This estimates a variety of Markov Switching GARCH models.

Written by:  Estima
Topics:Paper results;Switching models;ARCH-GARCH
References:Dueker
Requires:Version 8.00
dueker_jbes2005.zip

A rough implementation of Dueker (2005), "Dynamic Forecasts of Qualitative Variables: A Qual VAR Model of U.S. Recessions", JBES, vol 23, no 1, 96-104, which estimates a VAR with a "probit" equation using Gibbs sampling.
(The data set has a version of the FedFunds rate from a different source, and uses the GDP deflator rather than the CPI)

Written by:  Estima
Topics:Paper results;State-space models;Bayesian methods;Logit/probit
References:Dueker
Requires:Version 7.30
durbinlevinson.src

Uses the Durbin-Levinson recursion to estimate the coefficients in a sequence of autoregressive representations for a stationary series.

Written by:  Estima
Topics:ARIMA
References:Durbin;Levinson
Requires:Version 5.10
eba.src

Performs the calculations from Granger and Uhlig(1990), "Reasonable Extreme Bounds Analysis", J. of Econometrics, vol. 44, 159-170.

Written by:  Uhlig;Estima
Topics:Regression;Bayesian methods
References:Granger;Uhlig
Requires:Version 6.00
ect.rpf

Demonstrates estimation of a vector error correction model. This uses the JOHMLE procedure to estimate the cointegrating vector, then imposes the error correction form using the ECT instruction.

Written by:  Estima
Topics:Example programs;VAR;Cointegration
Requires:Version 8.00
egarchbootstrap.rpf

Example of bootstrapping an EGARCH model (for forecasting variance out-of-sample)

Written by:  Estima
Topics:Example programs;ARCH-GARCH;Bootstrapping
Requires:Version 7.00
egarchsimulate.rpf

Example of simulation of an EGARCH model (for forecasting variance out-of-sample)

Written by:  Estima
Topics:Example programs;ARCH-GARCH;Monte Carlo
Requires:Version 7.00
egcrtval.src

Computes 'exact' critical values for the Dickey-Fuller and the Engle-Granger cointegration tests from the response surface regression in MacKinnon (1991).

Written by:  Stephan Kohns
Topics:Cointegration
References:MacKinnon
Requires:Version 5.00
egtest.src

Computes an Engle-Granger test for cointegration. The (approximate) critical values for t-test form are from MacKinnon, "Critical Values for Cointegration Tests", Long-Run Economic Relationships, R.F. Engle and C.W.J. Granger, eds, London, Oxford, 1991, pp 267-276. Use the related procedure EGTESTRESIDS if you already have the residuals.

Written by:  Estima
Topics:Cointegration
References:Engle;Granger;MacKinnon
Requires:Version 7.30
Also available for version 5.10 with fewer features
egtestresids.src

Computes an Engle-Granger test for cointegration using the residuals from a previous first-stage regression, producing MacKinnon critical values. Use the related procedure EGTEST instead if you need to do the first stage regression as well.

Written by:  Estima
Topics:Cointegration
References:Engle;Granger;MacKinnon
Requires:Version 7.30
Also available for version 5.10 with fewer features
ehljme2000.rpf

Model specification for Erceg, Henderson & Levin(2000), "Optimal monetary policy with staggered wage and price contracts," Journal of Monetary Economics, vol. 46, no 2, 281-313.

Written by:  Estima
Topics:Example programs;DSGE
References:Erceg;Henderson;Levin
Requires:Version 7.30
ehrmann_ellison_valla_el2003.zip

Replicates results from Ehrmann, Ellison, Valla (2003), "Regime-dependent impulse response functions in a Markov-switching vector autoregression model", Economics Letters, Vol. 78, pp. 295-299.
The data set is a reconstruction rather than the authors' original data set.

Written by:  Estima
Topics:Paper results;VAR;Markov switching
References:Ehrmann;Ellison;Valla
Requires:Version 8.00
elderserletis_jmcb2010.zip

Replication file for Elder and Serletis(2010), "Oil Price Uncertainty", Journal of Money, Credit and Banking, Vol. 42, No. 6, 1137-1159.

Written by:  Estima
Topics:Paper results;VAR;GARCH
References:Elder;Serletis
Requires:Version 8.10
elfcalc.src

Computes the empirical likelihood for a set of moment conditions.

Written by:  Estima
Topics:GMM
Requires:Version 6.00
emexample.rpf

Written by:  Estima
Topics:Example programs
Requires:Version 8.00
enders_siklos_jbes2001.zip

Replication file for Enders and Siklos(2001), "Cointegration and Threshold Adjustment," JBES, vol. 19, no. 2, 166-76.

Written by:  Estima;Enders;Siklos
Topics:Paper results;Cointegration;Threshold
References:Enders;Siklos
Requires:Version 7.30
endersgranger.src

Procedure for the threshold unit root tests in
Enders and Granger(1998), "Unit-Root Tests and Asymmetric Adjustment with an Example Using the Term Structure of Interest Rates", JBES, vol 16, pp 304-11.

Written by:  Estima
Topics:Unit root;Threshold
References:Enders;Granger
Requires:Version 7.30
endersgrangerjbes1998.zip

Replicates Enders and Granger(1998), "Unit-Root Tests and Asymmetric Adjustment with an Example Using the Term Structure of Interest Rates", JBES, vol 16, 304-11. The technical details of the program are described on pages 128 - 132 of Enders' "RATS Progamming Manual".

Written by:  Enders;Estima
Topics:Paper results;Unit root;Threshold
References:Enders;Granger;Chan
Requires:Version 5.10
enderssiklos.src

Does various types of the unit root regressions with threshold breaks on the residuals from an Engle-Granger cointegrating regression.
Enders and Siklos(2001), "Cointegration and Threshold Adjustment," JBES, vol. 19, no. 2, 166-76.

Written by:  Estima;Enders;Siklos
Topics:Cointegration;Threshold
References:Enders;Siklos
Requires:Version 7.30
eqntoacf.src

Creates from the ARMA model given by an equation the theoretical autocovariance function

Written by:  Estima
Topics:ARIMA
References:Brockwell;Davis
Requires:Version 5.00
erstest.src

This implements the DFGLS, PT, DFGLSu and QT tests for unit roots due to Elliott, Rothenberg and Stock(1996), "Efficient Tests for an Autoregressive Unit Root", Econometrica, vol 64, no. 4, 813-836 and Elliott(1999), "Efficient Tests for a Unit Root When the Initial Observation is Drawn from its Unconditional Distribution", International Economic Review, vol 40, 767-783.

Written by:  Alan Taylor;Estima
Topics:Unit root
References:Elliott;Rothenberg;Stock
Requires:Version 7.30
Also available for version 6.00 with fewer features
exactinverse.src

Computes the exact (limit) inverse of A + kB as k-->infinity, for p.s.d. symmetric matrices A and B. This is a matrix of the form C + k^-1 D.
This was introduced by Koopman(1997), "Exact Initial Kalman Filtering and Smoothing for Nonstationary Time Series Models," JASA, vol 92, pp 1630-1638. However, the calculation method has been simplified.

Written by:  Estima
Topics:State-space models
References:Koopman
Requires:Version 7.00
ExampleOne.rpf

Introductory example #1 (display instruction)

Written by:  Estima
Topics:Example programs
Requires:Version 8.00
ExampleTwo.rpf

Introductory example #2 (data handling

Written by:  Estima
Topics:Example programs
Requires:Version 8.00
ExampleThree.rpf

Introductory example #3 (linear regression)

Written by:  Estima
Topics:Example programs
Requires:Version 8.00
ExampleFour.rpf

Introductory example #4 (basic forecasting)

Written by:  Estima
Topics:Example programs
Requires:Version 8.00
ExampleFive.rpf

Introductory example #5 (linear regression with hypothesis tests).

Written by:  Estima
Topics:Example programs
Requires:Version 8.00
ExampleSix.rpf

Introductory example #6 (non-linear least squares)

Written by:  Estima
Topics:Example programs
Requires:Version 8.00
expsmooth1.rpf

Demonstrates forecasting using exponential smoothing with non-seasonal data. Uses the instruction ESMOOTH.

Written by:  Estima
Topics:Example programs;Forecasting
Requires:Version 8.00
expsmooth2.rpf

Demonstrates forecasting using exponential smoothing with seasonal data. Uses the instruction ESMOOTH.

Written by:  Estima
Topics:Example programs;Forecasting
Requires:Version 8.00
fabianimestre_ee_2004.zip

Replication for Fabiani & Mestre(2004), "A system approach for measuring the euro area NAIRU," Empirical Economics, vol. 29, no. 2, pages 311-341.
Demonstrates state-space model with multiple observables.

Written by:  Estima
Topics:Paper results;State-space models
References:Fabiani;Mestre
Requires:Version 7.30
faust_carnegie1998.zip

Replication of Faust(1998), "The Robustness of Identified VAR Conclusions About Money", Carnegie-Rochester Conference Series on Public Policy, vol 49, 207-244.
This examines the maximal extent that GDP can be explained by a monetary shock in a VAR.

Written by:  Estima
Topics:Paper results;VAR
References:Faust
Requires:Version 7.00
faustleeper_jbes1997.zip

Replication file for Faust and Leeper(1997), "When Do Long-Run Identifying Restrictions Give Reliable Results", JBES, vol 15, no 3, pp 345-353.
Demonstrates use of the Blanchard-Quah factorization, and the procedures MCGraphIRF, MCFEVDTable and StructResids.

Written by:  Estima
Topics:Paper results;VAR
References:Faust;Leeper
Requires:Version 7.30
fif.src

Fractional Integration Filter procedure. This is now (v 6.10) available in RATS with the RATS DIFF instruction.

Written by:  Francisco Goerlich
Topics:Outdated;Long memory
References:Diebold;Rudebusch
Requires:Version 5.00
filardojbes1994.zip

Example provided by Kim and Nelson of a Markov Switching model with time-varying transition probabilities (TVTP).
Based upon Filardo(1994), "Business Cycle Phases and Their Transitional Dynamics", JBES, vol 12, no 3, 299-308 with a different data set.

Written by:  Estima
Topics:Paper results;Switching models
References:Filardo
Requires:Version 7.10
flux.src

Computes the Nyblom fluctuations test on a set of series of scores. Computes both individual and joint test statistics. Nyblom(1989), "Testing for Constancy of Parameters Over Time", JASA, vol 84, 223-230.

Written by:  Estima
Topics:Stability tests
References:Nyblom
Requires:Version 7.30
Also available for version 6.20 with fewer features
fm.src

Estimates a cointegrating relation among the listed variables using fully modified least squares. Minor update in April, 2007 to fix issue with range used on final regression.
Phillips and Hansen(1990), "Statistical Inference in Instrumental Variables Regression with I(1) Processes", Review of Economic Studies, vol 57, 99-125.
Hansen, Bruce (1992), "Efficient Estimation and Testing of Cointegrating Vectors in the Presence of Deterministic Trends", Journal of Econometrics, vol 53, 87-121.

Written by:  Estima
Topics:Cointegration
References:Hansen(Bruce);Phillips
Requires:Version 7.30
Also available for version 5.10 with fewer features
fmols.src

Fully modified estimation of cointegrating regressions.

Written by:  Evens Salies
Topics:Cointegration;Outdated
References:Hansen(Bruce)
Requires:Version 5.00
forcedfactor.src

Computes a factorization of a covariance matrix which includes (scales of) specified columns in the factorization, or, optionally, a scale of specified rows in the inverse of the factorization. This allows you to either force an orthogonalized component to hit the variables in a specific pattern (done by setting a column of the factorization), or to force that an orthogonalized component be formed from a particular linear combination of innovations (forces a row in the inverse).

Written by:  Estima
Topics:VAR
Requires:Version 7.00
Also available for versions 5.10,5.00 with fewer features
fract.src

Computes a wider range of fractiles than the standard STATISTICS(fract) command in RATS.

Written by:  Norman Morin
Requires:Version 5.00
fractint.rpf

Demonstrates estimation of a fractionally differenced ARMA model (ARFIMA) using the Whittle likelihood.

Written by:  Estima
Topics:Example programs;Long memory;Spectral
Requires:Version 8.00
freqdeseason.rpf

Demonstrates frequency domain deseasonalization as described in Sims (reference??)

Written by:  Estima
Topics:Example programs;Spectral;Seasonality
References:Sims
Requires:Version 8.00
fry_pagan_jel2011.zip

Example of calculation of Fry-Pagan (2011) median target estimator.
"Sign Restrictions in Structural Vector Autoregressions: A Critical Review," Journal of Economic Literature, vol. 49, no. 4, 938-60.

Written by:  Estima
Topics:Paper results;VAR;Bayesian methods
References:Fry;Pagan
Requires:Version 8.00
gain.src

Computes and optionally graphs the estimated gain and phase of a pair of series.

Written by:  Estima
Topics:Spectral
Requires:Version 5.00
galiaer1999.zip

Replication file for Jordi Gali(1999), "Technology, Employment and the Business Cycle: Do Technology Shocks Explain Aggregate Fluctuations", American Economic Review, vol. 89, pp. 249-271.

Written by:  Gali;Estima
Topics:Paper results;VAR
References:Gali
Requires:Version 7.00
Also available for version 6.10 with fewer features
galiqje1992.zip

Replication file for Jordi Gali(1992), "How Well Does the IS-LM Model Fit Postwar U.S. Data", QJE, vol 107, no. 2, pp 709-738. Demonstrates VAR's with short and long run restrictions, particularly the instruction CVMODEL and the ShortandLong procedure.

Written by:  Estima
Topics:Paper results;VAR
References:Gali
Requires:Version 7.30
Also available for version 7.00 with fewer features
gammaparms.src

Returns a 2-vector with the two parameters for a Gamma distribution with the given mean and standard deviation. Note that the RATS functions 0ggammadensity(x,a,b) and %rangamma(a) use a parameterization in terms of shape and scale, not degrees of freedom and mean. This returns the a and b appropriate for use with those functions.

Written by:  Estima
Topics:Bayesian methods
Requires:Version 5.10
garch.src

A menu-driven procedure for estimating univariate ARCH, GARCH, and related models with varying lag lengths. By Norman Morin. Version 6, posted on November 17, 1999, adds support for MA terms in the mean equation, and the procedure code itself is now significantly shorter than before. Download GARCH.SRC (which includes non-negativity constraints) or GARCHN.SRC (identical, but omits non-negativity constraints). Note: RATS now has a built-in GARCH instruction for handling most ARCH and GARCH models, so this procedure is largely obsolete.

Written by:  Norman Morin
Topics:ARCH-GARCH;Menu-driven
References:Bera;Higgins;Engle;Hamilton;Nelson;Trevor
Requires:Version 5.00
garchbacktest.rpf

Example of rolling estimates for a GARCH model (for doing VaR calculations).

Written by:  Estima
Topics:Example programs;ARCH-GARCH
Requires:Version 8.00
garchboot.rpf

Example of bootstrapping with a univariate GARCH model, for calculating Value At Risk.
RATS Version 8, User's Guide, Example 16.6

Written by:  Estima
Topics:Example programs;ARCH-GARCH;Bootstrapping
Requires:Version 8.00
garchdeco.rpf

Example of estimation of a multivariate GARCH with DECO estimator.
Method (not example) from Engle and Kelly(2011), "Dynamic Equicorrelation", Journal of Business & Economic Statistics, vol 30, no 2, pp 212-228.

Written by:  Estima
Topics:Example programs;ARCH-GARCH
References:Engle;Kelly
Requires:Version 8.00
garchfore.src

GARCHFore computes out-of-sample variance forecasts for a standard univariate GARCH model, estimated using the GARCH instruction.

Written by:  Estima
Topics:ARCH-GARCH
Requires:Version 6.20
garchflux.rpf

Example of use of fluctuation test for GARCH model

Written by:  Estima
Topics:Example programs;ARCH-GARCH;Stability tests
References:Nyblom
Requires:Version 8.00
garchgirf.rpf

Example of variance GIRF from multivariate GARCH model.

Written by:  Estima
Topics:Example programs;ARCH-GARCH
Requires:Version 9.00
garchgibbs.rpf

Analysis of a univariate GARCH model using random walk Metropolis-Hastings.
RATS Version 8, User's Guide, Example 16.5

Written by:  Estima
Topics:Example programs;ARCH-GARCH;Bayesian methods;Monte Carlo
Requires:Version 8.00
garchimport.rpf

Example of Monte Carlo integration on a GARCH model using importance sampling.
RATS Version 8, User's Guide, Example 16.3

Written by:  Estima
Topics:Example programs;ARCH-GARCH;Bayesian methods;Monte Carlo
Requires:Version 8.00
garchmv.rpf

Multivariate GARCH examples. This program was originally written by Rob Trevor and discussed in May, 1994 issue of the RATSletter. It has since been updated by Estima to demonstrate newer aspects of the RATS code, and to include Engle's Dynamic Conditional Correlation (DCC) model. Note: RATS now has a built-in GARCH instruction for handling most ARCH and GARCH models, so the examples in this file are generally obsolete.

Written by:  Rob Trevor;Estima
Topics:Example programs;ARCH-GARCH
References:Trevor
Requires:Version 8.00
garchmvbootstrap.rpf

Example of bootstrapping for MV GARCH models. This estimates quantiles on bootstrapped 10-day returns using two different MV GARCH models.

Written by:  Estima
Topics:Example programs;ARCH-GARCH;Bootstrapping
Requires:Version 7.00
garchmvdcc2.rpf

Demonstrates multivariate GARCH with two-step DCC estimator.
Engle(2002), "Dynamic Conditional Correlation: A Simple Class of Multivariate Generalized Autoregressive Conditional Heteroskedasticity Models," JBES, vol 20, no 3, 339-350.

Written by:  Estima
Topics:Example programs;ARCH-GARCH
References:Engle
Requires:Version 6.00
garchmvdccgibbs.rpf

Example of Gibbs sampling (using Independence Chain Metropolis) with DCC model

Written by:  Estima
Topics:Example programs;ARCH-GARCH;Bayesian methods;Monte Carlo
Requires:Version 8.00
garchmvmax.rpf

Written by:  Estima
Topics:Example programs;ARCH-GARCH
Requires:Version 8.10
Also available for version 8.00 with fewer features
garchmvsimulate.rpf

Example of simulation of a multivariate (DVECH) GARCH process

Written by:  Estima
Topics:Example programs;ARCH-GARCH
Requires:Version 7.00
garchm_uv_dummy.rpf

An example of univariate GARCH-M with dummy shift in the "M" effect and variance.
Based upon a model from Sun and Tong(2010), "Risk and the January effect", Journal of Banking and Finance, vol 34, no 5, 965-974.

Written by:  Estima
Topics:Example programs;ARCH-GARCH
References:Sun;Tong
Requires:Version 9.10
garchn.src

Same as GARCH.SRC, but without non-negativity constraints.

Written by:  Norman Morin
Topics:ARCH-GARCH;Menu-driven
References:Bera;Higgins;Engle;Hamilton;Nelson;Trevor
Requires:Version 5.00
garchsemiparam.rpf

Estimation of univariate GARCH model with semi-parametric handling of the density of the error process. Partially described in RATS Version 8 User's Guide, section 13.1

Written by:  Estima
Topics:Example programs;ARCH-GARCH
Requires:Version 8.00
garchuv.rpf

Univariate GARCH examples. This program was originally written by Rob Trevor and discussed in May, 1994 issue of the RATSletter. Note: RATS now has a built-in GARCH instruction for handling most ARCH and GARCH models, so the examples in this file are generally obsolete.

Written by:  Rob Trevor
Topics:Example programs;ARCH-GARCH
References:Trevor
Requires:Version 8.00
garchuvmax.rpf

Examples of estimates of univariate GARCH models using MAXIMIZE.

Written by:  
Topics:Example programs;ARCH-GARCH
Requires:Version 8.00
garchvirfdiag.rpf

Example of computing the Volatility Impulse Response (VIRF) for a GARCH model which doesn't have a "VECH" form, but only models the variances.

Written by:  Estima
Topics:Example programs;ARCH-GARCH
Requires:Version 8.00
gausshermite.src

GaussHermite returns the points at which f(x) needs to be evaluated and the corresponding weights for Gauss-Hermite numerical integration.

Written by:  Estima
Topics:Numerical methods
Requires:Version 6.00
gcontour.rpf

Demonstrates the GCONTOUR instruction for creating contour graphs.

Written by:  Estima
Topics:Example programs;Graphics
Requires:Version 8.00
geddraw.src

Generates draws for a generalized error distribution by acceptance-rejection method. Revised in April, 2006, to add SHAPE option.

Written by:  Estima
Topics:Random numbers
Requires:Version 5.00
gencombos.src

Systematically generates all combinations of k integers from the set {1,...,n}. All this procedure does is to generate them as the vector of integers "pick". If you need to do something more than this, insert the necessary code at the "disp pick" instruction.

Written by:  Estima
Requires:Version 5.00
gibbs.rpf

Demonstrates Gibbs sampling for a linear regression model with a Normal-gamma prior. Uses DENSITY instruction to generate estimated density function for parameters.

Written by:  Estima
Topics:Example programs;Regression;Monte Carlo;Bayesian methods
Requires:Version 8.00
gibbsprobitdynamic.rpf

Demonstrates Gibbs sampling estimation of a dynamic "probit" model, where the latent index follows an AR(1) equation.

Written by:  Estima
Topics:Example programs;Logit/probit;Monte Carlo;Bayesian methods
Requires:Version 7.30
gibbsvar.rpf

This is an example of the use of Gibbs sampling applied to a VAR with a standard Minnesota prior. Different priors can be handled by changing the way that bprior and hprior (the mean and precision of the prior) are created.

Written by:  Estima
Topics:Example programs;VAR;Bayesian methods;Monte Carlo
Requires:Version 8.00
gibbsvar.src

Uses Gibbs sampling to compute posterior distributions of the parameters of a VAR, along with forecasts. The model/estimator is the normal-diffuse of Kadiyala and Karlsson (1997), "Numerical Methods for Estimation and Inference in Bayesian VAR Models," Journal of Applied Econometrics, pp 99-132

Written by:  Todd Clark
Topics:VAR;Bayesian methods;Monte Carlo
References:Kadiyala;Karlsson
Requires:Version 6.10
giv.rpf

Demonstrates generalized instrumental variables estimation. Uses the NLLS instruction with the INSTRUMENTS and OPTIMAL options.

Written by:  Estima
Topics:Example programs;GMM
Requires:Version 8.00
glsdetrend.src

Local to unity GLS detrending routine. Includes the ERS cases (no constant, constant, constant and trend) as well as the Perron and Rodriguez cases (constant and trend with a single break). This just does the detrending, not the actual unit root test(s).
Elliott, Rothenberg and Stock(1996), "Efficient Tests for an Autoregressive Unit Root", Econometrica, vol 64, no. 4, pp 813-836.
Perron and Rodriguez(2003), "GLS Detrending, Efficient Unit Root Tests and Structural Change", Journal of Econometrics, vol 115, pp 1-27.

Written by:  Estima
Topics:Unit root
References:Elliott;Rothenberg;Stock;Perron;Rodriguez
Requires:Version 7.00
gmautofit.src

Does an automatic fit of a multiplicative seasonal ARMA model to a series following the procedure described in Gomez and Maravall, "Automatic Modeling Methods for Univariate Series", in Peña, Tiao and Tsay, eds., "A Course in Time Series Analysis", New York: Wiley, 2001.

Written by:  Estima
Topics:ARIMA
References:Gomez;Maravall
Requires:Version 7.30
Also available for version 7.10 with fewer features
gnewbold.src

Performs the Granger-Newbold forecast comparison test.
Granger and Newbold(1973), "Some Comments on the Evaluation of Economic Forecasts", Applied Economics, vol. 5, 35-47.

Written by:  Estima
Topics:Forecasting
References:Granger;Newbold
Requires:Version 7.30
Also available for versions 5.10,5.00 with fewer features
gonzales-rivera_nd1998.zip

Replication file for González-Rivera(1998), "Smooth-Transition GARCH Models," Studies in Nonlinear Dynamics & Econometrics, vol. 3, no 2, 1-20.

Written by:  Estima
Topics:Paper results;ARCH-GARCH;Threshold
References:Gonzales-Rivera
Requires:Version 8.00
gonzalograngerjbes1995.zip

Replication of the interest rates example in Gonzalo and Granger(1995), "Estimation of common long memory components in cointegrated systems", JBES, vol 13, pp 27-36. Demonstrates the procedure johmle.src and the function %PERP.

Written by:  Estima
Topics:Paper results;Cointegration
References:Gonzalo;Granger
Requires:Version 7.00
Also available for version 6.20 with fewer features
gph.src

Estimates fractional difference power for series using the frequency domain regression techniques of Geweke and Porter-Hudak(1983), "The Estimation and Application of Long Memory Time Series Models", J. of Time Series Analysis, pp 221-238.

Written by:  Estima
Topics:Spectral;Long memory
References:Geweke;Porter-Hudak
Requires:Version 7.30
Also available for versions 5.10,5.00 with fewer features
grangerbootstrap.rpf

Bootstrapped p-values for Granger causality test.
Alternative to CAUSAL.RPF
RATS Version 8, User's Guide, Example 3.2

Written by:  Estima
Topics:Example programs;VAR;Bootstrapping
References:Granger
Requires:Version 8.00
graphboxplot.rpf

Demonstrates creating of a boxplot using the GBOX instruction.

Written by:  Estima
Topics:Example programs;Graphics
Requires:Version 8.00
graphforecast.rpf

Demonstrates graphing forecasts (time series defined over different intervals). Uses the ESMOOTH instruction for forecasts.

Written by:  Estima
Topics:Example programs;Graphics;Forecasting
Requires:Version 8.00
graphfunction.rpf

Demonstrates use of the SCATTER instruction with STYLE=LINES for graphing a general function.

Written by:  Estima
Topics:Example programs;Graphics
Requires:Version 8.00
graphhighlow.rpf

Demonstrates "high-low-close" graphs, done using the GRAPH instruction with the option STYLE=VERTICAL.

Written by:  Estima
Topics:Example programs;Graphics
Requires:Version 8.00
graphlabels.rpf

Demonstrates the various labels on a GRAPH instruction.

Written by:  Estima
Topics:Example programs;Graphics
Requires:Version 8.00
graphmatrix.src

GraphMatrix graphs a rectangular array of series on separate graphs The user can control the maximum number of graphs which can be placed either horizontally or vertically; if needed, the procedure will create as many pages as necessary in order to display the graphs.

Written by:  Estima
Topics:Graphics
Requires:Version 5.00
graphoverlay.rpf

Demonstrates "overlay" graphs (graphs with separate scales for the left and right axes).

Written by:  Estima
Topics:Example programs;Graphics
Requires:Version 8.00
grayjfe1996.zip

Replicates work on Markov-switching GARCH models from Gray(1996), "Modeling the conditional distribution of interest rates as a regime-switching process", J. of Financial Economics, vol 42, pp 27-62. Makes extensive use of the functions on markov.src.

Written by:  Estima
Topics:Paper results;ARCH-GARCH;Switching models
References:Gray
Requires:Version 7.00
Also available for version 6.10 with fewer features
gregoryhansen_joe1996.zip

Replication of example from Gregory and Hansen(1996), "Residual-based Tests for Cointegration in Models with Regime Shifts", Journal of Econometrics, vol 70, 99-126.

Written by:  Estima
Topics:Paper results;Cointegration;Structural breaks
References:Gregory;Hansen(Bruce)
Requires:Version 7.30
gregoryhansen.src

Implements the Gregory-Hansen cointegration test. The cointegrating regression is allowed to have a trend or not, and can have either a break in the intercept only or a break in all coefficients.
Gregory and Hansen(1996), "Residual-based Tests for Cointegration in Models with Regime Shifts", Journal of Econometrics, vol 70, 99-126.
Gregory and Hansen(1996), "Tests for Cointegration in Models with Regime and Trend Shifts," Oxford Bulletin of Economics and Statistics, vol. 58, no 3, pp 555-560.
(Renamed from GREGHANS.SRC in July, 2005).

Written by:  Estima
Topics:Cointegration;Structural breaks
References:Gregory;Hansen(Bruce)
Requires:Version 7.30
Also available for versions 5.10,5.00 with fewer features
gridseries.src

Creates a series with an evenly spaced grid based either upon range and number of points, or range and interval width.

Written by:  Estima
Requires:Version 5.00
grier_henry_etal_jae2004.zip

Replication file for Grier, Henry, Olekalns & Shields(2004), "The asymmetric effects of uncertainty on inflation and output growth," Journal of Applied Econometrics, vol 19, no. 5, 551-565.
This requires RATS 8.2 or later because of the use of the SIGNS option on the GARCH instruction to allow for asymmetric effects with different signs for output and inflation.

Written by:  Estima
Topics:Paper results;ARCH-GARCH
References:Grier;Henry;Olekalns;Shields
Requires:Version 8.30
hadri.src

Implements Hadri tests for unit roots in panel data. This has stationarity as the null, and rejects if the detrended or de-meaned data are too persistent.
Hadri(2000), "Testing for stationarity in heterogeneous panel data", The Econometrics Journal, vol 3, no 2, 148-161.

Written by:  Estima
Topics:Panel;Unit root
References:Hadri
Requires:Version 7.30
hafner_herwartz_jimf2006.zip

Replication file for Hafner and Herwartz(2006), "Volatility impulse responses for multivariate GARCH models: An exchange rate illustration", Journal of International Money and Finance, vol 25, no 5, 719-740.
Note: the data set is a reconstruction.

Written by:  Estima
Topics:Paper results;ARCH-GARCH
References:Hafner;Herwartz
Requires:Version 7.30
halton.src

Generates an n-vector of the Halton sequence for the given base (which should be a prime number). Halton sequences are deterministic "low-discrepancy" sequences which fill the unit cube relatively uniformly (with a different base for each dimension) allowing numerical integrals to be estimated more accurately for a given number of function evaluations than would be possible with truly random numbers.

Written by:  Estima
Topics:Numerical methods
References:Halton
Requires:Version 5.10
hamilton_susmel_joe1994.zip

Replication file for Hamilton and Susmel(1994), "Autoregressive Conditional Heteroskedasticity and Changes in Regime," Journal of Econometrics, vol 64, pp 307-333.
This does Markov Switching ARCH models.

Written by:  Estima
Topics:Paper results;ARCH-GARCH;Switching models
References:Hamilton;Susmel
Requires:Version 8.00
hamilton.rpf

Updated version of the HAMILTON.PRG switching model example discussed in the RATS 5.0 User's Guide. This version includes an EM algorithm written by Andrew Leach that provides better initial conditions, allow the model to converge to a solution when using the entire sample data set.

Written by:  Estima
Topics:Example programs;Switching models;Markov switching
References:Hamilton
Requires:Version 8.00
hannan.rpf

Demonstrates Hannan Efficient GLS estimation for a distributed lag.

Written by:  Estima
Topics:Example programs;Serial correlation;Spectral
Requires:Version 8.00
hannanrissanen.src

Computes estimates for an ARMA model using the Hannan-Rissanen algorithm, which runs a LS regression on lags of the dependent variable and residuals from a long preliminary AR.
Hannan and Rissanen, "Recursive estimation of mixed autoregressive-moving average order", Biometrika, 1991, vol 69, pp 81-94.

Written by:  Estima
Topics:ARIMA
References:Hannan;Rissanen
Requires:Version 5.10
hansen_ier1994.zip

Replication of Bruce Hansen (1994), "Autoregressive Conditional Density Estimation", International Economic Review, vol 35, no. 3, pp 705-730. This estimates GARCH models with student t errors with time-varying degrees of freedom, and introduces the skew-t density.

Written by:  Estima
Topics:Paper results;ARCH-GARCH
References:Hansen(Bruce)
Requires:Version 7.30
hansen_jbes_1997.zip

Replication file for the examples of Hansen, Bruce E.(1997), "Approximate Asymptotic P-Values for Structural Change Tests", Journal of Business and Economic Statistics, vol 15, no. 1, pp 60-67.
Uses APBREAKTEST procedure.

Written by:  Estima
Topics:Paper results;Stability tests
References:Hansen(Bruce);Andrews;Ploberger
Requires:Version 5.10
hansen_joe1999.zip

Replication file from Bruce Hansen(1999), "Threshold effects in non dynamic panels: estimation, testing and inference", Journal of Econometrics, vol 93, pp 345-368.
Does threshold effects on a fixed effects estimator in panel data. Demonstrates use of PANELTHRESH procedure.

Written by:  Estima
Topics:Paper results;Panel;Structural breaks
References:Hansen(Bruce)
Requires:Version 8.10
hansen_joe2000.zip

Replication for Hansen(2000), "Testing for Structural Change in Conditional Models", Journal of Econometrics, vol. 97, no. 1, pages 93-115.
Demonstrates test for a structural break in a linear regression model with fixed regressor bootstrap.

Written by:  Estima
Topics:Paper results;Stability tests;Bootstrapping
References:Hansen(Bruce)
Requires:Version 7.30
hansen.rpf

Demonstrates use of LINREG with INSTRUMENTS for testing overidentifying restrictions.

Written by:  Estima
Topics:Example programs;GMM;Specification tests
Requires:Version 8.00
hansenecm1996.zip

Replication program for a SETAR model on GNP from Bruce Hansen(1996), "Inference When a Nuisance Parameter is Not Identified Under the Null Hypothesis", Econometrica, vol 64, no. 2, pp 413-430. Demonstrates use of tar.src procedure.

Written by:  Estima
Topics:Paper results;Switching models
References:Hansen(Bruce)
Requires:Version 7.00
Also available for version 6.10 with fewer features
hansenseojoe2002.zip

Replication file for Hansen and Seo(2002), "Testing for two-regime threshold cointegration in vector error-correction models", Journal of Econometrics, vol 110, pp 293-318.

Written by:  Estima
Topics:Paper results;Cointegration;Threshold
References:Hansen(Bruce);Seo
Requires:Version 7.00
Also available for version 6.00 with fewer features
harveyruizshephardrestud.zip

Replication file for Harvey, Ruiz and Shephard(1994), "Multivariate Stochastic Variance Models", Review of Economic Studies, vol 61, no. 2, pp 247-264. Includes programs for univariate and multivariate models.

Written by:  Estima
Topics:Paper results;State-space models;Financial;Stochastic volatility
References:Harvey;Ruiz;Shephard
Requires:Version 7.00
hasbrouck.rpf

Example of the calculation of decomposition of long-run variance using the techniques from Hasbrouck(1995) "One security, many markets: determining the contribution to price discovery", Journal of Finance, vol 50, no 4, pp 1175-1199.

Written by:  Estima
Topics:Example programs;Cointegration
References:Hasbrouck
Requires:Version 9.00
hausman.rpf

Demonstrates direct calculation of a Hausman specification test statistic for 2SLS vs 3SLS.

Written by:  Estima
Topics:Example programs;Specification tests
Requires:Version 8.00
hegy.src

An implementation of the "HEGY" (Hylleberg, Engle, Granger, and Yoo, 1990) seasonal unit root tests for quarterly time series. Options allow you to specify the number of lags, and choose between models with and without intercept, seasonal dummies, and/or trend. You can also have it test all of these models at once.

Written by:  Suliman Al-Turki
Topics:Unit root;Seasonality
References:Hylleberg;Engle;Granger;Yoo
Requires:Version 5.00
hetero.rpf

Demonstrates LINREG with the SPREAD option for estimating regression with heteroscedastic errors. Includes examples with both variances being known and being estimated.

Written by:  Estima
Topics:Example programs
Requires:Version 8.00
heterotest.rpf

Demonstrates Goldfeld-Quandt, Breusch-Pagan and Harvey tests for heteroscedasticity.

Written by:  Estima
Topics:Example programs
Requires:Version 8.00
hillgev.src

Estimates the tail index for a distribution, using Hill's method.
Hill(1975), "A Simple General Approach to Inference About the Tail of a Distribution," Annals of Statistics, vol 3, 1163-1174.

Written by:  Estima
References:Hill
Requires:Version 6.00
hinichtest.src

Performs the Hinich bispectrum test for linearity and Gaussianity. Hinich and Patterson (1989), "Evidence of nonlinearity in the trade-by-trade stock market return generating process", in Economic Complexity: Chaos, Sunspots, Bubbles and Nonlinearity, Barnett, Geweke and Shell, eds. Cambridge University Press.

Written by:  Estima
Topics:Tests(other)
References:Hinich;Patterson
Requires:Version 6.10
histbins.src

A modified version of the older HIST.SRC (see below). This version displays bin ranges and counts.

Written by:  Nick Kanellopoulos
Requires:Version 5.00
histogram.src

New Histogram procedure, using the DENSITY command introduced in RATS 5.0. This includes one command that requires 5.04 or later--this command can be removed if you have an older version (see comment line in the file). (Renamed from HISTOGRM.SRC).

Written by:  Estima
Requires:Version 7.00
Also available for versions 5.10,5.00 with fewer features
history.rpf

Demonstrates calculation and graphing of the historical decomposition of the data using a VAR.

Written by:  Estima
Topics:Example programs;VAR
Requires:Version 9.00
Also available for version 8.00 with fewer features
histscat.src

HISTSCAT generates a histogram plot using SCATTER with the XLABELS option. It can't do bar graphs, but it does provide proper x-axis labeling.

Written by:  Estima
Requires:Version 5.00
hjbounds.src

HJBounds computes (and optionally graphs) the Hansen-Jagannathan bounds for a set of returns, as a function of the unobserved mean of a riskfree asset.
Hansen and Jagannathan(1991), "Implications of Security Market Data for Models of Dynamic Economics", JPE, vol 99, 225-262.

Written by:  Estima
Topics:Financial
References:Hansen(Lars);Jagannathan
Requires:Version 5.00
holtz-eakin_n_r_ecm1988.zip

Example of techniques for estimating a VAR with panel data (with large N-small T data set) from Holtz-Eakin, Newey and Rosen(1988), "Estimating Vector Autoregressions with Panel Data," Econometrica, vol. 56, no 6, pp 1371-95.
The data set is from the same source as Holtz-Eakin, Newey and Rosen(1989), "The Revenues-Expenditures Nexus: Evidence from Local Government Data," International Economic Review, vol 30, no 2, 415-429, but looks at a different model.

Written by:  Estima
Topics:Paper results;Panel;VAR
References:Holtz-Eakin;Newey;Rosen
Requires:Version 7.00
hpfilter.rpf

Demonstrates various ways of computing the Hodrick-Prescott filter using RATS. The standard HP filter is built into the FILTER instruction (beginning with RATS 6.20), but it can also be analyzed using the instruction DLM.

Written by:  Estima
Topics:Example programs;Detrending;Filtering
References:Hodrick;Prescott
Requires:Version 8.00
hpfilter.src

Executes a Hodrick-Prescott Filter (Hodrick, R. & Prescott, E., "Post-War U.S. Business Cycles: An Empirical Investigation", Carnegie-Mellon working paper, 1980. NOTE: The FILTER instruction in RATS can now compute the HP filter directly.

Written by:  Estima
Topics:Outdated;Detrending;Filtering
References:Hodrick;Prescott
Requires:Version 5.00
htunit.src

Implementation of Harris-Tzavalis test for unit roots in panel data. This has a null of a unit root, with asymptotics assuming large N, fixed T.
Harris and Tzavalis(1999), "Inference for unit roots in dynamic panels where the time dimension is fixed". Journal of Econometrics, vol 91, pp 201–226.

Written by:  Estima
Topics:Panel;Unit root
References:Harris;Tzavalis
Requires:Version 7.30
hurst.src

Computes a Hurst exponent. Revised in March, 2007 to use a single dialog box for input, and for improved output.

Written by:  Estima
Topics:Long memory
References:Hurst
Requires:Version 6.00
Also available for version 5.00 with fewer features
icss.src

Performs the Inclan-Tiao test for breaks in variance.
Inclan and Tiao(1994), "Use of Cumulative Sums of Squares for Retrospective Detection of Changes in Variance", JASA, vol 89, 913-923.

Written by:  Estima
Topics:Stability tests
References:Inclan;Tiao
Requires:Version 7.30
Also available for version 5.10 with fewer features
imhof.src

Imhof Procedure for computing P(u'Au < x) for a quadratic form in Normal(0,1) variables. This can be used for ratios of quadratic forms as well, since P((u'Au/u'Bu) < x)= P(u'(A-xB)u < 0). Use the functions %QFORMPDF or %QFORMDPDF with RATS versions 6.00 or later.

Written by:  Estima
Topics:Outdated
References:Imhof;Abrahamse;Koerts
Requires:Version 5.00
impulses.rpf

Demonstrates calculation and (various ways of) graphing impulse response functions. It also demonstrates with VARIRF.SRC procedure, which can do these types of graphics as well.

Written by:  Estima
Topics:Example programs;VAR;Graphics
Requires:Version 8.00
inclantiao.rpf

Replication file for Inclan and Tiao, "Use of Cumulative Sums of Squares for Retrospective Detection of Changes in Variance", JASA 1994, vol 89, pp 913-923. Data are included in the program file.

Written by:  Estima
Topics:Paper results;Stability tests
References:Inclan;Tiao
Requires:Version 7.30
influnem.rpf

Demonstrates looping over graph instructions.

Written by:  Estima
Topics:Example programs;Graphics
Requires:Version 8.00
instrument.rpf

Demonstrates basic 2SLS estimation, using the instruction LINREG with the INSTRUMENTS option.

Written by:  Estima
Topics:Example programs;GMM
Requires:Version 8.00
interpol.src

Interpolates a series, changing the frequency to a higher one while maintaining the last value in each period. The newer procedure DISAGGREGATE.SRC can do the same calculation and quite a bit more.

Written by:  Estima
Topics:Interpolation
Requires:Version 5.10
Also available for version 5.00 with fewer features
intervention.rpf

Demonstrates intervention analysis using the instruction BOXJENK with the INPUTS option.

Written by:  Estima
Topics:Example programs;ARIMA
Requires:Version 8.00
invchisqrparms.src

Returns a 2-vector with the two parameters (degrees of freedom and scale, in that order) for an inverse chi-square distribution with the given mean and standard deviation.

Written by:  Estima
Topics:Bayesian methods
Requires:Version 6.00
invgammaparms.src

Returns a 2-vector with the two parameters for an inverse Gamma distribution with the given mean and standard deviation. Note that the RATS functions 0ggammadensity(x,a,b) and %rangamma(a) use a parameterization in terms of shape and scale, not degrees of freedom and mean. This returns the a and b appropriate for use with those functions.

Written by:  Estima
Topics:Bayesian methods
Requires:Version 6.00
Also available for version 5.10 with fewer features
ipshin.src

Implements panel unit root tests from Im, Pesaran and Shin(2003), "Testing for Unit Roots in Heterogeneous Panels", J. of Econometrics, vol 115,53-74.

Written by:  Estima
Topics:Unit root;Panel
References:Im;Pesaran;Shin
Requires:Version 7.30
Also available for version 7.10 with fewer features
irelandjedc2004.zip

Replication program for Ireland(2004), "A Method for Taking Models to the Data", Journal of Economic Dynamics and Control, vol 28, no. 6, 1205-1226.
Demonstrates use of DSGE instruction, combined with DLM, for estimating a dynamic model using maximum likelihood.

Written by:  Estima
Topics:Paper results;DSGE;State-space models
References:Ireland
Requires:Version 7.20
irfrestrict.src

Builds up (one constraint at a time) a restriction matrix for a "B" form structural VAR.

Written by:  Estima
Topics:VAR
Requires:Version 8.00
johmle.src

Computes Johansen lambda tests for cointegrating rank, and the ML estimator for a single cointegrating vector. Updated in February, 2006, October, 2006, and February, 2007, to include additional options and improved output.

Written by:  Estima
Topics:Cointegration
References:Johansen
Requires:Version 7.30
Also available for versions 7.00,6.10,5.10 with fewer features
jprjbes1994.zip

Replication file for Jacquier, Polson and Rossi(1994), "Bayesian Analysis of Stochastic Volatility Models," Journal of Business and Economic Statistics, vol 12, no 4, pp. 371-89.
Includes both a Metropolic MCMC and a rejection method similar to that in Kim, Shephard and Chib(1998), "Stochastic Volatility: Likelihood Inference and Comparison with ARCH Models", Review of Economic Studies, vol 65, pp 361-93.

Written by:  Estima
Topics:Paper results;Bayesian methods;Financial;Stochastic volatility
References:Jacquier;Polson;Rossi
Requires:Version 7.30
kernel.src

KERNEL.SRC computes and graphs a non-parametric estimate of the unconditional density of a single series. Other than the graphics, this can be done with with the RATS instruction DENSITY with any version 5.0 or later.

Written by:  Norman Morin
Topics:Outdated;Nonparametric
References:Epanechnikov;Gauss
Requires:Version 5.00
kernreg.src

KERNREG.SRC and LOWESS.SRC are procedures for flexible fits of the form y = f(x). KERNREG does this by kernel regression (weighted sums of y values), while LOWESS uses locally weighted fits of first order polynomials. RATS v5 now includes the NPREG instruction.

Written by:  Estima
Topics:Outdated;Nonparametric
Requires:Version 5.00
kfexact.src

KFEXACT.SRC performs the Kalman filtering technique described in "Exact Initial Kalman Filtering and Smoothing for Nonstationary Time Series Models" by Siem Jan Koopman, JASA, December 1997. This is now included in the RATS instruction DLM when you use the EXACT option.

Written by:  Estima
Topics:Outdated;State-space models
References:Koopman
Requires:Version 5.00
kfilter.src

Kalman filtering procedure, using general matrix inputs (updated so that you don't have to declare/dimension the XKK array ahead of time). This procedure has been superseded by the built-in DLM command introduced in RATS 5.0.

Written by:  Estima
Topics:Outdated;State-space models
Requires:Version 5.00
kilian_restat1998.zip

Replication of Kilian(1998), "Small-Sample Confidence Intervals for Impulse Response Functions", Review of Economics and Statistics, vol 80, no 2, 218-230.

Written by:  Estima
Topics:Paper results;VAR;Bootstrapping
References:Kilian
Requires:Version 9.00
kilianvigfusson_qe2011.zip

Replication file for Kilian & Vigfusson(2011), "Are the responses of the U.S. economy asymmetric in energy price increases and decreases?", Quantitative Economics, vol. 2, no 3, 419-453.

Bootstrap-in-bootstrap analysis of a VAR with asymmetries.

Written by:  Estima
Topics:Paper results;VAR;Switching model;Bootstrapping
References:Kilian;Vigfusson
Requires:Version 9.00
klein.rpf

Estimates Klein's Model I using 2SLS

Written by:  Estima
Topics:Example programs;Simultaneous equations
References:Klein
Requires:Version 8.00
kolmtest.src

Computes the test statistic for the Kolmogorov-Smirnov test of goodness of fit and displays the corresponding critical value at different significance levels. Frequently used to test for Normality, can also be used to test for Chi-squared, F, and t-distributions.

Written by:  Luis Alzate;Diego Vasquez
Topics:Normality
References:Deshpande;Judge;Lilliefors;Massey
Requires:Version 5.00
koop_leon-gonzalez-strahan_er2010.zip

This is an example of the Gibbs sampling procedure for cointegrated models described in Koop, León-González and Strachan(2010), "Efficient Posterior Simulation for Cointegrated Models with Priors on the Cointegration Space", Econometric Reviews, vol. 29, no. 2, 224-242.
This actually does just the flat prior, though adding the types of priors they describe isn't difficult.

Written by:  Estima
Topics:Paper results;Cointegration;Monte Carlo
References:Koop;Leon-Gonzalez;Strachan
Requires:Version 8.00
koutmos_jbfa1996.zip

Replication file for the multivariate EGARCH model with mean and asymmetric volatility spillovers from Koutmos(1996), "Modeling the Dynamic Interdependence of Major European Stock Markets", Journal of Business Finance and Accounting, vol 23, 975-988.

Written by:  Estima;Koutmos
Topics:Paper results;ARCH-GARCH
References:Koutmos
Requires:Version 7.30
kpss.src

Does the KPSS stationarity test procedure.
Kwiatowski, Phillips, Schmidt & Shin(1992), "Testing the Null Hypothesis of Stationarity Against the Alternative of a Unit Root: How Sure Are We That Economic Time Series Have a Unit Root?", J. of Econometrics, vol 54, 159-178.

Written by:  Phil Rothman;Estima
Topics:Unit root
References:Kwiatowski;Phillips;Schmidt;Shin
Requires:Version 7.30
Also available for versions 7.20,6.00 with fewer features
kpswaer1991.zip

Replicates results from King, Plosser, Stock and Watson(1991), "Stochastic Trends and Economic Fluctuations", American Economic Review, vol. 81, pp. 819-840. Demonstrates the procedures swdols.src, swtrends.src, johmle.src, and forcedfactor.src

Written by:  Mark Watson;Estima
Topics:Paper results;VAR;Cointegration
References:King;Plosser;Stock;Watson
Requires:Version 7.00
Also available for version 6.20 with fewer features
krolzigmsvar.zip

Replication files for Krolzig's "International Business Cycles: Regime Shifts in the Stochastic Process of Economic Growth", Oxford University Discussion Paper.

Written by:  Estima
Topics:Paper results;VAR;Markov switching
References:Krolzig
Requires:Version 7.00
kscpostdraw.src

Uses the rejection method to draw from the posterior formed by multiplying a Normal by a log inverse gamma. This comes up in the analysis of the stochastic volatility model. This is a refinement of the proposal in:
Kim, Shephard and Chib(1998), "Stochastic Volatility: Likelihood Inference and Comparison with ARCH Models", Review of Economic Studies, vol 65, pp 361-93

Written by:  Estima
Topics:Bayesian methods;Monte Carlo;Stochastic volatility
References:Kim;Shephard;Chib
Requires:Version 7.00
ksmooth.src

KSMOOTH.SRC performs Kalman smoothing, using general matrix inputs. See also the example program KSMOOTH.PRG. Note that this procedure has been superseded by the built-in DLM instruction introduced in RATS 5.0.

Written by:  Estima
Topics:Outdated;State-space models
Requires:Version 5.00
l1trend.zip

Example of L1 filtering (to extract a trend).
Kim, Koh, Boyd, Gorinevsky(2009), "L1 Filtering", SIAM Review, vol 51, pp 339-360.

Written by:  Estima
Topics:Paper results;State-space models
References:Kim;Koh;Boyd;Gorinevsky
Requires:Version 8.00
lagpolyroots.src

Produces a table of the inverted roots of the input lag polynomial, showing the modulus and (for complex roots) the period.

Written by:  Estima
Requires:Version 7.30
Also available for version 5.10 with fewer features
lagselec.src

Automatically computes various lag-length tests for a single series, including AIC, BIC, Ljung-Box, and more.

Written by:  Norman Morin
Topics:Information criteria
Requires:Version 5.00
lanne_lutkepohl_jmcb2008.zip

Replication file for Lanne and Lutkepohl(2008), "Identifying Monetary Policy Shocks via Changes in Volatility", JMCB, vol 40, no 6, 1131-1149.
Demonstrates identification of a structural VAR using volatility regimes.

Written by:  Estima
Topics:Paper results;VAR
References:Lanne;Lutkepohl
Requires:Version 7.30
laubach_williams_restat2003.zip

Replication file for Laubach and Williams(2003), "Measuring the Natural Rate of Interest", Review of Economics and Statistics, vol. 85, no 4, 1063-1070.
Estimates several state-space models with multiple observables with a combination of regression equations and latent variables.

Written by:  Estima
Topics:Paper results;State-space models
References:Laubach;Williams
Requires:Version 8.00
lebo_box_ajps2008.zip

Replication file for Lebo and Box-Steffensmeier(2008), "Dynamic Conditional Correlations in Political Science", American Journal of Political Science, vol 53, no 2, 688-704.
Does multivariate GARCH models with DCC applied to political science data.

Written by:  Estima;Lebo
Topics:Paper results;ARCH-GARCH
References:Lebo;Box-Steffensmeier
Requires:Version 8.00
lee_jimf_1994.zip

Replication for T. H. Lee(1994), "Spread and volatility in spot and forward exchange rates," Journal of International Money and Finance, vol. 13, no 3, 375-383.

This estimates a set of VECM-GARCH-X models on spot and forward exchanges rates for several countries.

Written by:  Estima
Topics:Paper results;ARCH-GARCH
References:Lee(T-H)
Requires:Version 9.20
levinlin.src

Implements tests from Levin, Lin and Chu(2002), "Unit root tests in panel data: Asymptotic and finite-sample properties", Journal of Econometrics, vol 108, no 1, 1–24.

Written by:  Estima
Topics:Unit root;Panel
References:Levin;Lin;Chu
Requires:Version 7.30
liml.src

LIML does limited information maximum likelihood estimation of a linear regression equation. Before using this, you should set the instrument set using INSTRUMENTS.

Written by:  Estima
Topics:Simultaneous equations
Requires:Version 7.00
Also available for version 6.00 with fewer features
listexample.rpf

Example of the use of the LIST aggregator

Written by:  Estima
Topics:Example programs
Requires:Version 9.00
localdlm.src

Creates the "A", "C" and "F" matrices for a local level or local trend DLM with shocks to the trend rate or level or both.

Written by:  Estima
Topics:State-space models
References:Durbin;Koopman
Requires:Version 5.00
localdlminit.src

Provides rough estimates of the component variances for the irregular and trend rate variances for a local level or local trend model, possibly in the presence of seasonals.

Written by:  Estima
Topics:State-space models
Requires:Version 7.00
localtrend.src

Performs a "local smoothing regression". Used in one of the example programs for the Makridakis, Wheelwright, and Hyndman textbook (see Textbook Examples)

Written by:  Estima
Topics:Regression;Detrending;Filtering
Requires:Version 5.10
Also available for version 5.00 with fewer features
logmvskewt.src

Computes the log density function for a multivariate skew-t distribution.
Bauwens & Laurent(2005), "A New Class of Multivariate Skew Densities, With Application to Generalized Autoregressive Conditional Heteroscedasticity Models," JBES, vol 23, pp 346-354.

Written by:  Estima
Topics:Probability distributions
References:Bauwens;Laurent
Requires:Version 7.00
lognormalparms.src

Returns a 2-vector with the parameters for the underlying Normal to achieve the given mean and standard deviation for a log normal.

Written by:  Estima
Topics:Bayesian methods
Requires:Version 5.00
logskewtdensity.src

Function returning the log of the normalized (to unit variance and zero mean) skew-t density from Hansen(1994), "Autoregressive Conditional Density Estimation", International Economic Review, vol 35, no. 3, 705-730.

Written by:  Estima
Topics:Probability distributions
References:Hansen(Bruce)
Requires:Version 5.10
lowess.rpf

Example of non-parametric regression techniques.
From the NIST Engineering Statistics Handbook

Written by:  Estima
Topics:Example programs;Nonparametric
Requires:Version 8.00
lowess.src

Does a flexible fit of y=f(x) using the lowess (locally weighted scatterplot smoothing). This is obsolete. Use the RATS instruction NPREG instead.

Written by:  Estima
Topics:Outdated;Nonparametric
Requires:Version 5.00
lpunit.src

Implements the Lumsdaine-Papell unit root test, allowing for two breaks in the intercept, the trend or both at unknown locations.
Lumsdaine and Papell(1997), "Multiple trend breaks and the unit root hypothesis", Review of Economics and Statistics, vol 79, 212-218.

Written by:  Estima
Topics:Unit root;Structural breaks
References:Lumsdaine;Papell
Requires:Version 7.30
lsdvc.src

Computes a least squares dummy variable (i.e. fixed effects) estimator for a dynamic panel data model with correction for bias.
Reference: Kiviet(1995), "On bias, inconsistency, and efficiency of various estimators in dynamic panel data models," Journal of Econometrics, vol. 68, no. 1, 53-78.

Written by:  Estima
Topics:Panel
References:Kiviet
Requires:Version 7.00
lsunit.src

Implementation of Lee-Strazicich LM unit root tests with one or two structural breaks. Optionally, it can do more than two breaks.
Lee and Strazicich(2004), "Minimum LM Unit Root Test with One Structural Break", Appalachian State University Working Paper
Lee and Strazicich(2003), "Minimum LM Unit Root Test with Two Structural Breaks", Review of Economics and Statistics, vol 85, no. 4, 1082-1089.

Written by:  Estima
Topics:Unit root;Structural breaks
References:Lee;Strazicich
Requires:Version 7.30
Also available for version 5.10 with fewer features
lts.src

LTS.SRC implements the Least Trimmed Squares Regression method. This computes robust linear regressions in the presence of outliers. For details on this technique and the procedure, see LTS Information (HTML file), or download the same info in the file LTS.TXT).

Written by:  Eric Blankmeyer
Topics:Estimators
References:Rousseeuw;Leroy
Requires:Version 5.00
lubikschorfheide_jme2007.zip

Replication for the DSGE model from Lubik, Thomas A. & Schorfheide, Frank(2007), "Do central banks respond to exchange rate movements? A structural investigation," Journal of Monetary Economics, vol 54, no. 4, 1069-1087.
Includes a general solution of the model (for examining dynamics) and estimation with Canadian data.

Written by:  Estima
Topics:Paper results;DSGE
References:Lubik;Schorfheide
Requires:Version 7.10
maautolags.src

@MAAutoLags computes an information criterion for various lags of MA processes using the innovations algorithm, finding the "optimal" choice under that criterion and (optionally) producing a table with the values for all lags.

Written by:  Estima
Topics:ARIMA
Requires:Version 7.30
Also available for version 6.10 with fewer features
mackinnoncv.src

Computes "exact" critical values for the Dickey-Fuller and the Engle-Granger cointegration tests from the response surface regressions in MacKinnon, J. (1991), "Critical Values for Cointegration Tests", Long-Run Economic Relationships, R.F. Engle and C.W.J. Granger, eds. London: Oxford University Press. (Renamed from MACKCVAL.SRC).

Written by:  Estima
Topics:Unit root;Cointegration
Requires:Version 5.10
mannwhitney.src

Performs a Mann-Whitney(-Wilcoxon) non-parametric test for whether the observations from the vectors X and Y are drawn from the same distribution.
Wilcoxon(1945), "Individual comparisons by ranking methods", Biometrics Bulletin, vol 1, pp 80–83.
Mann & Whitney(1947), "On a test of whether one of two random variables is stochastically larger than the other", Annals of Mathematical Statistics, vol 18, pp 50–60.

Written by:  Estima
Topics:Tests(other)
References:Mann;Whitney;Wilcoxson
Requires:Version 7.30
Also available for version 7.10 with fewer features
mark_sul_obes2003.zip

Replication for Mark and Sul(2003), "Cointegration Vector Estimation by Panel DOLS and Long-run Money Demand," Oxford Bulletin of Economics and Statistics, vol. 65, no. 5, 655-680.
Demonstrates DOLS for panel data.

Written by:  Estima
Topics:Paper results;Panel;Cointegration
References:Mark;Sul
Requires:Version 7.00
markov.src

MARKOV.PRG provides examples of Markov switching models using generated data. Based on December 1998 RATSLetter article. This has been superseded by the newer HAMILTON.PRG example in RATS Version 5.0, so these will only be of interest to users still running RATS 4.x, who can refer to the December 1998 newsletter for technical details.

Written by:  Estima
Topics:Switching models;Markov switching
Requires:Version 7.00
Also available for version 5.10 with fewer features
matheson_stavrev_el2013.zip

Based upon Matheson and Stavrev(2013), "The Great Recession and the inflation puzzle," Economics Letters, vol. 120, no 3, pp 468-472 with a reconstructed (and extended) data set.
Estimates the model by a non-linear Kalman filter using unconstrained estimates, inequality constrained state estimates and state estimates constrained through use of functions that map to the proper range.

Written by:  Estima
Topics:Paper results;State-space models
References:Matheson;Stavrev
Requires:Version 9.20
matpeek.src

Contains two procedures: MatrixPeek and MatrixPoke. These extract information or put information into a rectangular array at specified locations. Since version 5.10, RATS now includes built-in functions %MATPEEK and %MATPOKE.

Written by:  Estima
Topics:Outdated
Requires:Version 5.00
maximize.rpf

Example of the use of MAXIMIZE for a stochastic frontier model.
Adapted from Greene, Econometric Analysis, 6th Edition, example 16.9 from pp 541-2.

Written by:  Estima
Topics:Example programs
Requires:Version 8.00
mbkernel.src

Version of KERNEL.SRC required by MODES.SRC.

Written by:  Guido Travaglini
References:Silverman
Requires:Version 5.00
mcfevdtable.src

Computes error bands for the forecast error variance decomposition for a VAR using using the information already computed. Note: this assumes that the shocks used are orthogonal and produce a complete factorization of the covariance matrix. It cannot be used with isolated shocks (from, for instance, sign restrictions).

Written by:  Estima
Topics:VAR;Bayesian methods;Monte Carlo
Requires:Version 7.30
Also available for version 6.30 with fewer features
mcgraphirf.src

Graphs error bands for impulse response functions using the information already computed by another procedure (such as MCVARDoDraws). This has many options controlling the general layout and content.

Written by:  Estima
Topics:VAR;Bayesian methods;Monte Carlo
Requires:Version 7.00
mcleodli.src

Performs a McLeod-Li test for 2nd order dependence. McLeod and Li(1993), "Diagnostic Checking of ARMA Time Series Models Using Squared Residual Autocorrelations", J. of Time Series Analysis, vol 4, pp 269-273.

Written by:  Estima
Topics:Dependence tests
References:McLeod;Li
Requires:Version 7.30
Also available for version 5.10 with fewer features
mcmcpostproc.src

Post processor for Markov Chain Monte Carlo statistics. Computes means, standard errors, numerical standard errors and CD measures for each component in an input SERIES[VECT] with the generated statistics.

Written by:  Estima
Topics:Bayesian methods;Monte Carlo
Requires:Version 6.20
mcpriceeurope.rpf

Monte Carlo option pricing using antithetic acceleration.

Written by:  Estima
Topics:Example programs;Monte Carlo;Financial
Requires:Version 8.00
mcprocessirf.src

Generates error bands for impulse response functions using the information already computed by another procedure (such as MCVARDoDraws). This includes the same calculations as is done by MCGraphIRF, but rather than graphing, creates three RECT[SERIES] which can be graphed or put into tables as you need.

Written by:  Estima
Topics:VAR;Bayesian methods;Monte Carlo
Requires:Version 8.00
Also available for version 7.00 with fewer features
mcvardodraws.src

Computes impulse response functions for a VAR using Monte Carlo simulation. This assumes the model is an OLS VAR estimated using the ESTIMATE instruction. This uses a Choleski factorization, though it can be modified fairly easily to do any just-identified factorization.

Written by:  Estima
Topics:VAR;Bayesian methods;Monte Carlo
Requires:Version 9.00
Also available for version 7.00 with fewer features
meangroup.src

Similar to SWAMY.SRC, but does a simple weighted average of the coefficient vectors.

Written by:  Estima
Topics:Panel
Requires:Version 7.00
Also available for versions 5.10,5.00 with fewer features
meplot.src

Displays a mean excess plot for a series.

Written by:  Estima
Topics:Financial
Requires:Version 7.00
mesa.src

Computes and optionally graphs a spectrum using Maximum Entropy Method.

Written by:  Estima
Topics:Spectral
Requires:Version 5.10
Also available for version 5.00 with fewer features
mhegy.src

MHEGY.SRC implements the monthly version of the "HEGY" (Hylleberg, Engle, Granger, and Yoo, 1990) seasonal unit root tests (use the HEGY.SRC version above for quarterly series). Note: Requires Norman Morin's LAGSELEC.SRC procedure file.

Written by:  Ulrich Leuchtmann;Estima
Topics:Unit root;Seasonality
References:Hylleberg;Engle;Granger;Yoo
Requires:Version 6.00
michaelnobaypeeljpe1997.zip

Replication for Michael, Nobay and Peel(1997), "Transactions Costs and Nonlinear Adjustment in Real Exchange Rates: An Empirical Investigation", J. of Political Economy, vol 105, no 4, pp 862-879.

Written by:  Estima
Topics:Paper results;Threshold
References:Michael;Nobay;Peel
Requires:Version 7.00
miscprob.prg

Written by:  Estima
Topics:Example programs;Logit/probit
Requires:Version 5.00
mixed.src

Estimates an equation using the mixed estimation technique. See the RATS User's Guide for full details.

Written by:  Estima
Topics:Estimators;Bayesian methods
Requires:Version 5.00
mixture.rpf

Example of a mixture model (not-Markovian) demonstrating the different estimation strategies.

Written by:  Estima
Topics:Example programs;Switching models
Requires:Version 8.00
mixvar.src

MIXVAR computes estimates for a single equation using the mixed estimation procedure used by the RATS command ESTIMATE. It can be helpful when you have a variable you wish to forecast which does not fit into a full-blown VAR, because it has no predictive content for the other variables, or when you have a limited amount of data for one variable, so you need to use fewer coefficients in that equation than in others.

Written by:  Estima
Topics:VAR;Estimators;Bayesian methods
Requires:Version 5.00
mnz_restat_2003.zip

Replication file for Morley, Nelson & Zivot(2003), "Why Are the Beveridge-Nelson and Unobserved-Components Decompositions of GDP So Different?," The Review of Economics and Statistics, vol. 85(2), pages 235-243.

Written by:  Estima
Topics:Paper results;State-space models
References:Morley;Nelson;Zivot
Requires:Version 7.20
modelcompanion.src

Defines a function "%ModelCompanion(model)" which returns the companion matrix for a model (could be a VAR, but doesn't have to be). Beginning with version 6.35, this function is built-in.

Written by:  Estima
Topics:VAR
Requires:Version 6.10
modellagmatrix.src

Function for using %ModelLagMatrix for RATS versions before 8.1. This returns the NxN matrix of coefficients for the dependent variables of the <> at lag <>.

Written by:  Estima
Topics:VAR
Requires:Version 5.00
modes.src

MODES.SRC finds the critical windows and the number of modes of a given time series by KERNEL looping from an initially small window up to the largest obtained through selected increments and incremental values. The companion procedure BOOTS.SRC retrieves critical windows stored in a temp file, KERNEL boots the given time series for each of them, and tests for the null of m versus the alternative of m+1 modes by computing the ASL (Achieved Significance Level) statistics. Both require MBKERNEL.SRC, a stripped-down version of the KERNEL.SRC procedure. MBDEMO.PRG and GDPQ.RAT are sample program and data files. Or download MODES.ZIP which contains all of the above files.

Written by:  Guido Travaglini
References:Silverman
Requires:Version 5.00
montearch.rpf

Demonstrates Monte Carlo examination of the critical values of a test; in this case, for a test for ARCH.

Written by:  Estima
Topics:Example programs;ARCH-GARCH;Monte Carlo
Requires:Version 8.00
monteexogvar.rpf

Demonstrates Monte Carlo integration in a VAR with shock to an "exogenous" variable.

Written by:  Estima
Topics:Example programs;VAR;Bayesian methods;Monte Carlo
Requires:Version 9.00
Also available for version 8.00 with fewer features
montenearsvar.rpf

Example of MCMC analysis of a combination of a near VAR for the lag coefficients and a structural VAR for the covariance matrix.

Written by:  Estima
Topics:Example programs;VAR;Bayesian methods;Monte Carlo
Requires:Version 9.00
Also available for version 7.00 with fewer features
montesur.rpf

Demonstrates an efficient method of drawing from the posterior distribution of a near-VAR by means of importance sampling for the covariance matrix.

Written by:  Estima
Topics:Example programs;VAR;Bayesian methods;Monte Carlo
Requires:Version 9.00
Also available for version 8.00 with fewer features
montesvar.rpf

Monte Carlo (importance sampling) integration for impulse responses in a structural VAR.
montesvar_mh.rpf is similar, but uses Metropolis-Hastings

Written by:  Estima
Topics:Example programs;VAR;Bayesian methods;Monte Carlo
References:Sims;Zha
Requires:Version 9.00
Also available for version 5.00 with fewer features
montesvar_mh.rpf

Monte Carlo integration of a structural VAR using Random Walk Metropolis. (MONTEVAR.RPF is similar, but uses importance sampling).

Written by:  Estima
Topics:Example programs;VAR;Bayesian methods;Monte Carlo
References:Sims;Zha
Requires:Version 9.00
montevar.rpf

Example of Monte Carlo Integration of Impulse Responses
Note that this is for illustration of the technique. In practice, you would use the @MONTEVAR procedure to do the draws.

Written by:  Estima
Topics:Example programs;VAR;Bayesian methods;Monte Carlo
Requires:Version 9.00
Also available for version 8.00 with fewer features
montevar.src

This computes and graphs error bands for impulse response functions for a VAR using Monte Carlo simulation. This assumes the model is a symmetric VAR estimated using the ESTIMATE instruction. This uses a Choleski factorization, though it can be modified fairly easily to do any just-identified factorization.

Written by:  Estima
Topics:VAR;Bayesian methods;Monte Carlo
Requires:Version 9.00
Also available for version 7.00 with fewer features
montevecm.rpf

Monte Carlo integration for a Vector Error Correction Model (with fixed cointegrating vector)

Written by:  Estima
Topics:Example programs;VAR;Cointegration;Bayesian methods;Monte Carlo
Requires:Version 9.20
mountforduhligjae2009.zip

Replication file for Mountford and Uhlig (2009), "What are the Effects of Fiscal Policy Shocks?", Journal of Applied Econometrics (to appear).
Demonstrates analysis of impulse responses with sign constraints, and sign + zero constraints.

Written by:  Estima
Topics:Paper results;VAR;Bayesian methods;Monte Carlo
References:Mountford;Uhlig
Requires:Version 7.20
msemsetupstd.src

These functions and procedures are fairly generic calculations for EM estimation in Markov Switching models.

Written by:  Estima
Topics:Markov switching
Requires:Version 8.00
msregression.src

Procedure file for Markov Switching univariate linear regressions, with the either the full coefficient vector switching or part of the coefficient vector is switching and part fixed. Use the MSVARSetup procedures for switching autoregressions and VAR's, and MSSysRegression for other types of multivariate regressions.

Written by:  Estima
Topics:Markov switching
Requires:Version 9.20
Also available for version 8.00 with fewer features
mssetup.src

These are fairly generic Markov Chain/Markov Switching model support functions. This takes the place of the markov.src file.

Written by:  Estima
Topics:Markov switching
Requires:Version 9.20
Also available for version 8.00 with fewer features
mssysregression.src

Procedure file for Markov switching multivariate linear regressions (same right hand side variables) with either the full coefficient vector switching or part of the coefficient vector is switching and part fixed. Use the MSVARSetup procedures for switching autoregressions and VAR's where only the mean (and possibly the variance) changes.

Written by:  Estima
Topics:VAR;Markov switching
Requires:Version 9.20
Also available for version 8.00 with fewer features
msvariances.rpf

Model of Markov-switching variances.
Based upon Application 3 from pp 86-92 of Kim and Nelson, "State-space Models with Regime Switching"

Written by:  Estima
Topics:Example programs;Markov switching
Requires:Version 9.00
msvarsetup.src

Procedure file for setting up Markov switching VAR's.

Written by:  Estima
Topics:VAR;Markov switching
Requires:Version 9.20
Also available for versions 8.00,6.10 with fewer features
multiplebreaks.src

This does multiple structural change analysis as described in Bai and Perron, but using a threshold variable other than time.
Bai and Perron(2003), "Computation and Analysis of Multiple Structural Change Models", J. of Applied Econometrics, pp 1-22.

Written by:  Estima
Topics:Stability tests;Structural breaks
References:Bai;Perron
Requires:Version 7.30
Also available for version 5.10 with fewer features
mvarchtest.src

Performs a multivariate LM test for ARCH effects in a set of series by regressing the crossproducts of the series (that is u(i,t) x u(j,t) for all combinations of i and j) on a constant and its lag(s) and testing the coefficients on the lags.

Written by:  Estima
Topics:ARCH-GARCH
Requires:Version 7.10
mvbndecomp.src

Computes a multivariate Beveridge-Nelson decomposition of a set of series via a vector autoregression.
Arino and Newbold(1998), "Computation of the Beveridge-Nelson Decomposition for Multivariate Economic Time Series", Economic Letters, vol 61, 37-42.

Written by:  Estima
Topics:Decomposition;VAR
References:Beveridge;Nelson;Arino;Newbold
Requires:Version 5.10
mvgarchfore.src

Forecasts a multi-variate GARCH model, estimated using the GARCH instruction. Minor revisions/corrections in May 2006.

Written by:  Estima
Topics:ARCH-GARCH;Forecasting
Requires:Version 6.20
mvgarchtovech.src

Extracts a VECH representation out of the most recent GARCH instruction for use in forecasting or impulse response analysis.

Written by:  Estima
Topics:ARCH-GARCH
Requires:Version 7.00
mvgarchvarfore.src

@MVGARCHVarFore computes out-of-sample variance forecasts for several types of GARCH models which don't have a full VECH representation. As a result, they forecast only the variances (producing zeros for the off-diagonals).

Written by:  Estima
Topics:ARCH-GARCH
Requires:Version 8.00
mvgarchvarmats.src

This pulls the matrices for a variance recursion out of the output from a GARCH model. Do this immediately after the GARCH instruction and repeat the VARIANCES option.

Written by:  Estima
Topics:ARCH-GARCH
Requires:Version 8.00
mvident.src

Creates a Tiao-Box cross correlation matrix with +,- and . symbols for significant positive, negative and insignificant cross correlations respectively.
Tiao and Box(1981), "Modeling multiple time series with applications", JASA, vol 76, 802-816.

Written by:  Estima
Topics:ARIMA
References:Tiao;Box
Requires:Version 5.10
mvjb.src

Computes a multivariate version of the Jarque-Bera test for normality. Note that there are more sophisticated versions of this (for instance, Doornik and Hansen, "An Omnibus Test for Univariate and Multivariate Normality"). This just transforms the input residual series to uncorrelated components (using an eigenbased factorization if not provided by the user) and sums up the univariate JB statistics from those.

Written by:  Estima
Topics:Normality
Requires:Version 7.30
Also available for version 5.10 with fewer features
mvkfiltr.src

Multivariate Kalman filtering procedure. Superseded by built-in DLM instruction introduced in RATS 5.0.

Written by:  Estima
Topics:Outdated
Requires:Version 5.00
mvqstat.src

Computes the Hosking variant on the multivariate Q statistic.
Hosking(1981), "Equivalent Forms of the Multivariate Portmanteau Statistic", JRSS-B, vol 43, no. 2, 261-262.

Written by:  Estima
Topics:ARIMA
References:Hosking
Requires:Version 5.10
nbercycles.src

Generates dummy variables for quarterly or monthly data based upon the NBER business cycle reference dates.
Source:
National Bureau of Economic Research, Inc.
1050 Massachusetts Avenue
Cambridge MA 02138
USA
www.nber.org/cycles.html

Written by:  Estima
Topics:Business cycles
References:NBER
Requires:Version 6.00
neural.rpf

Estimates and does predictions using a neural network model. Demonstrates the instructions NNLEARN and NNTEST.

Written by:  Estima
Topics:Example programs;Neural networks
Requires:Version 8.00
nlls.rpf

Demonstrates estimation using non-linear least squares with the instruction NLLS.

Written by:  Estima
Topics:Example programs;Nonlinear estimation
Requires:Version 8.00
nndynfore.rpf

Example of dynamic forecasting with neural networks

Written by:  Estima
Topics:Example programs;Neural networks
Requires:Version 7.00
nonlinear.rpf

Demonstrates several techniques for maximum likelihood estimation of a non-linear model.
RATS Version 8, User's Guide, Example from Section 4.13

Written by:  Estima
Topics:Example programs;Nonlinear estimation
Requires:Version 8.00
normtest.src

Implements a multivariate test for normality, as described by Doornik and Hansen (1994), which was based on a proposal of Shenton and Bowman (1977). It can also perform univariate normality tests. The test is described in a working paper by Jurgen A. Doornik and Henrik Hansen, which is available as a PostScript file at: http://www.nuff.ox.ac.uk/Users/Doornik/.

Written by:  Ulrich Leuchtmann
Topics:Normality
References:Doornik;Hansen;Shenton;Bowman
Requires:Version 5.00
npreg.rpf

Demonstrates nonparametric regression using the NPREG instruction. The application is semiparametric weighted least squares, estimating the schedastic function for weighted least squares using NPREG.

Written by:  Estima
Topics:Example programs;Nonparametric
Requires:Version 8.00
observableindex.rpf

Estimates an observable index model from Sargent & Sims(1977), "Business cycle modeling without pretending to have too much a priori economic theory"

Written by:  Estima
Topics:Paper results;VAR
References:Sargent;Sims
Requires:Version 7.00
olshodrick.src

Procedure to compute a least squares regression with the covariance matrix proposed by Hodrick(1992) "Dividend Yields and Expected Stock Returns: Alternative Procedures for Inference and Measurement", Review of Financial Studies, vol 5, no 3, 357-386.

Written by:  Estima
Topics:Financial
References:Hodrick
Requires:Version 7.00
olsmenu.rpf

Example of user-defined menus.
RATS Version 8, User's Guide, Section 16.4

Written by:  Estima
Topics:Example programs
Requires:Version 8.00
onebreak.rpf

Analysis of linear regression with single break in time sequence.
This is based on an example from Stock & Watson, Introduction to Econometrics, 3rd edition, chapter 15.

Written by:  Estima
Topics:Example programs;Stability tests
Requires:Version 8.00
ozbekozlale_jedc_2005.zip

Replication file for Ozbek and Ozlale(2005), "Employing the extended Kalman filter in measuring the output gap," Journal of Economic Dynamics and Control, vol. 29, no. 9, pages 1611-1622.
Demonstrates extended Kalman filter.

Written by:  Estima
Topics:Paper results;State-space models
References:Ozbek;Ozlale
Requires:Version 7.30
Also available for version 7.20 with fewer features
pacf2ar.src

Generates the series of coefficients for an autoregressive representation from an input set of partial autocorrelations.

Written by:  Estima
Topics:ARIMA
Requires:Version 5.00
pancoint.src

Procedure for Cointegration Tests in Heterogeneous Panels with Multiple Regressors ("Pedroni tests").

Pedroni (2004), "Panel Cointegration; Asymptotic and Finite Sample Properties of Pooled Time Series Tests with an Application to the PPP Hypothesis," Econometric Theory, vol. 20, 597-625.

Pedroni (1999) "Critical Values for Cointegration Tests in Heterogeneous Panels with Multiple Regressors," Oxford Bulletin of Economics and Statistics, vol. 61, 653-70.

Written by:  Peter Pedroni;Estima
Topics:Panel;Cointegration;Unit root
References:Pedroni
Requires:Version 7.30
Also available for versions 6.00,5.10 with fewer features
panel.rpf

Demonstrates various techniques for estimating linear models in panel data. Does fixed effects, random effects, first differenced and SUR using the instruction PANEL. Also shows how to implement create dummy variables and do panel data filtering techniques.

Written by:  Estima
Topics:Example programs;Panel
Requires:Version 8.00
panelcause.rpf

Example of panel causality test allowing for heterogeneity in the coefficients and variances.

Written by:  Estima
Topics:Example programs;Panel
Requires:Version 8.30
Also available for version 7.30 with fewer features
paneldols.src

PANEDOLS.SRC is procedure for Peter Pedroni's methodology for group mean panel tests using Dynamic OLS.
Pedroni(2001) "Purchasing Power Parity Tests in Cointegrated Panels," Review of Economics and Statistics, vol. 83, 727-731.

Written by:  Peter Pedroni;Estima
Topics:Panel;Cointegration
References:Pedroni
Requires:Version 7.30
Also available for version 6.20 with fewer features
panelfm.src

PANELM.SRC is a new version of Peter Pedroni's methodology for group mean panel tests using Fully Modified OLS. Now in the form of the procedure, this is much easier to use than the old example program version (PANGROUP.PRG), and includes several important revisions by Prof. Pedroni.

Pedroni (2000) "Fully Modified OLS for Heterogeneous Cointegrated Panels," Advances in Econometrics, Vol. 15, 93-130.

Pedroni (2001) "Purchasing Power Parity Tests in Cointegrated Panels," Review of Economics and Statistics, vol. 83, 727-731.

Written by:  Peter Pedroni;Estima
Topics:Panel;Cointegration
References:Pedroni
Requires:Version 7.30
Also available for versions 6.20,5.10,5.00 with fewer features
panelscc.src

This estimates Spatial Correlation Consistent (SCC) covariance matrix from panel data, from Driscoll and Kraay's "Consistent-Covariance Matrix Estimation With Spatially Dependent Panel Data", Review of Economics and Statistics article, November, 1998. It computes coefficient estimates and standard errors consistent for spatial correlation, autocorrelation and heteroskedasticity for linear instrumental-variable panel data. Also available are an example program using purchasing-power parity model (PPP01.PRG) and the accompanying data set (PPP.RAT).

Written by:  Steve Green
Topics:Panel
References:Driscoll;Kraay
Requires:Version 5.00
panelthresh.src

Tests a fixed effects regression for one or two breaks in a single regressor, with breaks determined by the values of another variable.
Bruce Hansen(1999), "Threshold effects in non dynamic panels: estimation, testing and inference", Journal of Econometrics, vol 93, pp 345-368.

Written by:  Estima
Topics:Panel;Structural breaks
References:Hansen(Bruce)
Requires:Version 8.00
panelcause.rpf

Example of panel causality test allowing for heterogeneity in the coefficients and variances.

Written by:  Estima
Topics:Paper results;Structural breaks;Unit root
References:Papell;Prodan
Requires:Version 0.00
pdl.rpf

Demonstrates estimation of polynomial distributed lags using the instructions ENCODE and LINREG with UNRAVEL. See also PDLREG.SRC.

Written by:  Estima
Topics:Example programs;Distributed lags
Requires:Version 8.00
pdl.src

Automates the process of estimating Polynomial Distributed Lag models-- you list the variables, start and end lags, polynomial degree, select a constraint type, and the procedure does the rest.

Written by:  Estima
Topics:Distributed lags
Requires:Version 5.00
pdlreg.src

Computes a Polynomial Distributed Lag. This is an update of the older PDL.SRC procedure included with RATS for many years. It offers more options, and the input conforms more closely to the standard form used by built-in RATS instructions.

Written by:  Estima
Topics:Distributed lags
Requires:Version 6.10
pdlselec.src

Helps select a PDL model by computing AIC and BIC criteria. Note: this requires an older version of the PDL procedure (also originally by Norman Morin), which is available in the file PDLMORIN.SRC procedure.

Written by:  Norman Morin
Topics:Distributed lags
Requires:Version 5.00
pedroni_jae2007.zip

Replication of Pedroni(2007), "Social capital, barriers to production and capital shares: implications for the importance of parameter heterogeneity from a nonstationary panel approach", Journal of Applied Econometrics, vol 22, no 2, 429-451. Uses the PANCOINT and PANELFM and procedures for testing and estimation of cointegration models in heterogeneous panels.

Written by:  Peter Pedroni;Estima
Topics:Paper results;Panel;Cointegration
References:Pedroni
Requires:Version 8.00
pedronirestat2001.zip

Replication file for Pedroni(2001) "Purchasing Power Parity Tests in Cointegrated Panels", Review of Economics and Statistics, 83, 727-731. Demonstrates the procedures panelfm.src and paneldols.src.

Written by:  Peter Pedroni;Estima
Topics:Paper results;Panel;Cointegration
References:Pedroni
Requires:Version 7.00
perron.src

Performs the Perron test for a unit root allowing for a one-time change in the slope or level of the series. Useful when standard tests against trend stationary alternatives cannot reject the null hypothesis of unit root if the true data generating process is that of stationary around a trend function which contains a one time break. By Diego Vasquez, based in part on Norman Morin's URADF.SRC procedure.

Written by:  Diego Vasquez
Topics:Unit root
References:Perron
Requires:Version 5.00
perron97.src

Implements various unit root tests for series with endogenous time breaks, as described in Perron's paper "Further evidence on breaking trend functions in macroeconomic variables, Journal of Econometrics 80, 1997.

Written by:  G. Colletaz;F. Serranito
Topics:Unit root
References:Perron
Requires:Version 5.00
perronbreaks.src

Implementation of the general structure for analyzing breaks with unit roots in Perron(2006), "Dealing with Structural Breaks," in Palgrave Handbook of Econometrics, Vol. 1, pp 278-352, extended to allow more than one break.

Written by:  Estima
Topics:Unit root
References:Perron
Requires:Version 7.30
perronngmtests.src

Computes one or more of the Perron-Ng "M" unit root tests.
Perron and Ng(1996), "Useful Modifications to Some Unit Root Tests with Dependent Errors and Their Local Asymptotic Properties", Review of Economic Studies, vol 63, 435-463.

Written by:  Estima
Topics:Unit root
References:Perron;Ng
Requires:Version 7.00
perronrodriguez.src

Does the Perron-Rodriguez(2003) test for unit roots using GLS detrending, allowing for a break point at an unknown date.
Perron and Rodriguez(2003), "GLS Detrending, Efficient Unit Root Tests and Structural Change", Journal of Econometrics, vol 115, pp 1-27.

Written by:  Estima
Topics:Unit root;Structural breaks
References:Perron;Rodriguez
Requires:Version 7.00
perronwada_jme_2009.zip

Replication file for Perron and Wada(2009), "Let’s take a break: Trends and cycles in US real GDP", Journal of Monetary Economics, vol 56, 749-765.

Written by:  Estima
Topics:Paper results;State-space models
References:Perron;Wada
Requires:Version 7.20
persist.src

Uses frequency domain techniques to estimate the sum of the coefficients of the moving average representation for a series (persistence measure).

Written by:  Estima
Topics:Spectral;ARIMA
Requires:Version 5.10
Also available for version 5.00 with fewer features
pesaranshinsmithjasa.zip

Replication file for Pesaran, Shin and Smith(1999), "Pooled Mean Group Estimation of Dynamic Heterogeneous Panels", JASA, vol. 94, no. 446, pp. 621-634. Demonstrates the instruction SWEEP.

Written by:  Estima
Topics:Paper results;Panel;Cointegration
References:Pesaran;Shin;Smith
Requires:Version 7.00
phillipshannan.src

Uses a multivariate Hannan's Efficient Estimator to estimate a set of linear equations with stationary errors and tests linear restrictions on the parameter matrix.

Phillips(1991), "Error Correction and Long Run Equilibria in Continuous Time." Econometrica, Vol. 59, 967-980.

Hall and Trevor(1992), "Long Run Equilibrium Estimation And Inference: A Non-Parametric Application." In P.C.B. Phillips (ed), Models, Methods and Applications of Econometrics: Essays in Honour of A.R. Bergstrom. Basil Blackwell.

Written by:  Rob Trevor;Estima
Topics:Spectral;Cointegration
References:Phillips;Hall(V.B.);Trevor
Requires:Version 5.10
polymult.src

Takes as input two vectors of coefficients from two lag polynomials (or two general polynomials) and multiplies them out to get a vector of coefficients for their product. The second polynomial can include seasonal terms. The RATS function %POLYMULT has largely made this obsolete.

Written by:  Norman Morin
Topics:Outdated
Requires:Version 5.00
portfolio.rpf

Demonstrates tracing the mean-variance efficient frontier for a portfolio given mean and covariance matrix. This uses the instruction LQPROG for quadratic programming and SCATTER for drawing a general function.

Written by:  Estima
Topics:Example programs;Financial;Linear/quadratic programming
Requires:Version 8.00
potest.src

Computes a Phillips-Ouliaris(-Hansen) test for cointegration. This includes the first stage regression. Use the related procedure @POTESTRESIDS if you already have the residuals.
Phillips and Ouliaris(1990), "Asymptotic Properties of Residual Based Tests for Cointegration," Econometrica, vol. 58, no 1, 165-193.
Hansen, Bruce E., 1992. "Efficient estimation and testing of cointegrating vectors in the presence of deterministic trends," Journal of Econometrics, vol. 53, no 1-3, 87-121.

Written by:  Estima
Topics:Cointegration
References:Phillips;Ouliaris;Hansen(Bruce)
Requires:Version 7.30
potestresids.src

Computes a Phillips-Ouliaris(-Hansen) test for cointegration using the residuals from an (already completed) regression. Use the related procedure @POTEST if you need to do the first stage regression as well.
Phillips and Ouliaris(1990), "Asymptotic Properties of Residual Based Tests for Cointegration," Econometrica, vol. 58, no 1, 165-193.
Hansen, Bruce E., 1992. "Efficient estimation and testing of cointegrating vectors in the presence of deterministic trends," Journal of Econometrics, vol. 53, no 1-3, 87-121.

Written by:  Estima
Topics:Cointegration
References:Phillips;Ouliaris;Hansen(Bruce)
Requires:Version 7.30
ppunit.src

Computes one of the Phillips-Perron modifications to the Dickey-Fuller unit root tests.
Phillips(1987), "Time Series Regressions with a Unit Root", Econometrica, pp. 277-301.
Phillips and Perron(1988), "Testing for a Unit Root in Time Series Regressions", Biometrika, 1988.

Written by:  Estima
Topics:Unit root
References:Perron
Requires:Version 7.30
Also available for versions 7.20,5.10,5.00 with fewer features
princomp.src

A simple procedure for extracting principal components. Updated in Feb. 2006, with options for analyzing data in correlation or centered form.

Written by:  Estima
Topics:Factor models
Requires:Version 6.30
Also available for versions 6.20,5.10 with fewer features
prinfactors.src

PRINFACTORS does a principal components based factor analysis of an input covariance or correlation matrix.

Written by:  Estima
Topics:Factor models
Requires:Version 7.30
Also available for version 6.10 with fewer features
prjconditional.src

Computes predicted probabilities for a conditional logit. This should be only be used after doing DDV with TYPE=CONDITIONAL.

Written by:  Estima
Topics:Logit/probit
Requires:Version 6.00
prjmultinomial.src

Computes predicted probabilities and marginal effects for choices in a multinomial logit. This should be only be used after doing DDV with TYPE=MULTINOMIAL.

Written by:  Estima
Topics:Logit/probit
Requires:Version 6.30
prjpoisson.src

Computes prediction and marginal effects for a count data model using the Poisson. This should be only be used after doing DDV with TYPE=COUNT.

Written by:  Estima
Topics:Regression
Requires:Version 6.00
probit.rpf

Demonstrates logit and probit estimation for a binary choice model. Uses the instruction DDV.

Written by:  Estima
Topics:Example programs;Logit/probit
Requires:Version 8.00
psdinitcx.src

Contains the user-defined function %PSDINITCX, which implements the calculation of a ergodic variance of a state space model using the diagonalization methods described in Soren Johansen, "A Small Sample Correction for the Test of Cointegrating Rank in the Vector Autoregressive Model", Econometrica, September 2002. This is more efficient than the direct solution of the linear system used in the RATS function %PSDINIT when there are 6 or more states, with the advantage becoming quite noticeable when there are 15 or more.

Written by:  Estima
Topics:VAR
References:Johansen
Requires:Version 5.00
qplot.src

Creates a Q plot for a series against a hypothesized Normal or Exponential distribution.

Written by:  Estima
Requires:Version 5.10
qprog.rpf

Demonstrates inequality constrained quadratic programming. The application is a linear regression with inequality constraints. Uses the instruction LQPROG.

Written by:  Estima
Topics:Example programs;Linear/quadratic programming
Requires:Version 8.00
qqplot.prg

Written by:  Estima
Topics:Example programs;Graphics
Requires:Version 5.00
quahvaheyej1995.zip

Replication file for Quah and Vahey (1995), "Measuring Core Inflation?", Economic Journal, vol. 105, pp 1130-44. Demonstrates use of the HISTORY instruction and the 0QFACTOR function.

Written by:  Estima
Topics:Paper results;VAR
References:Quah;Vahey
Requires:Version 7.00
quartimax.src

QuartiMax rotates a set of factor loadings (previously computed) using the quartimax criterion.

Written by:  Estima
Topics:Factor models
Requires:Version 5.00
randomize.rpf

Demonstrates approximate randomization, a form of bootstrapping for testing "unrelatedness". Uses the instruction BOOT.

Written by:  Estima
Topics:Example programs;Bootstrapping
Requires:Version 8.00
rangrid.src

Defines a FUNCTION called %RANGRID that creates a random draw from distribution approximated across a grid of points.

Written by:  Estima
Topics:Random numbers;Outdated
Requires:Version 5.00
ranmixture.src

This draws a vector from a mixture of Normals.

Written by:  Estima
Topics:Random numbers
Requires:Version 5.00
rannormaltrunc.src

Generates a (single) draw from a truncated random Normal distribution. The distribution can be truncated above, below or both.

Written by:  Estima
Topics:Random numbers
Requires:Version 5.00
rantruncate.src

Generates draws from a truncated Normal using the rejection method. In versions of RATS 7.3 and later, this is a built-in function.

Written by:  Estima
Topics:Random numbers
Requires:Version 5.10
ras.zip

This Zip file contains the RAS procedure for updating rectangular matrices by the RAS method (bi-proportional adjustment of matrices)--useful in Input-Ouput analysis. The file includes the procedure file, example program and output, and descriptive file.

Written by:  Paco Goerlich
Requires:Version 5.00
regactfit.src

Regression post-processor which graphs actual/fitted and residuals in separate vertical zones on the same box.

Written by:  Estima
Topics:Regression
Requires:Version 7.00
Also available for version 6.10 with fewer features
reganova.src

Prints an analysis of variance table for the last linear regression.

Written by:  Estima
Topics:Regression
Requires:Version 7.30
Also available for version 5.10 with fewer features
regarima.rpf

Demonstrates estimation of a RegARIMA model (regression with an ARIMA error process).

Written by:  Estima
Topics:Example programs;ARIMA
Requires:Version 8.00
regconfidence.src

Regression post-processor to show table of confidence intervals for coefficients

Written by:  Estima
Topics:Regression
Requires:Version 5.10
regcorrs.src

Computes and graphs autocorrelations, displaying also the Q statistic, AIC and SBC criteria for the residuals from the last regression or ARIMA estimation.

Written by:  Estima
Topics:ARIMA;Regression
Requires:Version 7.00
Also available for version 5.10 with fewer features
regcrits.src

Computes and displays the Akaike Information Criterion, Schwarz Bayesian Criterion, Hannan-Quinn, and FPE, for use in comparing models.

Written by:  Estima
Topics:Regression
Requires:Version 9.20
Also available for versions 7.30,5.00 with fewer features
regexactdw.src

Regression post-processor which computes the exact significance level for the Durbin-Watson statistic in an OLS regression.

Written by:  Estima
Topics:Regression
References:Durbin;Watson
Requires:Version 5.10
reghbreak.src

RegHBreak is a regression post-processor which performs Andrews-Quandt and Andrews-Ploberger tests, estimating the p-value using fixed regressor bootstrapping. Use this after running a linear regression.

Bruce Hansen(2000), "Testing for Structural Change in Conditional Models", Journal of Econometrics, vol. 97, no. 1, 93-115.

Andrews and Ploberger(1994), "Optimal Tests When a Nuisance Parameter is Present Only Under the Alternative", Econometrica, vol 62, no 6, 1383-1414.

Written by:  Estima
Topics:Regression;Stability tests;Bootstrapping
References:Hansen(Bruce)
Requires:Version 7.30
regpartcorr.src

The procedure REGPARTCORR computes and prints the partial correlations between the regressors and the dependent variable (file renamed from REGPCORR.SRC).

Written by:  Estima
Topics:Regression
Requires:Version 7.30
Also available for version 5.10 with fewer features
regpcse.src

Computes a Panel-Corrected version of an OLS regression on a panel data set. This should be used after the LINREG which does the OLS estimates. This allows for one of several forms of covariances between the regressors and disturbances.

Beck and Katz(1995), "What to Do (and Not to Do) with Time-Series-Cross Section Data in Comparative Politics." American Political Science Review, vol 89, 634-647.

Written by:  Estima
Topics:Panel
References:Beck;Katz
Requires:Version 8.10
Also available for version 7.00 with fewer features
regrecursive.src

RegRecursive is a regression post-processing procedure which computes recursive residuals and does testing methods based upon them. The basic regression is y(t)=X(t)b+u(t). The variance of u is assumed to be the (unknown) sigma**2. RegRecursive uses the Kalman filter to produce a series of estimates for the regression. Recursive residuals are the residuals for t using the estimates through t-1, normalized to be homoscedastic if the regression model is correct. Virtually all of this (other than graphs) can be done with the built-in RATS instruction RLS.

Written by:  Estima
Topics:Regression;Stability tests
Requires:Version 5.00
regreset.src

RegRESET is a regression post-processor which performs Ramsey's RESET test. Use this after running a linear regression to test the specification of that regression.

Ramsey(1969): "Tests for specification errors in classical Least-Squares Regression Analysis," JRSS-B, vol 32, 350-371.

Lee, White and Granger(1992), "Testing for Neglected Non-linearities in Time Series Models," J. of Econometrics, vol 56, 269-290.

Written by:  Estima
Topics:Regression
References:Ramsey
Requires:Version 7.30
Also available for version 7.00 with fewer features
regstabtest.src

Computes Hansen (Nyblom-Hansen) stability test for a (just computed) linear regression. It computes both individual and joint test statistics.

Written by:  Estima
Topics:Regression
References:Nyblom;Hansen
Requires:Version 8.00
regstrtest.src

Does an LM test for linearity vs an alternative of smooth transition based upon lags of a known threshold variable in the preceding linear regression. This should be executed immediately after a LINREG.
The general idea (of testing interactions between regressors and terms from a Taylor expansion of the transition variable) is from
Luukkonen, Saikkonen and Terasvirta(1988), "Testing Linearity against smooth transition autoregressive models", Biometrika vol 75, 491-499.
The labeling and interpretation of the hypotheses is from
Terasvirta(1994), "Specification, Estimation and Evaluation of Smooth Transition Autoregressive Models", JASA, vol 89, no. 425, pp 208-218.

Written by:  Estima
Topics:Regression;Structural breaks
References:Terasvirta;Luukkonen;Saikkonen
Requires:Version 8.00
regtotex.src

Takes the most recent regression and produces a TeX equation showing the regression information in equation form.

Written by:  Estima
Topics:Regression
Requires:Version 6.00
regtree.src

Performs a CART (Classification and Regression Trees) analysis. This is a nonparametric alternative to regression for analyzing the relationship between a dependent variable and a set of explanatory variables. CART works by splitting off the data into branches based upon the values of the independent variables. At each stage, it takes the branch which has the highest within group sum of squares for the dependent variable, and picks a split point which gives the greatest reduction in that sum. The calculations required to create a CART are simple (nothing more than sums of squares), but tedious, as each value of each explanatory variable is examined at each stage.

Written by:  Estima
Topics:Regression
Requires:Version 5.10
Also available for version 5.00 with fewer features
regwhitenntest.src

Regression post-processor to do the White Neural Network test.
Lee, White and Granger(1992), "Testing for Neglected Non-linearities in Time Series Models," J. of Econometrics, vol 56, 269-290.

Written by:  Estima
Topics:Regression;Neural networks
References:White
Requires:Version 7.00
regwhitetest.src

Regression post-processing procedure for doing a "White" test for heteroscedasticity. This should be executed immediately after a LINREG.

Written by:  Estima
Topics:Regression
References:White
Requires:Version 7.00
regwutest.src

RegWuTest performs a Wu (or Durbin-Wu-Hausman) specification test on a regression just estimated by instrumental variables. Because it works off the last regression, there are no parameters.
Wu(1973), "Alternative tests of independence between stochastic regressors and disturbances", Econometrica vol 42, 529-546.

Written by:  Estima
Topics:Regression
References:Wu;Durbin;Hausman
Requires:Version 7.00
reprobit.rpf

Example program demonstrating the estimation of a panel data probit model with random effects.

Written by:  Estima
Topics:Example programs;Panel;Logit/probit
Requires:Version 8.00
reset.src

Performs a Regression Error Specification Test.

Written by:  Norman Morin
Topics:Tests(other)
References:Ramsey;Granger;Terasvirta;Lee;White
Requires:Version 5.00
rgse.src

Procedure which uses Robinson's Gaussian semiparametric estimator for estimating the fractional differencing parameter.
Robinson(1992), "Semiparametric analysis of long-memory time series", Annals of Statistics, vol 22, 515-539.

Written by:  Rob Schoen;Estima
Topics:ARIMA;Long memory
References:Robinson
Requires:Version 7.30
Also available for version 6.00 with fewer features
riskmtrc.src

Implements Riskmetrics-style time varying correlations and volatilities computations.

Written by:  Frederick Bourgoin
Topics:Financial
Requires:Version 5.00
rlinreg.src

Computes and graphs recursive coefficient estimates along with 1.96 standard error bands around them, to give a sense whether the coefficients seem constant over a sample

Written by:  Norman Morin
Topics:Outdated
Requires:Version 5.00
rls.prg

Demonstrates use of the instruction RLS for doing an arranged autoregression for testing for threshold effects.

Written by:  Estima
Topics:Example programs;Threshold
References:Tsay
Requires:Version 5.10
robust.rpf

Demonstrates robust estimators for linear models. Uses the instruction RREG (for computing LAD estimator), and LINREG with SPREAD for iterated weighted least squares.

Written by:  Estima
Topics:Example programs;Regression
Requires:Version 8.00
robustlmtest.src

Performs a heteroscedasticity-consistent LM test for the orthogonality between the residuals from the most recent regression and the input test variables. See, for instance, Wooldridge, "Econometric Analysis of Cross Section and Panel Data", MIT Press, 2002, page 60.

Written by:  Estima
Topics:Regression;Tests(other)
Requires:Version 5.10
robuststar.rpf

Demonstrates a test for STAR (smooth transition autoregression) with outlier adjustments.
Adjustment polynomial for downweighting data points in STAR linearity tests, from van Dijk, Franses and Lucas(1999), "Testing for smooth transition nonlinearity in the presence of additive outliers", JBES, vol 17, no 2, 217-235.

Written by:  Estima
Topics:Example programs;Threshold
Requires:Version 8.00
rollreg.src

Rolling OLS regressions in one of three modes. Written originally at Bank of Canada; revised in 2010.

Written by:  Estima;Simon Van Norden
Topics:Regression;Stability tests
Requires:Version 7.00
Also available for version 6.00 with fewer features
roots.src

Contains the procedure ComplexRoots which computes the complex roots of an input polynomial. This has been made obsolete by the RATS function %POLYCXROOTS.

Written by:  Estima
Topics:Outdated
References:Press;Flannery
Requires:Version 5.00
rrgqtest.src

Performs a Goldfeld-Quandt type (sample partition) test for heteroscedasticity, applied to a series (such as recursive residuals) that are already assumed to be independent.

Written by:  Estima
Topics:Tests(other)
References:Goldfeld;Quandt
Requires:Version 6.00
rsstatistic.src

Computes either the classical R/S statistic, or Lo's modified version, where the scale is the square root of the long-run variance.
Mandelbrot and Wallis(1969), "Computer Experiments with Fractional Gaussian Noise", Water Resources Res., vol 5, 228-267.
Lo(1991), "Long-term Memory in Stock Market Prices", Econometrica, vol 59, 1279-1313.

Written by:  Estima
Topics:Dependence tests
References:Mandelbrot;Wallis;Lo
Requires:Version 5.10
Also available for version 5.00 with fewer features
rollingcausality.rpf

Example of a (bivariate) Granger causality test in a rolling window with simulated data.

Written by:  Estima
Topics:Tests(other)
Requires:Version 8.00
runtest.src

For a input series x which shows two states (1,0), this computes a run test. The procedure can estimate the probability of success, or you can input this yourself.

Written by:  Estima
Topics:Dependence tests
Requires:Version 5.10
Also available for version 5.00 with fewer features
sadorsky_ee2012.zip

Replication file for Sadorsky(2012), "Correlations and volatility spillovers between oil prices and the stock prices of clean energy and technology companies", Energy Economics, vol 34, pp 248-255.

Written by:  Estima;Sadorsky
Topics:Paper results;ARCH-GARCH
References:Sadorsky
Requires:Version 9.00
sarima.src

This is a menu-driven procedure for identifying, estimating, and forecasting ARIMA models. Basically, this combines the functions of the BJIDENT and BJFORE procs included with RATS in a single, easy to use procedure. December 1998 update provides many more options, including support for non-consecutive lag lists.

Written by:  Norman Morin
Topics:ARIMA
Requires:Version 5.00
seasonaldlm.src

Creates the A, C, and SW matrices for the seasonal component of a DLM. See Durbin and Koopman, "Time Series Analysis by State Space Methods", Oxford University Press 2001, pp 40-42, and West and Harrison, "Bayesian Forecasting and Dynamic Models" 2nd ed, Springer 1997, chapter 8 for more information.

Written by:  Estima
Topics:State-space models
References:Durbin;Koopman;West;Harrison
Requires:Version 6.10
sctest.rpf

Examples of tests for serial correlation.

Written by:  Estima
Topics:Example programs;Serial correlation
Requires:Version 8.00
shiller.rpf

Demonstrates estimation of a distributed lag using the Shiller Smoothness prior. Shiller, R.J. (1973). "A Distributed Lag Estimator Derived from Smoothness Priors." Econometrica, Vol. 41, pp. 775-788. Uses the instructions CMOMENT and LINREG(CMOMENT) to handle mixed estimation. See also gibbs.prg, which does the same type of prior, but uses Gibbs sampling rather than mixed estimation.

Written by:  Estima
Topics:Example programs;Bayesian methods;Distributed lags
References:Shiller
Requires:Version 8.00
shillergibbs.rpf

Example of Gibbs sampling applied to a Shiller Smoothness Prior for a distributed lag.

Written by:  Estima
Topics:Example programs;Bayesian methods;Distributed lags;Monte Carlo
References:Shiller
Requires:Version 8.00
shortandlong.src

Computes a factorization of sigma with a combination of short and long run restrictions. It can only be applied to just-identified parameter- izations where the restrictions are zero restrictions. If you have an underidentified parameterization, you can compute the "RPERP" matrix which maps free parameters into the loading matrix, but you have to use NOESTIMATE.

Written by:  Estima
Topics:VAR
Requires:Version 6.20
shortandlongvecm.rpf

Example of a VECM with short-and-long run restrictions for structural model.
From Lutkepohl, New Introduction to Multiple Time Series Analysis. Example 9.4 from pp 377-383

Written by:  Estima
Topics:Example programs;Cointegration
Requires:Version 8.00
simplerbc.rpf

Example of solving a small DSGE, producing impulse responses

Written by:  Estima
Topics:Example programs;DSGE;State-space models
Requires:Version 9.20
Also available for version 8.00 with fewer features
simszhaecm1999.zip

This zip file includes most of the analysis in
Sims and Zha(1999), "Error Bands for Impulse Responses", Econometrica, vol 67, no. 5, pp 1113-1156.
This includes calculation of error bands using Monte Carlo integration, bootstrapping and also includes IRF's for a structural VAR.

Written by:  Estima
Topics:Paper results;VAR;Bayesian methods;Monte Carlo;Bootstrapping
References:Sims;Zha
Requires:Version 7.00
simuladd.rpf

Simultaneous equations; add factoring
RATS Version 8, User's Guide, example from Section 8.3.

Written by:  Estima
Topics:Example programs;Simultaneous equations;Forecasting
Requires:Version 8.00
simulest.rpf

Simultaneous equations; estimation
RATS Version 8, User's Guide, Example 8.1.

Written by:  Estima
Topics:Example programs;Simultaneous equations
Requires:Version 8.00
simulfore.rpf

Simultaneous equations; forecasting
RATS Version 8, User's Guide, example from Section 8.3.

Written by:  Estima
Topics:Example programs;Simultaneous equations;Forecasting
Requires:Version 8.00
simulmult.rpf

* * SIMULMULT.RPF * RATS Version 8, User's Guide, example from Section 8.3. * source prsetup.src smpl 1984:1 1985:4 forecast(model=prsmall,results=base) compute govt(1984:1)=govt(1984:1)+2.0 forecast(model=prsmall,results=mults) compute govt(1984:1)=govt(1984:1)-2.0 do i=1,%rows(mults) set mults(i) = (mults(i)-base(i))/2.0 labels mults(i) # 'M_'+%modellabel(prsmall,i) end do i print(picture="*.###") / mults

Written by:  Estima
Topics:Example programs;Simultaneous equations
Requires:Version 8.00
simultheil.rpf

Simultaneous equations; forecast performance analysis
RATS Version 8, User's Guide, example from Section 8.3.

Written by:  Estima
Topics:Example programs;Simultaneous equations;Forecasting
Requires:Version 8.00
sinclairjmcb2009.zip

Replication of Sinclair(2009), "The Relationships between Permanent and Transitory Movements in U.S. Output and the Unemployment Rate," Journal of Money, Credit and Banking, vol. 41(2-3), pages 529-542.

Written by:  Estima
Topics:Paper results;State-space models
References:Sinclair
Requires:Version 7.20
skalin_terasvirta_jae1999.zip

Replication file for Skalin and Terasvirta(1999), "Another Look at Swedish Business Cycles, 1861-1988", Journal of Applied Econometrics, vol. 14, no 4, pp 359-78.
This fits ESTAR and LSTAR models to a number of long annual macro series from Sweden and does a causality test allowing for threshold effects.

Written by:  Estima
Topics:Paper results;Threshold
References:Skalin;Terasvirta
Requires:Version 8.00
specdens.src

Calculates the spectral density matrix at frequency zero, i.e., the long-run covariance matrix, of a set of series using nonparametric methods.

Written by:  Norman Morin
References:Andrews;Den Haan;Hamilton
Requires:Version 5.00
specfore.rpf

Demonstrates univariate forecasting using spectral techniques. Uses the SPECFORE.SRC procedure.

Written by:  Estima
Topics:Example programs;Spectral;Forecasting
Requires:Version 8.00
specfore.src

Computes forecasts using spectral techniques.

Written by:  Estima
Topics:Spectral;Forecasting
References:Geweke
Requires:Version 5.00
specth.src

Takes a vector of AR and MA terms and calculates the resulting theoretical spectrum (Note: requires the acfmorin.src procedure). An alternative that does a similar calculation using a RATS equation as input is armaspectrum.src.

Written by:  Norman Morin
Topics:ARIMA;Spectral
References:Granger;Newbold;Hamilton
Requires:Version 5.00
spectrum.rpf

Example of calculation of a spectral density.
From Brockwell & Davis, "Time Series Analysis: Theory and Methods", (their) Example 10.4.3 on page 354

Written by:  Estima
Topics:Example programs;Spectral
Requires:Version 8.00
spectrum.src

This computes and graphs the estimated spectrum of a series. This is an updated version of the same procedure included with RATS--the new version adds LOGSCALE and PERIODOGRAM options.

Written by:  Estima
Topics:Spectral
Requires:Version 7.00
Also available for version 5.00 with fewer features
spgraph.rpf

Demonstrates generation of a "matrix" of graphs using the instruction SPGRAPH.

Written by:  Estima
Topics:Example programs;Graphics
Requires:Version 8.00
splom.src

This generates a scatter plot matrix - an NxN matrix of bivariate scatter plots.

Written by:  Estima
Topics:Graphics
Requires:Version 5.10
Also available for version 5.00 with fewer features
spunit.src

Computes various "Schmidt-Phillips" tests (TAU) for a unit root.
Schmidt and Phillips(1992), "LM Test for a Unit Root in the Presence of Deterministic Trends", Oxford Bulletin of Economics and Statistics, vol 54, no. 3, 257-287. *

Written by:  Diego Vasquez
Topics:Unit root
References:Schmidt;Phillips;Schwert
Requires:Version 7.30
Also available for versions 6.00,5.00 with fewer features
ssmspectrum.src

Returns the estimated multivariate spectrum from a state space model given by the A and SW options. It returns in its argument a series of complex matrices.

Written by:  Estima
Topics:State-space models;Spectral
Requires:Version 5.10
ssvar.src

Uses Gibbs sampling to generate posterior estimates (including forecasts, if the user chooses) as in Villani, Mattias (2006), "Inference in Vector Autoregressive Models with an Informative Prior on the Steady State," Sveriges Riksbank Research Paper No. 19, forthcoming in the Journal of Applied Econometrics.

Written by:  Todd Clark
Topics:VAR;Bayesian methods;Monte Carlo
References:Villani
Requires:Version 6.10
stabtest.src

Computes Hansen's stability test statistics (for individual coefficients, variance and jointly).
Hansen(1992), "Parameter Instability in Linear Models", Journal of Policy Modeling, vol. 14, 517-533.

Written by:  Estima
Topics:Stability tests
References:Hansen(Bruce);Nyblom
Requires:Version 7.30
Also available for version 5.10 with fewer features
stampdiags.src

Produces the standard set of diagnostics for a (univariate) state space model used by the STAMP(tm) software. This includes a Q test for serial correlation, Normality test, and Goldfeld-Quandt type heteroscedasticity test.

Written by:  Estima
Topics:State-space models;Stability tests
Requires:Version 7.30
Also available for version 7.00 with fewer features
startest.src

This does the test for linearity vs an alternative of LSTAR or ESTAR (smooth transition autoregression).
Terasvirta(1994), "Specification, Estimation and Evaluation of Smooth Transition Autoregressive Models", JASA, vol 89, 208-218.

Written by:  Estima
Topics:Threshold
Requires:Version 7.30
Also available for version 5.10 with fewer features
stepprobit.src

StepProbit does a backwards stepwise reduction of a probit model, dropping variables as long as the smallest t-statistic is less than the threshold in absolute value.

Written by:  Estima
Topics:Estimators
Requires:Version 6.10
stockwat.src

This procedure is a modification of Stock's procedure to do Stock-Watson and Dickey-Fuller Unit Root and Time Trend tests.
Stock and Watson(1988), "Testing for Common Trends", JASA, vol. 83, 1097-1116.

Written by:  Estima
Topics:Unit root
References:Stock;Watson
Requires:Version 5.10
Also available for version 5.00 with fewer features
structresids.src

Converts standard VAR residuals into structural innovations.

Written by:  Estima
Topics:VAR
Requires:Version 6.20
sur.rpf

Demonstrate SUR (seemingly unrelated regression) estimation using the instruction SUR.

Written by:  Estima
Topics:Example programs
References:Grunfeld
Requires:Version 8.00
surgat.src

SURGAT (Seasonal Unit Roots Graphical Analysis and Testing device) is a menu-driven program to help in the analysis of the seasonal component and the trend of a (quarterly, monthly or annual) time series. This program is originally written by Ignacio D¡az-Emparanza with the collaboration of Rosa Cao and Lander Ibarra. Requires SPECTRUM.SRC and LAGSELEC.SRC procedure files.

Written by:  Daz-Emparanz;Cao;Ibarra
Topics:Unit root
Requires:Version 5.00
surgibbssetup.src

This is a collection of procedures for setting up a Gibbs sampler for a (linear) SUR, such as a near-VAR. An example and a further explanation are provided in the "Bayesian Econometrics" workbook.

Written by:  Estima
Topics:Bayesian methods
Requires:Version 7.00
sv.rpf

Demonstrates quasi-maximum likelihood estimation of a stochastic volatility model using the instruction DLM.

Written by:  Estima
Topics:Example programs;Financial;State-space models
Requires:Version 8.00
svar.src

Procedure for estimating the parameters for a structural VAR. By Giannini, Lanzarotti, and Seghelini, based on Giannini's monograph entitled "Topics in Structural VAR Econometrics". An example program using SVAR.SRC and VMA.SRC, called SVAREXAM.PRG, is also available. This requires the data file ITALY.RAT.

Written by:  Giannini;Lanzarotti;Seghelini
Topics:VAR
References:Giannini
Requires:Version 5.00
swamy.rpf

Demonstrates estimation of a linear model in panel data using Swamy's matrix weighted average. See also swamy.src, which is the same calculation converted into a procedure.

Written by:  Estima
Topics:Example programs;Panel
Requires:Version 8.00
swamy.src

Computes a GLS matrix weighted estimator for a panel data set. For an example, see swamy.prg. meangroup.src does a similar estimator, but uses simple weighted average rather than a matrix-weighted average.
Swamy(1970), "Efficient Inference in a Random Coefficient Regression Model", Econometrica, vol 38, 311-323.

Written by:  Estima
Topics:Panel
References:Swamy
Requires:Version 7.30
Also available for versions 6.10,6.00 with fewer features
swarch.rpf

Demonstrates estimation of a Markov switching ARCH model. Hamilton and Susmel (1994), "Autoregressive Conditional Heteroskedasticity and Changes in Regime", Journal of Econometrics, vol. 64, pp 307-33.

Written by:  Estima
Topics:Example programs;ARCH-GARCH
Requires:Version 8.00
swdols.src

Estimates cointegrating vectors using Stock and Watson's dynamic OLS.
Stock and Watson(1993), "A Simple Estimator of Cointegrating Vectors in Higher Order Integrated Systems", Econometrica, vol. 61, 783-820.

Written by:  Estima
Topics:Cointegration
References:Stock;Watson
Requires:Version 7.30
Also available for version 5.10 with fewer features
switch.src

Estimates by maximum-likelihood the switch point in a Goldfeld-Quandt switching regression model.

Written by:  Paco Goerlich
Topics:Switching models
References:Goldfeld;Quandt
Requires:Version 5.00
swtrends.src

Stock-Watson test for cointegration rank via common trends.
Stock and Watson(1988), "Testing for Common Trends", JASA, vol. 83, 1097-1107.

Written by:  Estima
Topics:Cointegration
References:Stock;Watson
Requires:Version 5.10
tar.src

Estimates a self-exciting threshold autoregression, and computes asymptotic p-values for tests for the threshold effect.
Bruce Hansen(1996), "Inference When a Nuisance Parameter is Not Identified Under the Null Hypothesis", Econometrica, vol 64, no. 2, 413-430.

Written by:  Estima
Topics:Threshold;Estimators
References:Hansen(Bruce)
Requires:Version 7.30
Also available for version 6.00 with fewer features
tarmodels.rpf

Example of estimation of a STAR Model.
This is based on example 3 from Terasvirta(1994), "Specification, Estimation and Evaluation of Smooth Transition Autoregressive Models", JASA, vol 89, pp 208-218.

Written by:  Estima
Topics:Example programs;Threshold
Requires:Version 8.00
terasvirtajasa1994.zip

Replication programs for Terasvirta(1994), "Specification, Estimation and Evaluation of Smooth Transition Autoregressive Models", JASA, vol 89, pp 208-218. Demonstrates the procedures startest.src, yulelags.src, and lagpolyroots.src.

Written by:  Estima
Topics:Paper results;Threshold
References:Terasvirta
Requires:Version 7.00
Also available for version 6.10 with fewer features
threshtest.src

Tests for a break in a linear regression based upon a threshold variable. Bruce E. Hansen, "Inference in TAR models", Studies in Nonlinear Dynamics and Econometrics,(1997).

Written by:  Estima
Topics:Stability tests;Threshold
References:Hansen(Bruce)
Requires:Version 7.30
Also available for version 6.00 with fewer features
tlookup.src

TLOOKUP.SRC provides a procedure for doing table lookups. Given an Nx2 table containing and index column and a column of corresponding values (such as a table of degrees of freedom and corresponding critical values), the procedure returns the value corresponding to a requested index (it will interpolate the value if necessary).

Written by:  Estima
Requires:Version 5.00
tobit.rpf

Demonstrates estimation of standard tobit and two-step tobit models for dealing with censored or truncated data. Uses the instructions LDV and PRJ with the MILLS option.

Written by:  Estima
Topics:Example programs
Requires:Version 8.00
triples.src

Implements the "Triples" test for asymmetry.
Randles, Fligner, Policello and Wolfe(1980), "An Asympotically Distribution-Free Test for Symmetry vs. Asymmetry", JASA, vol 75, 168-172.
Verbrugge(1997), "Investigating cyclical asymmetries", Studies in Nonlinear Dynamics and Econometrics, 2.1, 15-22.

Written by:  Verbrugge
Topics:Tests(other)
References:Randles;Fligner;Policello;Wolfe;Verbrugge
Requires:Version 6.00
tsayjasa1998.zip

Replication file for Tsay (1998), "Testing and Modeling Multivariate Threshold Models", J. of American Statistical Assn, vol. 93, no. 443, 1188-1202.
Demonstrates use of RLS (recursive least squares) and SWEEP instructions.

Written by:  Estima
Topics:Paper results;Threshold
References:Tsay
Requires:Version 7.00
tsaynltest.src

TsayNLTest does the Tsay Ori-F test for neglected non-linearities in an autoregression. Optionally, it can do the LST variant (which tests more specifically against STAR).
Tsay(1996), "Nonlinearity Tests for Time Series", Biometrika, vol 73, 461-466.
Luukkonen, Saikkonen and Terasvirta(1988), "Testing Linearity against smooth transition autoregressive models", Biometrika vol 75, 491-499.

Written by:  Estima
Topics:Tests(other)
References:Tsay;Luukkonen;Saikkonen;Terasvirta
Requires:Version 5.10
tsaytest.src

Does a Tsay arranged regression test for the presence of threshold autoregression (TAR). Demonstrates the instruction KALMAN with the ADD option to add observations to a regression out of time sequence.
Tsay(1989), "Testing and Modeling Threshold Autoregressive Processes", JASA, pp 231-240.

Written by:  Estima
Topics:Threshold;Stability tests
References:Tsay
Requires:Version 5.10
Also available for version 5.00 with fewer features
tsecctest.src

Does the Tse LM test for constant correlation. This must follow estimation of a constant correlation model.
Tse, Y.K.(2000), "A Test for Constant Correlations in a Multivariate GARCH Model", Journal of Econometrics 98, 107-127.

Written by:  Estima
Topics:ARCH-GARCH
References:Tse
Requires:Version 7.10
tsejoe2000.zip

This contains an example program and data file for implementing Tse's LM test for constant correlation in a multivariate GARCH model. The program replicates the results from the article: Tse, Y.K.(2000), "A Test for Constant Correlations in a Multivariate GARCH Model", Journal of Econometrics, 98, pp. 107-127.

Written by:  Estima
Topics:Paper results;ARCH-GARCH
References:Tse
Requires:Version 7.10
Also available for version 6.00 with fewer features
tvarset.src

TVARSET sets up a time-varying parameters VAR system for estimation using the Kalman filter. As written, it is based upon the simple symmetric Bayesian VAR prior, with the time-variation proportional to the initial covariance matrix.

Written by:  Estima
Topics:VAR
Requires:Version 7.00
Also available for versions 6.30,6.20,6.10,6.00,5.10,5.00 with fewer features
tvarying.rpf

Demonstrates time-varying coefficients estimation of a VAR with search over space of hyperparameters.

Written by:  Estima
Topics:Example programs;VAR
Requires:Version 8.00
uforeerrors.src

Computes error statistics on a series of in-sample one-step forecasts.

Written by:  Estima
Topics:Forecasting
Requires:Version 7.30
Also available for version 6.00 with fewer features
uhligfuncs.src

This is a pair of functions for simplifying the specification of sign-constrained impulse response functions. One is to implement the rejection method; the other calculates the penalty function, as described in Uhlig(2005), "What are the effects of monetary policy on output? Results from an agnostic identification procedure", Journal of Monetary Economics, 52, pp 381-419. You should look at the replication files for that paper to see how these are used.

Written by:  Estima
Topics:VAR
References:Uhlig
Requires:Version 6.30
uhligjme2005.zip

Three programs replicating VAR identification of impulse responses with sign restrictions from Uhlig(2005), "What are the effects of monetary policy on output? Results from an agnostic identification procedure", Journal of Monetary Economics, vol 52, pp. 381-419.

Written by:  Estima
Topics:Paper results;VAR
References:Uhlig
Requires:Version 7.00
Also available for version 6.10 with fewer features
uniformparms.src

Returns a 2-vector with the two parameters (lower and upper bounds) for a uniform distribution with the given mean and standard deviation.

Written by:  Estima
Topics:Bayesian methods
Requires:Version 5.10
union.rpf

Demonstrates various techniques for analyzing predicted probabilities in a probit model. Makes use of the instruction PRJ for calculating the predictions and SCATTER for graphing the effects.

Written by:  Estima
Topics:Example programs;Logit/probit
Requires:Version 8.00
uniquevalues.src

Returns a vector of sorted unique values for a series.

Written by:  Estima
Requires:Version 6.00
unitroot.rpf

Examples of unit root testing, demonstrating Dickey-Fuller, Phillips-Perron, Schmidt-Phillips and ERS and KPSS tests.

Written by:  Estima
Topics:Example programs;Unit root
Requires:Version 8.00
unitroot.src

One of several variations on Dickey-Fuller and Phillips Perron unit root tests witten by Francisco Goerlich.

Written by:  Francisco Goerlich
Topics:Unit root
References:Dickey;Fuller;Phillips;Perron
Requires:Version 5.00
unitrootbreak.rpf

Example of unit root tests with breaks

Written by:  Estima
Topics:Example programs;Unit root
Requires:Version 8.00
uradf.src

For basic ADF (Augmented Dickey-Fuller) tests, we recommend Norman Morin's URADF.SRC procedure. This performs Augmented Dickey-Fuller unit root tests, and includes AIC and BIC searches for appropriate lag length and more .

Written by:  Norman Morin
Topics:Unit root
References:Dickey;Fuller;Davidson;MacKinnon;Goerlich;Hamilton
Requires:Version 5.00
urauto.src

One of several variations on Dickey-Fuller and Phillips Perron unit root tests witten by Francisco Goerlich.

Written by:  Francisco Goerlich
Topics:Unit root
References:Dickey;Fuller;Phillips;Perron
Requires:Version 5.00
ursb.src

Performs the Sargan-Bhargava unit root test.
Bhargava(1986), "On the theory of testing for unit roots in observed time series", Review of Economic Studies, pp 369-384.

Written by:  Francisco Goerlich
Topics:Unit root
References:Sargan;Bhargava
Requires:Version 5.00
urtt.src

One of several variations on Dickey-Fuller and Phillips Perron unit root tests witten by Francisco Goerlich.

Written by:  Francisco Goerlich
Topics:Unit root
References:Dickey;Fuller
Requires:Version 5.00
urttopp.src

One of several variations on Dickey-Fuller and Phillips Perron unit root tests witten by Francisco Goerlich.

Written by:  Francisco Goerlich
Topics:Unit root
References:Ouliaris;Par;Phillips
Requires:Version 5.00
var.src

VAR.SRC is a sophisticated, menu-driven procedure for selecting, estimating, and evaluating VAR models. Written by Norman Morin. This procedure makes it easy to graph autocorrelations of your data, test for lag length, do Wald tests on coefficient restrictions and on the Variance/Covariance matrix, test residuals for serial correlation, ARCH, normality (including Jarque-Bera), compute the sum of the Vector Moving Average coefficients, display the VMA representation coefficients, do impulse response analysis using a variety of decompositions, compute forecast error variance decomposition, and compute bootstrapped standard errors for impulse responses. Includes support for the Blanchard + Quah decomposition for IRFs. If you are using RATS Version 4.20 or later, download VAR.SRC. If you are using 4.00 through 4.10, download VAR400.SRC. VAR400 offers most of the same features as VAR, but with a less user-friendly interface due to lack of USERMENU instructions, etc. Also, please note that the 4.0 versions are not being updated, and thus do not include Blanchard-Quah and other recent additions.

Written by:  Norman Morin
Topics:VAR;Menu-driven
References:Blanchard;Quah;Hamilton;Lutkepohl;Magnus;Doan
Requires:Version 5.00
varbootsetup.src

This is a pair of procedures for setting up and realizing bootstrap replications for a VAR.

Written by:  Estima
Topics:VAR;Bootstrapping
Requires:Version 7.00
varcalc.src

VARCalc does a direct calculation of a VAR.

Written by:  Estima
Topics:VAR
Requires:Version 6.10
varcause.rpf

Demonstrates block causality (exogeneity) tests in a VAR. Uses the instruction RATIO.

Written by:  Estima
Topics:Example programs;VAR
References:Sims
Requires:Version 8.00
varfpe.src

Computes minimum FPE representation for the equations in a VAR.

Written by:  Estima
Topics:VAR
Requires:Version 5.00
varfromdlm.src

Generates a VAR representation for a selection of variables from a stationary DLM (state-space model).

Written by:  Estima
Topics:VAR;State-space models;DSGE
Requires:Version 5.10
vargarchsimulate.rpf

Example of simulation of a VAR-GARCH process. Includes calculation of error statistics on forecasts of the mean (for illustration; it's not a good idea in the presence of GARCH errors).

Written by:  Estima
Topics:Example programs;ARCH-GARCH
Requires:Version 8.30
varimax.src

VARIMAX rotates a set of factor loadings (previously computed) using the varimax criterion.

Written by:  Estima
Topics:Factor models
Requires:Version 5.10
varirf.src

This organizes the graphs of an impulse response function from an already estimated VAR.

Written by:  Estima
Topics:VAR
Requires:Version 7.00
Also available for versions 6.10,5.00 with fewer features
varirfdelta.src

Computes the covariance matrix of the IRF to a fixed shock using the delta method.

Written by:  Estima
Topics:VAR
Requires:Version 7.00
varlag.rpf

Demonstrates several methods for choosing lag length in a VAR. Among them are LR tests on blocks of lags, general-to-specific lag length testing, and Akaike and Schwarz information criteria. Demonstrates the RATIO instruction and the VARLagSelect procedure.

Written by:  Estima
Topics:Example programs;VAR
Requires:Version 8.00
varlagmd.src

Contains the procedure VARLagModel, which computes the NxN matrix of sums of the lag coefficients in the (I-A(L))y(t)=u(t) representation of a VAR model. This is the same matrix which ESTIMATE generates as %VARLAGSUMS, but can be used when the coefficients have been reset as part of a Monte Carlo procedure.

Written by:  Estima
Topics:Outdated
Requires:Version 5.00
varlagselect.src

VARLagSelect chooses the lag length which minimizes one of the information criteria.

Written by:  Estima
Topics:VAR
Requires:Version 7.30
Also available for version 6.10 with fewer features
varmadlm.src

VARMADLM.SRC includes two setup routines for estimating or analyzing a vector ARMA model using the RATS instruction DLM.

Written by:  Estima
Topics:VAR;State-space models
Requires:Version 6.10
varmagarch.rpf

Example of multivariate VAR and VARMA (mean model) GARCH models

Written by:  Estima
Topics:Example programs;ARCH-GARCH
Requires:Version 9.20
varspectrum.src

Returns the estimated multivariate spectrum from a VAR given by the the combination of model and sigma. It returns in its third argument a series of complex matrices.

Written by:  Estima
Topics:State-space models;Spectral
Requires:Version 6.10
varstability.rpf

Example of a Nyblom fluctuations test applied to a VAR

Written by:  Estima
Topics:Example programs;VAR;Stability tests
References:Nyblom
Requires:Version 8.00
vecmcause.rpf

Example of testing for causality and long-run causality in a VECM

Written by:  Estima
Topics:Example programs;Cointegration
Requires:Version 7.10
vecmgarch.rpf

Example of some of the calculations done in Pardo and Torro(2007), "Trading with asymmetric volatility spillovers", JBFA, vol. 34(9-10), 1548-1568, applied to a different data set.

Written by:  Estima
Topics:Example programs;ARCH-GARCH;Cointegration
Requires:Version 9.10
vma.src

Procedure for computing impulse response functions and forecast error variance decomposition for structural VAR's (requires SVAR.SRC procedure described above). By Giannini, Lanzarotti, and Seghelini. An example program using SVAR.SRC and VMA.SRC, called SVAREXAM.PRG, is also available. This requires the data file ITALY.RAT.

Written by:  Giannini;Lanzarotti;Seghelini
Topics:VAR
References:Giannini
Requires:Version 5.00
vratio.src

Implements the variance ratio unit root test procedure as outlined in Cochrane (1988), Diebold (1989), and Lo and McKinley (1988). Revised and updated by Estima. (Updated May, 2006: documented DIFF option, corrected problem with NODIFF).

Written by:  Christopher Zorn;Estima
Topics:Unit root
References:Cochrane;Diebold;Lo;McKinley
Requires:Version 6.00
watsonaer1994.zip

Examples of use of the Bry-Boschan business cycle dating algorithm.
From Mark Watson(1994), "Business Cycle Durations and Postwar Stabilization of the U.S. Economy", American Economic Review, vol 84, no 1, 24-46.
Watson's paper applies this to monthly data. This also includes an example applying it (or more accurately the Harding-Pagan variant) to the same data at a quarterly frequency.

Written by:  Estima
Topics:Paper results;Business cycles
References:Watson;Bry;Boschan;Harding;Pagan
Requires:Version 8.30
watsonjpe1993.zip

This zip file contains an example program and the required data and procedure files to reproduce most of the analysis from Watson(1993), "Measures of Fit for Calibrated Models", Journal of Political Economy, vol 101, pp 1011-1041. In addition to demonstrating Watson's measures of fit, it also demonstrates methods for solving DSGE models. Watson uses the popular King, Plosser, and Rebelo model. This demonstrates the procedures ssmspectrum.src, varspectrum.src, and the instruction DSGE (or dsgetool.src for version 6.xx).

Written by:  Estima
Topics:Paper results;DSGE
References:Watson;King;Plosser;Rebelo
Requires:Version 7.00
Also available for version 6.00 with fewer features
westchotest.src

Computes the modified Ljung-Box test, robust to heteroscedasticity, proposed in West and Cho(1995), "The predictive ability of several models of exchange rate volatility," Journal of Econometrics, vol. 69, no 2, 367-391.

Written by:  Estima
Topics:Dependence tests
References:West;Cho
Requires:Version 7.30
west_cho_joe1995.zip

Replication file for West and Cho(1995), "The predictive ability of several models of exchange rate volatility," Journal of Econometrics, vol. 69, no 2, 367-391.

Written by:  Estima
Topics:Paper results;ARCH-GARCH
References:West;Cho
Requires:Version 8.00
wfractil.src

Contains the procedure "WFRACTILES", which computes fractiles of a set of sample values with weights. This has been made obsolete by the RATS function %WFRACTILES

Written by:  Estima
Topics:Outdated
Requires:Version 5.00
white.src

Implements White's 1980 test for heteroscedasticity.

Written by:  Norman Morin
Topics:Tests(other)
References:White
Requires:Version 5.00
whittletest.src

Implements the Whittle test for independence of state sequences.

Written by:  Giller
Topics:Switching models;Markov switching
References:Whittle
Requires:Version 7.20
willingertaqteverfs1999.zip

Replication file for Willinger, Taqqu and Teverovsky(1999), "Stock Market Prices and Long-Range Dependence", Finance and Stochastics, vol 3 pp 1-13. Uses the procedures hurst.src and rsstatistic.src

Written by:  Estima
Topics:Paper results;Long memory
References:Willinger;Taqqu;Teverovsky
Requires:Version 6.30
wrightjbes2000.zip

This replicates the results in Wright(2000), "Alternative Variance-Ratio Tests Using Ranks and Signs", JBES, vol 18, pp 1-9. It demonstrates the procedure vratio.src.

Written by:  Estima
Topics:Paper results;Dependence tests;Financial
References:Wright
Requires:Version 7.00
Also available for version 6.00 with fewer features
wutest.src

WuTest performs a Wu specification test on a regression just estimated by instrumental variables. Because it works off the last regression, there are no parameters.

Written by:  Estima
Topics:Regression
References:Wu
Requires:Version 5.10
wzsampler.rpf

This uses the Waggoner-Zha(2003) sampler, "A Gibbs sampler for structural vector autoregressions," Journal of Economic Dynamics and Control, 28(2), 349–366 to analyze a structural VAR.

Written by:  Estima
Topics:VAR;Bayesian methods;Monte Carlo
References:Waggoner;Zha
Requires:Version 9.00
yulelags.src

YuleLags computes an information criterion for various lags of AR processes using the Yule-Walker estimates based upon the sample covariances. Use the newer ARAutoLags procedure instead.

Written by:  Estima
Topics:ARIMA
Requires:Version 7.30
Also available for versions 6.10,6.00 with fewer features
yulevar.src

This estimates a VAR on stationary data using the Yule-Walker equations.

Written by:  Estima
Topics:VAR
Requires:Version 7.30
Also available for version 6.10 with fewer features
zivot.src

Zivot and Andrews unit root test. Allows for a single break in the intercept, the trend or both.
Zivot and Andrews(1992), "Further evidence on the Great Crash, the oil price shock, and the unit-root hypothesis", JBES, vol 10, 251-70.

Written by:  Estima
Topics:Unit root;Structural breaks
References:Andrews;Zivot
Requires:Version 7.30
Also available for versions 6.00,5.10,5.00 with fewer features