Help!! What don't I understand about BONDS??
Posted: Sat May 30, 2009 2:23 pm
Hi All,
I don't get this... I'm really trying do a super-basic savings model, and I guess I'm a bit DAFT...
What don't I understand?? I would really appreciate a proper explanation (or any comments)
I haven't found any similar question on the forum, and I am sure that my question is probably so simple and I just don't get it.
This is a two country model.
Each country is endowed with a level 1 of a good. ysh=ysf=1.
The household can either consume or save using an noncontigent bond.
In the deterministic model, both agents know that after period 150, home country's endowment will rise by 1%.
I would expect the home country to borrow in the first 150 periods, and lend in the next 150, in order to smooth consumption.
I've set initival and endval bond to zero, in order to make sure of NO Ponzi scheme.
the error I get is below, and for your convenience the model is also below.... Please have a look and I'll appreciate any comments on the matter.
Thanks, Erez
**************************************
STEADY-STATE RESULTS:
ch 1
cf 1
lambh -1
lambf -1
R 0.010101
bh 0
bf 0
zh 0
??? Error using ==> lnsrch1
Some element of Newton direction isn't finite. Jacobian maybe singular or there is a problem with initial values
Error in ==> solve1 at 126
[x,f,fvec,check]=lnsrch1(xold,fold,g,p,stpmax,func,j1,j2,varargin{:});
Error in ==> dynare_solve at 110
[x,info]=solve1(func,x,j1(r(i):r(i+1)-1),j2(r(i):r(i+1)-1),jacobian_flag,varargin{:});
Error in ==> steady_ at 69
[oo_.steady_state,check] = dynare_solve([M_.fname '_static'],...
*******************************
// Deterministic/Stochastic model - bond
// 2 countries, each endowed with the same good
// In the Deterministic model, the first 150 periods, no shock.
// From period 150-300, home country endowment rises by 0.01 stderr.
// home and foreign good are exactly the same;
// Bond is used as a noncontingent storage device.
var ch cf lambh lambf R bh bf zh;
varexo eh;
parameters beta sigma ysh ysf rho;
beta = 0.99;
sigma = 1.5; //intERtemp elas
rho = 0; // rho=0 in a deterministic model;
ysh = 1;
ysf = 1;
model;
(ch)^(-sigma) = - lambh;
lambh = lambh(+1) * beta * ( 1 + R);
(cf)^(-sigma) = - lambf;
lambf = lambf(+1) * beta * ( 1 + R);
ch + bh = ysh * exp(zh) + (1 + R ) * bh(-1);
cf + bf = ysf + (1 + R ) * bf(-1);
bh + bf = 0;
zh = rho * zh(-1) + eh;
end;
initval;
ch =1;
cf =1;
lambh =1;
lambf =1;
R =1/beta-1;
bh =0;
bf =0;
zh =0;
end;
steady;
endval;
ch =1;
cf =1;
lambh =1;
lambf =1;
R =1/beta-1;
bh =0;
bf =0;
zh =0.01;
end;
steady;
// placing steady after initval will start the model irf from the steady state values.
// if we didn't have the command steady now, the model will calculate at the initval figures.
check;
shocks;
var eh; periods 1:150; values 0.01;
//var eh; stderr 0.01;
end;
simul (periods=300);
//stoch_simul(periods=300, irf=300, nograph);
I don't get this... I'm really trying do a super-basic savings model, and I guess I'm a bit DAFT...
What don't I understand?? I would really appreciate a proper explanation (or any comments)
I haven't found any similar question on the forum, and I am sure that my question is probably so simple and I just don't get it.
This is a two country model.
Each country is endowed with a level 1 of a good. ysh=ysf=1.
The household can either consume or save using an noncontigent bond.
In the deterministic model, both agents know that after period 150, home country's endowment will rise by 1%.
I would expect the home country to borrow in the first 150 periods, and lend in the next 150, in order to smooth consumption.
I've set initival and endval bond to zero, in order to make sure of NO Ponzi scheme.
the error I get is below, and for your convenience the model is also below.... Please have a look and I'll appreciate any comments on the matter.
Thanks, Erez
**************************************
STEADY-STATE RESULTS:
ch 1
cf 1
lambh -1
lambf -1
R 0.010101
bh 0
bf 0
zh 0
??? Error using ==> lnsrch1
Some element of Newton direction isn't finite. Jacobian maybe singular or there is a problem with initial values
Error in ==> solve1 at 126
[x,f,fvec,check]=lnsrch1(xold,fold,g,p,stpmax,func,j1,j2,varargin{:});
Error in ==> dynare_solve at 110
[x,info]=solve1(func,x,j1(r(i):r(i+1)-1),j2(r(i):r(i+1)-1),jacobian_flag,varargin{:});
Error in ==> steady_ at 69
[oo_.steady_state,check] = dynare_solve([M_.fname '_static'],...
*******************************
// Deterministic/Stochastic model - bond
// 2 countries, each endowed with the same good
// In the Deterministic model, the first 150 periods, no shock.
// From period 150-300, home country endowment rises by 0.01 stderr.
// home and foreign good are exactly the same;
// Bond is used as a noncontingent storage device.
var ch cf lambh lambf R bh bf zh;
varexo eh;
parameters beta sigma ysh ysf rho;
beta = 0.99;
sigma = 1.5; //intERtemp elas
rho = 0; // rho=0 in a deterministic model;
ysh = 1;
ysf = 1;
model;
(ch)^(-sigma) = - lambh;
lambh = lambh(+1) * beta * ( 1 + R);
(cf)^(-sigma) = - lambf;
lambf = lambf(+1) * beta * ( 1 + R);
ch + bh = ysh * exp(zh) + (1 + R ) * bh(-1);
cf + bf = ysf + (1 + R ) * bf(-1);
bh + bf = 0;
zh = rho * zh(-1) + eh;
end;
initval;
ch =1;
cf =1;
lambh =1;
lambf =1;
R =1/beta-1;
bh =0;
bf =0;
zh =0;
end;
steady;
endval;
ch =1;
cf =1;
lambh =1;
lambf =1;
R =1/beta-1;
bh =0;
bf =0;
zh =0.01;
end;
steady;
// placing steady after initval will start the model irf from the steady state values.
// if we didn't have the command steady now, the model will calculate at the initval figures.
check;
shocks;
var eh; periods 1:150; values 0.01;
//var eh; stderr 0.01;
end;
simul (periods=300);
//stoch_simul(periods=300, irf=300, nograph);