Fixed bug reported by Rob Luginbuhl in dynare forum

time-shift
Marco Ratto 2012-06-29 00:50:54 +02:00
parent a74f7c0285
commit bd9af2fa5a
3 changed files with 6 additions and 1 deletions

View File

@ -28,6 +28,9 @@ y = H(:,1);
X = H(:,2:end);
b=(X\y);
if any(isnan(b)) || any(isinf(b)),
b=0;
end
yhat = X*b;
if rank(yhat),
co = abs(y'*yhat/sqrt((y'*y)*(yhat'*yhat)));

View File

@ -56,7 +56,8 @@ for ll = 1:n,
pars{ii,ll} = [pars{ii,ll-1} NaN];
cosnJ(ii,ll) = cosnJ(ii,ll-1);
else
pars{ii,ll} = tmp2(find(cosnJ2(:,1)==max(cosnJ2(:,1))),:);
tmp3 = tmp2(find(cosnJ2(:,1)==max(cosnJ2(:,1))),:);
pars{ii,ll} = tmp3(1,:);
end
else
pars{ii,ll} = NaN(1,ll);

View File

@ -284,6 +284,7 @@ if info(1)==0,
normJ=1;
[U, S, V]=svd(JJ(indJJ,:)./normJ,0);
S=diag(S);
S=[S;zeros(size(JJ,2)-length(indJJ),1)];
if nparam>8
ide_moments.S = S([1:4, end-3:end]);
ide_moments.V = V(:,[1:4, end-3:end]);