c语言statistics函数,Statistics基本定理

概念:

总体均值

math?formula=E%5B(X)%5D%3Du

总体方差

math?formula=E%5B(X-u)%5E2%5D%20%3D%20var(X)%20%3D%20%5Csigma%5E2

样本均值

math?formula=E%5BX'%5D%3D%5Csum(X_i')%2Fn

样本方差

math?formula=E%5B(X'-E%5BX'%5D)%5E2%5D%20%3D%20%5Cfrac%7B%5Csum_%7Bi%7D%5EN(X_i'-E%5B(X')%5D)%5E2%7D%7B(n-1)%7D%20%3D%20S%5E2

估计值表示:

estimator,常用:p为真值,

math?formula=%5Chat%7Bp%7D为p的估计

无偏(unbias):

用样本统计估计总体参数时,估计量的均值(数学期望)与未知参数的真值一样时,为无偏估计。

一致性(consistency):

随着样本量的增加,偏差越来越小,则称为一致性估计。譬如用MLE对方差估计时,其偏差为

math?formula=%5Csigma%5E2%2Fn,这个值随着样本量n的增大而减小,所以为一致性估计。

有效性(availability):

到达variance最小的estimator

Empirical:

empirical->从样本中获得的,ture-> 从总体中获得的。譬如:empirical risk minimization,ERM常用的手段就是MLE,structural risk minimization, SRM就比如是加了正则的MLE,ie:MAP

性质:

期望乘法:

math?formula=E(kX)%3Dk*E(X)

方差乘法:

math?formula=Var(kX)%3Dk%5E2%20*%20Var(X)

方差加法:

math?formula=Var(X1%2BX2)%3DVar(X1)%20%2B%20Var(X2)%20%2B%20Cov(X1%2CX2)

方差分解:

math?formula=Var(X)%20%3DE%5BVar(X%7CY)%5D%20%2BVar(E%5BX%7CY%5D)

方差:

math?formula=%5Csigma%5E2%20%3D%20E%5B(X-u)%5E2%5D%20%3D%20E(X%5E2)%20-%20u%5E2

协方差

math?formula=Cov(X%2CY)%3DE%5BXY%5D-E(X)E(Y)

X,Y不相关则:

math?formula=E%5BXY%5D%3DE(X)E(Y),即

math?formula=Cov(X%2CY)%3D0,此时

math?formula=Var(X1-X2)%3DVar(X1%2BX2)%3DVar(X1)%2BVar(X2)

协方差性质

math?formula=Cov(aX%2CbY)%3DabCov(X%2CY)

math?formula=Cov(%5Csum%20X_i%2C%5Csum%20Y_j)%20%3D%20%5Csum_i%20%5Csum_j%20Cov(X_i%2CY_j)

样本均值是总体均值的无偏估计

样本方差是总体方差的无偏估计(分母为

math?formula=n-1)

样本均值的方差为

math?formula=%5Csigma%5E2%2Fn。因此,10个样本和100个样本估计均值都是无偏的,但100个样本估计出来其估计值的方差更小,所以更有效:

math?formula=Var(%5Coverline%20X)%20%3D%20Var(%5Cfrac%20%7B%5Csum%20X%7D%20n%20)

math?formula=%3D%5Cfrac%20%7BnVar(X)%7D%7Bn%5E2%7D%3D%5Cfrac%20%7BVar(X)%7D%7Bn%7D

部分推论与定理:

1、CLT:样本均值收敛于正态分布。

样本均值为一个随机变量,采样多次计算,获得多个样本值,这个值收敛于u=总体均值的正太分布

2、协方差为0:

cov(X1,X2)=0代表两变量不相关(没有线性关系),但是不代表其独立。

(correlation does not imply causation)

3、Law of total expectation:

math?formula=E%5BX%5D%3D%20E%5BE%5BX%7CY%5D%5D

4、Gauss-Markov Theorem

假设:

math?formula=E%5B%5Cepsilon%5D%3D0,误差期望为0

math?formula=Var(%5Cepsilon)%3D%5Csigma%5E2,同方差

math?formula=Cov(%5Cepsilon_i%2C%5Cepsilon_j)%3D0,不相关

则:

OLS estimator为BLUE(Best Linear unbiased estimator)

5、Cramer-Rao lower bound(CRLB)

通过variance下界来确定estimator是否是有效的。

6、 Resampling:

Bootstrap:Sampling with replacement from the original sample。[1]

Subsampling:No replacement,and resample size is smaller than the sample size[2]

如果用多个Resampling的mean来估计总体的mean,其实是estimate on estimate,不一定会更好。

当少量离群值的扰动对我们估计有很大的影响时,用Bootstrap可以缓解。[3]

即:这种方式可以降低我们estimate的 variance,但是可能会导致更大的bias。这就引申到bootstrap bias[4]的解决方式了。

[1]:其convergence:

"Unless one is reasonably sure that the underlying distribution is not [heavy tailed], one should hesitate to use the naive bootstrap".

[2]:subsampling leads to valid inference whereas bootstrapping does not

[3]:The basic idea is that if your estimator is very sensitive to perturbations in the data (i.e., the estimator has high variance and low bias), then you can average over lots of bootstrap samples to reduce the amount of overfitting particular examples.

[4]:

[5]:CV或者Bootstrapping的方式估计prediction error:https://stats.stackexchange.com/questions/18348/differences-between-cross-validation-and-bootstrapping-to-estimate-the-predictio

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值