Merge remote-tracking branch 'ratto/master'
commit
8d4c812671
|
@ -427,6 +427,13 @@ switch DynareOptions.lik_init
|
||||||
T,R,Q,H1,Z,mmm,pp,rr);
|
T,R,Q,H1,Z,mmm,pp,rr);
|
||||||
diffuse_periods = length(dlik);
|
diffuse_periods = length(dlik);
|
||||||
end
|
end
|
||||||
|
if isnan(dLIK),
|
||||||
|
fval=dLIK;
|
||||||
|
info = 45;
|
||||||
|
exit_flag = 0;
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
case 4% Start from the solution of the Riccati equation.
|
case 4% Start from the solution of the Riccati equation.
|
||||||
if kalman_algo ~= 2
|
if kalman_algo ~= 2
|
||||||
kalman_algo = 1;
|
kalman_algo = 1;
|
||||||
|
@ -516,6 +523,7 @@ if analytic_derivation,
|
||||||
D2P=sparse(size(D2Om,1),size(D2Om,2)); %zeros([size(T),length(xparam1),length(xparam1)]);
|
D2P=sparse(size(D2Om,1),size(D2Om,2)); %zeros([size(T),length(xparam1),length(xparam1)]);
|
||||||
jcount=0;
|
jcount=0;
|
||||||
end
|
end
|
||||||
|
if DynareOptions.lik_init==1,
|
||||||
for i=1:EstimatedParameters.nvx
|
for i=1:EstimatedParameters.nvx
|
||||||
k =EstimatedParameters.var_exo(i,1);
|
k =EstimatedParameters.var_exo(i,1);
|
||||||
DQ(k,k,i) = 2*sqrt(Q(k,k));
|
DQ(k,k,i) = 2*sqrt(Q(k,k));
|
||||||
|
@ -534,6 +542,7 @@ if analytic_derivation,
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
offset = EstimatedParameters.nvx;
|
offset = EstimatedParameters.nvx;
|
||||||
for i=1:EstimatedParameters.nvn
|
for i=1:EstimatedParameters.nvn
|
||||||
k = EstimatedParameters.var_endo(i,1);
|
k = EstimatedParameters.var_endo(i,1);
|
||||||
|
@ -543,6 +552,7 @@ if analytic_derivation,
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
offset = offset + EstimatedParameters.nvn;
|
offset = offset + EstimatedParameters.nvn;
|
||||||
|
if DynareOptions.lik_init==1,
|
||||||
for j=1:EstimatedParameters.np
|
for j=1:EstimatedParameters.np
|
||||||
dum = lyapunov_symm(T,DT(:,:,j+offset)*Pstar*T'+T*Pstar*DT(:,:,j+offset)'+DOm(:,:,j+offset),DynareOptions.qz_criterium,DynareOptions.lyapunov_complex_threshold);
|
dum = lyapunov_symm(T,DT(:,:,j+offset)*Pstar*T'+T*Pstar*DT(:,:,j+offset)'+DOm(:,:,j+offset),DynareOptions.qz_criterium,DynareOptions.lyapunov_complex_threshold);
|
||||||
% kk = find(abs(dum) < 1e-12);
|
% kk = find(abs(dum) < 1e-12);
|
||||||
|
@ -565,6 +575,7 @@ if analytic_derivation,
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
if analytic_derivation==1,
|
if analytic_derivation==1,
|
||||||
analytic_deriv_info={analytic_derivation,DT,DYss,DOm,DH,DP,asy_Hess};
|
analytic_deriv_info={analytic_derivation,DT,DYss,DOm,DH,DP,asy_Hess};
|
||||||
else
|
else
|
||||||
|
|
|
@ -155,8 +155,8 @@ while newRank && (t<=last)
|
||||||
end
|
end
|
||||||
|
|
||||||
if (t>last)
|
if (t>last)
|
||||||
error(['univariate_diffuse_kalman_filter:: There isn''t enough information to estimate the initial conditions of the nonstationary variables']);
|
warning(['univariate_diffuse_kalman_filter:: There isn''t enough information to estimate the initial conditions of the nonstationary variables']);
|
||||||
LIK = NaN;
|
dLIK = NaN;
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue