This class allows to determine the variance in a given data set.
More...
template<typename T>
class Ocean::VarianceT< T >
This class allows to determine the variance in a given data set.
- Template Parameters
-
T | Data type of the variance data |
- See also
- Variance, VarianceF, VarianceD.
◆ VarianceT() [1/2]
Creates a new variance object.
◆ VarianceT() [2/2]
Creates a new variance object with several values.
- Parameters
-
values | The values to be used, must be valid if size > 0 |
size | The number of values to be used, with range [0, infinity) |
◆ add() [1/3]
Adds the same value several times.
- Parameters
-
size | The number of value to add, with range [1, infinity) |
value | The value to be added |
◆ add() [2/3]
Adds a new value.
- Parameters
-
value | The value to be added |
◆ add() [3/3]
Adds several values.
- Parameters
-
values | The values to be added, must be valid if size > 0 |
size | The number of values to be added, with range [0, infinity) |
◆ average()
Returns the average of the data set.
- Returns
- Data set average
◆ deviation()
Returns the deviation of the data set.
The deviation is determined by the square root of the variance.
- Returns
- Data set deviation
◆ operator bool()
Returns whether the data set holds at least one value.
- Returns
- True, if so
◆ remove()
Removes a previously added value.
- Parameters
-
value | The value to be removed, must have been added before |
- See also
- add().
◆ size()
Returns the size of the data set.
- Returns
- Data set size
◆ variance() [1/3]
Returns the variance of the data set.
- Returns
- Data set variance
E[X^2] - (E[x])^2 = mean(X^2) - mean(X)^2 = sum(X^2) / size - (sum(X) / size)^2 = sum(X^2) * size / size^2 - sum(X)^2 / size^2 = (sum(X^2) * size - sum(X)^2) / size^2
◆ variance() [2/3]
Specialization for double elements.
- Returns
- Resulting variance
E[X^2] - (E[x])^2
◆ variance() [3/3]
Specialization for double elements.
- Returns
- Resulting variance
E[X^2] - (E[x])^2
◆ size_
◆ squaredSum_
Stores the squared data sum.
◆ sum_
The documentation for this class was generated from the following file: