varSampStable
varSampStable
Calculate the sample variance of a data set. Unlike varSamp, this function uses a numerically stable algorithm. It works slower but provides a lower computational error.
Syntax
Alias: VAR_SAMP_STABLE
Parameters
Returned value
- Returns the sample variance of the input data set. Float64.
Implementation details
The varSampStable function calculates the sample variance using the same formula as the varSamp:
Where:
xis each individual data point in the data set.mean(x)is the arithmetic mean of the data set.nis the number of data points in the data set.
Example
Query:
Response:
varSampStable
Introduced in: v1.1
Calculate the sample variance of a data set. Unlike varSamp, this function uses a numerically stable algorithm. It works slower but provides a lower computational error.
The sample variance is calculated using the same formula as varSamp:
Where:
- is each individual data point in the data set
- is the arithmetic mean of the data set
- is the number of data points in the data set
Syntax
Arguments
x— The population for which you want to calculate the sample variance.(U)Int*orFloat*orDecimal*
Returned value
Returns the sample variance of the input data set. Float64
Examples
Computing stable sample variance