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

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

[复制链接]
发表于 2012-10-1 14:22:06 | 显示全部楼层 |阅读模式
varbvsoptimize(varbvs)
varbvsoptimize()所属R语言包:varbvs

                                        Coordinate ascent for variational approximation to Bayesian
                                         协调上升的变分近似贝叶斯

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

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

varbvsoptimize implements the fully-factorized variational approximation for Bayesian variable selection in linear regression. It finds the "best" fully-factorized variational approximation to the posterior distribution of the coefficients in a linear regression model of a continuous outcome (quantitiative trait), with spike and slab priors on the coefficients. By "best", we mean the approximating distribution that locally minimizes the Kullback-Leibler divergence between the approximating distribution and the exact posterior.
varbvsoptimize实现的完全工厂化变的贝叶斯近似的线性回归变量选择。找到“最好的”完全工厂化变分近似的后验分布的连续的结果(quantitiative性状)线性回归模型中的系数,与穗板先验的系数。 “最好”,我们指的是近似的分布,局部最小化的Kullback-Leibler散度之间的近似分布和精确的后。

varbvsupdate runs a single iteration of the coordinate ascent updates to maximize the variational lower bound or, equivalently,
varbvsupdate运行的单次迭代的坐标上升更新最大化的变分下界,或等价地,


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



varbvsoptimize(X, y, sigma, sa, logodds, alpha0 = NULL,
mu0 = NULL, verbose = TRUE)

varbvsupdate(X, sigma, sa, logodds, xy, d, alpha0, mu0, Xr0, S)



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

参数:X
Matrix of observations about the variables (or features). It has n rows and p columns, where n is the number of samples, and p is the number of variables.
矩阵观测的变量(或功能)。 n行p列,其中n的样本数,和p是变量的数目。


参数:sigma
Scalar giving the variance of the residual.
标量给残差的方差。


参数:sa
sa*sigma is the prior variance of the regression coefficients.
sa*sigma是先验方差的回归系数。


参数:logodds
Prior log-odds of inclusion for each variable. It is equal to logodds = log(q/(1-q)), where q is the prior probability that each variable is included in the linear model of Y. It may either be a scalar, in which case all the variables have the same prior inclusion probability, or it may be a vector of length p.
在此之前登录赔率包含的每个变量。这是等于logodds = log(q/(1-q)),q是先验概率,每个变量的线性模型Y的,它可以是一个标量,在这种情况下,所有的变量具有相同的前列入概率,或者它可以是一个矢量的长度p。


参数:alpha0
Initial variational estimate of posterior inclusion probabilities. It is a vector of length p. If alpha0 = NULL, the variational parameters are initialized at random.
初始变的估计后列入概率。它是一个向量的长度p。如果alpha0 = NULL,变参数的随机初始化。


参数:mu0
Initial variational estimate of posterior mean coefficients. It is a vector of length p. If mu0 = NULL, the variational parameters are randomly initialized.
首次变后平均系数的估计。它是一个向量的长度p。如果mu0 = NULL,变参数的随机初始化。


参数:y
Vector of observations about the outcome. It is a vector of length n.
矢量观测的结果。它是一个向量的长度n。


参数:verbose
Set verbose = FALSE to turn off reporting the  algorithm's progress.
设置verbose = FALSE关闭算法的进展情况报告。


参数:xy
Equal to t(X) %*% y, where y is the vector of observations about the outcome.
t(X) %*% y,y是矢量观测的结果。


参数:d
Equal to diag(t(X) %*% X).
等于diag(t(X) %*% X)。


参数:Xr0
Equal to X %*% (alpha0*mu0).
等于X %*% (alpha0*mu0)。


参数:S
Order in which the coordinates are updated. It is a vector of any length. Each entry of S must be an integer between 1 and p.
顺序的坐标被更新。它是一个任意长度的向量。每个条目S必须是1之间的整数和p。


Details

详细信息----------Details----------

alpha, mu and s are the parameters of the variational approximation and, equivalently, variational estimates of posterior quantites: under the variational approximation, the ith regression coefficient is normal with probability alpha[i]; mu[i] and s[i] are the mean and variance of the coefficient given that it is included in the model. alpha, mu and s are always column vectors of length p.
alpha,mu和s的变分近似的参数,并等价,变分后分位数的估计:变分近似下,第i个回归系数的概率是正常<X >alpha[i]和mu[i]是,它是包含在模型中的系数的均值和方差。 s[i],alpha和mu总是列向量的长度s。

To account for an intercept, y and X must be centered beforehand so that y and each column of X has a mean of zero.
占为拦截,y和X必须围绕事先y和X每列有一个均值为零。

The computational complexity of running varbvsupdate is O(n*length(S)). For efficient computation, most of the work is done by varbvsupdateR, a function implemented in C. The call to the C function in the shared library is made using .C.
计算复杂度的运行varbvsupdate是O(n*length(S))。为了有效地进行计算,大部分的工作是由varbvsupdateR,用C实现的功能,在共享库中的C函数的调用是使用.C。


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

varbvsoptimize returns a list containing four components: variational parameters alpha, mu and s, and the variational estimate of the marginal log-likelihood lnZ.
varbvsoptimize返回一个列表,其中包含四个组成部分:变参数alpha,mu和s,和变估计的边际对数似然lnZ。

varbvsupdate returns a list containing three components: the updated variational parameters alpha and mu, and the
varbvsupdate返回一个列表,其中包含三个组成部分:更新的变参数alpha和mu,和


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


Peter Carbonetto



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

varsimbvs
varsimbvs


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



## Randomly generate genotypes and quantitative trait measurements for[#随机生成基因型和数量性状的测量]
## 1000 SNPs and 500 individuals, in which the variance of the residual[#1000 SNPs和500个个体,其中所述的残余方差]
## error is 4. Of these SNPs, 10 have nonzero additive effects on the[#误差为4。这些SNPs中,有非零的加性效应]
## trait.[#特征。]
se   <- 4
snps <- create.snps(1000,10)
data <- create.data(snps$maf,snps$beta,se,500)

## Compute the variational approximation given (appropriate) choices for[#变分近似计算(适当的)选择]
## the hyperparameters.[#的超。]
result <- varbvsoptimize(data$X,data$y,4,1/4,log(0.01/0.99))

## View the posterior inclusion probabilities for the (true) causal SNPs.[#查看后入选的概率(真)因果单核苷酸多态性。]
S <- which(snps$beta != 0)
cbind(snps$beta[S],result$alpha[S])

## View the largest posterior inclusion probability for a SNP that has[#查看最大后验的,有一个SNP包含概率]
## no effect on the quantitative trait.[#没有影响的数量性状。]
S <- which(snps$beta == 0)
i <- S[which.max(result$alpha[S])]
cbind(snps$beta[i],result$alpha[i])


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-27 18:35 , Processed in 0.021808 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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