Problem with analytic_derivation

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.

Problem with analytic_derivation

Postby glucke » Fri Nov 09, 2012 8:24 pm

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?
Sorry for my English. I'm from Russia.
glucke
 
Posts: 31
Joined: Sun Apr 01, 2007 6:43 pm

Re: Problem with analytic_derivation

Postby jonathanb » Sun Nov 11, 2012 1:29 am

Only works for stationary models without missing observations.
jonathanb
 
Posts: 54
Joined: Wed Sep 17, 2008 8:52 pm
Location: New York

Re: Problem with analytic_derivation

Postby glucke » Sun Nov 11, 2012 9:57 am

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
Sorry for my English. I'm from Russia.
glucke
 
Posts: 31
Joined: Sun Apr 01, 2007 6:43 pm

Re: Problem with analytic_derivation

Postby jpfeifer » Sun Nov 11, 2012 11:20 am

Could you post the mod-file
------------
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: Problem with analytic_derivation

Postby glucke » Tue Nov 13, 2012 4:35 pm

I'm sorry for delay. This model isn't finished.
Attachments
data_USA2_75_12Q2.rar
(30.39 KiB) Downloaded 73 times
model_D7_steadystate.m
(40.9 KiB) Downloaded 74 times
model_D7.mod
(120.45 KiB) Downloaded 78 times
Sorry for my English. I'm from Russia.
glucke
 
Posts: 31
Joined: Sun Apr 01, 2007 6:43 pm


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 5 guests