Libraries
bignum
binary
bitmap
ble
bytes
core
crypto
device
encoding
esp32
expect
fixed-point
flash
font
gpio
i2c
i2s
icons
io
line-wrap
log
math
monitor
net
pulse-counter
reader
reader-writer
rmt
serial
spi
statistics
system
tls
uart
uuid
writer
zlib
Class OnlineStatistics
extends
Object
Online algorithm for computing simple statistics.
This uses Welford's online algorithm (see more here
https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
).
Class summary
Constructors
Statics
Methods
Fields
constructor
Constructs an empty statistics.
Constructors
constructor
Constructs an empty statistics.
Statics
from-byte-array
bytes/
any
->
OnlineStatistics
Constructs statistics from the
bytes
.
Works with byte arrays generated by
to-byte-array
.
Methods
count
->
int
Count of the collected values.
max
->
num
Maximum of the collected values.
Returns null if no values have been collected.
mean
->
float
Mean of the collected values.
Returns null if no values have been collected.
min
->
num
Minimum of the collected values.
Returns null if no values have been collected.
operator ==
other/
any
->
bool
See
super
.
population-variance
->
float
Estimated population variance of the collected values.
Returns null if one or fewer values have been collected.
sample-variance
->
float
Estimated sample variance of the collected values.
Returns null if one or fewer values have been collected.
stringify
->
string
Stringifies this object.
Inheritance
Objects that need a human-friendly string representation should overwrite this method. The default string is based on the internal class-ID.
to-byte-array
->
ByteArray
Serializes the OnlineStatistics.
update
value/
num
->
none
Updates the estimated variance with the
value
.