Conditional Forecast


Hello dear all,
I am interested in get conditionals forecast after estimation, my model has five exogenous variables and I would like to know if there are some recomendation to choose


What exogenous variables could I include in controlled_varexo?

and I would like to know the research paper in which it is based in order to understand better the methodology.

Thanks a lot



Usually the idea is that you can control these shocks, i.e. they are policy instruments. Say you want to keep GDP at 1 percent above trend. What is the sequence of monetary policy shocks, i.e. deviations from the standard monetary policy rule, that are necessary to achieve this.

I am not aware of a reference. You can find a description of what is going on at [Understanding the Conditional Forecast)


Thanks dear jpfeifer,

I would like to get conditional forecast using RAMSES II (Christiano, Trabandt and Walentin (2011)).
Variables I want to give constrained path are GDP, foreign GDP, interest rate, foreign interest rate, exchange rate among some others.

I understand that conditional forecast of dynare needs to especify shocks we can control to achieve the constrained path, but I am more interested in checking what happens with unconditioned variables when GDP, interest rate and exchange rate follow the constrained path (“scenario analysis”). Is there some way to do this with dynare?

I appreciate very much your help.




Then pick as many shocks for controlling as controlled variables. Note that these variables must be controllable. For example, if foreign output follows an exogenous process with only one shock, you cannot use monetary policy shocks in a small open economy to controll foreign output.


Thanks dear jpfeifer,

Given is not very clear to me how to choose shocks for controlling controlled variables, I am thinking use the methodology of Banbura, Gianonne and Lenza: “CONDITIONAL FORECASTS AND SCENARIO ANALYSIS WITH VECTOR AUTOREGRESSIONS FOR LARGE CROSS-SECTIONS”.

They don’t need to specify these shocks, and it can also be applied to a state space representation like a DSGE model, in short they start from the idea (details is found in pag. 16)

and their algorithm follows these steps:

  1. They derive a state space representation from the original s-s by removing the rows, also columns that correspond to the missing observations.
  2. Draw states using smoother simulation for the modified (for the missing data) state space representation.
  3. Using measure equation compute future values of unconditioned variables.

In this respect I found this reply in Help:

[quote]Re: Missing observations
Postby jpfeifer » Sun Nov 04, 2012 9:25 am

Dynare will use the longer sample and treat the missing values as unobserved states during the Kalman filter routine, i.e. their best forecast is inferred from the model and the remaining data.[/quote]

And my question are:

  1. If I could consider unconditioned variables as missing observations ? so when they are estimated in Dynare, may I consider them as forecasts?
  2. Related to first. Is there only point estimated for missing observations? or Can we find output from several paths in order to compute percentiles?




Sorry, but I don’t understand your questions. But what Banbura et al describe should be doable in Dynare. If I understand it correctly (I haven’t read the full paper), you first run estimation so that you have the parameters estimated on that data set. After that, run the calibrated smoother on the extended dataset that contains the controlled values for the variables and NaN for the non-controlled variables. If you want to get a distribution based on the posterior distribution of parameters, you may need to use the

and within it call

Regarding percentiles: the Kalman smoother will return the mean and variance for the objects of interest. Given the normal distribution underlying this, you can compute any quantile.


I have a similar issue. Here is what I’m doing and let me know if there is a more efficient way to do it.

Particularly, I’m testing my DSGE in real-life forecasting, both 1) in an automated setup where the data and short-term forecasts are fed into a DSGE, and then a DSGE forms a medium-term forecasts, 2) as well as testing a platform for experts to play with their judgemental forecasts and see what the model spits out. To my understanding the conditional_forecast command is not suitable/convenient in either case (not only because one has to define an exogenous variable that drives the endogenous variable - which might not be easy to do e.g. for the short-term forecast of domestic GDP, but also the way to make the forecasting process automated and allow different conditional forecast horizons for different variables).

Rather, one would use Kalman smoother to get the rest of the variables and horizons (judgement horizons can differ across variables). However, because I’m using measurement errors to get reasonable forecasting performance, those measurement errors are also applied to the judgemental/short-term forecasts. This situation that measurement errors are applied to the forecasts, though might be logical (because forecasts might be prone to errors), sometimes might not be desirable if one wants to pin down a variable and see the full effect on the rest of variables and also have a proper accounting of macro variables ( Y=C + I + G + NX).

For that reason, I’m using a “shadow variable” without measurement error which is observed only for the forecasting horizon (the historical values are nans), while the same variable with the measurement error is observed for both the historical data and for forecasts; then I’m using both the variable with and without the measurement error as observables; in this way I can impose measurement-error-free forecasts, while allowing for some measurement error in the past.