coin.spin(SMPracticals)
coin.spin()所属R语言包:SMPracticals
Function for Coin Spinning, Practical 11.1
硬币纺纱,11.1实用功能
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function computes the posterior distribution of the success probability theta when a coin is spun on its edge (or tossed), when the prior density for that probability is a mixture of beta densities.
当硬币纺其边缘上(或抛出),该函数计算的成功概率θ波的后验分布时,该概率是现有密度的β密度的混合物。
用法----------Usage----------
coin.spin(para, r = 0, n = 0, n.points = 199)
参数----------Arguments----------
参数:para
A matrix with 3 columns and k rows, where k is the number of components of the mixture. The first column contains the probabilities, and the next two the shape parameters a and b for the components.
具有3列和k行,其中k是在该混合物的成分的数目的矩阵。第一列包含的概率,而接下来的两个形状参数a和b的组成部分。
参数:r
Number of successes
成功数
参数:n
Number of trials
试验次数
参数:n.points
The number of values of theta, equally-spaced between 0 and 1.
的θ的值的数目,同样在0和1之间隔开。
Details
详细信息----------Details----------
This is provided simply so that readers spend less time typing. It is not intended to be robust and general code.
这是简单地让读者花更少的时间打字。它的目的不是是坚固和一般的代码。
值----------Value----------
参数:x
Values of theta
值的θ
参数:y
Values of posterior density for theta
的后验概率密度值THETA
(作者)----------Author(s)----------
Anthony Davison (<code>anthony.davison@epfl.ch</code>)
参考文献----------References----------
实例----------Examples----------
## From Practical 11.1:[#从实践11.1:]
para <- matrix( c(0.5, 10, 20, 0.5, 20, 10), nrow=2, ncol=3, byrow=TRUE)
prior <- coin.spin(para)
plot(prior, xlab="theta",ylab="PDF", type="l",ylim=c(0,6))
post <- coin.spin(para, r=4, n=10)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|