Page 1 of 1

Problem with analytic_derivation

PostPosted: Fri Nov 09, 2012 8:24 pm
by glucke
Hello,

I have problem with analytic_derivation calculation. I use dynare 4.3.1, matlab 7.3.0.267.

I have following error message:
??? Error using ==> mtimes
Input arguments must be 2-D.

Error in ==> sylvester3 at 16
d=qq*d*u;

Error in ==> getH at 428
xx=sylvester3(a,b,c,d);

Error in ==> dsge_likelihood at 495
[dum, DT, DOm, DYss] = getH(A, B, Model,DynareResults,DynareOptions,kron_flag,indparam,indexo,iv);

Error in ==> sfd at 50
[dummy,v(:)] = feval(funfcn{3},x,varargin{:});

Error in ==> sfminbx at 193
H = sfd(x,g,Hstr,group,[],DiffMinChange,DiffMaxChange,funfcn,varargin{:});

Error in ==> fminunc at 288
[x,FVAL,LAMBDA,EXITFLAG,OUTPUT,GRAD,HESSIAN] = sfminbx(funfcn,x,l,u, ...

Error in ==> dynare_estimation_1 at 212
[xparam1,fval,exitflag] = fminunc(objective_function,xparam1,optim_options,dataset_,options_,M_,estim_params_,bayestopt_,oo_);

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

Error in ==> model_D7 at 1807
dynare_estimation(var_list_);

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


Matrix "d" has 3 dimension (within sylvester3 or getH). My version of matlab don't understand what is product of 2D matrix with 3D matrix. I don't understand what should be result of such product too. Could you help me to understand what result should be?

Re: Problem with analytic_derivation

PostPosted: Sun Nov 11, 2012 1:29 am
by jonathanb
Only works for stationary models without missing observations.

Re: Problem with analytic_derivation

PostPosted: Sun Nov 11, 2012 9:57 am
by glucke
As I understand, it's not a problem of missing observation. Code of getH function creates 3D matrix. Code of sylvester3 tries to make product of this matrix and always think that d is 2D matrix.

Code: Select all
    elem = zeros(m,m,param_nbr);
    d = elem;
    for j=1:param_nbr,
        elem(:,:,j) = (Dg0(:,:,j)-Dg1(:,:,j)*A);
        d(:,:,j) = Dg2(:,:,j)-elem(:,:,j)*A;
    end
    xx=sylvester3(a,b,c,d);


Is correct idea of following understanding?
Code: Select all
    for j=1:param_nbr,
        elem(:,:,j) = (Dg0(:,:,j)-Dg1(:,:,j)*A);
        d(:,:,j) = Dg2(:,:,j)-elem(:,:,j)*A;
        xx(:,:,j)=sylvester3(a,b,c,d);
    end

Re: Problem with analytic_derivation

PostPosted: Sun Nov 11, 2012 11:20 am
by jpfeifer
Could you post the mod-file

Re: Problem with analytic_derivation

PostPosted: Tue Nov 13, 2012 4:35 pm
by glucke
I'm sorry for delay. This model isn't finished.