[Top][All Lists]

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

Moving polynomial fit

From: babelproofreader
Subject: Moving polynomial fit
Date: Sat, 5 Sep 2009 08:09:36 -0700 (PDT)

I would like to write a script/function for use on a time series that will
least squares fit a polynomial of a given degree to a moving window across
the time series in the same way as a moving average computes an average of a
moving window, the output of the script/function being a vector of the
extreme right hand edge/last values of the fitted polynomial over the moving
window. I have tried using the Savitsky-Golay filters from the Signals
package but they are not suitable for my purposes as the end conditions mean
that the values of the fitted polynomial at the right hand edges of the
moving window are different from the values calculated when the data are no
longer at the right hand edge. What in-built Octave functions should I
consider using to achieve the above i.e. polyfit or some other function(s)?
Also, as loops can be quite slow, is there a more efficient way of coding
the above rather than having to resort to a for loop?

View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

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