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=False)
Return the current, running (sample) correlation (float).
 
fintercept(self, sample=False)
Return the current, running (sample) intercept (float).
 
fslope(self, sample=False)
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, toRepr, toStr, toStr2

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

Properties
  x
Get the x accumulator (Fcook or Fwelford).
  y
Get the y accumulator (Fcook or Fwelford).

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 with initial x values (Scalars).
  • ys - Iterable with initial y values (Scalars).
  • Fstats - Stats class for x and y values (Fcook or Fwelford).
  • name - Optional name (str).
Raises:
Overrides: object.__init__

See Also: Method Flinear.fadd.

__iadd__ (self, other)

 

Add other to this instance.

Arguments:
  • other - An Flinear instance or Scalar pairs, meaning scalar or Fsum instances.
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 with additional x values (Scalars), meaning scalar or Fsum instances).
  • ys - Iterable with additional y values (Scalars, meaning scalar or Fsum instances).
  • sample - Return the sample instead of the entire population count (bool).
Returns:
Current, running (sample) count (int).
Raises:
  • OverflowError - Partial 2sum overflow.
  • TypeError - Non-scalar xs or ys value.
  • ValueError - Invalid or non-finite xs or ys value.

fadd_ (self, *x_ys, **sample)

 

Accumulate and return the current count.

Arguments:
  • x_ys - Individual, alternating x, y, x, y, ... positional values (Scalars).

See Also: Method Flinear.fadd.

fcorrelation (self, sample=False)

 

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

Arguments:
  • sample - Return the sample instead of the entire population correlation (bool).

fintercept (self, sample=False)

 

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

Arguments:
  • sample - Return the sample instead of the entire population intercept (bool).

fslope (self, sample=False)

 

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

Arguments:
  • sample - Return the sample instead of the entire population slope (bool).

Property Details

x

Get the x accumulator (Fcook or Fwelford).

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 the y accumulator (Fcook or Fwelford).

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.