Re: iterative algorithm for calculating the moving average
- From: Ron Shepard <ron-shepard@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Apr 2005 23:17:44 -0500
In article <xkhce.1151947$8l.1071914@pd7tw1no>, "me" <me@xxxxxx>
wrote:
> Any ideas? Does anyone have any algorithms or references on the above
> subject?
Why not try the obvious solution, from the running total value
subtract off the old "first" element, and add on the new "last"
element? This might involve some accumulation of roundoff errors
for very long strings of values, so you might want to reset
everything every Nth step for some suitable value of N. This
involves two adds and a multiplication for each time step,
regardless of the number of elements in the running average.
$.02 -Ron Shepard
.
- Follow-Ups:
- References:
- Prev by Date: iterative algorithm for calculating the moving average
- Next by Date: Re: iterative algorithm for calculating the moving average
- Previous by thread: iterative algorithm for calculating the moving average
- Next by thread: Re: iterative algorithm for calculating the moving average
- Index(es):
Relevant Pages
|