The file MATRIX2.MAC contains a number of subroutines that can be loaded and run with the matrix command. These subroutines files include production matrix commands and those of less interest. The command call load(subname); load these routines so that they can be called by user programs. The staging2.mac contains a number of routunes that are self documented in the comments of the routine. These are loaded with the command call load(subname :staging) More specialized routines are contained in wbsuppl.mac and are loaded with call load(subname :wbsuppl); Routines listed in matrix2.mac include MATRIX command functions and subroutines. While users can add commands to the matrix2.mac file, they are warned that if new versions of b34s are loaded, the matrix2.mac file will be updated which will result in any user routines being lost. As an alternative a user routine mytest in file mylib.mac could be loaded with the command call load(mytest,'c:\mydir\mylib.mac'); It is recommended that comments on the use of a routine be placed at the beginning of the file using the /$ or /; comment form. The library staging2.mac contains potential production subroutines that have not been moved to matrix2.mac. Help files are placed in these routines and examples are also shown. Running examples are found in staging.mac. Routines in staging2.mac can be loaded with the command call load(kk :staging); where kk is the routine name. Unless otherwise stated, test programs for the routines in matrix2.mac and staging2.mac are contained in the files matrix.mac and staging.mac. Index of Routines in matrix2.mac and staging2.mac Mac file name c:\b34slm\lib\matrix2.mac # Name Heading 10 README 27 ACE_OLS Tests ACE Model using OLS 124 ACE_PLOT Plot ACE Response Curves 297 ACF_PLOT Plot ACF 341 ALTSE Copies lower triangle to upper and gets SE 364 AUTOCOV Autocovaiance 397 BJ_IDEN List / Plot ACF and PACF 501 B_G_TEST Breusch- Godfrey (1978) Test on Residuals 568 B_G_ALT Breusch- Godfrey (1978) Test using dropping 639 BLUS BLUS master 1020 BPF Baxter - King Symmetric MA Filter 1126 BPFM Baxter - King Symmetric MA Filter - Missing Data at 1229 BUILDLAG Builds NEWY and NEWX for VAR Modeling 1260 CATS Cointegration Analysis using Johansen Approach 1529 CCFTEST Tests Cross Correlations 1563 CFREQ Determine Frequency Distribution 1581 COINT2 Cointegreation of Two Series 1669 COINT2LM Cointegreation of Two Series - Gives L1 and Minimax 1782 COINT2M Moving Cointegration of Two Series - Simple Version 1836 COINT2M2 Moving Cointegration Two Series OLS, L1 Minimax 1924 COINT2ME Moving Cointegration of Two Series - Extended Versi 1998 COINT3 Cointegration of Three Series 2120 COINT3ME Moving Cointegration of Three Series 2213 COINT_SW Stock-Watson DOLS Cointegration analysis 2286 CONTRIB Advanced routine do MARS contrib analysis 3985 CPERIOD Normalized Cumulative Periodogram 4058 DATAVIEW Interactively View Data 4329 DATA_ACF Plot ACF and PACF of a series 4389 DATA2ACF Plot ACF and PACF of a series with file name 4446 DF_GLS Elliot-Rothenberg-Stock DF_GLS Test 4531 DIST_TAB Distribution Table 4575 DO_SPEC View Spectrum 4631 DO2SPEC View Spectrum with a file name 4684 DUD Derivative Free Nonlinear Estimation 4844 DUD2 Derivative Free Nonlinear Estimation 5011 FDIFINFO Fractional Differencing 5059 FILTER High Low Pass Filter using Real FFT 5108 FILTERC High Low Pass Filter using Complex FFT 5158 FORPLOT Forecast Plot 5314 GAMFORE Forecast a GAM Model 5417 GAMPLOT Display GAMFIT Results 5785 GARCH2P Two Pass GARCH Using ARMA Command 5821 GARCH2PF Two Pass GARCH Using ARMA Command with Forecasts 5871 GET_NAME Get Name of a Matrix Variable 5913 GTEST Tests ARCH / GARCH Models 6138 GWRITE Save Matrix Object in GAUSS Format using one file 6195 GWRITE2 Pass Large Datasets to GAUSS in 2 files 6268 HP_2 Hodrick - Prescott Moving Filtering 6356 HP_BP_1 Baxter - King & Hodrick - Prescott Filtering 6411 HP_BP_2 Baxter - King & Hodrick - Prescott Moving Filtering 6552 IRF Impulse Response Functions for VAR Model 6814 KPSS KPSS Stability Test 6894 KSWTEST K Period Stock Watson Test 7109 KSWBOOTS K periods Stock-Watson Bootstrap Critical Values 7451 KSWTESTM Moving Period Stock Watson Test 7754 LAGTEST 3-D Graph to display RSS for Various OLS Lags 7814 LAGTEST2 3-D Graph to display RSS for Various MARS Lags 7877 LMTEST Engle LM test for a Range of lags 7916 LS2 Two Stage Least Squares and GMM Estimation 8218 MARQ Estimation of a Nonlinear Model using Derivatives 8340 MARSPLOT Plot MARS Curves & Surfaces 8389 MCLEODLI McLeod-Li (1983) Linearity test (y,ip,maxacf) 8431 MINIMAX Minimax Estimation using MAXF2 8474 MISSPLOT Plots Data With Missing Values 8528 MOVEAVE Moving average of a vector 8557 MOVEBJ Moving Arima Forecast using AUTOBJ 8645 MOVECORR Moving Correlation of two vectors 8684 MOVEH82 Moving Hinich 82 test 8744 MOVEH96 Moving Hinich 96 test 8781 MOVEOLS Moving OLS with LAGS 8844 MOVEVAR Moving Variance 8874 MSMOOTH Moving calls to smooth for forecasting 8985 NLVARCOV NLLSQ Variance Covariance 9018 OLSPLOT Plot of Fitted and Actual Data & Res 9061 OLSQ_RES Testing restrictions in OLS Models 9167 PAD Pad a 1D Real*8 Series on both ends 9198 PERMUTE Reorder a Square Matrix 9247 POLYFIT Fit an nth Order Regression 9289 POLYVAL Evaluate an nth Order Polynominam Regression 9311 PPEXP_P Plot and save ppexp output 9502 PVALUE_1 Present value of $1 recieved at end of n years 9518 PVALUE_2 Present Value of an Annuity of $1 9541 PVALUE_3 Present value of $1 recieved throughout year 9564 QUANTREG Quantile Regression 9617 RESET69 Ramsey(1969) Regression Specification Test 9681 RESET77 RESET77 Nonlinearitry Test 9765 RMATLAB Runs Matlab commands 9779 RRPLOTS Plots Recursive Residual Data 0211 RRPLOTS2 Plots Recursive Coefficients 0420 RTEST Tests Residuals of TS Models 0636 RTEST2 Tests Residuals of TS Models - No Res and y Plots 0824 SC_TEST Serial Correlation Tests 0988 SUBSET Subset an array under mask control 1040 SPECFORE Forecasting Using Spectral Methods 1132 SWARTEST Stock-Watson AR Test 1398 SWBOOTS Stock-Watson Bootstrap Critical Values 1800 SWBOOTSM Moving Stock Watson Statistics for last series 2369 TESTFUN Test Function 2378 TESTPGM Test Program 2385 TESTSUB Test Subroutine 2393 UROOT_T Battery of DF, PP, ERS and KPSS test 2545 VAREST VAR Modeling file c:\b34slm\lib\staging2.mac # Name Heading 10 README 29 ACE_OLS Tests ACE Model using OLS 126 ACE_PLOT Plot ACE Response Curves 299 BOOST BOOST, BOOST2, BOOST3 & BOOST4 code 706 BOOTOLS Bootstrap OLS Model 835 BOOTPLOT Plots an ordered series 859 BOOTL1 Bootstrap L1 Model 976 BOOTMM Bootstrap MM Model 1094 CATNAME Add string to a names vector 1154 CENTER Center a series or 2 D object mean=0 variance=1 1199 CENTER2 Standardizes a Series mean=0 Unit length 1244 CGETR16 Reads Real*16 Data into Matrix 1262 CGETVPA Reads VPA data into Matrix 1284 COR Correlation of a matrix. 1317 COV Calculated Covariance of a matrix 1338 COV2 Idempotent Matrix method get Variance-Cov 1378 COND Condition of a Matrix 1435 DDOT dot product of vectors with an offset 1474 DF_PP Dickey Fuller & Phillips Perron Tests 1609 DFVALUES Estimate of DF/PP Critical Values 1664 DISPMARS Displays Mars Model 2237 F_MARSLG Adjusts yhat and forecasts from MARSPLINE 2266 G4TEST Pena-Slate JASA March (2006) Joint OLS Test 2830 GARCHF Forecast ARCH / GARCH Series 3077 GARCH2PA Automatic GARCH Two Pass Modeling 3150 GENGARCH Simulate GARCH and ARCH Models 3220 GETCHAR Unpack a string into Character Array 3287 GETDATA Simple Real*8 data Read routine 3319 GETDATA2 Simple Real*16 data Read routine 3344 GETR16 Unpack a string into Real*16 Array 3410 GETVPA Unpack a string into VPA Array 3476 GETR8 Unpack a string into Real*8 Array 3543 GLESJER Glesjer (1969) Heteroscedasticity Test 3851 GLM_INFO Calculates out-of-sample best GLM model 3897 GLMSOLVE Effect of Elastic Net Parameter on RSS & RSQ 3971 GLS Cochrane & Orcutt GLS Estimation of AR(k) Model 4155 GLSDATA Transform x to x* given GLS rho vector 4184 GLS_ML GLS_ML Maximum Likelihood estimation of AR(1) Model 4340 GLS_2P Two Pass Generalized Least Squares for Order K 4541 GPH Geweke & Porter-Hudak (1983) Fractional Diff. Test 4619 G_QUANDT Goldfeld-Quandt Heteroscedasticity Test 4736 HETTEST1 Theil Heteroskedasticity Test on Sorted Data 4899 HET_TEST Heteroscedasticity Testing 5147 IACF Inverse ACF 5183 IACFN Inverse Autocorrelation 5227 LASSO LASSO Shrinkage Approach 5294 LASSO2 Generalized LASSO Shrinkage Approach 5369 LTS Least Trimmed Squares 5447 LTS_REC Recursive Least Trimmed Squares - Program 5539 LTS_REC2 Recursive Least Trimmed Squares - Subroutine 5612 MARS_P Display a Mars Probit Model 5669 MARSDIAG Row Sums of Marspline Model 5747 MARSVPLT Plots MARSSPLINE Vectors 5798 MARSINFO Estimate of MARSPLINE Model GCV Info 5835 MCOVF Function for Covariance. See built in mcov( ) 5981 NORM NORM(X,i) of a matrix or vector 6038 NTOKIN Counts number of tokins in a string 6097 NW_SE Newey West SE Correction Calculation 6202 OLS_CON Constrained OLS Model 6233 POISSON Estimation of a Poisson Model 6254 POISS_SE Specialized SE's for Poisson Models 6294 P_L_EST Probit & Logit Estimation 6453 PANEL_LIB Panel Subroutine Library 6861 QR_SMALL Break Appart QR Factorization 6903 RIDGE Ridge Regression 6955 RNW_SE Run Newey West SE Correction for OLS Model 7089 SVD_OLS OLS Using SVD Approach 7134 SVD2_OLS OLS Using SVD Approach and LAPACK 7179 TESTACC Test Accuracy using Residual Orthognality 7288 TLOGIT Tests Logit/Probit Model 7912 TRIM Remove obs from front of a series 7943 TS_TESTS Residual Specification tests 8223 TSALIGN Align Time Series Data 8267 UPMATRIX Unpack a matrix 8336 UNDIF Undifference a series 8368 WALD Wald Test of restrictions Descussion of routines that are NOT part of the production routare distributed with B34S. All other routines are discussed as part of the Matrix Command help files.