public final class WindowedMean extends Object
Constructor and Description |
---|
WindowedMean(int window_size)
constructor, window_size specifies the number of samples we will continuously get the mean and variance from.
|
Modifier and Type | Method and Description |
---|---|
void |
addValue(float value)
adds a new sample to this mean.
|
void |
clear()
clears this WindowedMean.
|
float |
getHighest() |
float |
getLatest() |
float |
getLowest() |
float |
getMean()
returns the mean of the samples added to this instance.
|
float |
getOldest() |
int |
getValueCount() |
int |
getWindowSize() |
float[] |
getWindowValues() |
boolean |
hasEnoughData() |
float |
standardDeviation() |
public WindowedMean(int window_size)
window_size
- size of the sample windowpublic boolean hasEnoughData()
public void clear()
public void addValue(float value)
value
- The value to addpublic float getMean()
public float getOldest()
public float getLatest()
public float standardDeviation()
public float getLowest()
public float getHighest()
public int getValueCount()
public int getWindowSize()
public float[] getWindowValues()
float[]
containing all values currently in the window of the stream, in order from oldest to
latest. The length of the array is smaller than the window size if not enough data has been added.Copyright © 2021. All rights reserved.