Deterministic endval and initval
Posted: Tue Feb 11, 2014 12:56 am
I have a linear model that I would like to run with initial and terminal conditions; in particular the variable "gap". I mainly care about keeping "gap" at the values I define in initval and endval at the beginning and end of the simulation. Running the code below does this, but it does not move smoothly to gap's terminal value- it appears to move towards the steady state and then just jump to the terminal value I chose in the last quarter of the simulation, as if the model does not even take the terminal condition into consideration while it is running, until the last quarter, when it suddenly jumps to that value. Any way to make it so that my endval value for gap functions as a real terminal condition that the model appears to actually take into consideration? (Hope that makes sense).
- Code: Select all
var infl infl_four zgap_ zgap zrrl qgap gap rate;
model(linear);
gap=gap(-1)+(1-1.1906+0.3067)*(qgap(-1)-gap(-1))+0.3067*(gap(-1)-gap(-2))+zgap;
infl=0.5*infl_four(-1)+(1-0.5)*infl(1)+0.02667*gap(-1)+0.11268*(zrrl-zrrl(-1));
qgap=-1.7602*zrrl+0.62*zgap_+0.38*gap;
zrrl=0.967*zrrl(1)+(1-0.967)*(rate-infl-0.6*gap);
zgap=(1-1.1906+0.3067)*(qgap-qgap(-1))-0.3067*(1-1.1906+0.3067)*(0.98^2)*(qgap(1)-qgap)+1.1906*0.98*zgap(1)-0.3067*(0.98^2)*zgap(2);
zgap_=0.93*zgap_(1)+(1-0.93)*qgap;
infl_four=0.25*(infl+infl(-1)+infl(-2)+infl(-3));
rate=max(0,0.85*rate(-1)+0.15*(0.0+infl+0.5*(infl-0.02)+gap));
end;
initval;
gap=-0.04;
infl=0.012;
infl_four=0.012;
rate=0.0012;
end;
endval;
gap=0.005;
infl=0.02;
infl_four=0.02;
rate=0.04;
end;
simul(periods=40,maxit=400) ;