[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: deprecating ols, gls
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: deprecating ols, gls |
Date: |
Thu, 27 Sep 2012 15:03:42 -0400 |
On 27 September 2012 14:54, Rik <address@hidden> wrote:
> From: Jordi Guti?rrez Hermoso <address@hidden>
>> Any objection to deprecating ols and gls? They are both easily
>> replaceable by other Octave functions. The backslash operator already
>> does least squares.
> I like them. It's true that a backslash operator would *generally* do the
> same thing, but if you take a look inside ols.m you will see that the
> algorithm is actually a fair bit more complicated than just a simple
> backslash operator.
This is precisely why I want to deprecate ols, in fact. The algorithm
in there is the textbook solution to the normal equations. I was
tweaking it while ago, trying to order the computations so that no
large intermediate matrices would occur, and later realised that it
would be sufficient to do
b = A\y;
instead of
b = ols (y, A);
If you want the extra outputs from ols, we should at least rewrite the
function to use the backslash operator instead of writing out the
normal equations like we learned in kindergarten. But between the
backslash operator, polytfit, and corrcoef, you really have all of
this covered.
- Jordi G. H.