Package pygeodesy :: Module fstats :: Class Fwelford
[frames] | no frames]

Class Fwelford

  object --+        
           |        
named._Named --+    
               |    
      _StatsBase --+
                   |
                  Fwelford

Welford's accumulator computing the running mean, (sample) variance and standard deviation.


See Also: Cook and Fcook.

Instance Methods
 
__init__(self, xs=(), name='')
New Fwelford accumulator.
 
__len__(self)
Return the total number of accumulated values (int).
 
fadd(self, xs, sample=False)
Accumulate and return the current count.
 
fcopy(self, deep=False, name='')
Copy this instance, shallow or deep.
 
copy(self, deep=False, name='')
Copy this instance, shallow or deep.
 
fmean(self, xs=())
Accumulate and return the current mean.
 
fstdev(self, xs=(), sample=False)
Accumulate and return the current standard deviation.
 
fvariance(self, xs=(), sample=False)
Accumulate and return the current variance.

Inherited from _StatsBase: fadd_, fmean_, fstdev_, fvariance_

Inherited from named._Named: _DOT_, __imatmul__, __matmul__, __repr__, __rmatmul__, __str__, attrs, classof, dup, rename, toRepr, toStr, toStr2

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties

Inherited from named._Named: classname, classnaming, name, named, named2, named3, named4

Inherited from object: __class__

Method Details

__init__ (self, xs=(), name='')
(Constructor)

 

New Fwelford accumulator.

Arguments:
  • xs - Iterable with initial values (Scalars).
  • name - Optional name (str).
Overrides: object.__init__

See Also: Method Fwelford.fadd.

__len__ (self)
(Length operator)

 

Return the total number of accumulated values (int).

Overrides: _StatsBase.__len__

fadd (self, xs, sample=False)

 

Accumulate and return the current count.

Arguments:
  • xs - Iterable with additional values (Scalars).
  • sample - Return the sample instead of the full population value (bool).
Returns:
Current, running count (float).
Raises:
  • OverflowError - Partial 2sum overflow.
  • TypeError - Non-scalar xs value.
  • ValueError - Invalid or non-finite xs value.

Note: Scalar means an Fsum instance or scalar.

fcopy (self, deep=False, name='')

 

Copy this instance, shallow or deep.

Arguments:
  • deep - If True make a deep, otherwise a shallow copy (bool).
  • name - Optional, non-empty name (str).
Returns:
The copy (Fwelford).

copy (self, deep=False, name='')

 

Copy this instance, shallow or deep.

Arguments:
  • deep - If True make a deep, otherwise a shallow copy (bool).
  • name - Optional, non-empty name (str).
Returns:
The copy (Fwelford).
Overrides: named._Named.copy

fmean (self, xs=())

 

Accumulate and return the current mean.

Arguments:
  • xs - Iterable with additional values (Scalars).
Returns:
Current, running mean (float).

See Also: Method Fwelford.fadd.

fstdev (self, xs=(), sample=False)

 

Accumulate and return the current standard deviation.

Arguments:
  • xs - Iterable with additional values (Scalars).
  • sample - Return the sample instead of the full population value (bool).
Returns:
Current, running standard deviation (float).

See Also: Method Fwelford.fadd.

fvariance (self, xs=(), sample=False)

 

Accumulate and return the current variance.

Arguments:
  • xs - Iterable with additional values (Scalars).
  • sample - Return the sample instead of the full population value (bool).
Returns:
Current, running variance (float).

See Also: Method Fwelford.fadd.