Handbook
Glossary
push-value ( stats x -- stats )
Vocabulary
math
.
statistics
.
running
Inputs
stats
an
object
x
an
object
Outputs
stats
an
object
Definition
IN:
math.statistics.running
GENERIC:
push-value
( stats x -- stats )
Methods
USING:
accessors
kernel
math
math.order
math.statistics.running
;
M::
object
push-value
( stats x -- stats )
stats
dup
n>>
zero?
[
x
>>min
x
>>max
]
[
[
x
min
]
change-min
[
x
max
]
change-max
]
if
[
1
+
dup
]
change-n
swap
:>
n
[
x
+
]
change-sum
x
over
mom1>>
-
:>
delta delta n
/f
:>
delta_n delta_n
sq
:>
delta_n2 delta delta_n
*
n 1
-
*
:>
term1
[
term1 delta_n2
*
n
sq
3 n
*
-
3
+
*
6 delta_n2
*
stats
mom2>>
*
+
4 delta_n
*
stats
mom3>>
*
-
+
]
change-mom4
[
term1 delta_n
*
n 2
-
*
3 delta_n
*
stats
mom2>>
*
-
+
]
change-mom3
[
term1
+
]
change-mom2
[
delta_n
+
]
change-mom1
;
USING:
math.statistics.running
sequences
;
M:
sequence
push-value
[
push-value
]
each
;