bayes(RSiena)
bayes()所属R语言包:RSiena
A function for fitting Bayesian models
贝叶斯模型拟合的功能
译者:生物统计家园网 机器人LoveR
描述----------Description----------
A function to fit a Bayesian model to Siena Data objects. Uses the function maxlikec for the MCMC part, the Bayesian part is performed in R.
的功能,以适应贝叶斯模型对锡耶纳的数据对象。使用的功能maxlikec的MCMC部分,的贝叶斯部分,在R.
用法----------Usage----------
bayes(data, effects, model, nwarm=100, nmain=100, nrunMHBatches=20,
plotit=FALSE, nbrNodes=1, dfra=NULL, n=10,
priorSigma=NULL, prevAns=NULL, clusterType=c("PSOCK", "FORK"),
getDocumentation=FALSE)
参数----------Arguments----------
参数:data
A sienaData object as returned by sienaDataCreate.
一个sienaData对象返回的sienaDataCreate。
参数:effects
List of sienaEffects objects as returned by getEffects.
返回getEffectssienaEffects对象名单。
参数:model
Model object, as created by sienaModelCreate. Should contain all options required for the MCMC scheme, and a random seed if required.
模型对象所创建的sienaModelCreate。应包含所有所需的的MCMC方案,如果需要的话和一个随机种子。
参数:nwarm
Number of iterations in the warm up phase.
在热身阶段的迭代数。
参数:nmain
Number of iterations in the main phase.
在主相中的迭代数。
参数:nrunMHBatches
Number of iterations of MCMC between Bayesian update steps.
MCMC贝叶斯更新步骤之间的迭代数量。
参数:plotit
Boolean: whether to plot parameters during the run
布尔:在运行过程中是否绘制参数
参数:nbrNodes
Number of processes to be used. Cannot be more than the number of waves.
要使用的进程数。不能被超过的波数。
参数:dfra
Hessian matrix. Optional
Hessian矩阵。可选
参数:n
Number of iterations used to estimate Hessian
用来估计Hessian矩阵的迭代数目
参数:priorSigma
Covariance matrix to use for the prior distribution of the thetas.
协方差矩阵的先验分布的thetas的使用。
参数:prevAns
An object of class "sienaFit" as returned by siena07, from which scaling information (derivative matrix and standard deviation of the deviations) will be extracted along with the latest version of the parameters which will be used as the initial values, unless the model requests the use of standard initial values. If the previous model is exactly the same as the current one, no estimate of the Hessian will be made. If not, any parameter estimates for effects which are included in the new model will be used as initial values, but an estimate of the Hessian will still be made. If the results used as prevAns are a reasonable starting point, this will increase the efficiency of the algorithm.
一个对象的类“sienaFit”经由siena07,从该定标信息(导数矩阵和的偏差的标准偏差)将沿与最新版本的参数的初始值将被用来作为萃取,除非模型请使用标准的初始值。如果先前的模式是完全一样的,则当前,没有估计的Hessian将会作出修改。如果没有任何参数估计的影响,其中包括在新模式将被用作初始值,但仍然可以作出一个估计的Hessian。如果结果作为prevAns是一个合理的起点,这将提高工作效率的算法。
参数:clusterType
If using multiple processes, whether to use forking processes or not. (Only "PSOCK" can be used on Windows.)
如果使用多个进程,无论是使用或不分叉过程。 (只有“PSOCK可以在Windows上使用。)
参数:getDocumentation
Flag to allow documentation of internal functions, not for use by users.
标志以允许内部函数的文档,而不是用户的使用。
Details
详细信息----------Details----------
This function wraps Bayesian sampling of parameters around calls to maxlikec. Unless a Hessian is supplied, one will be estimated from n batches of MH steps using the initial parameters. It is then transformed so the basic rate parameters are on a log scale. And inverted. It then attempts to scale the sampling covariance matrix to achieve about 40 out of 100 acceptances of Bayes proposals after single MH steps. Then a warming phase is done of nwarm Bayesian proposals each with 4 MH steps. Finally nmain repeats of (nrunMHBatches of nrunMH steps plus 1 Bayesian propsal) are performed. If plotit is TRUE, plots are produced at intervals during the run showing progress. They can be memory hogs, but the code may be useful for use on the returned values.
此功能包贝氏抽样的参数调用maxlikec。除非黑森州提供,一会n批MH步骤,使用的初始参数估计。它然后被转化,以便基本速率参数是对数标度的。和反相。然后,它尝试扩展的采样协方差矩阵,实现了约40 100承兑贝叶斯建议单MH步骤后。然后升温阶段的nwarm贝叶斯建议每4 MH步骤。最后nmain(nrunMHBatches的nrunMH步加1贝叶斯propsal中)进行重复。如果plotit是TRUE,图在运行过程中显示进度的时间间隔。它们可以是内存猪,但上使用的返回值的代码可能是有用的。
值----------Value----------
Returns a list containing, among other things:
返回一个列表,其中包含,除其他事项外:
参数:posteriorTot
?
?
参数:posteriorMII
?
?
参数:candidates
array of parameters
参数的数组
参数:acceptances
matrix of booleans: whether the corresponding change to the parameters was accepted. By group.
布尔值矩阵相应的改变的参数是否被接受。组。
参数:MHacceptances
array of acceptances of the MH steps, by step type and group but summed over dependent variables.
阵列接纳的MH步骤,一步类型和组,但总结过度依赖变量。
参数:MHrejections
array of rejections of the ML steps
拒绝数组的ML步骤
参数:MHproportions
array of proportions of the MH steps accepted
阵列的比例接受的MH步骤
(作者)----------Author(s)----------
Ruth Ripley
参考文献----------References----------
<h3>See Also</h3>
实例----------Examples----------
mynet1 <- sienaNet(array(c(tmp3, tmp4), dim=c(32, 32, 2)))
mydata <- sienaDataCreate(mynet1)
myeff <- getEffects(mydata)
myeff <- includeEffects(myeff, transTrip)
mymodel <- sienaModelCreate(maxlike=TRUE)
ans <- bayes(mydata, myeff, mymodel)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|