# Time To Build Ramsey model

Hello, everyone.
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]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;

[Cstar; Kstar][/code]

1. There are several brackets missing.
2. It should be initval not inival.
3. Every line needs to end with a semicolon.

Thank you for your great help, Mr.jpfeifer.
Thanks to your perfect comment,I was able to simulate this model.

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]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;

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

simul(periods=50);

rplot C;
rplot K;
[/code]

Always provide the error message you are experiencing. I can run your model with the current Dynare unstable.

I’ll be careful.
The problem is resolved in my own.
Thank you.

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

[code]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;

simul(periods = 5);

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

[/code]

Error message is follow;

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

Thank you.

You need to check your model. If inflation does not appear within the current period, there must be something wrong.

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

``````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;

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)