Averages/Simple moving average: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: changed comments and indentations, changed wording in the REXX section header.) |
(task description: Improve formatting and add related tasks box) |
||
Line 3: | Line 3: | ||
Computing the [[wp:Moving_average#Simple_moving_average|simple moving average]] of a series of numbers. |
Computing the [[wp:Moving_average#Simple_moving_average|simple moving average]] of a series of numbers. |
||
{{task heading}} |
|||
;Task: |
|||
Create a [[wp:Stateful|stateful]] function/class/instance that takes a period and returns a routine that takes a number as argument and returns a simple moving average of its arguments so far. |
Create a [[wp:Stateful|stateful]] function/class/instance that takes a period and returns a routine that takes a number as argument and returns a simple moving average of its arguments so far. |
||
{{task heading|Description}} |
|||
;Description: |
|||
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. |
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. |
||
Line 38: | Line 38: | ||
</pre> |
</pre> |
||
{{task heading|See also}} |
|||
{{Related tasks/Statistical measures}} |
|||
* [[Standard Deviation]] |
|||
< |
<hr> |
||
=={{header|360 Assembly}}== |
=={{header|360 Assembly}}== |