Page 1 of 1

Error in computing likelihood for initial parameter values

PostPosted: Fri Apr 04, 2014 12:32 am
by donald.ma
Hi,I am a new learner. When I try estimated a model ,dynare warned me the error:

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

The rank conditions ISN'T verified!


You did not declare endogenous variables after the estimation/calib_smoother command.
Loading 36 observations from lindata.xls

Error in computing likelihood for initial parameter values
Error using print_info (line 43)
Blanchard Kahn conditions are not satisfied: indeterminacy
Error in initial_estimation_checks (line 69)
print_info(info, DynareOptions.noprint)
Error in dynare_estimation_1 (line 169)
oo_ = initial_estimation_checks(objective_function,xparam1,dataset_,M_,estim_params_,options_,bayestopt_,oo_);
Error in dynare_estimation (line 70)
dynare_estimation_1(var_list,dname);
Error in lin (line 395)
dynare_estimation(var_list_);
Error in dynare (line 120)
evalin('base',fname) ;

what should I do next? Thank you for your help.I attached my codes and data file here.

Re: Error in computing likelihood for initial parameter valu

PostPosted: Fri Apr 04, 2014 8:31 am
by jpfeifer
You have to fix your model for simulation first. That the Blanchard-Kahn conditions are violated suggests a timing error. The model_diagnostics provides a hint:
The following endogenous variables aren't present at the current period in the model:
var_epi

Re: Error in computing likelihood for initial parameter valu

PostPosted: Wed Apr 16, 2014 11:37 pm
by donald.ma
jpfeifer wrote:You have to fix your model for simulation first. That the Blanchard-Kahn conditions are violated suggests a timing error. The model_diagnostics provides a hint:
The following endogenous variables aren't present at the current period in the model:
var_epi

thank you for you advise. I will try it again.

Re: Error in computing likelihood for initial parameter valu

PostPosted: Wed Apr 16, 2014 11:51 pm
by donald.ma
jpfeifer wrote:You have to fix your model for simulation first. That the Blanchard-Kahn conditions are violated suggests a timing error. The model_diagnostics provides a hint:
The following endogenous variables aren't present at the current period in the model:
var_epi

by the way,where can I see the hint in the program?

Re: Error in computing likelihood for initial parameter valu

PostPosted: Thu Apr 17, 2014 1:16 am
by donald.ma
I fix my program. There are still a problem.

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

The rank conditions ISN'T verified!


You did not declare endogenous variables after the estimation/calib_smoother command.
Loading 36 observations from lindata.xls

Error in computing likelihood for initial parameter values
Error using print_info (line 43)
Blanchard Kahn conditions are not satisfied: indeterminacy
Error in initial_estimation_checks (line 69)
print_info(info, DynareOptions.noprint)
Error in dynare_estimation_1 (line 169)
oo_ = initial_estimation_checks(objective_function,xparam1,dataset_,M_,estim_params_,options_,bayestopt_,oo_);
Error in dynare_estimation (line 70)
dynare_estimation_1(var_list,dname);
Error in lin (line 436)
dynare_estimation(var_list_);
Error in dynare (line 120)
evalin('base',fname) ;
>>

what should i do next? thank you very much.

Re: Error in computing likelihood for initial parameter valu

PostPosted: Thu Apr 17, 2014 10:26 am
by jpfeifer
Typically, this is a timing issue. Check your model. As you are the only one knowing your model, the forum will not provide help here.

Given the size of your model, start from a stripped down easier version and make sure that one runs before expanding it again.

Re: Error in computing likelihood for initial parameter valu

PostPosted: Fri Apr 18, 2014 12:17 am
by donald.ma
jpfeifer wrote:Typically, this is a timing issue. Check your model. As you are the only one knowing your model, the forum will not provide help here.

Given the size of your model, start from a stripped down easier version and make sure that one runs before expanding it again.


thank you very much. I have checked my model ,and solve this problem.

And another problem:

"Error using chol
Matrix must be positive definite."

I solove this problem by add "mode_compute=6". If someoneelse have the same problem, you can solve it like me . I write here to help somebody else.

Thank you for your help again, you do not know what a fave you do for me.

by the way,"The following endogenous variables aren't present at the current period in the model:
var_epi",how can you find this? by examing the model, or there is a way by DYNARE?

Re: Error in computing likelihood for initial parameter valu

PostPosted: Fri Apr 18, 2014 10:35 am
by jpfeifer
See the manual for
model_diagnostics

Re: Error in computing likelihood for initial parameter valu

PostPosted: Tue Jun 03, 2014 4:28 am
by RMB
Hi,

I'm newer here. I have a problem with my code - I'm trying to write the code for chapter 3 of Gali 2008, but I'm having successful.
Here my problems:

dynare gali2008.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.2.5).
Starting preprocessing of the model file ...
Found 17 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.

Warning: usage: [bnds,rowd,sens,rowp,rowg] = mu(matin,blk,opt)
> In mu at 45
In gali2008 at 171
In dynare at 120
Error in ==> mu at 44
if nargin < 1 | nargin > 4

??? Output argument "bnds" (and maybe others) not assigned during call to
"/Applications/MATLAB_R2009b.app/toolbox/robust/rctobsolete/mutools/commands/mu.m>mu".

Error in ==> gali2008 at 171
M_.params( 15 ) =
(-((1-M_.params(4))*(mu-log(1-M_.params(4)))))/(M_.params(4)+(1-M_.params(4))*M_.params(1)+M_.params(2));

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

I'm sending the code for anyone that want to help see and give me a hint.

Thanks a lot.

Re: Error in computing likelihood for initial parameter valu

PostPosted: Tue Jun 03, 2014 6:26 am
by jpfeifer
See Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf, Remark 3 (Variable Naming in Matlab and Dynare).
The naming of the parameter with mu conflicts with Matlab. Also see https://sites.google.com/site/pfeiferecon/Gali2008_chapter3.mod

Re: Error in computing likelihood for initial parameter valu

PostPosted: Wed Jun 04, 2014 8:19 am
by RMB
jpfeifer wrote:See Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf, Remark 3 (Variable Naming in Matlab and Dynare).
The naming of the parameter with mu conflicts with Matlab. Also see https://sites.google.com/site/pfeiferecon/Gali2008_chapter3.mod


Thanks, Pfeiter. Your material is awesome, I will review in a good moment, as soon as possible.
Your hint works to me, the naming mu wasn't good and so I renamed to mi.
But I still have problems with B-K conditions. I organized better my equations, included more than Gali2008_chapter3.mod (also, I included more variables, as wages, prices and prices that "maximized the market value of profits..."as described in Gali (2008, 44) - pstar.

I think I am adding some no necessary equation in place of a really necessary equation, but I don't see what, and a better way is understand better what Matlab is saying with:

>> dynare gali2008rev

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.5).
Starting preprocessing of the model file ...
Found 15 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
Processing outputs ...done
Preprocessing completed.
Starting MATLAB/Octave computing.


STEADY-STATE RESULTS:

y -0.195929
c -0.195929
n -0.293893
w 0.510178
p 1
i 0.0100503
pi 0
a 0
pstar 1
m 0.76387
yn -0.195929
rn 0.0100503
v 0
ytil 0
rreal 0.0100503

EIGENVALUES:
Modulus Real Imaginary

0 0 0
0.5 0.5 0
0.9 0.9 0
1 1 0
1.153 1.132 0.2197
1.153 1.132 -0.2197
Inf Inf 0


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

The rank conditions ISN'T verified!

??? Error using ==> print_info at 43
Blanchard Kahn conditions are not satisfied: indeterminacy

Error in ==> stoch_simul at 71
print_info(info, options_.noprint);

Error in ==> gali2008rev at 218
info = stoch_simul(var_list_);

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

The part of:
"There are 3 eigenvalue(s) larger than 1 in modulus
for 4 forward-looking variable(s)

The rank conditions ISN'T verified!

??? Error using ==> print_info at 43
Blanchard Kahn conditions are not satisfied: indeterminacy"

is not clear to me, where I have to look for?
I am attaching a new file again.

Thank you very much for your reply.

Re: Error in computing likelihood for initial parameter valu

PostPosted: Fri Jun 06, 2014 6:26 pm
by jpfeifer
You cannot consider wages, money demand and prices.
The reason is that under an interest rate rule nominal prices are indeterminate. You can determine relative prices but not the nominal ones. Hence, you can determine the real wage (w-p) and real money balances (m-p) but not their individual components.