Handbook
Glossary
combine-regress ( regress1 regress2 -- regress3 )
Vocabulary
math
.
statistics
.
running
Inputs
regress1
an
object
regress2
an
object
Outputs
regress3
an
object
Definition
USING:
accessors
kernel
math
;
IN:
math.statistics.running
::
combine-regress
( regress1 regress2 -- regress3 )
regress1 regress2
[
n>>
]
bi@
+
dup
:>
n regress1 regress2
[
x-stats>>
]
bi@
combine-stats
regress1 regress2
[
y-stats>>
]
bi@
combine-stats
regress2 regress1
[
x-stats>>
mean
]
bi@
-
:>
delta-x regress2 regress1
[
y-stats>>
mean
]
bi@
-
:>
delta-y regress1 regress2
[
xy>>
]
bi@
+
regress1 regress2
[
n>>
]
bi@
*
delta-x
*
delta-y
*
n
/
+
running-regress
boa
;