Overlapping Generations Model (OLG)

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.

Overlapping Generations Model (OLG)

Postby charliesan » Thu Sep 22, 2011 3:56 pm

Hi guys,

I've just started using matlab and dynare.

anyone has a code for a simple deterministic OLG model? I can only find Ramsey ones.

Thank You very much.

Charlie.
charliesan
 
Posts: 1
Joined: Thu Sep 22, 2011 3:51 pm

Re: Overlapping Generations Model (OLG)

Postby makota » Mon Feb 27, 2012 1:43 pm

Hey,

I noticed that here's very little OLG related material. So here's a basic 2 cohort Diamond-Samuelsson.

// Basic OLG with population growth and technological growth
var c c1 c2 k w r s y check1 check2;

parameters beta alpha delta n x;
beta = 0.4010; // 0.97^30
alpha = 1/3; delta = 0.9; n=0.1614; x=0.3478;

kss = ((1+1/beta)*(1+n)/(1-alpha))^(1/(alpha-1));
wss = (1-alpha)*kss^alpha; rss = alpha*kss^(alpha-1)-delta;
sss = (1+n)*kss; c1ss = sss/beta; c2ss = (1+rss)*sss;
yss = kss^alpha; css = c1ss+c2ss/(1+n);

model;
// In effective labour form
1/c1 = beta*(1+r(+1))/c2(+1);
c1 + s = w;
c2(+1) = (1+r(+1))*s;
y = k(-1)^alpha; // Y/XL = (K/XL)^alpha
w = (1-alpha)*k(-1)^alpha;
r = alpha*k(-1)^(alpha-1) - delta;
c = c1 + c2/(1+n+x); // C = X*L*c1 + X(-1)*L(-1)*C2;
// ECNOMY WIDE FEASIBILITY CONSTRAINT
y = (1+n+x)*k - (1-delta)*k(-1) + c;
check1 = y -( (1+n+x)*k - (1-delta)*k(-1) + c);
check2 = (1+n+x)*k - s;
end;

initval;
k = kss; c1 = c1ss; c2 = c2ss; r=rss; w=wss; s=sss; c=css; y = yss;
end;

steady;
makota
 
Posts: 9
Joined: Mon Feb 27, 2012 1:37 pm

Re: Overlapping Generations Model (OLG)

Postby jepecolc » Sat Jun 23, 2012 6:54 pm

Hi there,

Thanks a lot for this post. I have a problem, though. If I try to save the results in a "mat" file by using this command
dynasave (OLGResults) w c1 s c2 r k c y;

I get this error message

Error using horzcat
CAT arguments dimensions are not consistent.

I have found out that the problem is caused by variable "s"; i.e. if I use the command
dynasave (OLGResults) w c1 c2 r k c y; // excluding "s"

it works fine.

However, in the former case (when I get the error) if I open the oo_.endo_simul file, the variable "s" is there, with the same (!) number of observations as the other endogenous variables.


Does any one have an idea of what is going on? What am I doing wrong?

Any help would be appreciated.

Best,
jepecolc
jepecolc
 
Posts: 11
Joined: Mon Feb 07, 2005 10:53 am


Return to Dynare help

Who is online

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