Could anyone help me to run this code?

hello
Hello, I am a dynare novice.i have observable value for Y C W R.could anyone guide me to run this codes.I will be grateful

``````//NK Model with Rigidity in Investments

//Costs relating to investment adjustment and the

//non-utilization of maximum installed capacity

//- Chapter 6 (UNDERSTANDING DSGE MODELS)

var Y I C CR CNR R K W L LR LNR PIW P PI A LAMBDAR LAMBDANR Q U CM;

varexo e;

parameters sigma phi alpha beta delta rhoa psi theta

thetaW psiW phic omegaR Psi1 Psi2 chi;

sigma = 2;

phi = 1.5;

alpha = 0.35;

beta = 0.985;

delta = 0.025;

rhoa = 0.95;

psi = 8;

theta = 0.75;

thetaW = 0.75;

psiW = 21;

phic = 0.8;

omegaR = 0.5;

Psi1 = ((1/beta)-(1-delta));

Psi2 = 1;

chi = 1;

model(linear);

#Uss = 1;

#Pss = 1;

#CMss = ((psi-1)/psi)*(1-beta*theta)*Pss;

*((1-phic)^(-sigma))*(1-beta*thetaW)*((psiW-1)/psiW)*(Wss/Pss)

*(Wss/((1-alpha)*CMss))^phi)^(1/(sigma+phi));

#Iss = delta*Kss;

#Css = Yss - Iss;

#Lss = (1-alpha)*CMss*(Yss/Wss);

//1-Ricardian household Lagrangian

LAMBDAR = (sigma/((1-phic)*(1-phic*beta)))

*(phic*beta*(CR(+1)-phic*CR)-(CR-phic*CR(-1)))-P;

//2-Phillips equation for Ricardian household wages

PIW = beta*PIW(+1)+((1-thetaW)*(1-beta*thetaW)/thetaW)*(LR-LAMBDAR-W);

//3-Gross wage inflation rate

PIW = W - W(-1);

//4-Tobinâ€™s Q

//5-Demand for Installed Capacity

//6-Demand for Investment

//7-Law of Motion of Capital

K = (1-delta)*K(-1) + delta*I;

//8-Non-Ricardian household Lagrangian

LAMBDANR = (sigma/((1-phic)*(1-phic*beta)))

*(phic*beta*(CNR(+1)-phic*CNR)-(CNR-phic*CNR(-1)))-P;

//9-Phillips equation for non-Ricardian household wages

PIW = beta*PIW(+1)+((1-thetaW)*(1-beta*thetaW)/thetaW)*(LNR-LAMBDANR-W);

//10-Budget constraint of the non-Ricardian household

P+CNR=W+LNR;

//11-Aggregate consumption

//12-Aggregate labor

//13-Production function

Y = A + alpha*(U+K(-1)) + (1-alpha)*L;

//14-Demand for capital

U + K(-1) = Y - R;

//15-Demand for labor

L = Y - W;

//16-Marginal cost

CM = ((1-alpha)*W + alpha*R - A);

//17-Phillips Equation

PI = beta*PI(+1)+((1-theta)*(1-beta*theta)/theta)*(CM-P);

//18-Gross inflation rate

PI = P - P(-1);

//19-Equilibrium condition

Yss*Y = Css*C + Iss*I;

//20-Productivity shock

A = rhoa*A(-1) + e;

end;

model_diagnostics;

check (qz_zero_threshold=1e-20);

shocks;

var e;

stderr 0.01;

end;

stoch_simul(qz_zero_threshold=1e-20)

Y I C CR CNR R K W L LR LNR PIW PI Q U A;
``````

What exactly is your question? The code runs on my machine.

1 Like

thank you Professor for your kind response.Professor,I have used this these command.

//Observable Variables

varobs Y C W R;

//Estimation command

estimation(datafile=data, filtered_data, mh_replic= 2000, bayesian_irf, forecast=10, mh_conf_sig = 0.95, mh_nblocks = 2, mh_jscale = 3.5);

stoch_simul(qz_zero_threshold=1e-20)

Y I C CR CNR R K W L LR LNR PIW PI Q U A;

Error using dynare
Dynare: preprocessing failed

Estimating models is hard. I fixed a few things. But your model still lacks an `estimated_params` block as well as proper observation equations.