Merge remote-tracking branch 'ratto/master'

time-shift
Sébastien Villemot 2012-09-17 10:29:53 +02:00
commit 8d4c812671
2 changed files with 13 additions and 2 deletions

View File

@ -427,6 +427,13 @@ switch DynareOptions.lik_init
T,R,Q,H1,Z,mmm,pp,rr);
diffuse_periods = length(dlik);
end
if isnan(dLIK),
fval=dLIK;
info = 45;
exit_flag = 0;
return
end
case 4% Start from the solution of the Riccati equation.
if kalman_algo ~= 2
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)]);
jcount=0;
end
if DynareOptions.lik_init==1,
for i=1:EstimatedParameters.nvx
k =EstimatedParameters.var_exo(i,1);
DQ(k,k,i) = 2*sqrt(Q(k,k));
@ -534,6 +542,7 @@ if analytic_derivation,
end
end
end
end
offset = EstimatedParameters.nvx;
for i=1:EstimatedParameters.nvn
k = EstimatedParameters.var_endo(i,1);
@ -543,6 +552,7 @@ if analytic_derivation,
end
end
offset = offset + EstimatedParameters.nvn;
if DynareOptions.lik_init==1,
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);
% kk = find(abs(dum) < 1e-12);
@ -565,6 +575,7 @@ if analytic_derivation,
end
end
end
end
if analytic_derivation==1,
analytic_deriv_info={analytic_derivation,DT,DYss,DOm,DH,DP,asy_Hess};
else

View File

@ -155,8 +155,8 @@ while newRank && (t<=last)
end
if (t>last)
error(['univariate_diffuse_kalman_filter:: There isn''t enough information to estimate the initial conditions of the nonstationary variables']);
LIK = NaN;
warning(['univariate_diffuse_kalman_filter:: There isn''t enough information to estimate the initial conditions of the nonstationary variables']);
dLIK = NaN;
return
end