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

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

[复制链接]
发表于 2012-9-30 14:22:31 | 显示全部楼层 |阅读模式
bayesLMConjugate(spBayes)
bayesLMConjugate()所属R语言包:spBayes

                                        Simple Bayesian linear model via the Normal/inverse-Gamma conjugate
                                         通过简单的贝叶斯线性模型正/反伽马共轭

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

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

Given an lm object, the bayesLMConjugate function fits a simple Bayesian linear model with Normal and inverse-Gamma priors.  
由于lm对象,bayesLMConjugate功能符合一个简单的贝叶斯线性模型与正常和反伽马先验。


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


  bayesLMConjugate(formula, data = parent.frame(), n.samples,
                     beta.prior.mean, beta.prior.precision,
                     prior.shape, prior.rate, ...)



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

参数:formula
for a univariate model, this is a symbolic description of the regression model to be fit. See example below.  
单变量模型中,这是一个象征性的回归模型是适合的描述。见下面的例子。


参数:data
an optional data frame containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which spLM is called.   
一个可选的数据框包含在模型中的变量。如果没有找到,数据,变量environment(formula),通常是spLM被称为环境。


参数:n.samples
the number of posterior samples to collect.  
后的样品收集。


参数:beta.prior.mean
beta multivariate normal mean vector hyperprior.  
beta多元的正常均值向量hyperprior。


参数:beta.prior.precision
beta multivariate normal precision matrix hyperprior.  
beta多元的正常精密的矩阵hyperprior。


参数:prior.shape
sigma.sq inverse-Gamma shape hyperprior.  
sigma.sq反伽马的形状hyperprior。


参数:prior.rate
sigma.sq inverse-Gamma 1/scale hyperprior.  
sigma.sq的反伽马1/scale hyperprior。


参数:...
currently no additional arguments.   
目前没有任何额外的参数。


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

An object of class bayesLMConjugate, which is a list with at least the following tag:
类的一个对象bayesLMConjugate,这是至少有以下标记的列表:


参数:p.samples
a coda object of posterior samples for the defined parameters.  
一个coda对象定义的参数后样品。


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



Sudipto Banerjee <a href="mailto:sudiptob@biostat.umn.edu">sudiptob@biostat.umn.edu</a>, <br>
Andrew O. Finley <a href="mailto:finleya@msu.edu">finleya@msu.edu</a>




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


## Not run: [#不运行:]

data(FORMGMT.dat)

n = nrow(FORMGMT.dat)
p = 7 ##an intercept and six covariates[#拦截和6个协变量]

n.samples <- 500

## Below we demonstrate the conjugate function in the special case[#下面我们证明了在特殊情况下的共轭函数]
## with improper priors. The results are the same as for the above,[#不正确的先验知识。为上述的结果是相同的,]
## up to MC error. [#到MC错误。]
beta.prior.mean <- rep(0, times=p)
beta.prior.precision <- matrix(0, nrow=p, ncol=p)

prior.shape <- -p/2
prior.rate <- 0

m.1 <-
  bayesLMConjugate(Y ~ X1+X2+X3+X4+X5+X6, data = FORMGMT.dat,
                     n.samples, beta.prior.mean,
                     beta.prior.precision,
                     prior.shape, prior.rate)

summary(m.1$p.samples)

## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-17 10:40 , Processed in 0.037218 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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