Error in the posterior IRFs

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.

Error in the posterior IRFs

Postby gfenig » Thu Nov 24, 2011 1:55 am

Hi,
I was trying to estimate Ireland's 2010 paper "A New Keynesian Perspective on the Great Recession"
At the beggining I was trying to do that by using the default option (Chris Sims’ csminwel), but I had the following error:

??? Error using ==> chol
Matrix must be positive definite.

Error in ==> metropolis_hastings_initialization at 52
d = chol(vv);
................................

So I then I tried to use "simulated annealing-like optimizer" (mode_compute=4). So it worked (at least the program was running). The problem is that the posterior distributions of the parameters are completely different to the priors. The other problem I had is that there is and error when dynare attemps to compute the posterior IRFs

??? Undefined function or method 'cs' for input arguments of type 'double'.

Error in ==> PosteriorIRF_core1 at 179
y = 100*y/cs(i,i);

Error in ==> PosteriorIRF at 209
[fout] = PosteriorIRF_core1(localVars,1,B,0);

Error in ==> dynare_estimation_1 at 897
PosteriorIRF('posterior');

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> ireland_repl at 216
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;

I do not know whether my prior distributions doesn't make sense or if I have to manipulate the data in someway.
I will appreciate if someone could help me. I'm posting the mod file and the data file.

Thanks,

Guidon Fenig
Attachments
Data_Ireland.xls
(31.5 KiB) Downloaded 58 times
ireland_repl.mod
(2.34 KiB) Downloaded 99 times
gfenig
 
Posts: 2
Joined: Wed Nov 23, 2011 8:01 pm

Re: Error in the posterior IRFs

Postby jpfeifer » Thu Nov 24, 2011 8:21 am

Having a posterior different from the prior is not a problem per se, it might simply mean your data is really informative.

If you don't know if your prior is sensible, there is no point in using a prior. Just do a maximum likelihood information. If you actually meant posterior instead of prior, compare it to Ireland's paper.

Regarding the "Matrix must be positive definite." continue using mode_compute=6.

Finally, from having a short look at your mod-file, you need to specify a correct observation equation to map the growth rates (I guess) in your data file into the model variables. Search the forum on how to do this.
------------
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: Error in the posterior IRFs

Postby gfenig » Thu Nov 24, 2011 6:21 pm

Thank you for that.
I actually made some adjustements in data set I have (following Ireland)

I redefined output as: log(y)-mean(y)
inflation=log(pi)-mean(pi)
interest rate=log(r)-mean(y)+log(exp(mean(y))/exp(mean(r)))-mean(pi)

I also defined in the mod file the corresponding observation equations, as you suggested (I follwed the mod file US_IR11_rep, that I found in the list of replication papers of Dynare).

But now when I run the estimation I have the following error:

??? Error using ==> print_info at 39
Blanchard Kahn conditions are not satisfied: no stable equilibrium

Error in ==> initial_estimation_checks at 101
print_info(info, options_.noprint)

Error in ==> dynare_estimation_1 at 122
initial_estimation_checks(xparam1,gend,data,data_index,number_of_observations,no_more_missing_observations);

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> ireland_repl_est2 at 182
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;

Then if I remove the observation equation for the output gap, it works but I'm not sure about the results.

Thank you again,

Guidon Fenig
Attachments
Data_Ireland2.xls
(31 KiB) Downloaded 63 times
ireland_repl_est2.mod
(3.81 KiB) Downloaded 82 times
gfenig
 
Posts: 2
Joined: Wed Nov 23, 2011 8:01 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 5 guests