# Forecasts conditional on shocks

I a multi-country (about 30 countries) model. It’s similar to DSGE model and the purpose is to examine the impact of shocks on a macro variable on one country on all other countries. Eg: how does increase in the federal funds rate (FFR) of the US affects the unemployment rate, exchange rate, etc of US and other countries in the system. After formulating the model, I wrote

var ERROR_FFR_US; stderr 2;

ERROR_FFR_US is the residual of the equation of the federal funds rate for the US. Then I found out the steady states, stoch_simul() and forecasted the paths of the macro variables. My question is how do I attach these forecasts with the the current and historical values and plot them in graphs? So far, Dynare just plots the forecasts without the current and historical values.

Secondly, do these forecasts take into account the shock on the federal funds rate of the US?

How exactly do you do the forecasts? Using the smoother on data?

Actually, I haven’t imported any historical data in Dynare. I’m not sure how to, so if you have examples on how to do that, that would be helpful.

Using the results from stoch_simul(), I created conditional forecasts, wherein I prespecified the values of federal funds rate and inflation rate and the number of periods. Here’s the code I wrote

% conditional_forecast_paths;
%
% var INF_US;
% periods 1:3, 4:5;
% values 10, 12;
% var FFR_US;
% periods 1:5;
% values 5;
%
% end;
%
% conditional_forecast(parameter_set = calibration, controlled_varexo = (RESIDUAL_INF_US, RESIDUAL_FFR_US), replic = 3000);
%
% plot_conditional_forecast(periods = 10) INF_US FFR_US;

Usually, you would run the `calib_smoother` (search the forum) to extract the terminal state of the system. Then conduct the `conditional_forecast`. However, Dynare does not support plotting data along with the results. You would need to do that manually using Matlab’s plotting capabilities.

Ok. Thanks for letting me know. I have one final question as I was just curious mathematically how to incorporate the impulse responses in the forecasts. Sorry for asking so many questions. Thank you for your time.

I am forecasting a few macro variables such as inflation rate (INF), GDP, unemployment rate (UNRATE), federal funds rate (FFR) etc. Then, I imposed a 2 % upward shock on the federal funds rate, and the examined the impact of the shock on other variables by creating impulse response functions and plotting them. Suppose the horizon is 20. So, I have 20 observations
For example: INF_FFR: (20 x 1) vector that stores the impulse response of INF when FFR rises by 2 % points

Now, I want to forecast INF taking into account the shock on FFR (scenario analysis). So, my plot will have the historical values of INF plus the forecasts.

In order to create the forecasts, I estimated a simple ARIMA model for INF, found the forecasts without the shock (FCST) and the 90 percent forecast interval. How I do I incorporate INF_FFR? Should I just add them to the forecasts? i.e. FCST + INF_FFR?

You seem to be confusing something. The ARIMA forecast relects the return of the state space system from its last state back to the mean/steady state without any additional shocks. A proper conditional forecast would take that transition already into account. By looking at the IRFs starting from the steady state, you would be missing this dynamics. That being said, for a linear model, the IRFs are invariant to the location in the state space. Hence, the addition you propose should be valid as well (apart from the fact that your ARIMA model and the DSGE model may be conflicting in their implied dynamics).

Got it, thanks. Your explanation makes sense. I should have clarified - since you had mentioned that Dynare doesn’t support plotting data along with results and that I should use MATLAB, therefore, I thought of constructing ARIMA model in MATLAB, forecasting from them, and adding the impulse responses obtained from Dynare. Thereby, I would be able to plot the historical values along with the forecasts accounting for the shocks.

What I meant is: use the `calib_smoother` on actual data to get the state of the system. Then generate conditional_forecasts. Add these forecasts to the terminal state of the system and plot them in Matlab.

Okay, that makes sense. Thanks again 