error with deterministic model

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 with deterministic model

Postby Peterpierre » Thu May 28, 2009 12:21 am

hi

I'm simulating a deterministic model and I get this error, any hint what does it mean?
I have no variable c. For the Steady State works fine.
Thanks!



Attempted to access c(:,12); index out of bounds because size(c)=[0,0].

Error in ==> bksupk at 46
d1(ir) = c(:,jcf) ;

Error in ==> simk at 314
c = bksupk(ny,fid,ncc,icc1) ;

Error in ==> simul at 73
simk ;
Peterpierre
 
Posts: 28
Joined: Tue Apr 22, 2008 6:17 pm

Re: error with deterministic model

Postby StephaneAdjemian » Thu May 28, 2009 8:21 am

Hi, c is an internal variable of dynare and is not related to your declared endogenous variables. 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: error with deterministic model

Postby Peterpierre » Fri May 29, 2009 2:20 am

Thanks!
The code is below. It is very simple, just a static equation that Dynare solves when I ask it to find the steady state.
Then I wanted to shock one of the parameters for some periods and plot the time series of another variable for T periods.
So Dynare has to solve a system of T nonlinear equations. I thought this is what the deterministic command "simul" would do. But it does not work.
Do you know why?
Thanks a lot!!!


var n1;
varexo shock1;
parameters alphac alphah ep;

alphac = 0.67;
alphah = 0.8;
ep = .8;

model;
(((1-n1)^alphac)/(n1^alphah))^(1/ep)=((1-shock1)/shock1)*(alphac/alphah)*(((1-n1)^(alphac-1))/(n1^(alphah-1)));
end;


initval;
shock1 = 0.3;
n1=.5;
end;
steady;

shocks;
var shock1;
periods 1:5;
values 0.35;
end;

simul(periods=10);
rplot n1;
Peterpierre
 
Posts: 28
Joined: Tue Apr 22, 2008 6:17 pm

Re: error with deterministic model

Postby StephaneAdjemian » Tue Jun 02, 2009 1:35 pm

Hi, Dynare crashes with your code but It's not surprising. I really don't understand what you are trying to do. Your model has no leads or lags. You don't need Dynare to solve your (static) equation for n1... If you don't have a closed form solution you just have to call twice the matlab's non linear solver (for the two values of shock1).

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.


Return to Dynare help

Who is online

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