方差定義見“概率論與數理統計(浙大四版)”P109.
樣本方差的標準定義見“概率論與數理統計(浙大四版)”P145,注意是除以1/(n-1)不是1/n,盡管根據方差定義,感覺應該是除以1/n。看std的matlab幫助:There are two common textbook definitions for the standard deviation s of a data vector X.一個是除以n,一個是除以n-1。
通過除以1/(n-1)能證明樣本方差是方差的無偏估計,見“概率論與數理統計(浙大四版)”P151公式(3.20),Hanyang Peng曾經給我推過這個證明,很easy。
matlab函數var,matlab2013a幫助說明
var normalizes V by N– 1 if N > 1, where N isthe sample size. This is an unbiased estimator of the variance ofthe population from which X is drawn, as long as X consists of independent, identically distributed samples. For N =1, V is normalized by 1.
V = var(X,1) normalizesby N and produces the second moment of the sample about its mean. var(X,0) is equivalent to var(X).
second moment:二階矩