Index exceeds matrix dimensions??

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.

Index exceeds matrix dimensions??

Postby adi199283 » Thu Sep 04, 2014 3:20 pm

Dear all, the errors of my program are as follow:
Error in dsge_likelihood (line 301)
constant = SteadyState(BayesInfo.mfys);

Error in initial_estimation_checks (line 47)
[fval,junk1,junk2,a,b,c,d] =
feval(objective_function,xparam1,DynareDataset,DynareOptions,Model,EstimatedParameters,BayesInfo,DynareResults);

Error in dynare_estimation_1 (line 179)
oo_ =
initial_estimation_checks(objective_function,xparam1,dataset_,M_,estim_params_,options_,bayestopt_,oo_);

Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);

Error in v0903 (line 392)
dynare_estimation(var_list_);

Error in dynare (line 180)
evalin('base',fname) ;

I see similar topic in the forum and try to modify my intial value or mode_compute=6 but it still fails.
Does anyone has any idea about it ?
Thanks!!
Attachments
v0903.mod
(3.39 KiB) Downloaded 90 times
newone2.xls
(26.5 KiB) Downloaded 95 times
adi199283
 
Posts: 25
Joined: Sun May 11, 2014 12:31 pm

Re: Index exceeds matrix dimensions??

Postby jpfeifer » Thu Sep 04, 2014 3:42 pm

Your model is wrong. It is not linear. See Remark 2 (Using stoch_simul before Estimation) in 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.
------------
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: Index exceeds matrix dimensions??

Postby adi199283 » Thu Sep 04, 2014 4:11 pm

jpfeifer wrote:Your model is wrong. It is not linear. See Remark 2 (Using stoch_simul before Estimation) in 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.

Thank you for your advice. I try to incorporate the command in remark 2 into my model. Then, when I run the progarm, it says:

Undefined function or variable 'M_'.

Error in v0903 (line 372)
oo_.dr.eigval = check(M_,options_,oo_);

Error in dynare (line 180)
evalin('base',fname) ;
adi199283
 
Posts: 25
Joined: Sun May 11, 2014 12:31 pm

Re: Index exceeds matrix dimensions??

Postby adi199283 » Thu Sep 04, 2014 4:25 pm

jpfeifer wrote:Your model is wrong. It is not linear. See Remark 2 (Using stoch_simul before Estimation) in 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.

By the way, could you please tell me why the model is not linear. I think I have finished the first order linearization.
Thanks!!
adi199283
 
Posts: 25
Joined: Sun May 11, 2014 12:31 pm

Re: Index exceeds matrix dimensions??

Postby jpfeifer » Thu Sep 04, 2014 7:39 pm

Always post the update files to replicate the problem. Your model is not linear, because when you put
Code: Select all
resid(1);

your equations have non-zero residuals although all variables are initialized at 0. Thus, your linearization must be wrong. My guess is that you made an error in the definition of the exogenous processes that are now mean 1 or something like that instead of mean 0.
------------
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: Index exceeds matrix dimensions??

Postby adi199283 » Fri Sep 05, 2014 12:33 am

jpfeifer wrote:Always post the update files to replicate the problem. Your model is not linear, because when you put
Code: Select all
resid(1);

your equations have non-zero residuals although all variables are initialized at 0. Thus, your linearization must be wrong. My guess is that you made an error in the definition of the exogenous processes that are now mean 1 or something like that instead of mean 0.



Dear Pfeifer,
I use the resid(1) command and correct the non-zero mistake. But other problems sitll exist. When I run the program, it says
Undefined function or variable 'M_'.

Error in v0903 (line 347)
oo_.dr.eigval = check(M_,options_,oo_);

Error in dynare (line 180)
evalin('base',fname) ;
Attachments
newone2.xls
(26.5 KiB) Downloaded 90 times
v0903.mod
(3.38 KiB) Downloaded 86 times
adi199283
 
Posts: 25
Joined: Sun May 11, 2014 12:31 pm

Re: Index exceeds matrix dimensions??

Postby jpfeifer » Fri Sep 05, 2014 6:55 am

Please use the most recent Dynare version. There I get a different error. The problem still is that
Code: Select all
//%15rr=rhopai*pai+rhoy*y+eps_r;
exp(rr)=exp(pai^rhopai)*exp(y^rhoy)*exp(eps_r);

is clearly not linear.
------------
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: Index exceeds matrix dimensions??

Postby adi199283 » Fri Sep 05, 2014 12:21 pm

jpfeifer wrote:Please use the most recent Dynare version. There I get a different error. The problem still is that
Code: Select all
//%15rr=rhopai*pai+rhoy*y+eps_r;
exp(rr)=exp(pai^rhopai)*exp(y^rhoy)*exp(eps_r);

is clearly not linear.


Hi. I have correct the mistake you mention and I use dynare 4.4.3.
After running the program, the problem is still:
Undefined function or variable 'M_'.

Error in v0905 (line 342)
oo_.dr.eigval = check(M_,options_,oo_);

Error in dynare (line 180)
evalin('base',fname) ;
Attachments
newone2.xls
(26.5 KiB) Downloaded 100 times
v0905.mod
(2.9 KiB) Downloaded 81 times
adi199283
 
Posts: 25
Joined: Sun May 11, 2014 12:31 pm

Re: Index exceeds matrix dimensions??

Postby jpfeifer » Fri Sep 05, 2014 12:26 pm

There must be a problem with your installation of Dynare. I get
EIGENVALUES:
Modulus Real Imaginary

1.826e-17 -1.826e-17 0
1.996e-17 1.996e-17 0
0.75 0.75 0
0.75 0.75 0
0.75 0.75 0
0.9917 0.9916 0.01513
0.9917 0.9916 -0.01513
1.232 1.232 0
Inf Inf 0
Inf Inf 0


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

The rank condition ISN'T verified!

Error using print_info (line 42)
Blanchard Kahn conditions are not satisfied: no stable equilibrium

Error in stoch_simul (line 98)
print_info(info, options_.noprint, options_);

Error in v0905 (line 344)
info = stoch_simul(var_list_);

Error in dynare (line 180)
evalin('base',fname) ;
------------
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: Index exceeds matrix dimensions??

Postby adi199283 » Fri Sep 05, 2014 12:55 pm

jpfeifer wrote:There must be a problem with your installation of Dynare. I get
EIGENVALUES:
Modulus Real Imaginary

1.826e-17 -1.826e-17 0
1.996e-17 1.996e-17 0
0.75 0.75 0
0.75 0.75 0
0.75 0.75 0
0.9917 0.9916 0.01513
0.9917 0.9916 -0.01513
1.232 1.232 0
Inf Inf 0
Inf Inf 0


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

The rank condition ISN'T verified!

Error using print_info (line 42)
Blanchard Kahn conditions are not satisfied: no stable equilibrium

Error in stoch_simul (line 98)
print_info(info, options_.noprint, options_);

Error in v0905 (line 344)
info = stoch_simul(var_list_);

Error in dynare (line 180)
evalin('base',fname) ;


Oh, thank you so much.
How should I deal with this problem. Is the only thing I can do is to change the initial value?
Does it work if I change the way that compute the steady state?
adi199283
 
Posts: 25
Joined: Sun May 11, 2014 12:31 pm

Re: Index exceeds matrix dimensions??

Postby jpfeifer » Fri Sep 05, 2014 1:12 pm

Search the forum on this. Typically, the timing of the variables in incorrect. See e.g. http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5797
------------
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: Index exceeds matrix dimensions??

Postby adi199283 » Fri Sep 05, 2014 2:10 pm

jpfeifer wrote:Search the forum on this. Typically, the timing of the variables in incorrect. See e.g. http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5797

Thank you very much. I will try.
By the way, do you know how to use the command model_info? The reference says that "this command can only be used in conjunction with the block option of the model block"
But when I try this, it fails.
model(linear);
model_info('EVALUATE FORWARD');
adi199283
 
Posts: 25
Joined: Sun May 11, 2014 12:31 pm

Re: Index exceeds matrix dimensions??

Postby adi199283 » Fri Sep 05, 2014 2:28 pm

jpfeifer wrote:Search the forum on this. Typically, the timing of the variables in incorrect. See e.g. http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5797

Sorry to bother you. I have come to realize how to use this command. Thx.
adi199283
 
Posts: 25
Joined: Sun May 11, 2014 12:31 pm

Re: Index exceeds matrix dimensions??

Postby adi199283 » Wed Sep 10, 2014 6:41 am

jpfeifer wrote:Search the forum on this. Typically, the timing of the variables in incorrect. See e.g. http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5797

Dear Pfeifer,
Sorry to disturb you again. Despite of some modification, problems still exist in my mod file. Does it mean that the qz decomposition condition is not satisfied?
ans =

1 2 3

??? Index exceeds matrix dimensions.

Error in ==> dr_block at 277
temp = sorted_roots(nd-nba+1:nd-nyf)-1-options_.qz_criterium;

Error in ==> resol at 143
[dr,info,M_,options_,oo_] = dr_block(dr,check_flag,M_,options_,oo_);

Error in ==> stoch_simul at 66
[oo_.dr, info] = resol(oo_.steady_state,0);

Error in ==> v0906 at 507
info = stoch_simul(var_list_);

Error in ==> dynare at 132
evalin('base',fname) ;
Attachments
v0906.mod
(3.14 KiB) Downloaded 86 times
newone2.xls
(26.5 KiB) Downloaded 96 times
adi199283
 
Posts: 25
Joined: Sun May 11, 2014 12:31 pm

Re: Index exceeds matrix dimensions??

Postby jpfeifer » Wed Sep 10, 2014 7:22 am

The Blanchard-Kahn conditions are not satisfied. The crash is due to a bug. For generating the correct error message, replace the original Dynare 4.4.3 file with the attached one.
Attachments
dr_block.m
(30.45 KiB) Downloaded 115 times
------------
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

Next

Return to Dynare help

Who is online

Users browsing this forum: No registered users and 11 guests