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

Class Fwelford

  object --+            
           |            
named._Named --+        
               |        
    _FstatsNamed --+    
                   |    
         _FstatsBase --+
                       |
                      Fwelford

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


See Also: Cook and Fcook.

Instance Methods
 
__init__(self, xs=None, **name)
New Fwelford stats accumulator.
 
__iadd__(self, other)
Add other to this Fwelford instance.
 
fadd(self, xs, sample=False)
Accumulate and return the current count.

Inherited from _FstatsBase: fadd_, fmean, fmean_, fstdev, fstdev_, fvariance, fvariance_

Inherited from _FstatsNamed: __add__, __float__, __int__, __len__, __neg__, __radd__, __str__, copy, fcopy

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

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

Properties

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

Inherited from object: __class__

Method Details

__init__ (self, xs=None, **name)
(Constructor)

 

New Fwelford stats accumulator.

Arguments:
  • xs - Iterable of initial values (each scalar, an Fsum or Fsum2Tuple).
  • name - Optional name=NN (str).
Overrides: object.__init__

See Also: Method Fwelford.fadd.

__iadd__ (self, other)

 

Add other to this Fwelford instance.

Arguments:
Returns:
This instance, updated (Fwelford).
Raises:
  • TypeError - Invalid other.
  • ValueError - Invalid other.

See Also: Method Fwelford.fadd and Parallel algorithm.

fadd (self, xs, sample=False)

 

Accumulate and return the current count.

Arguments:
  • xs - Iterable of additional values (each scalar, an Fsum or Fsum2Tuple).
  • sample - Use sample=True for the sample count instead of the population count (bool).
Returns:
Current, running (sample) count (int).
Raises:
  • OverflowError - Partial 2sum overflow.
  • TypeError - Invalid xs.
  • ValueError - Invalid or non-finite xs.
Overrides: _FstatsBase.fadd