Commit bd9af2fa authored by Marco Ratto's avatar Marco Ratto
Browse files

Fixed bug reported by Rob Luginbuhl in dynare forum

parent a74f7c02
......@@ -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)));
......
......@@ -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);
......
......@@ -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]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment