Version 10.0

The following are the main changes from version 10.0 compared with 9.0. For changes that came in with Version 9.0, see RATS 9.0 Release Notes.

CALENDAR scheme with irregular input dates (10.0)

CALENDAR with the JULIAN option can take an input series with coded date information to allow dates to be included in graphs, and allow date notation and date functions to refer to entries. There are several new functions to compute the date coding, plus the JULIAN option on DATA which can pull it off the date information on the file (if it's available).

Data (Other Formats) Wizard(10.0)

This now includes handling for name overrides (series<<"fileseriesname") that were added to the DATA instruction with version 9.2 with improved methods of dealing with illegal or duplicated names (such as use of INV or T on an original data file).

New Optimization Methods (9.2)

METHOD/PMETHOD=ANNEALING (simulated annealing) and METHOD/PMETHOD=GA (genetic annealing). Inequality constraints for SIMPLEX, GENETIC, ANNEALING and GA will now be respected (by rejecting values outside the bounds). Only implicit equality constraints can't be handled by those.

FRED® data (9.1)

FRED is now included in all versions of the software, not just Pro, and there's now a separate browser for the wide range of other databases included on the FRED web site.

OECD MEI data (9.1)

You can now download the entire Main Economic Indicators from OECD directly using RATS.

Pseudo-code Generators (9.2)

Pseudo-code generators to help organize Monte Carlo/Gibbs Samplers and Rolling Windows analysis have been added.

Edit-Prettify operation (9.2)

Indents DO and DOFOR loops to make a program more readable.

New Project Wizard (9.2)

A new wizard which does some basic setup for new program files has been added. You get to this from the File-New-Project... menu operation.

PDF graphics (9.1)

PDF is now available as an export format for graphics which can be used on the Save As... or Export... menu operations, or as a format in GSAVE. You can export into either portrait or landscape. PDF is built in to the Macintosh and UNIX. On Windows, you need to set an environment variable called GHOSTSCRIPT with the full path for the executable for (the console version) of GhostScript, such as with (the operating system command)

SET GHOSTSCRIPT=C:\PROGRAM FILES\GS\GS9.16\BIN\GSWIN64C

PNG graphics (9.2)

PNG (Portable Network Graphics, a portable bitmap format) is now available as an export format for graphics which can be used on the Save As... or Export... menu operations, or as a format in GSAVE.

WMF graphics (9.2)

WMF (Windows Meta File) now properly handles dotted/dashed lines. (PostScript or PDF are still preferred options for graphics export, but WMF will be more useful for black and white export than it previously was).

Command Line Definitions (9.1)

If you run RATS from the command line, you can use the command line switches /Dvariable=value or /Dvariable under Windows or -Dvariable=value or -dvariable for the Mac or UNIX to define a variable for use in the program being run. The second form of each defines a value of 1. These create an INTEGER, REAL or STRING, depending upon the form of value.

In the program, you probably want to check for whether the value has been defined. You can do that by adding a DECLARE instruction for the desired type. If the variable was defined on the command line, this will have no effect—if it wasn't, then the variable will get a standard "empty" value, which is 0 for an INTEGER, %NA (the missing value) for a REAL and an empty string for a STRING. For instance, if you want a command line definition of NDRAWS for the number of draws, adding the following to the program before you use NDRAWS will make the default 1000.

declare integer ndraws

compute ndraws=%if(ndraws==0,ndraws,1000)

URL's reading (9.1)

For files that read data or text, you can now use URL's (beginning with HTTP or HTTPS) to access data directly from websites. For instance,

cal(m) 1991:1

*

* Import German New Manufacturing Order Index directly from the Deutsche Bundesbank

*

open data "http://www.bundesbank.de/cae/servlet/StatisticDownload?tsId=BBDE1.M.DE.Y.BAA1.A2P000000.G.C.I10.A&its_csvFormat=en&its_fileFormat=csv&mode=its"

data(format=cdf,nolabels,org=col,skiplines=5,left=2,right=2) 1991:1 * neword

fetches a series from the Bundesbank's web site and gives it the name NEWORD. The end of the range is left open, so this will automatically expand the range based upon what's on the web site.

source http://estima.com/procedures/dfunit.src

pulls whatever is the current @DFUNIT procedure off the Estima web site.

is now available as an output format on COPY, WRITE, REPORT, PRTDATA and file export operations.

Series List Windows (9.1)

Now have a Copy Names Only operation (both on the Edit menu and the contextual menu) which copies to the clipboard as text the list of selected series names.

CALENDAR Wizard/Start Date Dialog (10.0)

This dialog (which usually comes up as part of the Data Wizard), now will show the day of the week for daily or weekly data, and the spin buttons on the month/period and day will spin through to change the month or year.

Box-Jenkins (ARIMA) Wizard (10.0)

ARCH/GARCH(Univariate) Wizard (10.0)

ARCH/GARCH(Multivariate) Wizard (10.0)

These dialogs have all been converted to use tabs to reduce clutter.

FRML's with Simple Linear Structure (10.0)

A FRML with a simple linear structure (for instance, one that has been created by converting an EQUATION) can be used in forecasting instructions like IMPULSE and ERRORS that can only handle linear models.

BOXJENK instruction (SV option) (9.1)

This is a minor change, but makes it much simpler to do certain types of Gibbs sampling operations that involve ARIMA models (particularly low order AR's). It allows the variance, which is usually sampled separately, to be input to BOXJENK.

CALENDAR instruction (SAVE option) (9.2)

This allows you to save a calendar scheme to be used either by CALENDAR with the RECALL option or DATA (and similar instructions) with the CALENDAR option.

CALENDAR instruction (JULIAN option) (10.0)

This sets a date mapping which allows for irregular data to use date functions and date labeling.

CVMODEL instruction (9.2)

Defines %NFREE as the number of freely estimated parameters (including diagonal elements if those are concentrated or marginalized out).

DATA instruction (CALENDAR and REVERSE options) (9.1)

CALENDAR=Coded CALENDAR data array [not used]

In general, DATA does a fairly good job of detecting the frequency and dates of the information on a data file which has date information. However, if you have a very short data set, or a data set with large gaps, it might fail to determine the date scheme that you intend. The CALENDAR option allows you to force a particular (encoded) date scheme. The %CALENDAR() function can be used to take the current CALENDAR scheme and save the information into a VECT[INTEGER]. The most typical use would be

DATA(CALENDAR=%CALENDAR(),other options) ...

which forces the data to be interpreted as having the CALENDAR scheme of the current workspace.

REVERSE/[NOREVERSE]

If your data are in time-reversed order (starting with the most recent at the top or left), use REVERSE to have it switched to the standard time series order when read in. Note that if the file has usable dates which run in the reversed order, DATA will automatically detect that and correct the ordering, so this is only necessary if you have a data set with reversed sequence and no usable dates.

DATA instruction (file name overrides) (9.2)

You can use series<<fileseriesname parameter fields to map a series/column name on an original file to a (valid) RATS name. This can be used to handle source file names which are too long, improperly formatted (for instance, having spaces), conflict with RATS reserved names (such as INV or T), or simply not easily understood.

You can use a VECT[SERIES] as part or all of the input list.

DATA instruction (JULIAN option) (10.0)

The JULIAN option creates a SERIES with the Julian date numbers of the entries from the file. This can be used to create a mapped irregular date scheme.

DISPLAY instruction (SERIES types) (9.2)

You can use DISPLAY to show the full range of a SERIES of any type. PRINT is still the better choice for regular data series, as it has options to restrict the range.

DLM instruction (SAVE/GET options) (9.1)

SAVE=DLM to save inputs [not used]

GET=DLM with saved model to be used[not used]

SAVE saves the information about the inputs to the model (basic input options A, C, Y, F, SW, SV, MU, Z and less standard ones SX0, X0, Q, R, SH0 and DISCOUNT). You can then use GET on a later DLM instruction to re-use those inputs. Note that this only applies to the inputs, not the outputs, or to TYPE options or estimation controls.

DLM instruction (FPRE/FPOST/FSPOST options) (9.2)

FPRE=FUNCTION(VECTOR *,SYMMETRIC *) called before the prediction step [not used]

FPOST=FUNCTION(VECTOR *,SYMMETRIC *) called after the filter step [not used]

FSPOST=FUNCTION(VECTOR *,SYMMETRIC *) called after a smoothing update [not used]

These allow adjustments of the state vector and/or covariance matrix during filtering and smoothing operations.

DSGE instruction(9.2)

The FRML's in the MODEL can now be written in the more natural form of

frml frmlname depvar = right-side-formula

if that's appropriate, rather than having to be written as the "implicit"

frml frmlname = depvar-(right-side-formula)

Also, a model can be forced to be solved backwards for all roots (even explosive ones), by using CUTOFF=%NA.

ECT instruction(9.2)

MODELS created using SYSTEM with ECT can be used more flexibly than before. In particular, you can use them for the mean model on GARCH, and can make draws from their distribution similar to VAR's without error correction. See, for instance, the MONTEVECM.RPF and the VECMGARCH.RPF examples.

ERRORS instruction(10.0)

The input MODEL can include FRML's if the FRML's are of a simple linear form.

ESTIMATE instruction(9.2)

%VARLAGSUMS is computed for the differenced dependent variables in models with ECT's.

FILTER instruction(10.0)

Now includes TYPE=HPDETREND, which produces the deviations from the Hodrick-Prescott trend, in case you want that rather than the HP filtered data itself.

FORECAST instruction(10.0)

This now defines %FSTART and %FEND as the start and end entry for the computed forecasts.

FRML instruction(9.2)

The COEFFS option has been added to let a FRML from a linear relationship have fixed coefficients.

GARCH instruction (9.2)

Can estimate MODEL's with embedded Error Correction Terms.

Estimates non-trivial mean models in an initial step to improve the guess values and the pre-sample covariance matrix. (This is done automatically).

Adds the XBEKK option to control GARCH-X handling in BEKK models.

Adds the DENSITY and PARMSET options to override the standard likelihood density functions.

Defines %NFREE (number of free parameters)

GARCH instruction (10.0)

DISTRIB=GED can be used with multivariate models.

DCC and QBAR options control the calculation of the DCC recursion.

GRAPH instruction (9.1)

There is no longer a limit on the number of series graphed. Since there are only 30 styles, those, by default, "wrap" after 30 so style 31 is the same as style 1.

GROUP instruction (9.2)

You can use a VECTOR[FRML] or VECTOR[EQUATION] as the part or all of the list of components in the MODEL.

GRPARM instruction (custom month labels) (9.1)

CMLABELS=VECTOR[STRING] with short (one or two character) month labels

SMLABELS=VECTOR[STRING] with short (roughly 3 character) month labels

LMLABELS=VECTOR[STRING] with full month names

These allow you to localize the labeling of months in graphs. The default is the standard English names and abbrevations. For instance,

grparm(cmlabels=||"E","F","M","A","M","J","J","A","S","O","N","D"||)

grparm(smlabels=||"enero","feb","marzo","abr","mayo","jun","jul","agosto","set","oct","nov","dec"||)

grparm(lmlabels=||"enero","febrero","marzo","abril","mayo","junio","julio",$

"agosto","septiembre","octubre","noviembre","deciembre"||)

would use Spanish month names and abbreviations instead. Note that the graphs themselves don't have the labels built in—instead, they save the raw date information. The substitution is done whenever any graph is displayed, printed or exported after the GRPARM instruction.

GRPARM instruction (SHADING and GRID options) (9.2)

These allow override of the default styles for user-controlled shading and grid lines.

GRPARM instruction (DEFINE option) (9.2)

These allow override of the default styles for lines, fills and symbols.

HISTORY instruction (BASE and EFFECTS options) (10.0)

BASE and EFFECTS are a more straightforward way to deal with the output of the decompositions than the older RESULTS option.

HISTORY also defines %FSTART and %FEND as the starting and ending entries of the computed decomposition.

LINREG instruction (SHUFFLE options) (10.0)

This adds the SHUFFLE option for bootstrapping.

NEWTYPE instruction (9.2)

This instruction allows you to define your own abbreviations for complicated data types.

NONLIN instruction (9.2)

The new ZEROS option will explicitly initialize all elements at 0.0.

REPORT instruction (PREFIX/SUFFIX options with ACTION=MODIFY) (9.1)

PREFIX="prefix formatting string" [not used]

SUFFIX="suffix formatting string" [not used]

These can be used with ACTION=FORMAT as an alternative to the SPECIAL option if you need some other form of tagging (for eventual use in TeX). You can use these alone or together. For instance, SUFFIX="^{**}" will add ** as a superscript (ordinarily ** is on the same line at normal text size), and PREFIX="\lbrace",SUFFIX="\rbrace" will enclose the element in { }.

SCATTER instruction (9.1)

There is no longer a limit on the number of series graphed. Since there are only 30 styles, those, by default, "wrap" after 30 so style 31 is the same as style 1.

SIMULATE instruction (10.0)

Defines the %FSTART and %FEND variables as the start and end of the computed simulations.

SPGRAPH instruction (9.2)

The YROTATE option allows the row labels (YLABELS option) to be rotated 90 degrees. While it makes them harder to read, the rotated text takes up quite a bit less room on the page if the labels are more than a few characters long.

STATISTICS instruction (10.0)

With the new NOCENTER option, will compute variants of the statistics appropriate when a mean of zero can be assumed. It also adds the SHUFFLE option for bootstrapping.

STEPS instruction (10.0)

Defines the %FSTART and %FEND variables as the start and end of the computed forecasts.

STORE instruction (REQUEST option) (9.1)

REQUEST=VECT[STRINGS] with the database names to include

This applies to the CONVERT option and is mainly designed for data formats such as FRED, FAME or HAVER that have too many series to import in their entirety (or may have no option to run through the entire catalog anyway). You create a VECT[STRINGS] with the names that you want, and STORE will pull them off the data base (if they're present) and add them to the file being edited.

SUR instruction (10.0)

Includes the SHUFFLE option for bootstrapping.

UFORECAST instruction (10.0)

Defines the %FSTART and %FEND variables as the start and end of the computed forecasts.

VCV instruction (10.0)

Includes the SHUFFLE option for bootstrapping.

Functions

%checkname(name) — Check for name already defined (9.1)

Returns 1 if the name (as a STRING) is already in the symbol table, and 0 if it isn't.

Argument type: |
STRING variable or literal ("....") |

Returns type: |
INTEGER |

%chol(S) — Cholesky decomposition (10.0)

Returns the Cholesky decomposition of a SYMMETRIC matrix. For a matrix S, this returns a lower-triangular RECTANGULAR array F, such that \({\bf{FF'}} = {\bf{S}}\). S must be positive semi-definite. See also the %PSDFACTOR function. This is a synonym for %DECOMP and was added as a clearer name for the calculation.

Argument type: |
SYMMETRIC |

Returns type: |
RECTANGULAR |

%dnn(n) — Duplication matrix (9.2)

Returns the "duplication matrix" which maps a vech (lower triangle) of an n × n symmetric matrix to the equivalent vec of a full n × n matrix by duplicating the lower triangle elements to the above diagonal locations.

Argument types: |
Integer |

Returns type: |
RECTANGULAR (dimensions \({n^2} \times n(n + 1)/2\)) |

%dnninv(n) — Inverse duplication matrix (9.2)

Returns the (generalized) inverse of a duplication matrix which maps the vec of an n × n matrix to the vech (lower triangle) of a symmetric matrix.

Argument types: |
Integer |

Returns type: |
RECTANGULAR (dimensions \(n(n + 1)/2{\rm{ }} \times {\rm{ }}{n^2}\)) |

%eqncopy(equation) — Makes a copy of an equation (9.2)

Returns a copy of an equation. This is useful if you might be redefining the original equation and need to make a copy of it as it currently exists.

Argument type: |
EQUATION name or handle |

Returns type: |
EQUATION |

%girfmatrix(S) — Generalized IRF Shock Matrix

Returns the shock matrix generated from a SYMMETRIC matrix that will give the "Generalized" Impulse Response Function. Each column in the output is the column in the input divided by the square root of its diagonal element (which is what that column would be if it were the first column in a Cholesky factor). S must be positive semi-definite. Note that this is not a factor of S, and should not be used as the basis for calculating the decomposition of variance.

Argument type: |
SYMMETRIC |

Returns type: |
RECTANGULAR |

%invztest(p) — Inverse two-tailed normal test (10.0)

Returns the x for which the two-tailed probability of a Normal distribution is p. In particular, %ztest(%invztest(p))=p.

Argument type: |
Real 0<p<1, r>0 |

Returns type: |
Real |

%julianfromcoded(x,codeformat) — Translation of numerically coded date (10.0)

Returns the RATS julian date corresponding to the value x where the date is coded numerically according to the string codeformat. For instance, if dates are coded as numbers with digits yyyymmdd, then you would use %julianfromcoded(x,"yyyymmdd").

Argument type: |
Real,string |

Returns type: |
Integer |

%julianfromymd(y,m,d) — Julian date for specified date (10.0)

Returns the RATS julian date (number of days since January 1st, 0001, acting as if the Gregorian calendar extends back) for the date y:m:d.

Argument types: |
Integers |

Returns type: |
Integer |

%knn(n) — Transposition operator (9.2)

Returns the transposition operator which maps a vec of an n × n matrix to vec of its transpose.

Argument types: |
Integer |

Returns type: |
RECTANGULAR (dimensions \({n^2} \times {n^2}\)) |

%lnn(n) — Elimination matrix (9.2)

Returns the "elimination matrix" which maps a vec of an n × n matrix to the equivalent vech (lower triangle) by eliminating the above diagonal elements.

Argument types: |
Integer |

Returns type: |
RECTANGULAR (dimensions \(n(n + 1)/2 \times {n^2}\) ) |

%lnnx(n) — Elimination matrix for below diagonal (9.2)

Returns the "elimination matrix" which maps a vec of an n × n matrix to the equivalent vech (lower triangle) by eliminating the elements at and above the diagonal.

Argument types: |
Integer |

Returns type: |
RECTANGULAR (dimensions \(n(n - 1)/2 \times {n^2}\)) |

%loginvchisqrdensity(x,degrees,scale) — Log density of scaled inverse chi-squared (9.1)

Returns the log density at x for the scaled inverse chi-squared with degrees of freedom degrees and scale value scale.

Argument types: |
Real, all positive |

Returns type: |
Real |

%loginvgammadensity(x,a,b) — Log density of inverse gamma (9.1)

Returns the log density at x for the inverse gamma with shape a and scale b.

Argument types: |
Real, all positive |

Returns type: |
Real |

%modelalpha(M) — Error correction loadings for a model (9.2)

Returns the matrix of loadings on the error correction terms in a model that includes them.

Argument type: |
MODEL |

Returns type: |
N x r matrix |

%mspreduce(P) — Markov switching probability function reparameterization (9.2)

Takes a full size N × N matrix of Markov switching transition probabilities P and reduces it to the (N−1) × N matrix of free parameters. This is the inverse of %MSPEXPAND.

Argument type: |
RECTANGULAR |

Returns type: |
RECTANGULAR |

%ranlognormal(mean,sd) — Draws from log Normal density (9.1)

Returns draws from a log Normal distribution with mean mean and standard deviation sd. (Note that these are moments of the log Normal itself, not of the underlying Normal density). If you use this in an expression where the left side of the expression is an array that has already been declared and dimensioned (A=%RANLOGNORMAL(1.0,0.5)), this will fill all elements of the array with random draws. Otherwise, it returns a single real value.

Argument types: |
Real |

Returns type: |
Real or array of reals, depending on context of expression |

%ransign() — Random sign (10.0)

Returns random signs (only values +1 and -1) drawn with equal probability. If you use this in an expression where the left side of the expression is an array that has already been declared and dimensioned (A=%RANSIGN(10.0)), this will fill all elements of the array with random draws. Otherwise, it returns a single real value.

Argument types: |
None |

Returns type: |
Real or array of reals, depending on context of expression. |

%ransvksc(u,mean,var) — Draws for log variance in stochastic volatility model (9.1)

Returns a draw from the posterior for the log variance generated by combining a normal on the log variance (from adjoining observations) with an inverse gamma of the variance itself (from the observation). This is a step in a Gibbs sampling algorithm where the variance is drawn for a specific entry conditional on the variances at all other entries. It is based upon the rejection method of Kim, Shepard and Chib(1998) with refinements to provide better behavior. u is the residual, assumed to be distributed N(0,h). Conditioning on adjacent observations gives a Normal distribution for log h, where mean is the mean and var is the variance of that distribution. Note that these are moments of the log Normal, not of the underlying Normal density, and note again that it returns a draw for the log of the variance.

Argument types: |
Real |

Returns type: |
Real |

%regsetrange(start,end) — Reset regression range information (9.2)

Sets the recoverable regression range (used by %REGSTART() and %REGEND()) to the start and end values.

Argument type: |
Integer |

Returns type: |
None |

%regtable() — Returns the "table" for the most recent regression (10.0)

Returns a RECTANGULAR[INTEGER] array listing the explanatory variables in the most recent regression. The array has dimensions 2 × number of explanatory variables. Row one lists the series numbers of the explanatory variables, row two lists the lags. Use 0 for equation to get the table of variables in the most recent regression.

Argument type: |
None |

Returns type: |
2 × k RECT[INTEGER] |

%skewnn(n) — Skew-symmetric mapping matrix (9.2)

Returns a matrix operator which will maps the vech of an \((n - 1) \times (n - 1)\) lower triangle to the vec of an \(n \times n\) skew-symmetric matrix which has the lower triangle below its diagonal, and minus the transpose of the lower triangle above its diagonal. Note that this creates a matrix to do the mapping—it doesn't do the mapping itself.

Argument types: |
Integer |

Returns type: |
RECTANGULAR (dimensions \({n^2} \times n(n - 1)/2\)) |

%tablediff(table1,table2) — Find differences in tables (9.2)

Finds the difference between two tables, returning a table with all variables from table1 which are not in table2.

Argument types: |
Regression tables (\(2 \times n\)RECT[INTEGER]) |

Returns type: |
Regression table |

%tableunique(table) — Locate series in table (9.2)

Returns a table which includes just one entry for each series which appears in table, showing only lag zero (no matter which lags appear in the table).

Argument type: |
Regression table (\(2 \times n\)RECT[INTEGER]) |

Returns type: |
Regression table |

%vech(S) — Vectorizing a SYMMETRIC (10.0)

Returns a VECTOR containing the values of array S. If S is SYMMETRIC or PACKED, the target is created by running through the the rows of the lower triangle. (This is actually the same as %VEC, but since stringing out a symmetric matrix by lower triangle is generally referred to as a "vech" operation, we've added a function by that name).

Argument type: |
Any array of reals |

Returns type: |
VECTOR |