Mercurial > hg > octave-thorsten
changeset 12547:17997376291b
Fix variable name clash in ols.m
author | Michael Creel <michael.creel@uab.es> |
---|---|
date | Tue, 29 Mar 2011 07:36:31 -0600 |
parents | 39ca02387a32 |
children | 2ba9478f6520 |
files | scripts/ChangeLog scripts/statistics/base/ols.m |
diffstat | 2 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2011-03-29 Michael Creel <michael.creel@uab.es> + + * statistics/base/ols.m: Fix erroneous degrees of freedom when + computing the covariance estimator. + 2011-03-28 Rik <octave@nomad.inbox5.com> * linear-algebra/cross.m, plot/ishold.m, signal/fftfilt.m: Improve
--- a/scripts/statistics/base/ols.m +++ b/scripts/statistics/base/ols.m @@ -101,9 +101,9 @@ endif z = x' * x; - r = rank (z); + rnk = rank (z); - if (r == nc) + if (rnk == nc) beta = inv (z) * x' * y; else beta = pinv (x) * y; @@ -113,7 +113,7 @@ r = y - x * beta; endif if (isargout (2)) - sigma = r' * r / (nr - r); + sigma = r' * r / (nr - rnk); endif endfunction