Page 1 of 1
error with deterministic model
Posted:
Thu May 28, 2009 12:21 am
by Peterpierre
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 ;
Re: error with deterministic model
Posted:
Thu May 28, 2009 8:21 am
by StephaneAdjemian
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.
Re: error with deterministic model
Posted:
Fri May 29, 2009 2:20 am
by Peterpierre
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;
Re: error with deterministic model
Posted:
Tue Jun 02, 2009 1:35 pm
by StephaneAdjemian
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.