找回密码
 注册
查看: 388|回复: 0

R语言 SEL包 getbinPost()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 00:30:29 | 显示全部楼层 |阅读模式
getbinPost(SEL)
getbinPost()所属R语言包:SEL

                                        Calculate posterior distribution for binomial model
                                         二项式模型计算后验分布

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Calculate posterior distribution for the simple beta-binomial model
简单的β-二项式模型计算后验分布


用法----------Usage----------


  getbinPost(x, object, k, n, type = c("density", "cdf"),
             rel.tol = .Machine$double.eps^0.5)



参数----------Arguments----------

参数:x
Vector specifying, where posterior distribution should be evaluated.
向量确定,后验分布进行评估。


参数:object
An SEL object.
SEL对象。


参数:k
Number of observed successes in the binomial model.
数二项式模型中观察到的成功。


参数:n
Number of total trials.
总试验数。


参数:type
Character specifying, whether posterior density or cdf should be evaluated.
字符指定,是否应进行评估后密度或CDF。


参数:rel.tol
rel.tol argument of the integrate subroutine, which numerically calculates the normalization constant, when a non-conjugate prior is used (ie a B-spline basis not leading to a Bernstein mixture).
rel.tol参数的数值计算的归一化常数,积分子程序,当一个非共轭事前被使用(即不导致到伯恩斯坦混合物的B-样条基)。


值----------Value----------

Numeric containing the function values corresponding to x values
数字包含的函数值对应的x值


(作者)----------Author(s)----------


Bjoern Bornkamp



参考文献----------References----------

Bornkamp, B. and Ickstadt, K. (2009). A Note on B-Splines for Semiparametric Elicitation. The American Statistician, 63, 373–377
Diaconis, P., and Ylvisaker, D. (1985), Quantifying Prior Opinion, Bayesian Statistics 2, (eds.) J.M. Bernardo, M.H. DeGroot, D.V. Lindley and A.F.M. Smith, Elsevier Science Publishers B.V., Amsterdam, pp. 133–156.

参见----------See Also----------

SEL
SEL


实例----------Examples----------


## Diaconis, Ylvisaker spun coin example (see references)[#戴康尼斯,Ylvisaker纺硬币的例子(请参阅参考资料)]
## simulate elicitations[#模拟的推算]
x <- seq(0, 1, length=9)[2:8]
ymu <- 0.5*pbeta(x, 10, 20)+0.5*pbeta(x, 20, 10)
sig <- 0.05
set.seed(4)
y <- ymu+rnorm(7, 0, sqrt(ymu*(1-ymu))*sig)

## perform fitting with different selections[#执行配不同的选择]
A <- SEL(x, y, d = 1, Delta = 0.001, inknts = x)
foo1 <- function(x) dbeta(x, 0.5, 0.5)
B <- SEL(x, y, d = 19, N=0, Delta = 0.02, pistar = foo1)
C <- SEL(x, y, d = 19, N=0, Delta = 0.05, pistar = foo1)
comparePlot(A, B, C, addArgs = list(layout = c(3,1)))

## posterior[#后]
sq <- seq(0,1,length=201)
res1 <- getbinPost(sq, A, 3, 10, type = "density")
res2 <- getbinPost(sq, B, 3, 10, type = "density")
res3 <- getbinPost(sq, C, 3, 10, type = "density")

## parametric posterior (corresponding to B(0.5,0.5) prior)[#参数后(对应于B(0.5,0.5)前)]
plot(sq, dbeta(sq, 3.5, 7.5), type="l", xlab = "",
     ylab = "Posterior density", lty = 4,
     ylim=c(0,max(c(res1, res2, res3))))
## "semiparametric" posteriors[“半参数”的后验概率]
lines(sq, res1, lty = 1)
lines(sq, res2, lty = 2)
lines(sq, res3, lty = 3)
legend(0.65,4, legend=c("Scenario A", "Scenario B", "Scenario C",
       "B(0.5,0.5) prior"), lty = 1:4)

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-5-18 10:06 , Processed in 0.035108 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表