RATS 11
RATS 11

Instructions /

HISTORY Instruction

Home Page

← Previous Next →

HISTORY( options )

HISTORY decomposes the historical values of a set of time series into a base projection and the accumulated effects of current and past innovations. It can only work for linear models as it relies upon linearity properties of moving average representations.

 

The syntax for HISTORY has changed quite a bit over the years. A pre-version 7 HISTORY instruction will look quite different from the preferred setup now, as it would use parameters and supplementary cards rather than options and MODELS. A description of the "Older Syntax" is provided below.

Wizard

In the Time Series—VAR (Forecast/Analyze) Wizard choose "Historical Decomposition" in the Action drop down.

Options

MODEL=general model to be forecast [unused]

Of the two ways to input the form of the model to be solved (the other is with supplementary cards), this is the more convenient. MODELs are usually created by GROUP or SYSTEM. It can include FRML's (formulas) only if they represent simple linear equations, as HISTORY requires that the model be fully linear. If the model includes any identities, those should be last in the model. If you use MODEL, omit the “equation” supplementary cards.

 

FROM=starting period of the forecast interval

TO=ending period of the forecast interval

STEPS=number of forecast steps to compute

These determine the periods for which the historical decomposition will be computed. If you have set a SMPL, these default to that range. Otherwise, FROM and TO default to the most recent estimation range. To use something other than these defaults, you can use:

FROM and TO to set the starting and ending periods for the decomposition, or

FROM and STEPS to set the starting date and number of steps (periods). If you use STEPS, but not FROM, the default for FROM will be the beginning of the estimation range.

 

ADD/[NOADD]

If you use ADD, HISTORY adds the projection (base) series in each block to the effects series in that block. This makes it easier to create meaningful graphs.

 

BASE=VECT[SERIES] for base effects[unused]

EFFECTS=RECT[SERIES] for cumulated effects of residuals[unused]

If there are \(M\) equations and \(N\) shocks, BASE creates a VECT[SERIES] with dimension \(M\) with the base forecasts of the dependent variables. EFFECTS creates a RECT[SERIES] with dimensions \(M \times N\) where column j gives the cumulated effects to the dependent variables of shock j. These were added with 10.0 as a simpler alternative to the older RESULTS option.

 

RESULTS=RECTANGULAR[SERIES] for result series [unused]

This provides a RECTANGULAR array of SERIES which will be filled with the results—we would recommend using the simpler BASE and EFFECTS options instead. If there are \(M\) equations and \(N\) shocks, its dimensions will be \((N + 1) \times M\). Each column has the decomposition of a single series. The first element (that is, the first series) in the column is the base projection. The second is the cumulated effect of the residuals to the first equation, the third shows the effect of the second set of residuals, etc.

 

CV=SYMMETRIC covariance matrix of residuals [from MODEL]

FACTOR=RECTANGULAR decomposition matrix [unused]

Use CV if you want the orthogonalization computed using a Cholesky factorization of the covariance matrix. If you are using the MODEL option and omit this option, HISTORY defaults to using the estimated covariance matrix for the MODEL.       

 

As an alternative, you can use FACTOR to supply a non-standard factorization of the covariance matrix, such as the factor matrix produced by a CVMODEL instruction. (This option was called DECOMP in versions before 7. DECOMP is still recognized as a synonym for FACTOR.)
 

PRINT/[NOPRINT]

TITLE="title for output" [none]

Use the PRINT option to display the output to the output window. This shows the historical decomposition of each series in a separate table, with the actual values, the forecasts, and the cumulated effects of each of the shocks. If you use the PRINT option, it will add the TITLE string (if used) to the top of the output (just once).

 

WINDOW="Title of window"

If you use the WINDOW option, a (read–only) spreadsheet window is created with the indicated title and displayed on the screen. This will display \(N\) blocks of \(N+2\) columns. These columns show the actual value, the forecast and the accumulated effects of each of the series of residuals. You can export information from this window to a file in a variety of formats using the File–Export... operation.

 

LABELS=VECTOR[STRINGS] to label shocks

You can use the LABELS option to assign specific labels to the shocks if the standard practice of labeling them with the corresponding dependent variable would be misleading. This matters only if you are using both the WINDOW option and the FACTOR option.

Variables Defined

%FSTART

Starting entry of decomposition (INTEGER)

%FEND

Ending entry of decomposition (INTEGER)

Technical Description

The historical decomposition is based upon the following partition of the moving average representation

 

(1) \({{\bf{y}}_{T + j}} = \sum\limits_{s = 0}^{j - 1} {{\Psi _s}{{\bf{u}}_{T + j - s}}}  + \left[ {\sum\limits_{s = j}^\infty  {{\Psi _s}{{\bf{u}}_{T + j - s}}} } \right]\)

 

The first sum represents that part of \(\bf{y}_{T+j}\) due to innovations in periods \(T+1\) to \(T+j\). The second is the forecast of \(\bf{y}_{T+j}\)  based on information available at time \(T\).

 

If \(\bf{u}\) has \(N\) components, the historical decomposition of \(\bf{y}_{T+j}\) has \(N+1\) parts:

The forecast of \(\bf{y}_{T+j}\) based upon information at time \(T\) (the term in brackets).

For each of the \(N\) components of \(\bf{u}\), the part of the first term that is due to the time path of that component.

Comments

If you use the actual estimated model and its residuals, the components of the decomposition will add up to the observed data.


 

Using the ADD option superimposes the innovation components on the base projection: the influential variables will tend to create movements from the base that are much larger than the less important variables.

Examples

This is from the HISTORY.RPF example:


 

system(model=canmodel)

variables logcangdp logcandefl logcanm1 $

          logexrate can3mthpcp logusagdp

lags 1 to 4

det constant

end(system)

*

estimate(noprint,noftests,resids=resids)

*

* This sets the range for the historical decomposition, so the base

* forecasts are computed using data through 2002:4 (the period before

* 2003:1).

*

compute hstart=2003:1

compute hend  =2006:4


 

history(model=canmodel,add,base=base,effects=effects,from=hstart,to=hend)

*

* This does a separate page of graphs for each dependent variable, with

* each page having a 3 x 2 layout with the graphs of the effects of the

* six shocks on that variable. With a different model size, you would

* need to change the VFIELDS and HFIELDS to match.

*

do j=1,neqn

   spgraph(vfields=3,hfields=2,window=varlabels(j),$

     header="Historical Decomposition of "+varlabels(j))

   do i=1,neqn

      *

      * This graphs the actual data (including four pre-sample values),

      * the base forecast, and the effects of shock I on variable J.

      *

      graph(header="Effect of "+shocklabels(i)) 3

      # depvar(j) hstart-4 hend

      # base(j)

      # effects(j,i)

   end do j

   spgraph(done)

end do i


 

 

history(model=canmodel,add,results=history,window="History",$

   labels=||"f1","f2","r1","r2","n1","n2"||,factor=bfactor,$

   from=hstart,to=hend)

 

This modifies the previous example by using a non-standard factorization, with relabeled shocks (financial shocks 1 and 2, real 1 and 2 and nominal 1 and 2). In addition to being stored into an array of series, the results are also displayed in a window named “History.”


Older Syntax

 

HISTORY( options )   equations  periods  start  VCVmatrix

# equation series newstart column(one for each equation)


 

Parameters

equations

number of equations

periods

number of periods to decompose. Prefer the newer STEPS or FROM and TO options.

start

starting period. Prefer the newer FROM option.

VCVmatrix

covariance matrix for Cholesky factor. Prefer the newer CV option.

Supplementary Cards (one for each equation)

equation

the equation name or number. If it isn't an identity, and you didn't estimate it with a RATS instruction like LINREG, you must associate a residuals series with it using ASSOCIATE.

series

first series in block of equations+1 to hold the decomposition for the dependent variable of this equation. Use numbered series or a VECTOR of SERIES. The base forecast is put into the first of these, and the effects into the next equations series.


 

Prefer the newer RESULTS option.

newstart

start entry for this set of series. Optional, defaults to entry specified by the FROM option.

column

column in covariance matrix of FACTOR matrix corresponding to this equation. Optional, defaults to the supplementary card position.


 


Copyright © 2025 Thomas A. Doan