Fan Chart (Predictive Density) - Forecast from a State-Space

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Fan Chart (Predictive Density) - Forecast from a State-Space

Postby Aldo » Sun Mar 26, 2017 6:05 pm

Hello dear all,
I want to use the state space representation from a DSGE model to get fan charts (predictives densities) using dynare.
In order to do this, I need one state space, like this:

y_t = Z*alpha_t + eps_t, eps_ t ~ N(0,H) observation equation
apha_t+1 = T*alpha_t + R*eta_t, eta_t ~ N(0,Q) state equation

I am using notation from Koopman and Durbin: "Filtering and smoothing of state vector for difuse state space models".
With this representation I will get several paths of forecasts by simulation, and after that I will compute percentiles of simulations to plot fan charts.

Also I am needing alpha_0 which must be the smoothed estimate in end of the sample.

My questions are:

1. How could I retrieve Z, H, T, R and Q?, and How could I check order of variables in y_t and alpha_t? I hope to get in y_t (alpha_t) variables in the same order of declared observed variables (declared endogenous variables) in .mod.

I saw https://github.com/JohannesPfeifer/DSGE_mod/tree/master/FV_et_al_2007. I guess it works when it is needed decomposition in states and shocks, but I need work with observed variables too.

2. How could I retrieve alpha_0 (smoothed estimate of alpha_t in end of the sample)?

3. Is there another ideas to get predictive densities in dynare?

Thanks

Aldo
Aldo
 
Posts: 56
Joined: Fri Aug 07, 2015 4:47 pm

Re: Fan Chart (Predictive Density) - Forecast from a State-S

Postby jpfeifer » Sun Mar 26, 2017 9:02 pm

1. Isn't the
Code: Select all
forecast
option of the estimation command already what you are looking for?
2. For building the transition matrix, you are on the right track. See http://www.dynare.org/phpBB3/viewtopic.php?f=2&t=15494
3. For retrieving the smoothed states: they are stored in
Code: Select all
oo_.SmoothedVariables
. Alternatively, you may be able to use
Code: Select all
smoother2histval
(see the manual).
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Fan Chart (Predictive Density) - Forecast from a State-S

Postby Aldo » Mon Mar 27, 2017 1:08 am

Thanks dear jpfeifer,
I saw the manual, and I after run my .mod I see output oo_.PointForecast.deciles. In order to plot my fan chart I would like to have output of complete simulation and not only deciles, for example I would like to compute percentiles.

I have another question, what is the dynare function which compute deciles of forecast?

And finally, I am running a DSGE-VAR, and I include forecast option in estimation command.
I would like to know if oo_.PointForecast.deciles is output of DSGE or DSGE-VAR? I ask this because I am not sure if dynare computes forecast for DSGE-VAR?

Thanks

Aldo
Aldo
 
Posts: 56
Joined: Fri Aug 07, 2015 4:47 pm

Re: Fan Chart (Predictive Density) - Forecast from a State-S

Postby jpfeifer » Mon Mar 27, 2017 7:23 am

This is tricky.
Code: Select all
prior_posterior_statistics_core.m
creates the forecasts.
Code: Select all
pm3.m

computes the deciles. In principle, you can easily access the saved forecasts across draws in the metropolis-subfolder in the FILENAME_forc_point*.mat-files.

At the current stage, forecasts are from the DSGE-model, not the VAR. It is on our to-do list, but we haven't managed to do it yet. See https://github.com/DynareTeam/dynare/issues/819. A year ago a user started working on it, but it went nowhere as far as I know. But maybe it is helpful: http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=8086
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Fan Chart (Predictive Density) - Forecast from a State-S

Postby Aldo » Mon Mar 27, 2017 12:20 pm

Thanks a lot dear jpfeifer,
Your help solve my problem.

Cheers!!

Aldo
Aldo
 
Posts: 56
Joined: Fri Aug 07, 2015 4:47 pm


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 5 guests