Python RunStats - Online Statistics and Regression

Statistics

class runstats.Statistics(iterable=())[source]

Compute statistics in a single pass.

Computes the minimum, maximum, mean, variance, standard deviation, skewness, and kurtosis. Statistics objects may also be added together and copied.

Based entirely on the C++ code by John D Cook at http://www.johndcook.com/skewness_kurtosis.html

__add__(that)[source]

Add two Statistics objects together.

__copy__(_=None)

Copy Statistics object.

__deepcopy__(_=None)

Copy Statistics object.

__eq__(that)[source]

Return self==value.

__iadd__(that)[source]

Add another Statistics object to this one.

__imul__(that)[source]

Multiply by a scalar to change Statistics weighting in-place.

__init__(iterable=())[source]

Initialize Statistics object.

Iterates optional parameter iterable and pushes each value into the statistics summary.

__len__()[source]

Number of values that have been pushed.

__mul__(that)[source]

Multiply by a scalar to change Statistics weighting.

__ne__(that)[source]

Return self!=value.

__reduce__()[source]

Helper for pickle.

__rmul__(that)

Multiply by a scalar to change Statistics weighting.

__weakref__

list of weak references to the object (if defined)

clear()[source]

Clear Statistics object.

copy(_=None)[source]

Copy Statistics object.

classmethod fromstate(state)[source]

Return Statistics object from state.

get_state()[source]

Get internal state.

kurtosis()[source]

Kurtosis of values.

maximum()[source]

Maximum of values.

mean()[source]

Mean of values.

minimum()[source]

Minimum of values.

push(value)[source]

Add value to the Statistics summary.

set_state(state)[source]

Set internal state.

skewness()[source]

Skewness of values.

stddev(ddof=1.0)[source]

Standard deviation of values (with ddof degrees of freedom).

variance(ddof=1.0)[source]

Variance of values (with ddof degrees of freedom).

Regression

class runstats.Regression(iterable=())[source]

Compute simple linear regression in a single pass.

Computes the slope, intercept, and correlation. Regression objects may also be added together and copied.

Based entirely on the C++ code by John D Cook at http://www.johndcook.com/running_regression.html

__add__(that)[source]

Add two Regression objects together.

__copy__(_=None)

Copy Regression object.

__deepcopy__(_=None)

Copy Regression object.

__eq__(that)[source]

Return self==value.

__iadd__(that)[source]

Add another Regression object to this one.

__init__(iterable=())[source]

Initialize Regression object.

Iterates optional parameter iterable and pushes each pair into the regression summary.

__len__()[source]

Number of values that have been pushed.

__ne__(that)[source]

Return self!=value.

__reduce__()[source]

Helper for pickle.

__weakref__

list of weak references to the object (if defined)

clear()[source]

Clear Regression object.

copy(_=None)[source]

Copy Regression object.

correlation(ddof=1.0)[source]

Correlation of values (with ddof degrees of freedom).

classmethod fromstate(state)[source]

Return Regression object from state.

get_state()[source]

Get internal state.

intercept(ddof=1.0)[source]

Intercept of values (with ddof degrees of freedom).

push(xcoord, ycoord)[source]

Add a pair (x, y) to the Regression summary.

set_state(state)[source]

Set internal state.

slope(ddof=1.0)[source]

Slope of values (with ddof degrees of freedom).