@CONDITION computes conditional forecasts or simulations for a linear model.

@CONDITION( options )   nconstr

# series  entry   value      (one for each constraint)


@CONDITION(GENERAL,other options )  nconstr

#  vector with linear combination of endogenous variables (one pair

#  entry   value                                           for each constraint)



number of constraints

Supplementary Cards (without GENERAL, one for each constraint)


Series constrained. This must be an endogenous variable of one of the equations.


Period of the constraint.


Target value for the constraint.

Supplementary Cards (with GENERAL, one pair for each constraint)


VECTOR or real numbers/expressions with linear combination of  endogenous variables to constrain


Period of the constraint.


Target value for the constraint.


MODEL=model to forecast

This should already be estimated.

FROM=starting period of forecasts [end of estimation + 1]

TO=ending period of forecasts [last constrained period]

STEPS=number of forecast steps

STEPS can be used in place of the TO option if it’s more convenient.

RESULTS=VECTOR[SERIES] for constrained forecasts

Use this to save the forecasts to a VECTOR of SERIES.

CV=SYMMETRIC covariance matrix of residuals [from the MODEL]

FACTOR=RECTANGULAR factor of the covariance matrix of residuals [Cholesky factor of covariance matrix]

SHOCKS=VECTOR[SERIES] for orthogonal shocks [not used]

You can use the SHOCKS option to retrieve the set of orthogonalized shocks which are used in the forecasts. The FACTOR option can provide the desired factorization of the covariance matrix. Note that the conditional forecasts don’t depend upon the factor that you use (as long as it is a complete factor); the only thing affected are the precise set of orthogonalized shocks needed to generate them.

You can use a FACTOR matrix which is less than full rank to do conditional forecasting subject to restrictions on the origin of the shocks. This is typically done by zeroing out columns corresponding to the shocks you don't want to use in meeting the conditions.


Choose GENERAL if you want to apply constraints to a linear combination of the endogenous variables, rather than to individual variables.


If you choose SIMULATE, the procedure generates a draw from the constrained distribution of the forecasts, assuming normally distributed innovations. This result is saved into forecasts instead of the constrained forecasts. This generates just one draw per call to @CONDITION. It’s a bit inefficient, since it goes through all the set up work each time, but, in practice, it seems to work adequately. If you need a very large number of simulations, or the simulations prove to be time-consuming, you can fairly easily adapt the procedure to generate more than one draw at a time.


When setting up constraints, it’s a good idea to keep them as loose as possible. For instance, if you’re trying to constrain a growth rate, it’s better to do this as year over year changes, rather than constraining each quarter or month. That is, to constrain the series Y (in logs) to 4% annual growth, use

@condition(model=kpsw,from=2010:1,steps=8,results=cforecasts) 1

# y 2010:4 y(2010:4)+.04

rather than

@condition(model=kpsw,from=2010:1,steps=8,results=cforecasts) 4

# y 2010:1 y(2009:4)+.01

# y 2010:2 y(2009:4)+.02

# y 2010:3 y(2009:4)+.03

# y 2010:4 y(2009:4)+.04

The potential problem with the tighter constraints is that they might force some “whipsawing” innovations to hit all the values.