Time To Build Ramsey 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.

Time To Build Ramsey model

Postby lzs52t » Sun Dec 20, 2015 10:34 am

Hello, everyone.
Someone please help me.
I'm newbe of dynare and have questions.

I want to simulate time-to-build ramsey model.
In this model, Law of motion of capital is follow;
k(t+1)-k(t)=f(k(t-1))-δk(t-1)
I know this model require two initial value of capital(k(-1)and k(0)), but I don't know how I express in dynare.

I write a dynare cord of this model,but I have a syntax error in line19 (K = Kstar)
I don't know why error occured. Please tell me why this cord is wrong.
Code: Select all
var C K;
parameters alpha delta beta rho;

alpha = 0.3;
beta = 0.99;
delta = 0.025;
rho = 0.9;

Cstar = ((1 - beta)/(alpha * beta^2)^(alpha/(alpha - 1)) - delta * ((1 - beta)/(alpha * beta^2)^(1/(alpha - 1));
Kstar = ((1 - beta)/(alpha * beta^2)^(1/(alpha - 1));

model;
C^(-1 * rho) = beta * C(+1)^(-1 * rho) + beta^2 * (alpha * K(+1)^(alpha - 1) - delta) * C(+2)^(-1 * rho);
K(+1) - K = K(-1)^(alpha) - delta * K(-1) - C;
end;

inival;
C = Cstar
K = Kstar
end;

steady;

[Cstar; Kstar]


Thank you for your reading.
lzs52t
 
Posts: 7
Joined: Sun Dec 20, 2015 10:17 am

Re: Time To Build Ramsey model

Postby jpfeifer » Sun Dec 20, 2015 2:29 pm

1. There are several brackets missing.
2. It should be initval not inival.
3. Every line needs to end with a semicolon.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Time To Build Ramsey model

Postby lzs52t » Sun Dec 20, 2015 4:41 pm

Thank you for your great help, Mr.jpfeifer.
Thanks to your perfect comment,I was able to simulate this model.
lzs52t
 
Posts: 7
Joined: Sun Dec 20, 2015 10:17 am

Re: Time To Build Ramsey model

Postby lzs52t » Wed Dec 23, 2015 9:15 am

someone please help me. I have another problem.

I want to simulate comparative dynamics in this model, but not work.

I want to move the beta and draw a picture which it affects on dynamic path.
So, I redefined beta from "parameters" to "varexo".
Code is here.

Code: Select all
var C K;
varexo beta;
parameters alpha delta rho;

alpha = 0.3;
delta = 0.025;
rho = 0.9;


model;
C^(-1 * rho) = beta * C(+1)^(-1 * rho) + beta^3 * (alpha * K(+1)^(alpha - 1) - delta) * C(+3)^(-1 * rho);
K(+1) - K = K(-2)^(alpha) - delta * K(-2) - C;
end;

Cstar = ((1 - beta)/(alpha * beta^3)+(delta / alpha))^(alpha/(alpha - 1)) - delta * ((1 - beta)/(alpha * beta^3)+(delta / alpha))^(1/(alpha - 1));
Kstar = ((1 - beta)/(alpha * beta^3)+(delta / alpha))^(1/(alpha - 1));

initval;
C = 10;
K = 100;
beta = 0.99;
end;

endval;
C = Cstar;
K = Kstar;
beta = 0.99;
end;

steady;

shocks;
var beta;
periods 5:45;
values 0.95;
end;

simul(periods=50);

rplot C;
rplot K;
lzs52t
 
Posts: 7
Joined: Sun Dec 20, 2015 10:17 am

Re: Time To Build Ramsey model

Postby jpfeifer » Wed Dec 23, 2015 9:32 am

Always provide the error message you are experiencing. I can run your model with the current Dynare unstable.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Time To Build Ramsey model

Postby lzs52t » Wed Dec 23, 2015 10:18 am

Thank you for your comment.
I'll be careful.
The problem is resolved in my own.
Thank you.
lzs52t
 
Posts: 7
Joined: Sun Dec 20, 2015 10:17 am

Re: Time To Build Ramsey model

Postby lzs52t » Thu Dec 24, 2015 6:58 am

I simulate another model of time to build.
Simulation doesn't work well.

please help me.

Code: Select all
var C K M pi;
parameters alpha delta beta g gamma;

alpha = 0.3;
beta = 0.99;
delta = 0.025;
g=1.01;
gamma = 0.8;

model;
C^(-1) = beta * C(+1)^(-1) + (beta^3) * (alpha * K(+1)^(alpha - 1) - delta) * C(+3)^(-1);
beta * gamma * M^(-1) = pi(-1)*C(-1)^(-1) - beta * C^(-1);
K(+1) - K = K(-2)^(alpha) - delta * K(-2) - C;
M(+1) = (g/pi(+1)) * M;
end;

Cstar =  ((1 - beta)/(alpha * beta^3) + (delta / alpha))^(alpha/(alpha - 1)) - delta * ((1 - beta)/(alpha * beta^3) + (delta / alpha))^(1/(alpha - 1));
Kstar =  ((1 - beta)/(alpha * beta^3) + (delta / alpha))^(1/(alpha - 1));
pistar = g;
Mstar =  gamma * beta/(g - beta)*((1 - beta)/(alpha * beta^3) + (delta / alpha))^(alpha/(alpha - 1)) - delta * ((1 - beta)/(alpha * beta^3) + (delta / alpha))^(1/(alpha - 1));

initval;
C = 1;
K = 1;
M = 1;
pi = 1.01;
end;

endval;
C = 1.97038;
K = 21.2584;
M = 78.0252;
pi = 1.01;
end;

steady;

simul(periods = 5);

rplot C;
rplot K;
rplot M;
rplot pi;



Error message is follow;

error: SIMUL: error in model specification : variable pi doesn't appear as current variable.

If you need additional information to solve this problem, please reply here.

Thank you.
lzs52t
 
Posts: 7
Joined: Sun Dec 20, 2015 10:17 am

Re: Time To Build Ramsey model

Postby jpfeifer » Sat Dec 26, 2015 10:19 am

You need to check your model. If inflation does not appear within the current period, there must be something wrong.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Time To Build Ramsey model

Postby lzs52t » Sat Jan 16, 2016 3:16 pm

Thanks for your comment.
I could able to simulate this model, but another problem occur.

I simulate time to build ramsey model.
But,I have another question.
I used check command and I verify the linearized model has some complex number of eigenvalues.
So optimal path should be oscillate.
I could able to simulate this model without error, but optimal path isn't oscillate.
My scenario is following;
going to steady state from initial value of C and K are 1.

I check my dynare code over ten times, but I was not able to why it occurs.


dynare code is here
Code: Select all
var C K;
parameters alpha beta delta rho;

alpha = 0.3;
beta = 0.99;
delta = 0.025;
rho = 0.9;


model;
C^(-1 * rho) = beta * C(+1)^(-1 * rho) + beta^7 * (alpha * K(+1)^(alpha - 1) - delta) * C(+7)^(-1 * rho);
K = K(-1) + K(-6)^(alpha) - delta * K(-6) - C(-1);
end;

initval;
C = 1;
K = 1;
end;

endval;
C = 1.96661;
K = 20.9;
end;

steady;

check;

simul(periods = 30);

rplot C;
rplot K;

dynatype(ram);

and result file is attachment.
X2 means if X(t+1)>X(t), return 1
X(t+1)<X(t), return -1
X(t+1)=X(t), return 0
GOX is growth rate of X.
(X is a variable name)

Thank you for your reading.
Attachments
lagram.txt
(1.74 KiB) Downloaded 133 times
ram.txt
(1.83 KiB) Downloaded 103 times
lzs52t
 
Posts: 7
Joined: Sun Dec 20, 2015 10:17 am

Re: Time To Build Ramsey model

Postby jpfeifer » Tue Jan 19, 2016 9:44 am

Complex eigenvalues do not automatically mean oscillations. Actually, some complex generalized eigenvalues are common in DSGE models.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Time To Build Ramsey model

Postby lzs52t » Tue Jan 19, 2016 10:19 am

Thank you.
I found some mistake in my model, and some problems are resolved.
lzs52t
 
Posts: 7
Joined: Sun Dec 20, 2015 10:17 am


Return to Dynare help

Who is online

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