楼主: vickey_chang
11813 3

[问答] 怎么计算置信区间的真实覆盖率? [推广有奖]

  • 0关注
  • 0粉丝

本科生

95%

还不是VIP/贵宾

-

威望
0
论坛币
429 个
通用积分
0.1500
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
125 点
帖子
52
精华
0
在线时间
131 小时
注册时间
2008-4-25
最后登录
2024-7-20

楼主
vickey_chang 发表于 2014-10-17 11:39:41 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
最近看到一篇文章,里面涉及到actual coverage和nominal coverage,并画出了两者之间的qq图(下图)
QQ截图20141017113311.png
我也参考了其他文章,真实覆盖率的算法如下:

QQ图片20141017113724.jpg
不知道,哪位大侠能帮我想想这个算法如何下手?


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:置信区间 覆盖率 coverage nominal actual 置信区间 覆盖率

回帖推荐

meishanjia1900 发表于3楼  查看完整内容

suppose the random variables x1,x2,...,xn are a random sample from a N(mu, sigma^2) distribution. R command: sample mean of x : mean(x) standard deviation of x : sd(x) the 97.5th percentile of the t-distribution with 15 degrees of freedom : qt(0.975, 15) so, the R script is: inORnot

沙发
qoiqpwqr 发表于 2014-10-17 19:37:16
做模拟的时候你知道真实的参数值,然后比如说你模拟了1000次,算了1000个置信区间,看一下其中多少个包含了真实的参数值就行了。

藤椅
meishanjia1900 发表于 2014-10-17 21:24:10
suppose the random variables x1,x2,...,xn are a random sample from a N(mu, sigma^2) distribution.

R command:

sample mean of x : mean(x)
standard deviation of x : sd(x)
the 97.5th percentile of the t-distribution with 15 degrees of freedom : qt(0.975, 15)

so, the R script is:

inORnot <- function(alpha, n, mu, sigma) {

  x = rnorm(n, mean = mu, sd = sigma)

  L = mean(x) - qt(1 - alpha / 2, n - 1)*sd(x)/sqrt(n)
  U = mean(x) + qt(1 - alpha / 2, n - 1)*sd(x)/sqrt(n)

  return(L <= mu & U >= mu)

}

tau <- function(alpha, S, n) {

  cum = 0
  for (i in 1:S) cum = cum + inORnot(alpha, n, mu = 0, sigma = 1)
  return(cum / S)

}

> tau(alpha = 0.05, S = 1000, n = 100)
[1] 0.957


板凳
vickey_chang 发表于 2014-10-19 10:30:12
meishanjia1900 发表于 2014-10-17 21:24
suppose the random variables x1,x2,...,xn are a random sample from a N(mu, sigma^2) distribution.

...
非常感谢您的回复,谢谢了!!

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-29 21:02