Page 1 of 2

What's this?

PostPosted: Fri Oct 12, 2012 4:35 am
by sunrain
Any one can help fix this?
"
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.2.0).
Starting preprocessing of the model file ...
ERROR: riksbankmodel1.mod:116.34: syntax error, unexpected ';'

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

Lots thanks!

Re: What's this?

PostPosted: Fri Oct 12, 2012 9:31 pm
by jpfeifer
It says there is a problem in line 116, column 34. Maybe there is a missing bracket.

Re: What's this?

PostPosted: Tue Oct 16, 2012 2:29 am
by sunrain
dear jpfeifer,

Yes, you are right. I fixed it.

Thank you very much indeed!

Lixin

Re: What's this?

PostPosted: Tue Oct 16, 2012 2:35 am
by sunrain
Dear Jpfeifer,

Thanks a lot first.

When I run my code(riksbank model by Adolfson et al (2005), the following errors took place:
Starting Dynare ...
Starting preprocessing of the model file ...
65 equation(s) found
Processing derivation ...
Processing Order 1... done
Processing Order 2... done
Processing outputs ...
Preprocessing completed.
Starting Matlab computing ...

??? Error using ==> lnsrch1 at 53
Some element of Newton direction isn't finite. Jacobian maybe singular or there is a problem with initial values

Error in ==> solve1 at 126
[x,f,fvec,check]=lnsrch1(xold,fold,g,p,stpmax,func,j1,j2,varargin{:});

Error in ==> dynare_solve at 110
[x,info]=solve1(func,x,j1(r(i):r(i+1)-1),j2(r(i):r(i+1)-1),jacobian_flag,varargin{:});

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

Error in ==> steady at 52
steady_;

Error in ==> riksbankmodel1 at 736
steady;

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

Could you give me some advice?

Thanks!

Lixin

Re: What's this?

PostPosted: Fri Oct 19, 2012 2:17 pm
by jpfeifer
Enter the steady state manually. And check for errors in the code.

Re: What's this?

PostPosted: Sat Oct 20, 2012 8:50 am
by sunrain
jpfeifer wrote:Enter the steady state manually. And check for errors in the code.


Dear Jpferier,

Thanks!
I did enter the steady state annually, but how to check the error?
The code is attached. Please give me some advice!

Thank you very much indeed!

Best

Lixin

Re: What's this?

PostPosted: Sat Oct 20, 2012 10:07 pm
by jpfeifer
But with the posted model, Dynare says
ERROR: There are 86 equations but 95 endogenous variables!

Re: What's this?

PostPosted: Sun Oct 21, 2012 5:57 pm
by donihue
As a follow-up to this, the following endogenous variables are not determined by the model's equations:
wbar, h, pid, pfaiz, v, gamf, rstar, ystar, pistar

Regards
Donihue

Re: What's this?

PostPosted: Mon Oct 22, 2012 3:39 am
by sunrain
jpfeifer wrote:But with the posted model, Dynare says
ERROR: There are 86 equations but 95 endogenous variables!


Dear Jpfeifer,

Thanks. I got my problem.
Thank you very much indeed!

Best

Lixin

Re: What's this?

PostPosted: Mon Oct 22, 2012 3:42 am
by sunrain
donihue wrote:As a follow-up to this, the following endogenous variables are not determined by the model's equations:
wbar, h, pid, pfaiz, v, gamf, rstar, ystar, pistar

Regards
Donihue


Dear Donihue,

Thanks for your kind help!
I will check my code in detail following up to your reminders.

Best

Lixin

Re: What's this?

PostPosted: Tue Oct 23, 2012 2:51 am
by sunrain
Dear Jpferier,

Thanks for your help.
When I run another version of RIKSBANK Open DSGE model, I met the following errors:

"ERROR: ea_sr07try.mod:20.1-10: syntax error, unexpected PARAMETERS"

but all parameters are defined and used later?

Could you give me a hand?

P.S: "//Y=C+I;" is a comment or an equation?

Best

Lixin

Re: What's this?

PostPosted: Tue Oct 23, 2012 7:11 am
by jpfeifer
The // indicates a parameter. Check if there is a semicolon at the end of line 19.

Re: What's this?

PostPosted: Tue Oct 23, 2012 8:40 am
by sunrain
jpfeifer wrote:The // indicates a parameter. Check if there is a semicolon at the end of line 19.


Dear Jpfeifer,

Thanks! I got it and fixed it.
Thank you very much indeed!

Best

Lixin

Re: What's this?

PostPosted: Wed Oct 24, 2012 3:42 am
by sunrain
jpfeifer wrote:But with the posted model, Dynare says
ERROR: There are 86 equations but 95 endogenous variables!


Dear Jpfeifer,

Thanks for your help.
I modified my code and it met the condition. but another problem occured when I ran the code as:
"...

The rank condition is verified.

Improvement on iteration 43 = 0.000000000
improvement < crit termination
Objective function at mode: -1899.896983

POSTERIOR KERNEL OPTIMIZATION PROBLEM!
(minus) the hessian matrix at the "mode" is not positive definite!
=> posterior variance of the estimated parameters are not positive.
You should try to change the initial values of the parameters using
the estimated_params_init block, or use another optimization routine.
Warning: The results below are most likely wrong!
> In dynare_estimation_1 at 433
In dynare_estimation at 70
In riksbankdsgewithoutvartry at 979
In dynare at 120


Log data density [Laplace approximation] is 1636.059824.

Warning: BETAINV did not converge for a = 77.7331, b = 0.62688, p = 1.
> In betainv at 109
In prior_bounds at 85
In dynare_estimation_1 at 866
In dynare_estimation at 70
In riksbankdsgewithoutvartry at 979
In dynare at 120
Warning: File 'riksbankdsgewithoutvartry/metropolis' not found.
> In CheckPath at 41
In metropolis_hastings_initialization at 62
In random_walk_metropolis_hastings at 69
In dynare_estimation_1 at 884
In dynare_estimation at 70
In riksbankdsgewithoutvartry at 979
In dynare at 120
??? Error using ==> chol
Matrix must be positive definite.

Error in ==> metropolis_hastings_initialization at 68
d = chol(vv);

Error in ==> random_walk_metropolis_hastings at 69
[ ix2, ilogpo2, ModelName, MhDirectoryName, fblck, fline, npar, nblck, nruns, NewFile, MAX_nruns, d ] = ...

Error in ==> dynare_estimation_1 at 884
feval(options_.posterior_sampling_method,objective_function,options_.proposal_distribution,xparam1,invhess,bounds,dataset_,options_,M_,estim_params_,bayestopt_,oo_);

Error in ==> dynare_estimation at 70
dynare_estimation_1(var_list,dname);

Error in ==> riksbankdsgewithoutvartry at 979
dynare_estimation(var_list_);

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

Could you provide some suggestions?

Thanks a lot!

Best

Lixin

Re: What's this?

PostPosted: Wed Oct 24, 2012 6:25 pm
by jpfeifer
This is a common problem discussed in the forum. Search for solutions. See e.g.
Code: Select all
http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=2580