Question about forecasts options in estimation

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.

Question about forecasts options in estimation

Postby Seungcheol Lee » Wed Aug 19, 2015 9:20 am

Hello

Firstly, I like to know how to get out-of-sample moving window (rolling) forecasts.
Is there any option about it? Or, do I have to forecast one-by-one making 1-period-ahead data set continuously?
(I think dynare only provides recursive(expanding window) forecasts, right?)

Secondly, I just need mean forecast values, but dynare calculates HPD credible interval unnecessarily.
Is there any option to omit taking posterior subdraws? I think this will save a lot of time if there is.

Thank you in advance!

Seungcheol
Seungcheol Lee
 
Posts: 14
Joined: Mon Jun 29, 2015 10:17 am

Re: Question about forecasts options in estimation

Postby jpfeifer » Wed Aug 19, 2015 9:25 am

Yes, Dynare only provides expanding window forecasts. The easiest way to achieve your goal is most probably to manually loop over Dynare using a mod-file. You could do something along the lines of:
Code: Select all
for ii=1:n_windows
data_current_window=datafull(t_start:t_end,:); % cut data to required window
save('mydata.mat',data_current_window); %save data
dynare mymodel noclearall
oo_cell{ii}=oo_;
clear M_ oo_ options_
t_start=t_start+1;
t_end=t_end+1;

end

where datafull is the full dataset that is put in the correct dimensions in every iteration, mydata.mat is the datafile loaded in the estimation command, and t_start and t_end need to be set before the loop at the values for the first window.

Regarding your second point: Bayesian estimation provides the mean forecast, not the forecast at the mean. Thus, you need to sample from the posterior to get this mean. It would be different if you just run estimation to get the posterior mean and then use this posterior mean to do forecasting with the forecast command.
------------
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: Question about forecasts options in estimation

Postby Seungcheol Lee » Wed Aug 19, 2015 10:09 am

Dear Jpfeifer

I got it. Thank you so much!

Seungcheol
Seungcheol Lee
 
Posts: 14
Joined: Mon Jun 29, 2015 10:17 am

Re: Question about forecasts options in estimation

Postby Seungcheol Lee » Sun Aug 23, 2015 11:16 pm

Dear Jpfeifer

Hello.

I did rolling forecast manually by making different data set and run estimation one-by-one.

I corrected model slightly, and am going to do the forecast again.

However, I like to do it in a different and more convenient way.

In the last your reply, I saw some code but I didn't use it since I couldn't fully understand it.

Can I insert your code in a mod file? or Is there a method to run mod file repeatedly?

I again need your help.

Thank you in advance!

Best
Seungcheol
Seungcheol Lee
 
Posts: 14
Joined: Mon Jun 29, 2015 10:17 am

Re: Question about forecasts options in estimation

Postby jpfeifer » Tue Aug 25, 2015 10:03 am

------------
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: Question about forecasts options in estimation

Postby jpfeifer » Mon Aug 31, 2015 11:45 am

The required capacity should be available in tomorrow's unstable version.
------------
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: Question about forecasts options in estimation

Postby Seungcheol Lee » Mon Aug 31, 2015 1:28 pm

Dear Jpfeifer

Thank you so much.

I will try rolling forecast with the version.

Best
Seungcheol
Seungcheol Lee
 
Posts: 14
Joined: Mon Jun 29, 2015 10:17 am

Re: Question about forecasts options in estimation

Postby Max Resende » Wed Sep 02, 2015 9:12 pm

Hi,

I am knew at Dynare and because of that I am having some problems with the forecast optin on estimation.
I'm trying to make a model that tests the forecasting performance of DSGE-VAR model, using Dynare 4.3.2

In order to make it, here's what I need:

1- I have 57 observations, and I'd like to test a 4 periods forecasting performance; (the first column of my excel sheet are the periods and the top row is the title of the colunns, so I have 57 observations on which column)
So with the observation interval [2:54) I'd like to predict the next 4 and compare with the truth value;

How should I write the estimation part? That's what I did:
estimation(datafile=dados2, forecast = 4, nobs = [54:57], plot_priors = 0, first_obs=20,mh_nblocks=2,mh_drop=0.45,mh_jscale=0.3,dsge_var,mode_compute=4,optim=('NumgradAlgorithm',3),mh_replic=2000,bayesian_irf);

I get the following error: Index exceeds matrix dimensions.

So, how can i correct it?

2 - When i write the estimation path without nobs = [54;57}, dynare runs ok. But i can't find the matrix that saves the values of the forecasting process.
Can't find oo_forecast anywhere.

Where can i found this values?

Thank you

max
Max Resende
 
Posts: 3
Joined: Wed Sep 02, 2015 8:38 pm

Re: Question about forecasts options in estimation

Postby jpfeifer » Thu Sep 03, 2015 7:00 pm

Codes and datafile please. Also note https://github.com/DynareTeam/dynare/issues/819
------------
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: Question about forecasts options in estimation

Postby Max Resende » Sat Sep 05, 2015 4:12 am

as you wish... there goes my .mod file

for some reason i haven't been able to upload my xls file..... can youhelp me with that?

Max
Last edited by Max Resende on Sun Sep 06, 2015 11:53 pm, edited 1 time in total.
Max Resende
 
Posts: 3
Joined: Wed Sep 02, 2015 8:38 pm

Re: Question about forecasts options in estimation

Postby jpfeifer » Sat Sep 05, 2015 7:17 am

Please put everything in one zip-file.
------------
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: Question about forecasts options in estimation

Postby Max Resende » Sun Sep 06, 2015 11:52 pm

As you requested..... Max
Attachments
max_dsge_var.zip
(65.82 KiB) Downloaded 77 times
Max Resende
 
Posts: 3
Joined: Wed Sep 02, 2015 8:38 pm

Re: Question about forecasts options in estimation

Postby jpfeifer » Sun Sep 13, 2015 4:42 pm

I just noticed you used 4.3.2. Please try the unstable version. It should work there.
------------
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


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 2 guests

cron