Cosmetic changes + Copyright headers fixes.
parent
b933a440bf
commit
c4f1958690
|
@ -58,7 +58,7 @@ function [alphahat,etahat,epsilonhat,ahat,SteadyState,trend_coeff,aK,T,R,P,PK,de
|
|||
% SPECIAL REQUIREMENTS
|
||||
% None
|
||||
|
||||
% Copyright (C) 2006-2017 Dynare Team
|
||||
% Copyright (C) 2006-2018 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
|
|
@ -30,7 +30,7 @@ function [Pstar,Pinf] = compute_Pinf_Pstar(mf,T,R,Q,qz_criterium, restrict_colum
|
|||
% SPECIAL REQUIREMENTS
|
||||
% None
|
||||
|
||||
% Copyright (C) 2006-2017 Dynare Team
|
||||
% Copyright (C) 2006-2018 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
@ -52,8 +52,6 @@ if nargin == 6
|
|||
indx = restrict_columns;
|
||||
indx0=find(~ismember([1:np],indx));
|
||||
else
|
||||
% indx=(find(max(abs(T))>0));
|
||||
% indx0=(find(max(abs(T))==0));
|
||||
indx=(find(max(abs(T))>=1.e-10));
|
||||
indx0=(find(max(abs(T))<1.e-10));
|
||||
end
|
||||
|
@ -62,7 +60,7 @@ Tbkp = T;
|
|||
T0=T(indx0,indx); % static variables vs. dynamic ones
|
||||
R0=R(indx0,:); % matrix of shocks for static variables
|
||||
|
||||
% perform Kitagawa transformation only for non-zero columns of T
|
||||
% Perform Kitagawa transformation only for non-zero columns of T
|
||||
T=T(indx,indx);
|
||||
R=R(indx,:);
|
||||
np = size(T,1);
|
||||
|
@ -117,15 +115,14 @@ end
|
|||
|
||||
if np0
|
||||
ST1=ST;
|
||||
|
||||
% now I recover stationarized static variables
|
||||
% using
|
||||
% ss = s-A*z and
|
||||
% Now I recover stationarized static variables using
|
||||
% ss = s-A*z
|
||||
% and
|
||||
% z-z(-1) (growth rates of unit roots) only depends on stationary variables
|
||||
Pstar = blkdiag(zeros(np0),Pstar);
|
||||
ST = [zeros(length(Pstar),length(indx0)) [T0*QT ;ST]];
|
||||
R1 = [R0; R1];
|
||||
% build the matrix for stationarized variables
|
||||
% Build the matrix for stationarized variables
|
||||
STinf = ST(np0+1:np0+nk,np0+1:np0+nk);
|
||||
iSTinf = inv(STinf);
|
||||
ST0=ST;
|
||||
|
@ -136,21 +133,15 @@ if np0
|
|||
ST0(1:np0,np0+nk+1:end) = ST(1:np0,np0+nk+1:end)-ST00*(iSTinf*ST(np0+1:np0+nk,np0+nk+1:end)); % snip non-stationary part
|
||||
R10 = R1;
|
||||
R10(1:np0,:) = R1(1:np0,:)-ST00*(iSTinf*R1(np0+1:np0+nk,:)); % snip non-stationary part
|
||||
|
||||
% kill non-stationary part before projecting Pstar
|
||||
% Kill non-stationary part before projecting Pstar
|
||||
ST0(np0+1:np0+nk,:)=0;
|
||||
R10(np0+1:np0+nk,:)=0; % is this questionable???? IT HAS TO in order to match Michel's version!!!
|
||||
|
||||
% project Pstar onto static x
|
||||
Pstar = ...
|
||||
ST0*Pstar*ST0'+ ...
|
||||
R10*Q*R10';
|
||||
|
||||
Pstar = ST0*Pstar*ST0'+R10*Q*R10';
|
||||
% QT(1:np0,np0+1:np0+nk) = QT(1:np0,np0+1:np0+nk)+ST(1:np0,np0+1:np0+nk); %%% is this questionable ????
|
||||
% reorder QT entries
|
||||
else
|
||||
STinf = ST(np0+1:np0+nk,np0+1:np0+nk);
|
||||
|
||||
end
|
||||
|
||||
% stochastic trends with no influence on observed variables are
|
||||
|
|
|
@ -115,7 +115,7 @@ function [fval,info,exit_flag,DLIK,Hess,SteadyState,trend_coeff,Model,DynareOpti
|
|||
%! @end deftypefn
|
||||
%@eod:
|
||||
|
||||
% Copyright (C) 2004-2017 Dynare Team
|
||||
% Copyright (C) 2004-2018 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
|
|
@ -36,7 +36,7 @@ function [dLIK,dlik,a,Pstar] = kalman_filter_d(Y, start, last, a, Pinf, Pstar, k
|
|||
% Durbin/Koopman (2012): "Time Series Analysis by State Space Methods", Oxford University Press,
|
||||
% Second Edition, Ch. 5 and 7.2
|
||||
|
||||
% Copyright (C) 2004-2017 Dynare Team
|
||||
% Copyright (C) 2004-2018 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
|
|
@ -87,7 +87,7 @@ function [dLIK, dlikk, a, Pstar, llik] = univariate_kalman_filter_d(data_index,
|
|||
% Series Analysis by State Space Methods", Oxford University Press,
|
||||
% Second Edition, Ch. 5, 6.4 + 7.2.5
|
||||
|
||||
% Copyright (C) 2004-2017 Dynare Team
|
||||
% Copyright (C) 2004-2018 Dynare Team
|
||||
%
|
||||
% This file is part of Dynare.
|
||||
%
|
||||
|
|
Loading…
Reference in New Issue