RATS 11.1
RATS 11.1

Instructions /

LIST and CARDS Instructions

Home Page

← Previous Next →

LIST   index = list of values

instruction requiring multiple supplementary cards

CARDS  supplementary cards fields

 

Several instructions (such as GRAPH and IMPULSE) require sets of supplementary cards whose entries are often linked by a simple formula. In many cases, you can use the CARDS and LIST instructions to replace a large number of supplementary cards with just two lines.

 

In older RATS programs, these were often used extensively for handling forecasting and other analysis instructions (FORECAST, IMPULSE, ERRORS, etc.) for Vector Autoregressions, as they could be defined as a set of equations. A more modern handling of these uses the MODEL options which group all the equations into a single object. The "Modernizing Old Programs".

Parameters

index

The index variable, which is an INTEGER variable (and will be defined as one if it isn't already declared). It should be followed by at least one blank, then the =.

list of values

The set of values (numbers or series) the index is to take. If you find it convenient, you can use a VECTOR[INTEGER] to form part or all of the list.

CARDS fields

The fields from the standard supplementary card for the instruction, written in terms of the index.

Example

declare vector[series] imp(7)

impulse  7 48 vcv 1

# 1 imp(1) 1 1

# 2 imp(2) 1 2

# 3 imp(3) 1 3

# 4 imp(4) 1 4

# 5 imp(5) 1 5

# 6 imp(6) 1 6

# 7 imp(7) 1 7

 

Notice the pattern in the supplementary cards. With CARDS and LIST, you can replace this with


 

declare vector[series] imp(7)

list ieqn = 1 to 7

impulse 7 48 vcv 1

cards ieqn imp(ieqn) 1 ieqn

 

LIST is an actual RATS instruction, while CARDS is a line which replaces the set of supplementary cards.

Additional Supplementary Cards

If there are any additional supplementary cards, such as the one the one needed with the INPUT option for FORECAST, include them after CARDS. For instance,
 

declare vector[series] forecast(8)

list ieqn = 1 to 8

forecast(input,print,steps=24,from=2010:1)  8

cards ieqn forecast(ieqn)

# .05 .03 0.0 0.0 0.0 0.0 0.0 0.0

 

which replaces

 

declare vector[series] forecast(8)

list ieqn = 1 to 8

forecast(input,print,steps=24,from=2010:1)  8

# 1 forecast(1)

# 2 forecast(2)

# 3 forecast(3)

# 4 forecast(4)

# 5 forecast(5)

# 6 forecast(6)

# 7 forecast(7)

# 8 forecast(8)

# .05 .03 0.0 0.0 0.0 0.0 0.0 0.0

Applicability

You can use CARDS for the main set of supplementary cards for the forecasting instructions FORECAST, STEPS, IMPULSE, ERRORS, SIMULATE and HISTORY; and the instructions GRAPH, GBOX, SCATTER, SUR, and SMODIFY.

 

You can also use CARDS to supply the supplementary card for an ENTER instruction (in a PROCEDURE, for example). Use the SEQUENCE option on ENTER to indicate the value for the LIST index that should be used in evaluating the CARDS instruction.

Modernizing Old Programs

The first example would likely be from a program which had the following structure:

 

system 1 to 7

variables ...list of seven series

det ...

lags ...

end(system)

estimate

*

declare vector[series] imp(7)

list ieqn = 1 to 7

impulse 7 48 vcv 1

cards ieqn imp(ieqn) 1 ieqn
 

To replace this with the use of a MODEL, you would change this to something like

 

system(model=mymodel)

variables ...list of seven series

det ...

lags ...

end(system)

estimate

*

impulse(model=mymodel,cv=%sigma,steps=48,col=1)

 

Note that the only change made to the setup of the VAR is to replace the SYSTEM instruction. The IMPULSE instruction replaces the seven supplementary cards (or the LIST and CARDS equivalent) with the MODEL option. This also uses the option form for the input of the other information (which we also recommend since it's easier to tell what's happening).


 


Copyright © 2026 Thomas A. Doan