方差定义见“概率论与数理统计(浙大四版)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:二阶矩