Skip to main content

varSamp

Introduced in: v1.1.0 Calculate the 样本方差 of a data set. The 样本方差 is calculated using the formula: Σ(xxˉ)2n1\frac{\Sigma{(x - \bar{x})^2}}{n-1}
Where:
  • xx is each individual data point in the data set
  • xˉ\bar{x} is the arithmetic mean of the data set
  • nn is the number of data points in the data set
The function assumes that the input data set represents a sample from a larger population. If you want to calculate the variance of the entire population (when you have the complete data set), you should use varPop instead.
该函数使用数值不稳定的算法。如果计算中需要数值稳定性,请使用 varSampStable 函数。该函数运行速度较慢,但计算误差更小。
Syntax
Aliases: VAR_SAMP Arguments Returned value Returns the 样本方差 of the input data set x. Float64 Examples Computing sample variance
Query
Response
最后修改于 2026年7月23日