beaver.gibbs(SMPracticals)
beaver.gibbs()所属R语言包:SMPracticals
Gibbs Sampler for Normal Changepoint Model, Practical 11.7
Gibbs抽样算法的为正常的Changepoint模型,实用11.7
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function implements a Gibbs sampler for the normal changepoint model applied to the beaver temperature data used in Example 6.22
此功能实现了例6.22的的河狸温度数据的正常结构变动模型的Gibbs抽样
用法----------Usage----------
beaver.gibbs(init, y, R = 10, a = 1, b = 0.05)
参数----------Arguments----------
参数:init
Initial values for parameters
参数的初始值
参数:y
A series of normal observations
一系列的正常观察
参数:R
Number of iterations of sampler
取样器的迭代数
参数:a
Value of a hyperparameter
一个超参数的值
参数:b
Value of a hyperparameter
一个超参数的值
Details
详细信息----------Details----------
This is provided simply so that readers spend less time typing. It is not intended to be robust and general code.
这是简单地让读者花更少的时间打字。它的目的不是是坚固和一般的代码。
值----------Value----------
A matrix of size R x 6, whose first four columns contain the values of the parameters for the iterations. Columns 5 and 6 contain the log likelihood and log prior for that iteration.
尺寸R×6,其前四个列中包含的参数的值的迭代的矩阵。 5和第6列中包含的对数似然迭代前登录。
(作者)----------Author(s)----------
Anthony Davison (<code>anthony.davison@epfl.ch</code>)
参考文献----------References----------
实例----------Examples----------
## From Example 11.7:[#从例11.7:]
data(beaver)
system.time( gibbs.out <- beaver.gibbs(c(36, 40, 3, 38), beaver$temp, R=1000))
par(mfrow=c(2,3))
plot.ts(gibbs.out[,1],main="mu1") # time series plot for mu1[时间序列图MU1]
plot.ts(gibbs.out[,2],main="mu2") # time series plot for mu2[时间序列图MU2]
plot.ts(gibbs.out[,3],main="lambda") # time series plot for lambda[为lambda的时间序列图]
plot.ts(gibbs.out[,4],main="gamma") # time series plot for gamma[时间序列图的伽玛]
plot.ts(gibbs.out[,5],main="log likelihood") # and of log likelihood[和对数似然]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|