Bug fix for the case of perfectly orthogonal pairs

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2994 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
ratto 2009-09-29 07:10:31 +00:00
parent 163d893e2e
commit 863dee7acd
1 changed files with 5 additions and 1 deletions

View File

@ -31,7 +31,11 @@ X = H(:,2:end);
% X = H(:,2:end);
yhat = X*(X\y);
co = y'*yhat/sqrt((y'*y)*(yhat'*yhat));
if rank(yhat),
co = y'*yhat/sqrt((y'*y)*(yhat'*yhat));
else
co=0;
end