计算方差时为啥分母为n比n-1偏差大?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了计算方差时为啥分母为n比n-1偏差大?相关的知识,希望对你有一定的参考价值。

如题,请教下大家了!

计算方差,分母是分情况决定的。当真实值已知时,方差分母应为n,因为所以测量均为多余观测,而当真实值未知时(大多数情况),第一次测量为必要测量,所以计算方差分母为n-1。欢迎追问 参考技术A 你首先要知道:方差越大,数据波动越大。方差=平均数/n,n越大,方差越小。所以应该是:计算方差时,分母为n比n-1偏差小。 参考技术B 有的是从零开始的 有的是从一开始的 不一样

matlab中求方差为啥除以n-1?

方差有两种biased和unbiased,前者除以n;后者除以n-1,叫做Bessel's correction,可以修正样本的variance,更精确描述样本空间。matlab采用的是后者。
抄一段对两者区别的解释
In statistics, Bessel's correction, named after Friedrich Bessel, is the use of n − 1 instead of n in the formula for the sample variance and sample standard deviation, where n is the number of observations in a sample: it corrects the bias in the estimation of the population variance, and some (but not all) of the bias in the estimation of the population standard deviation.

That is, when estimating the population variance and standard deviation from a sample when the population mean is unknown, the sample variance is a biased estimator of the population variance, and systematically underestimates it. Multiplying the standard sample variance by n/(n − 1) (equivalently, using 1/(n − 1) instead of 1/n) corrects for this, and gives an unbiased estimator of the population variance. The cost of this correction is that the unbiased estimator has uniformly higher mean squared error than the biased estimator.

A subtle point is that, while the sample variance (using Bessel's correction) is an unbiased estimate of the population variance, its square root, the sample standard deviation, is a biased estimate of the population standard deviation; because the square root is a concave function, the bias is downward, by Jensen's inequality. There is no general formula for an unbiased estimator of the population standard deviation, though there are correction factors for particular distributions, such as the normal; see unbiased estimation of standard deviation for details.

One can understand Bessel's correction intuitively as the degrees of freedom in the residuals vector:

(x_1-\overlinex,\,\dots,\,x_n-\overlinex),

where \overlinex is the mean. While there are n independent samples, there are only n − 1 independent residuals, as they sum to 0.
参考技术A 从数学上说,样本方差的公式是除以(n-1) 的。

总体方差的公式是除以n的。

从MATLAB的语法上说,
s = std(X,flag) for flag = 0, is the same as std(X). For flag = 1, std(X,1) returns the standard deviation using (2) above, producing the second moment of the set of values about their mean.

flag=0是除以(n-1)的。也是默认的。
flag=1是除以n的。

参考资料:http://www.mathworks.com/help/techdoc/ref/std.html

参考技术B 求方差为什么除以n-1,这个是数理统计和概率论的内容。
用数学名词语言来说的话,就是要保证随机量估计的“无偏性”。

你可以用“方差 无偏性”作为关键词,在百度里搜索。

以上是关于计算方差时为啥分母为n比n-1偏差大?的主要内容,如果未能解决你的问题,请参考以下文章

算方差的时候 为啥有的是除n 有的是除n-1 得出的数能一样吗?

样本方差为啥是n-1分之一?

matlab中求方差为啥除以n-1?

为什么方差的分母有时是n,有时是n-1 源于总体方差和样本方差的不同

Pandas计算标准差

样本方差为啥要除n-1,而不是n