help-octave
[Top][All Lists]
Advanced

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

Re: detrend() in Matlab and Octave


From: Martin Helm
Subject: Re: detrend() in Matlab and Octave
Date: Thu, 23 Dec 2010 15:08:52 +0100
User-agent: KMail/1.13.5 (Linux/2.6.34.7-0.5-desktop; KDE/4.5.4; x86_64; ; )

Am Donnerstag, 23. Dezember 2010, 08:15:06 schrieb H W Borchers:
> There is. A call like
> 
>     x = (1:5).^2;
>     detrend(x, 2)
> 
> will return the result [0 0 0 0 0] in Octave and [2 -1 -2 -1 2] in Matlab
> (with a warning).

detrend(x, 2) is as far as I understand the ML documentation no valid syntax, 
since ML cannot remove a quadratic trend therefor the ML result cannot be the 
same since it only removes a linear trend from a quadratic input while octave 
removes a quadratic trend from a quadratic input and gives you the correct 
answer [0 0 0 0 0].
detrend (x, 1)
ans =

   2.0000  -1.0000  -2.0000  -1.0000   2.0000

gives correctly the same as ML detrend (c, 'linear') or detrend(x).


reply via email to

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