Jump to content

Averages/Simple moving average: Difference between revisions

m
Add to description.
(Add to description.)
m (Add to description.)
Line 3:
 
The task is to:
:''Create a [[wp:Stateful|stateful]] function/class/instance that takes a number as argument and returns a simple moving average of its arguments so far.''
 
'''Description'''<br>
A simple moving average is a method for computing an average of a stream of numbers by only averaging the last P numbers from the stream, where P is known as the period. It can be implemented by calling an initialing routine with P as its argument, I(P), which should then return a routine that when called with individual, successive members of a stream of numbers, computes the mean of (up to), the last P of them, lets call this SMA().
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.