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

Class Flinear

  object --+        
           |        
named._Named --+    
               |    
    _FstatsNamed --+
                   |
                  Flinear

Cook's RunningRegression computing the running slope, intercept and correlation of a linear regression.

Instance Methods
 
__init__(self, xs=None, ys=None, Fstats=<class 'pygeodesy.fstats.Fwelford'>, **name)
New Flinear regression accumulator.
 
__iadd__(self, other)
Add other to this instance.
 
fadd(self, xs, ys, sample=False)
Accumulate and return the current count.
 
fadd_(self, *x_ys, **sample)
Accumulate and return the current count.
 
fcorrelation(self, **sample)
Return the current, running (sample) correlation (float).
 
fintercept(self, **sample)
Return the current, running (sample) intercept (float).
 
fslope(self, **sample)
Return the current, running (sample) slope (float).

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
  x
  y

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

Inherited from object: __class__

Method Details

__init__ (self, xs=None, ys=None, Fstats=<class 'pygeodesy.fstats.Fwelford'>, **name)
(Constructor)

 

New Flinear regression accumulator.

Arguments:
  • xs - Iterable of initial x values (each scalar, an Fsum or Fsum2Tuple).
  • ys - Iterable of initial y values (each scalar, an Fsum or Fsum2Tuple).
  • Fstats - Class for xs and ys values (Fcook or Fwelford).
  • name - Optional name=NN (str).
Raises:
Overrides: object.__init__

See Also: Method Flinear.fadd.

__iadd__ (self, other)

 

Add other to this instance.

Arguments:
  • other - An Flinear instance or an iterable of x_ys values, see method fadd_.
Returns:
This instance, updated (Flinear).
Raises:
  • TypeError - Invalid other or the other and these x and y accumulators are not compatible.
  • ValueError - Invalid or odd-length other.

See Also: Method Flinear.fadd_.

fadd (self, xs, ys, sample=False)

 

Accumulate and return the current count.

Arguments:
  • xs - Iterable of additional x values (each scalar, an Fsum or Fsum2Tuple).
  • ys - Iterable of additional y 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 or ys.
  • ValueError - Invalid or non-finite xs or ys.

fadd_ (self, *x_ys, **sample)

 

Accumulate and return the current count.

Arguments:
  • x_ys - Individual, alternating x, y, x, y, ... values (each scalar, an Fsum or Fsum2Tuple).

See Also: Method Flinear.fadd for further details.

fcorrelation (self, **sample)

 

Return the current, running (sample) correlation (float).

Arguments:
  • sample - Use sample=True for the sample correlation instead of the population correlation (bool).

fintercept (self, **sample)

 

Return the current, running (sample) intercept (float).

Arguments:
  • sample - Use sample=True for the sample intercept instead of the population intercept (bool).

fslope (self, **sample)

 

Return the current, running (sample) slope (float).

Arguments:
  • sample - Use sample=True for the sample slope instead of the population slope (bool).

Property Details

x

Get method:
x(self) - Get the x accumulator (Fcook or Fwelford).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.

y

Get method:
y(self) - Get the y accumulator (Fcook or Fwelford).
Set method:
_fset_error(inst, val) - Throws an AttributeError, always.
Delete Method:
_fdel(inst) - Zap the cached/memoized property value.