RBC_est.mod

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.

RBC_est.mod

Postby kaz » Wed Sep 09, 2009 5:47 am

I have been getting some error messege when running RBC_est.mod with Dynare version 4 with Matlab version 7.4.0.
I installed the latest snapshot.


The error messege says,

error => mtimes
dimension of internal matrix must be the same

error=>steady at 13
ex_ = ones(xlen, 1)*exe_';

error=>steady at 7
steady_;

error=> dynare at 26
evalin('base',fname);


Thanks,
Kaz
kaz
 
Posts: 14
Joined: Wed Sep 09, 2009 5:28 am

Re: RBC_est.mod

Postby StephaneAdjemian » Wed Sep 09, 2009 2:33 pm

Dear Kaz,

Where does your RBC_est.mod come from? I am unable to reproduce your bug using the file RBC_Est.mod distributed with Dynare as an example of the user guide... Can you post your mod file?

Best, Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: RBC_est.mod

Postby kaz » Wed Sep 09, 2009 11:20 pm

Hi Stephane,

I placed the mod file at the directory under /dynare/4.0.4/matlab.

Here is the mod file I have been running.

****
var y c k i l y_l w r z;
varexo e;
parameters beta psi delta alpha rho epsilon;

model;
(1/c) = beta*(1/c(+1))*(1+r(+1)-delta);
psi*c/(1-l) = w;
c+i = y;
y = (k(-1)^alpha)*(exp(z)*l)^(1-alpha);
w = y*((epsilon-1)/epsilon)*(1-alpha)/l;
r = y*((epsilon-1)/epsilon)*alpha/k(-1);
i = k-(1-delta)*k(-1);
y_l = y/l;
z = rho*z(-1)+e;
end;

varobs y;

initval;
k = 9;
c = 0.76;
l = 0.3;
w = 2.07;
r = 0.03;
z = 0;
e = 0;
end;

steady;

check;

estimated_params;
alpha, beta_pdf, 0.35, 0.02;
beta, beta_pdf, 0.99, 0.002;
delta, beta_pdf, 0.025, 0.003;
psi, gamma_pdf, 1.75, 0.02;
rho, beta_pdf, 0.95, 0.02;
epsilon, gamma_pdf, 10, 0.03;
stderr e, inv_gamma_pdf, 0.01, inf;
end;


estimation(datafile=simuldataRBC,nobs=200,first_obs=500,mh_replic=2000,mh_nblocks=2,mh_drop=0.45,mh_jscale=0.8);
****

I installed dynare v4.0.4 and ran the RBC_est.mod then got a different error messege,

****
Configuring Dynare ...
[mex] Generalized QZ.
[m] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.

Starting Dynare ...
Starting preprocessing of the model file ...
9 equation(s) found
Processing derivation ...
Processing Order 1... done
Processing Order 2... done
Processing outputs ...
Preprocessing completed.
Starting Matlab computing ...

STEADY: numerical initial values incompatible with the following equations
1 2 4 5 6 7 9

??? error ==> dynare_solve in line 82
exiting ...

error ==> steady_ at 69
[oo_.steady_state,check] = dynare_solve([M_.fname '_static'],...

error ==> steady at 52
steady_;

error ==> rbc_est at 107
steady;

error ==> dynare at 102
evalin('base',fname) ;
****

Thanks,
Kaz
kaz
 
Posts: 14
Joined: Wed Sep 09, 2009 5:28 am

Re: RBC_est.mod

Postby StephaneAdjemian » Thu Sep 10, 2009 2:14 pm

Hi Kaz,

The problem here is that you did not calibrate the parameters of the model. Equations 3 and 8 are Ok because these equations do not depend on any parameter.

So if you want to use the command steady before the estimation, you need to give values to the parameters of your model.

Best,
Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: RBC_est.mod

Postby kaz » Thu Sep 10, 2009 8:55 pm

Hi Stephane,

I deleted "steady" and "check" but still get the same message.


Thanks,
Kaz
kaz
 
Posts: 14
Joined: Wed Sep 09, 2009 5:28 am

Re: RBC_est.mod

Postby StephaneAdjemian » Fri Sep 11, 2009 8:19 am

This is weird. When I remove the commands steady and check your mod file runs perfectly on my laptop (with the snapshot version of dynare 4). Are you sure that you obtain exactly the same error message ?

Best, Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: RBC_est.mod

Postby kaz » Fri Sep 11, 2009 8:37 am

Hi Stephane,

Yes, I got the same message.

Is it ok to paste all files of snapshot to the folder under /dynare/4.0.4/?


Thanks,
Kaz
kaz
 
Posts: 14
Joined: Wed Sep 09, 2009 5:28 am

Re: RBC_est.mod

Postby StephaneAdjemian » Fri Sep 11, 2009 8:52 am

No you have to install the snapshot version in a new directory and to add the subfolder matlab in the path. You will have also to compile the preprocessor and the mex files if you are running matlab under linux or mac (the executable and mex files are already compiled for windows).

Trying with the version 4.0.4 on my laptop, I don't get any error message... Are you sure that you saved your modifications?

Best, Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: RBC_est.mod

Postby kaz » Fri Sep 11, 2009 9:07 am

Hi Stephane,

It's solved now, flowing your advice.


Thanks,
Kaz
kaz
 
Posts: 14
Joined: Wed Sep 09, 2009 5:28 am

Re: RBC_est.mod

Postby tjonsson » Mon Oct 12, 2009 11:43 am

Hi,

I use the same code as above (without "steady" or "check") and I have installed (following recommended procedure) the snapshot files. This is the error message I receive:

??? Error using ==> print at 315
Invalid handle object.

Error in ==> plot_priors at 67
eval(['print -dpdf ' M_.fname '_Priors' int2str(1)]);

Error in ==> dynare_estimation_1 at 87
plot_priors(bayestopt_,M_,options_)

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

Error in ==> RBC_Est at 134
dynare_estimation(var_list_);

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

Any idea what to do?
tjonsson
 
Posts: 5
Joined: Wed Oct 07, 2009 7:42 am

Re: RBC_est.mod

Postby kaz » Thu Oct 15, 2009 10:20 am

Hi,

Did you follow the Stephane's suggestion on Fri Sep 11, 2009 6:22 pm ?

Please do so if not yet.

Kaz
kaz
 
Posts: 14
Joined: Wed Sep 09, 2009 5:28 am

Re: RBC_est.mod

Postby tjonsson » Fri Oct 16, 2009 7:06 am

Hi Kaz!

Yes, I have tried estimating the model both with the snapshot (dynare-unstable) installed, and without (using only the 4.0.4-version). In either case I have set paths in Matlab according to Stephane's suggestion Fri Sep 11, 2009 9:52 am.

However, it only results in the error message above.

/Thomas
tjonsson
 
Posts: 5
Joined: Wed Oct 07, 2009 7:42 am

Re: RBC_est.mod

Postby kaz » Fri Oct 16, 2009 10:58 am

Hi,

Just for confirmation, the snapshot directory is something like //dynare/4.0.4
and the path in Matlab is like //dynare/4.0.4/matlab.

If the directories are like above and you have the same problem, I think the problem
is something to do with conflict between dynare and other software or hardware.


Good luck,
Kaz
kaz
 
Posts: 14
Joined: Wed Sep 09, 2009 5:28 am


Return to Dynare help

Who is online

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