计算加权均值估计中的标准误差


16

假设w1,w2,…,wn和x1,x2,...,xn分别从某些分布中得出iid,wi独立于xi。该wi是严格为正。您观察到所有的wi,但没有观察到xi;相反,您观察到∑ixiwi。我有兴趣根据此信息估算。显然,估计 ˉ X = Σ 我瓦特我X 我E⁡[x] 是无偏的,可以根据手头的信息进行计算。

x¯=∑iwixi∑iwi

如何计算此估算器的标准误差?对于其中副壳体只消值0和1,I天真地试图 小号Ë 听,说:√xi 基本上忽略了的变化W¯¯我,却发现这个表现不佳的样本量250比周围小(这可能取决于的方差W¯¯我。)看来,也许我不有足够的信息来计算“更好”的标准误差。

se≈x¯(1−x¯)∑iwi2∑iwi,
wiwi

Answers:


17

我最近遇到了同样的问题。以下是我发现的内容:

与具有相等权重的简单随机样本不同,加权平均值的标准误没有广泛接受的定义。如今,进行引导程序并获得均值的经验分布,并基于该估计值来进行标准误差将非常简单。

如果要使用公式进行此估算怎么办?

主要参考文献是Donald F. Gatz和Luther Smith撰写的本文,其中将基于3个公式的估计量与自举结果进行了比较。引导结果的最佳近似来自Cochran(1977):

(SEMw)2=n(n−1)(∑Pi)2[∑(PiXi−P¯X¯w)2−2X¯w∑(Pi−P¯)(PiXi−P¯X¯w)+X¯w2∑(Pi−P¯)2]

以下是来自此R listserve线程的相应R代码。

weighted.var.se <- function(x, w, na.rm=FALSE)
#  Computes the variance of a weighted mean following Cochran 1977 definition
{
  if (na.rm) { w <- w[i <- !is.na(x)]; x <- x[i] }
  n = length(w)
  xWbar = weighted.mean(x,w,na.rm=na.rm)
  wbar = mean(w)
  out = n/((n-1)*sum(w)^2)*(sum((w*x-wbar*xWbar)^2)-2*xWbar*sum((w-wbar)*(w*x-wbar*xWbar))+xWbar^2*sum((w-wbar)^2))
  return(out)
}

希望这可以帮助!


这很酷,但是对于我的问题,我什至没有观察到,而是观察到了总和∑ i P i X i。我的问题很奇怪,因为它涉及一些信息不对称(第三方正在报告总和,并试图隐藏一些信息)。PiXi∑iPiXi
— shabbychef 2012年

天哪,您是对的,抱歉,我没有完全理解您提出的问题。假设我们将您的问题归结为最简单的情况,其中所有均为Bernoulli RV。然后,您实际上将观察n个 RV 的随机子集的总和。我的猜测是这里没有很多信息可以估算。那么,您最终为最初的问题做了什么?win
— Ming K

@ Ming-ChihKao这个Cochran公式很有趣,但是如果您在数据不正常时以此为基础建立置信区间,则没有一致的解释正确吗?您将如何处理非正态加权平均平均置信区间?加权分位数?
— user3022875 '16

我认为该功能有误。如果您替代w=rep(1, length(x)),则weighted.var.se(rnorm(50), rep(1, 50))约为0.014。我认为sum(w^2)分子中缺少公式,因为当时P=1,方差为1/(n*(n-1)) * sum((x-xbar)^2)。我无法检查引用的文章,因为它是在付费专区后面的,但我认为这是更正。奇怪的是,当所有权重相等时,Wikipedia的(不同的)解决方案变得简陋:en.wikipedia.org/wiki/…。
— Max Candocia

一般而言,这些方法可能效果更好:analyticgroup.com/download/WEIGHTED_MEAN.pdf
— Max Candocia

5

给定,您的估计方差wi

∑wi2Var(X)(∑wi)2=Var(X)∑wi2(∑wi)2.
Because your estimate is unbiased for any wi, the variance of its conditional mean is zero. Hence, the variance of your estimate is
Var(X)E(∑wi2(∑wi)2)
With all the data observed, this would be easy to estimate empirically. But with only a measure of location of the Xi observed, and not their spread, I don't see how it's going to be possible to get an estimate of Var(X), without making rather severe assumptions.

at least in the specific case where xi have a Bernoulli distribution I can estimate the variance of x by x¯(1−x¯) as noted above. Even in this case, as noted in the question, I need a larger sample size than I would have expected.
— shabbychef
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.