| |
- builtins.object
-
- vcorelib.math.analysis.average.MovingAverage
- vcorelib.math.analysis.buffer.FloatBuffer
-
- vcorelib.math.analysis.average.MovingSum
- vcorelib.math.analysis.weighted.WeightedAverage
class FloatBuffer(builtins.object) |
|
FloatBuffer(depth: int = 10, initial: float = 0.0) -> None
A class implementing a simple circular buffer for floats. |
|
Methods defined here:
- __call__(self, value: float) -> float
- Insert an element into the buffer and return the oldest value (that
gets overwritten).
- __init__(self, depth: int = 10, initial: float = 0.0) -> None
- Initialize this instance.
- reset(self, initial: float = 0.0) -> None
- Reset the buffer.
- resize(self, depth: int, initial: float = 0.0) -> None
- Set a new depth for this buffer average and reset the values.
Data descriptors defined here:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
|
class MovingAverage(builtins.object) |
|
MovingAverage(depth: int = 10, initial: float = 0.0) -> None
A class for managing a moving average of floats. |
|
Methods defined here:
- __call__(self, value: float) -> float
- Add a new value to the dataset and get the average.
- __init__(self, depth: int = 10, initial: float = 0.0) -> None
- Initialize this moving average.
- reset(self, initial: float = 0.0) -> None
- Reset the average value.
- resize(self, depth: int, initial: float = 0.0) -> None
- Set a new depth for this moving average and reset the value.
Data descriptors defined here:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
|
class WeightedAverage(builtins.object) |
|
WeightedAverage(depth: int = 10) -> None
A class implementing a weighted average. |
|
Methods defined here:
- __call__(self, value: float, weight: float = 1.0) -> None
- Update tracking, doesn't compute weighted average.
- __init__(self, depth: int = 10) -> None
- Initialize this weighted average.
- average(self) -> float
- Compute the overall weighted average.
- reset(self) -> None
- Reset the average.
Readonly properties defined here:
- depth
- This average's depth.
Data descriptors defined here:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
| |