Statistics

class olympus.utils.stat.StatStream(drop_first_obs=10)[source]

Bases: object

Sharable object

Store the sum of the observations amd the the sum of the observations squared The first few observations are discarded (usually slower than the rest)

The average and the standard deviation is computed at the user’s request

In order to make the computation stable we store the first observation and subtract it to every other observations. The idea is if x ~ N(mu, sigma) x - x0 and the sum of x - x0 should be close(r) to 0 allowing for greater precision; without that trick var was getting negative on some iteration.

Attributes:
avg
count
current_count
current_obs
drop_obs
first_obs
max
min
sd
sum
sum_sqr
total
val
var

Methods

from_dict  
state_dict  
to_json  
update  
avg
count
current_count
current_obs
drop_obs
first_obs
static from_dict()[source]
max
min
sd
state_dict()[source]
sum
sum_sqr
to_json()[source]
total
update(val, weight=1)[source]
val
var
class olympus.utils.stat.StatStreamStruct[source]

Bases: _ctypes.Structure

Attributes:
current_count

Structure/Union member

current_obs

Structure/Union member

drop_obs

Structure/Union member

first_obs

Structure/Union member

max

Structure/Union member

min

Structure/Union member

sum

Structure/Union member

sum_sqr

Structure/Union member

current_count

Structure/Union member

current_obs

Structure/Union member

drop_obs

Structure/Union member

first_obs

Structure/Union member

max

Structure/Union member

min

Structure/Union member

sum

Structure/Union member

sum_sqr

Structure/Union member