help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: detrend


From: Tristan Quaife
Subject: Re: detrend
Date: Wed, 18 Oct 2000 14:29:44 +0100

flatmax wrote:
> 
> Hi there,
> Can any one technically define what is happening in the 'detrend'
> algorithm ?
> 
> function y = detrend (x, p)
>   r = rows (x);
>   b = ((1 : r)' * ones (1, p + 1)) .^ (ones (r, 1) * (0 : p));
>   y = x - b * (b ŠÜ x);
> 

If I remember correctly, the detrend function
fits a polynomial of order p to the vector x
and then returns the vector x with the polynomial
subtracted from it.

Tristan.



-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.che.wisc.edu/octave/octave.html
How to fund new projects:  http://www.che.wisc.edu/octave/funding.html
Subscription information:  http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]