Error illegal use of reserved keyword end, dynare

조회 수: 7 (최근 30일)
Sebastian Gonzalez
Sebastian Gonzalez 2020년 4월 19일
답변: Ameer Hamza 2020년 4월 19일
Hello,
I´m trying tu run a neoclassical model on matlab with dynare, but i'm getting this error with the "end", i´ve checked on the ecuations and are all as they must be. Any Hints?
"Error: File: P1_GONZALEZ.m Line: 61 Column: 1
Illegal use of reserved keyword "end".
addpath C:\dynare\4.6.1\matlab
dynare P1_GONZALEZ
% Endogenous variables:
var L C RK W K Y e A MU I FT;
% Exogenous variables:
varexo e_e e_MU e_A ;
% Parameters:
parameters ,BETA ,DELTA ,A ,PSI_L, MU ,e ,SIGMA_L ,ALPHA ,PHI_E ,PHI_C ,PHI_L ,RHO_E1 ,RHO_E2, RHO_E0, RHO_MU1 ,RHO_MU2 ,SIGME_E , SIGMA_MU ;
BETA = 0.99917;
DELTA = 0.0021;
PSI_L = 0.6818;
MU = 1;
SIGMA_L= 1;
ALPHA = 0.33;
PHI_E = 0.0028;
PHI_C = 0.01;
PHI_L = 0.01;
RHO_E1 = 1.84;
RHO_E2 = -0.85;
RHO_E0 = -0.6718;
RHO_MU1= 1.55;
RHO_MU2= -0.6;
SIGMA_E=0.01;
SIGMA_MU= 0.02;
RHO_A =0.95
SIGMA_A=0.01
%ESTADOS ESTACIONARIOS
K_EE = (((1-BETA+BETA*DELTA)*(MU*((BETA*ALPHA*A)^-1)))^((ALPHA-1))^-1);%%;
L_EE = 1;
Y_EE = A*MU*(K_EE^ALPHA)*((L_EE)^(ALPHA-1));
I_EE = DELTA*K_EE;
C_EE = A*(MU^-1)*(1-ALPHA)*((K_EE*(L_EE^-1))^ALPHA)*((PSI_L*(L_EE^SIGMA_L))^-1);
W_EE = A*(MU^-1)*(1-ALPHA)*((K_EE*(L_EE^-1))^ALPHA);
RK_EE= A*ALPHA*(MU^-1)* ((K_EE*(L_EE^-1))^(ALPHA-1));
MU_EE= 1;
FT_EE= PHI_C*(C_EE)+ PHI_L*(L_EE);
e_EE = 0.01;
% C_EE= Y_EE - I_EE - PHI_E*(e_EE^2)
% THE MODEL
model;
exp(L)= (exp(W)*((exp(C)*PSI_L)^-1))^((SIGMA_L)^(-1));
exp(C)= (BETA*(exp(C(+1))^-1)*(1-DELTA + exp(RK(+1))))^(-1);
exp(RK)= (ALPHA*A*(MU^(-1)))*((exp(K(-1))*MU)^(ALPHA-1))*((exp(L)*(MU^-1))^(1-ALPHA));
exp(W)= ((1-ALPHA)*A*(MU^(-1)))*((exp(K(-1))*MU)^(ALPHA))*((exp(L)*(MU^-1))^(-ALPHA));
exp(I)= exp(K)-(1-DELTA)*exp(K(-1));
exp(Y)= A*((exp(K(-1))*MU)^(ALPHA))*((exp(L)*(MU^-1))^(ALPHA-1));
exp(Y)= exp(C) + exp(I) + PHI_E*(e^2);
exp(e)= RHO_E0 + RHO_E1*(exp(e(-1)))+ RHO_E2*(exp(e(-2))) + FT + e_e;
exp(FT)= PHI_C*(C)+ PHI_L*(L);
exp(MU) = RHO_MU1* exp(MU(-1))+ RHO_MU2*exp(MU(-2))+ e_MU;
A = RHO_A*A(-1) + e_A*SIGMA_A;
end;
% *******
%INITIAL VALUES
initv;
K= log(K_EE);
Y= log(Y_EE);
C= log(C_EE);
I= log(I_EE);
W= log(W_EE);
RK= log(RK_EE);
e = log(e_EE);
L = log(L_EE);
FT= log(FT_EE);
MU= log(MU_EE)
A = 0;
end;
shock
var e_A = 1;
end;
check;
resid;
stoch_simul(order == 1,irf==60,graph)

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 4월 19일
I do not have dynare toolbox, but after going through your code, it seems that the line 'end;' repeated 3 times in your code, is unnecessary. Remove these lines, and you this error will go away.

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by