Error message for 2nd order approximation

As Dynare 4 is now the main version, this forum is now closed. Please, post
on the Dynare Help forum
Forum rules
As Dynare 4 is the current Dynare version, there forum is now close. Post new question in the Dynare Help Forum.

Error message for 2nd order approximation

Postby lombard » Wed Nov 19, 2008 11:25 am

Hi,

I couldn't find any related QA in the forum (I searched Gamma_y{nar+2})

The problem is that Dynare (4.0.2) crashes with the message

??? Assignment has more non-singleton rhs dimensions than non-singleton
subscripts

Error in ==> th_autocovariances at 131
Gamma_y{nar+2}(:,i) = abs(diag(aa*vx1*aa'+b2(:,i)*b2(:,i)'))./vv;

Error in ==> disp_th_moments at 38
[oo_.gamma_y,ivar] = th_autocovariances(dr,ivar,M_,options_);

Error in ==> stoch_simul at 69
disp_th_moments(oo_.dr,var_list);

Error in ==> trade_optimal at 699
info = stoch_simul(var_list_);

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

My options are

options_.irf=0;
options_.order=2;
options_.periods=0;
options_.nograph=1;
options_.noprint=1;
options_.nomoments=0;
options_.steadystate_flag=0;
options_.nocorr=1;
stoch_simul u,c;


where u and c are two existing variables.

If I set options_nomoments=1, then Dynare computes the solution and I can compute the moments out of the (second order) state-space representation.

Any idea about what could cause this crash?

Thanks and regards

Gianni
lombard
 
Posts: 132
Joined: Wed Feb 02, 2005 12:36 pm
Location: Basel

Re: Error message for 2nd order approximation

Postby lombard » Wed Nov 19, 2008 3:26 pm

I found where the problem originated.
At about line 84 of th_autocovariances.m you find the block
Code: Select all
    [vx, u] =  lyapunov_symm(A,B*M_.Sigma_e*B',options_.qz_criterium);
    iky = iv(ivar);
    if ~isempty(u)
      iky = iky(find(all(abs(ghx(iky,:)*u) < options_.Schur_vec_tol,2)));
      ivar = dr.order_var(iky);
    end


What happens is that lyapunov_symm returns a 'u' matrix that in the position of the selected variable (i.e. the variable(s) listed after stoch_simul) has some values that violate the Schur_vec_tol. It then returns an empty iky vector, which will produce an ivar empty vector etc.

Notice though that if I don't list any variable after stoch_simul, Dynare returns a solution. with numeric (second order) constant term and numeric correction, although the mean vector is NaN.
Furthermore, as mentioned in the previous message in this thread, I can compute the (conditional and unconditional) mean of the variables to second order using the state-space solution that Dynare provides even in the buggy case.

The source of the problem seem to be the existence of a unit root in some (not all) variables.

I think that if this is correct a warning message in the block quoted above would be very much appreciated :D

Cheers

Gianni
lombard
 
Posts: 132
Joined: Wed Feb 02, 2005 12:36 pm
Location: Basel


Return to Dynare version 4

Who is online

Users browsing this forum: No registered users and 2 guests