RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

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.

RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby Bouba » Thu Jul 01, 2010 9:38 pm

Dear Sir/Madam,

I was wondering if you could please assist me with the error message I am having below.

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//% Notes:
//% DYNARE timing convention has been used
//% for the capital accumulation equation

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//% VARIABLES AND PARAMETERS DEFINITION
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
var y c k i h l z;
varexo e;

parameters beta alpha gamma theta omega rho sigma;

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//% CALIBRATED PARAMETER VALUES FROM THE ARTICLE
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
beta = .96;
alpha = .29;
gamma= 2;
theta = .6;
omega= 1.42;
rho=.51;
sigma = .045;

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//% MODEL:
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

model;

//% FIRST ORDER CONDITIONS

exp(l)=((1-alpha)*(exp(k(-1))*(exp(h))^alpha)*exp(l)^(-alpha))^(1/theta);
exp(h)=((alpha*(exp(k(-1)*exp(h))^(alpha-1))*exp(l)^(1-alpha))*(1+exp(z)))^(1/omega-1);
((exp(c)-(exp(l)^1+theta)/(1+theta))^(-gamma))/(1+exp(z))=beta*(exp(c(+1))-(exp(l(+1))^(1+theta))/(1+theta)^(-gamma))*alpha*(exp(k)*exp(h(+1))^(alpha-1))*(exp(l(+1))^(1-alpha))*exp(h(+1))+(1-(1/omega)*exp(h(+1))^omega)/(1+exp(z(+1)));
((exp(k(-1))*exp(h))^alpha)*exp(l)^(1-alpha)=exp(c)+exp(k)/(1+exp(z))-(exp(k(-1))*(1-(1/omega)*exp(h)^omega))/(1+exp(z));

//% CONSTRAINTS

exp(k)=(((exp(k(-1))^alpha)*(exp(h))^(alpha))*exp(l)^(1-alpha)+(1-(1/omega)*(exp(h)^omega)*exp(k(-1)))/(1+exp(z))-exp(c))*(1+exp(z));
exp(y)=exp(c)+exp(i)/(1+exp(z));
z=rho*z(-1)+e;

end;

//% INITIAL VALUES AND STEADY STATE:
initval;
k=0.567966;
i=0.0563;
l=0.3610;
h=0.251526;
c=0.2196
z=0;
e=0;
end;

steady;

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//% SHOCKS: DEFINE SHOCKS
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

shocks;
var e = sigma^2;
end;

stoch_simul(periods=2100,order=1);


The message I get is:
>> dynare GHH.mod

Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.

Starting Dynare (version 4.1.2).
Starting preprocessing of the model file ...
ERROR: GHH.mod:59.1: syntax error, unexpected NAME

??? Error using ==> dynare at 126
DYNARE: preprocessing failed


Thank you so much.

Regards,
Bouba
Bouba
 
Posts: 22
Joined: Thu Jul 01, 2010 9:28 pm

Re: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby jpfeifer » Fri Jul 02, 2010 6:42 am

There was a semicolon missing after c=0.2196. Moreover, there are some problems with the uncommented line like /%%%.

Moreover, the steady state initial values are wrong. But at least this version runs up to SS computation.

Code: Select all
//% Notes:
//% DYNARE timing convention has been used
//% for the capital accumulation equation

//% VARIABLES AND PARAMETERS DEFINITION
var y c k i h l z;
varexo e;

parameters beta alpha gamma theta omega rho sigma;

//% CALIBRATED PARAMETER VALUES FROM THE ARTICLE
beta = .96;
alpha = .29;
gamma= 2;
theta = .6;
omega= 1.42;
rho=.51;
sigma = .045;

//% MODEL:

model;

//% FIRST ORDER CONDITIONS

exp(l)=((1-alpha)*(exp(k(-1))*(exp(h))^alpha)*exp(l)^(-alpha))^(1/theta);
exp(h)=((alpha*(exp(k(-1)*exp(h))^(alpha-1))*exp(l)^(1-alpha))*(1+exp(z)))^(1/omega-1);
((exp(c)-(exp(l)^1+theta)/(1+theta))^(-gamma))/(1+exp(z))=beta*(exp(c(+1))-(exp(l(+1))^(1+theta))/(1+theta)^(-gamma))*alpha*(exp(k)*exp(h(+1))^(alpha-1))*(exp(l(+1))^(1-alpha))*exp(h(+1))+(1-(1/omega)*exp(h(+1))^omega)/(1+exp(z(+1)));
((exp(k(-1))*exp(h))^alpha)*exp(l)^(1-alpha)=exp(c)+exp(k)/(1+exp(z))-(exp(k(-1))*(1-(1/omega)*exp(h)^omega))/(1+exp(z));

//% CONSTRAINTS

exp(k)=(((exp(k(-1))^alpha)*(exp(h))^(alpha))*exp(l)^(1-alpha)+(1-(1/omega)*(exp(h)^omega)*exp(k(-1)))/(1+exp(z))-exp(c))*(1+exp(z));
exp(y)=exp(c)+exp(i)/(1+exp(z));
z=rho*z(-1)+e;

end;

//% INITIAL VALUES AND STEADY STATE:
initval;
k=0.567966;
i=0.0563;
l=0.3610;
h=0.251526;
c=0.2196;
z=0;
e=0;
end;

steady;
check;
//% SHOCKS: DEFINE SHOCKS

shocks;
var e = sigma^2;
end;

stoch_simul(periods=2100,order=1);
------------
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: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby Bouba » Fri Jul 02, 2010 10:00 am

Thank you ever so much for your reply. I have now made the changes you suggested and you right, there seems to be a problem with the steady state values. It seems that I should have taken the log of the calculated values since I am using the EX LOg method here to write my model, Thus I run:

//% Notes:
//% DYNARE timing convention has been used
//% for the capital accumulation equation

//% VARIABLES AND PARAMETERS DEFINITION
var y c k h i l z;
varexo e;

parameters beta alpha gamma theta omega rho sigma;

//% CALIBRATED PARAMETER VALUES FROM THE ARTICLE
beta = .96;
alpha = .29;
gamma= 2;
theta = .6;
omega= 1.42;
rho=.51;
sigma = .045;

//% MODEL:

model;

//% FIRST ORDER CONDITIONS

exp(l)=((1-alpha)*(exp(k(-1))*(exp(h))^alpha)*exp(l)^(-alpha))^(1/theta);
exp(h)=((alpha*(exp(k(-1)*exp(h))^(alpha-1))*exp(l)^(1-alpha))*(1+exp(z)))^(1/omega-1);
((exp(c)-(exp(l)^1+theta)/(1+theta))^(-gamma))/(1+exp(z))=beta*(exp(c(+1))-(exp(l(+1))^(1+theta))/(1+theta)^(-gamma))*alpha*(exp(k)*exp(h(+1))^(alpha-1))*(exp(l(+1))^(1-alpha))*exp(h(+1))+(1-(1/omega)*exp(h(+1))^omega)/(1+exp(z(+1)));
((exp(k(-1))*exp(h))^alpha)*exp(l)^(1-alpha)=exp(c)+exp(k)/(1+exp(z))-(exp(k(-1))*(1-(1/omega)*exp(h)^omega))/(1+exp(z));

//% CONSTRAINTS
exp(k)=(((exp(k(-1))^alpha)*(exp(h))^(alpha))*exp(l)^(1-alpha)+(1-(1/omega)*(exp(h)^omega)*exp(k(-1)))/(1+exp(z))-exp(c))*(1+exp(z));
exp(y)=exp(c)+exp(i)/(1+exp(z));
z=rho*z(-1)+e;

end;

//% INITIAL VALUES AND STEADY STATE:
initval;

k=log(0.567966);
l=log(0.3610);
h=log(0.251526);
c=log(0.2196);

//%Alternatively I though that entering the ss equations (Pls see attached pdf) could help but it did not
//%h=log(((1-beta)/beta*(omega/(omega-1)))^(1/omega));
//%k=log((1-alpha)^(1/theta)*alpha^((alpha+theta)/((1-alpha)*theta))*h^((alpha*(1+theta)-omega*(alpha+theta))/(theta*(1-alpha))));
//%l=log((1-alpha)^(1/(alpha+theta))*k^(alpha/(alpha+theta))*h^(alpha/(alpha+theta)));
//%c=log(((k*h)^alpha)*l^(1-alpha)-(1/omega)*(h^omega)*k);

z=0;
e=0;
end;

steady;
check;
//% SHOCKS: DEFINE SHOCKS

shocks;
var e = sigma^2;
end;

stoch_simul(periods=2100,order=1);

Though having done this I am still still getting the following error message:

SOLVE: Iteration 104
Spurious convergence.
0
-23.5979
0.1266
0.0853
0
-0.5000
0.0348

??? Error using ==> steady_ at 132
STEADY: convergence problems

Error in ==> steady at 52
steady_;

Error in ==> GHH at 118
steady;

Error in ==> dynare at 132
evalin('base',fname) ;


I have attached a PDF of the model I am working on with everything solved for already i.e. FOCs, ss values. Could you please advise on what I can do to get it right. I am forever grateful for your help. Thank you so much.

Regards,
Bouba
Attachments
GHH pdf.pdf
Actual model and steady state equations.
(289.44 KiB) Downloaded 149 times
Bouba
 
Posts: 22
Joined: Thu Jul 01, 2010 9:28 pm

Re: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby jpfeifer » Fri Jul 02, 2010 11:07 am

Recheck your equations and make sure the definition of z is consistent. From equation 7, its SS is 0, but when you put exp(z) in the model, you get a 1 there.
Also, note that in equation 2, you have
exp(k(-1)*exp(h))
which should probably be
exp(k(-1))*exp(h)
------------
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: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby Bouba » Fri Jul 02, 2010 12:39 pm

Thank you again for your prompt reply. I will double check the equations now. Many thanks.

Regards,
Bouba
Bouba
 
Posts: 22
Joined: Thu Jul 01, 2010 9:28 pm

Re: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby Bouba » Sat Jul 03, 2010 9:51 pm

Dear jpfeifer,

I have change the equations around again and again, but I do not seem to get this code running in dynare. Attached is an example rbc model which is very similar in routine to what I am trying to do, but I really cant see where I am going wrong. I have re-calculated my steady state values using the information in the attached pdf and these are correct. Your help with this matter will be most welcome. Thank you again.

Regards,
Bouba
Attachments
GHH pdf.pdf
(289.44 KiB) Downloaded 210 times
rbc_simple.mod
(2.44 KiB) Downloaded 123 times
Bouba
 
Posts: 22
Joined: Thu Jul 01, 2010 9:28 pm

Re: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby jpfeifer » Sun Jul 04, 2010 10:23 am

Somehow you totally screwed up the brackets. Moreover, the constraints have been substituted into the problem, so you don't need them. 1+exp(z) should always be exp(z) and so on. I hope this one runs:


//% Notes:
//% DYNARE timing convention has been used
//% for the capital accumulation equation

//% VARIABLES AND PARAMETERS DEFINITION
var c k h l z;
//var y c k h i l z;

varexo e;

parameters beta alpha gamma theta omega rho sigma;

//% CALIBRATED PARAMETER VALUES FROM THE ARTICLE
beta = .96;
alpha = .29;
gamma= 2;
theta = .6;
omega= 1.42;
rho=.51;
sigma = .045;

//% MODEL:

model;

//% FIRST ORDER CONDITIONS

exp(l)=((1-alpha)*(exp(k(-1)*exp(h)))^alpha*exp(l)^(-alpha))^(1/theta);
exp(h)=(alpha*(exp(k(-1))*exp(h))^(alpha-1)*exp(l)^(1-alpha)*(exp(z)))^(1/(omega-1));
((exp(c)-(exp(l)^(1+theta))/(1+theta))^(-gamma))/(exp(z))=beta*(exp(c(+1))-(exp(l(+1))^(1+theta))/(1+theta))^(-gamma)*(alpha*(exp(k)*exp(h(+1)))^(alpha-1)*exp(l(+1))^(1-alpha)*exp(h(+1))+(1-(1/omega)*exp(h(+1))^omega)/(exp(z(+1))));
(exp(k(-1))*exp(h))^alpha*exp(l)^(1-alpha)=exp(c)+exp(k)/(exp(z))-(exp(k(-1))*(1-(1/omega)*exp(h)^omega))/(exp(z));

//% CONSTRAINTS
//exp(k)=(((exp(k(-1))*exp(h))^(alpha)*exp(l)^(1-alpha)+(1-(1/omega)*(exp(h)^omega)*exp(k(-1)))/(exp(z))-exp(c))*(exp(z));
//exp(y)=exp(c)+exp(i);//(exp(z));
z=rho*z(-1)+e;

end;

//% INITIAL VALUES AND STEADY STATE:
initval;

k=log(0.567966);
l=log(0.3610);
h=log(0.251526);
c=log(0.2196);

//%Alternatively I though that entering the ss equations (Pls see attached pdf) could help but it did not
//h=log(((1-beta)/beta*(omega/(omega-1)))^(1/omega));
//k=log((1-alpha)^(1/theta)*alpha^((alpha+theta)/((1-alpha)*theta))*h^((alpha*(1+theta)-omega*(alpha+theta))/(theta*(1-alpha))));
//l=log((1-alpha)^(1/(alpha+theta))*k^(alpha/(alpha+theta))*h^(alpha/(alpha+theta)));
//c=log(((k*h)^alpha)*l^(1-alpha)-(1/omega)*(h^omega)*k);
z=0;
e=0;
end;

steady;
check;
//% SHOCKS: DEFINE SHOCKS

shocks;
var e = sigma^2;
end;

stoch_simul(periods=2100,order=1);
------------
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: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby Bouba » Sun Jul 04, 2010 10:33 am

Yes, this code runs. Thank you so much.

Regards,
Bouba
Bouba
 
Posts: 22
Joined: Thu Jul 01, 2010 9:28 pm

Re: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby Bouba » Mon Jul 05, 2010 4:38 pm

Dear Mr Julliard,

In fact what I am trying to do is to estimate the parameters in my model using Bayesian analysis. I am getting the priors figure right, but after this I get the following error message:

??? Error using ==> schur
Input to SCHUR must not contain NaN or Inf.

Error in ==> lyapunov_symm at 61
[U,T] = schur(a);

Error in ==> DsgeLikelihood at 173
Pstar = lyapunov_symm(T,R*Q*R',options_.qz_criterium,options_.lyapunov_complex_threshold);

Error in ==> initial_estimation_checks at 60
[fval,cost_flag,ys,trend_coeff,info] =
DsgeLikelihood(xparam1,gend,data,data_index,number_of_observations,no_more_missing_observations);

Error in ==> dynare_estimation_1 at 334
initial_estimation_checks(xparam1,gend,data,data_index,number_of_observations,no_more_missing_observations);

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> GHHbayesian at 139
dynare_estimation(var_list_);

Error in ==> dynare at 132
evalin('base',fname) ;
.

I understand that I cannot have more observables than shocks and since my model has one shock (the one to the marginal efficiency of investment) I have chosen the observable capacity utilization, I am planning to include a TFP shock as well so I can include a second observable in consumption as using one observable perhaps may not be enough. Although the models are different, I read through your examples mod files online which replicates the estimation of the CIA model from Frank Schorfheide (2000) "Loss function-based evaluation of DSGE models", and this was indeed very useful to me, though I do not see where I am going wrong here. Your help will be much appreciated once more. Thank you for all.

Regards,
Bouba

NB: I have attached the mod file and the data I am using.
Attachments
GHHbayesian.mod
(1.52 KiB) Downloaded 98 times
data.m
(894 Bytes) Downloaded 95 times
Bouba
 
Posts: 22
Joined: Thu Jul 01, 2010 9:28 pm

Re: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby Bouba » Mon Jul 05, 2010 11:35 pm

Dear jpfeifer,,

The model seems to run when I am estimating one parameter, gamma for example and get rid of loglinear in the following code: estimation(datafile=data,nobs=140,loglinear,mh_replic=0,mh_nblocks=5,mh_jscale=0.8);
I am not sure why, perhaps since I am using the ex log method, this option does not apply...
Though, it looks like I have a far more serious problem when I try to estimate all the parameters, using only one shock and one observable, I get the following error:
Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.

??? Error using ==> dynare at 108
DYNARE: can't open GHHother.mod

>> dynare GHHother.mod

Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.

Starting Dynare (version 4.1.2).
Starting preprocessing of the model file ...
Found 5 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Processing outputs ...done
Preprocessing completed.
Starting MATLAB/Octave computing.


STEADY-STATE RESULTS:

c -0.875989
k 0.074472
h -1.38021
l -0.378713
z 0

EIGENVALUES:
Modulus Real Imaginary

0.51 0.51 0
0.9779 0.9779 0
1.052 1.052 0
Inf Inf 0
Inf Inf 0
Inf Inf 0


There are 4 eigenvalue(s) larger than 1 in modulus
for 4 forward-looking variable(s)

The rank condition is verified.


You did not declare endogenous variables after the estimation command.
??? Attempted to access k(1); index out of bounds because numel(k)=0.

Error in ==> draw_prior_density at 93
binf = abscissa(k(1));

Error in ==> plot_priors at 52
[x,f,abscissa,dens,binf,bsup] = draw_prior_density(i,bayestopt_);

Error in ==> dynare_estimation_1 at 87
plot_priors(bayestopt_,M_,options_)

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> GHHother at 143
dynare_estimation(var_list_);

Error in ==> dynare at 132
evalin('base',fname) ;

I have gone through some of the older posts and found that a similar problem was addressed by someone else a while ago, but the reply suggests that the reason of the above error was unknown. Would you know what the problem is here by any chance. Thank you.

Regards,
Bouba

NB: the same data I send you previously applies here.
Attachments
GHHother.mod
(2.18 KiB) Downloaded 98 times
Bouba
 
Posts: 22
Joined: Thu Jul 01, 2010 9:28 pm

Re: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby Bouba » Mon Jul 05, 2010 11:36 pm

Please excuse the smile face in the above message, not sure how that got there.

Regards,
Bouba
Bouba
 
Posts: 22
Joined: Thu Jul 01, 2010 9:28 pm

Re: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby jpfeifer » Tue Jul 06, 2010 7:06 am

Your current problem is related to the beta-distribution. Its support is [0,1]. Hence, you cannot have
Code: Select all
omega, beta_pdf, 2.5, 0.05;

as the mean of 2.5 is outside of its support. Use another distribution like the inverse gamma.
Similarly, change
Code: Select all
beta, beta_pdf, 0.97, 0.002;

to
Code: Select all
beta, beta_pdf, 0.97, 0.1;

as your starting values otherwise seems not be contained in the prior.

Three more things:
1. When estimating the model with different parameters, the steady state changes as it is a function of the parameters. Hence you have to fix the steady state computation, i.e. the formulas:

Code: Select all
initval;
//k=log(0.567966);
//l=log(0.3610);
//h=log(0.251526);
//c=log(0.2196);

//%Alternatively I though that entering the ss equations (Pls see attached pdf) could help but it did not
h=(((1-beta)/beta*(omega/(omega-1)))^(1/omega));
k=((1-alpha)^(1/theta)*alpha^((alpha+theta)/((1-alpha)*theta))*h^((alpha*(1+theta)-omega*(alpha+theta))/(theta*(1-alpha))));
l=((1-alpha)^(1/(alpha+theta))*k^(alpha/(alpha+theta))*h^(alpha/(alpha+theta)));
c=(((k*h)^alpha)*l^(1-alpha)-(1/omega)*(h^omega)*k);
k=log(k);
l=log(l);
h=log(h);
c=log(c);
z=0;
e=0;
end;

2. Your model variabels are specified in logs by using exp(). So you don't need to specify loglinear in the estimation command. However, your data has to correspond to the variable definition. If h in the model is the logarithm of the capital utilization your data has to be the log of the observed capital utilization, too. So the last line of your data file should most probably look like
Code: Select all
h= log(data(:,1));

3. Why do you set
Code: Select all
mh_replic=0

if you want to do Bayesian estimation? Moreover, consider using
Code: Select all
mode_compute=6

if your Hessian is not positive semidefinite.
------------
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: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby Bouba » Tue Jul 06, 2010 12:25 pm

Dear jpfeifer,

Thank you for your useful insight and clarifications. I have implemented the changes you suggested and these prompted me to read on other relevant material on the matter. Though, when I run the mod file, I get the following errors:

STEADY: numerical initial values incompatible with the following equations
1

??? Error using ==> dynare_solve at 82
exiting ...

Error in ==> steady_ at 124
[oo_.steady_state,check] = dynare_solve([M_.fname '_static'],...

Error in ==> steady at 52
steady_;

Error in ==> GHHother at 116
steady;

Error in ==> dynare at 132
evalin('base',fname) ;


I have had a thorough look at my ss equations through Matlab and corrected for any parenthesis problem. These equations were obtained from the last pages of the attached pdf. Would you know please why this is happening?

Regards,
Bouba
Attachments
GHHother.mod
(1.96 KiB) Downloaded 98 times
GHH.pdf
(289.44 KiB) Downloaded 123 times
Bouba
 
Posts: 22
Joined: Thu Jul 01, 2010 9:28 pm

Re: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby jpfeifer » Tue Jul 06, 2010 6:21 pm

Your
Code: Select all
h=(((1-beta)/beta)*(omega/(omega-1))^(1/omega));
l=(1-alpha)^(1/(alpha+theta))*k^(alpha/(alpha+theta))*h^(alpha/(alpha+theta));
k=(1-alpha)^(1/theta)*alpha^((alpha+theta)/((1-alpha)*theta))*h^((alpha*(1+theta)-omega*(alpha+theta))/(theta*(1-alpha)));
c=((k*h)^alpha)*l^(1-alpha)-(1/omega)*(h^omega)*k;

uses k in line 2 before it is computed in line 3. Moreover, I thought the code I posted above works:

Code: Select all
initval;
h=(((1-beta)/beta*(omega/(omega-1)))^(1/omega));
k=((1-alpha)^(1/theta)*alpha^((alpha+theta)/((1-alpha)*theta))*h^((alpha*(1+theta)-omega*(alpha+theta))/(theta*(1-alpha))));
l=((1-alpha)^(1/(alpha+theta))*k^(alpha/(alpha+theta))*h^(alpha/(alpha+theta)));
c=(((k*h)^alpha)*l^(1-alpha)-(1/omega)*(h^omega)*k);
k=log(k);
l=log(l);
h=log(h);
c=log(c);
z=0;
e=0;
end;
------------
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: RegardingERROR: GHH.mod:59.1: syntax error, unexpected NAME

Postby Bouba » Wed Jul 07, 2010 11:45 am

Yes, you were right both codes actually work, the problem was that I had the term initval; twice. Thank you ever so much for all your help. Finally, I just have some questions regarding couple points I am not totally clear about:
1. We used under initial value the actual equations in the ss, as you said the changes in parameters would also mean that the ss values would change hence the rational of not using exact values here. This makes perfect sense to me. However, as you can see in the attached pdf the second model at 2.3 Estimation (starting page 4), the Authors use exact values under initial, why is this possible here please?
3. Am I right in saying that, when using the option
estimated_params;
for example in the case of gamma=2, the choice of where to start and where to end the distribution of the pdf i.e. 2.9,0.3; is arbitrary to some extent as I could have started with any value bigger than 2 and ended with any value smaller than 2. If this is the case, is there a rule of thumb one can follow?
3. I am looking to do some sensitivity analysis for my model. First can you please confirm that this amounts to experimenting with different parameters values, for example initially I have
beta = .96;
alpha = .29;
gamma= 2;
theta = .6;
omega= 1.42;
rho=.51;
sigma = .045;
I could have next
beta = .86;
alpha = .39;
gamma= 1.8;
etc..
And then check in each case if I get the same posterior mean. I will be doing all this while keeping the following unchanged:
estimated_params;
stderr e,inv_gamma_pdf, 0.95,inf;
gamma,inv_gamma_pdf,2.9,0.3;
beta, beta_pdf, 0.97, 0.1;
alpha, beta_pdf, 0.31, 0.02;
rho, beta_pdf, 0.7, 0.02;
omega, inv_gamma_pdf, 2.5, 0.05;
sigma, normal_pdf, 0.3, 0.005;
end;

If this is what the sensitivity analysis amount to, could you please tell me how one can best edit the option
estimation(datafile=data,nobs=140,mh_replic=10000,mh_nblocks=5,mode_compute=6, mh_jscale=0.8);
just to get the information needed, in this case the posterior mean, would it be sensible to set mh_replic=0 during the sensitivity analysis?
And Finally
4. Looking at my result, I found that the prior mean for gamma was 2 while the posterior mean was around 9. Obviously this is not good news, as the posterior mean should be very close to the prior mean. Would increasing the number of mh_replic help with this issue, or is there another more efficient solution to this problem?

NB: is there any article or website you can refer me to on how to interpret in general the output produced by dynare for Bayesian estimation i.e. how do I interpret the Brooks and Gelman (1998) diagnostic, I know that this provide a condition for convergence but what does the graph means i.e. what's a good graph and what's a bad graph.

Many thanks.

Regards
Bouba
Attachments
Practicing Dynare.PDF
(413.61 KiB) Downloaded 112 times
Bouba
 
Posts: 22
Joined: Thu Jul 01, 2010 9:28 pm

Next

Return to Dynare help

Who is online

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