varSelectIP(varSelectIP)
varSelectIP()所属R语言包:varSelectIP
Objective Bayes Model Selection
目的贝叶斯模型选择
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This function will carry out a low-dimensional stochastic search in order to determine the “best” model, as measured by its posterior probability. The types of model that this function can handle are probit and regression models. For full details on the model set-up and the stochastic search, please refer to the papers listed below.
此功能将进行低维随机搜索,以确定“最佳”的模式,它的后验概率作为衡量。此功能可以处理的模型,该模型的概率和回归模型的类型。模型组和随机搜索的完整详细信息,请参阅下面列出的文件。
用法----------Usage----------
varSelectIP(response, covariates.retain = NULL, covariates.test, nsim,
keep, q, a = 0.2, model.type = c("probit", "reg"),
save.every = 50, out.fname = "models.csv", parallel = FALSE,
interactive = TRUE, nproc = 2)
参数----------Arguments----------
参数:response
The vector of response values. If a probit model, this should be a binary vector with the 0's coming before the 1's.
的响应值的矢量。如果一个概率模型,这应该是一个二进制向量与前1 0。
参数:covariates.retain
A matrix or a vector containing the covariates that should always be retained when searching through all possible models.
一个矩阵或一个向量,包含所有可能的模式搜索时,应始终保留的协变量。
参数:covariates.test
A matrix or a vector containing all the covariates that should be taken into consideration when searching through all possible models.
一个矩阵或一个向量,包含所有的协变量时,应考虑通过所有可能的模式。
参数:nsim
The number of iterations of the stochastic search to run through.
随机搜索的数目迭代运行通过。
参数:keep
The final number of models to report, along with their Bayes Factors.
最后报告的模型,随着他们的贝叶斯因子。
参数:q
The maximum number of covariates to be included in each model considered. These covariates will be chosen out of those in covariates.test above.
考虑每个模型中的协变量的最大数量。这些的协变量将被挑选出,covariates.test以上。
参数:a
The probability with which the entire set of active coefficients are re-drawn. See page 12 of reference (2) for more details.
的概率与该整个组的活性系数被重新绘制。参考(2)有关详细信息,请参阅第12页。
参数:model.type
This has to be either "probit" or "reg", specifying the type of model to be fit.
这是“概率”或“章”,指定类型的模型是合适的。
参数:save.every
Specifies how often the models should be written out to a .csv file. This allows a user to monitor progress of models found and to prevent loss of effort in the case of power failure, etc.
指定的模型往往写出来的。csv文件。这将允许用户监控模型发现和进展的努力,以防止丢失的情况下,电源故障等
参数:out.fname
The name of the .csv file to save models to.
的。csv文件的名称保存模型。
参数:parallel
A logical variable, instructing the package to carry out the bottleneck step on parallel processors.
一个逻辑变量,指示包进行并行处理器的瓶颈步骤。
参数:interactive
Another logical variable, to instruct the package that parallel processing is being carried out interactively. If FALSE, i.e. PBS or some other batch scheduler is being used, then .Rprofile should be in the current working directory. This argument is ignored if parallel is equal to FALSE. See http://www.stat.ufl.edu/~viknesh for a detailed example on how to run the parallel version of this function.
另外一个逻辑变量,指示并行处理的包,正在开展交互方式。如果为FALSE,即PBS或其他一些批处理调度程序正在被使用,那么Rprofile应该在当前的工作目录。如果平行等于FALSE,此参数将被忽略。 http://www.stat.ufl.edu/~viknesh如何运行的并行版本,此功能的详细示例。
参数:nproc
The number of processors to use when parallel processing is done interactively. It is needed only when parallel and interactive are both TRUE.
使用的处理器的数量时以交互方式进行并行处理。它是必要的,只有当并行和互动都是TRUE。
值----------Value----------
A table containing the top models found is returned. Each row in the table represents a model. A 1 within a row indicates that that covariate, from within the covariates defined by covariates.test, is included in the model. A 0 indicates that that particular covariate is left out of the model. The last column contains the Bayes Factor from comparing the specified model against the intercept-only model.
返回一个表,其中包含顶级车型。表中的每一行代表一个模型。 A 1行内表示,协从covariates.test定义的协变量,包括在模型中。 0表示,离开了特定的协变量的模型。最后一列包含指定的模型比较,对仅截距模型的贝叶斯因子。
(作者)----------Author(s)----------
Gopal, V. and Novelo, L. L. and Casella, G.
Maintainer: Gopal, V. <viknesh@stat.ufl.edu>
参考文献----------References----------
Casella, G. and Giron, F.J. and Martinez, M.L. and Moreno, E. (2009) Consistency of Bayesian Procedures for Variable Selection. _Annals of Statistics_, *37*, 1207 - 1228.
Leon-Novelo, L. and Moreno, E. and Casella, G. (2010) Objective Bayes Model Selection in Probit Models. http://www.stat.ufl.edu/~casella/Papers
实例----------Examples----------
n <- 20 # number of observations[的观测数]
p <- 6 # total number of covariates[总数的协变量]
set.seed(0)
gene_expression <- matrix(runif(n*p)*4,nrow=n,ncol=p)
age <- sample(20:40,n,replace=TRUE)
truth_betavector <- c(-0.1, -.01, 1, -1, rep(0,p+2-4))
design <- cbind(1, age, gene_expression) # sets up the entire design matrix.[建立了整个设计矩阵。]
# Simulating the z-values and y-values and setting up the data-frame[模拟的z值和y值和设置数据框]
y_tmp <- apply(design, 1, function(xi){rnorm(n=1, sum(xi * truth_betavector))})
y <- y_tmp[order(y_tmp)]
x <- design[order(y_tmp), -c(1:2)]
n0 <- sum(y<0)
n1 <- n-n0
z <- c(rep(0,n0),rep(1,n1))
mydata <- cbind(z, y, age, x)
colnames(mydata)<-c("z", "y", "age", paste("GE",1:p,sep=""))
# Probit regression function call:[Probit回归函数调用:]
varSelectIP(a=0.2, keep=2, covariates.retain=mydata[,3], model.type="probit",
q=5, covariates.test=mydata[,4:9], response=mydata[,1], nsim=2)
# Linear regression function call:[线性回归函数调用:]
varSelectIP(a=0.2, keep=2, covariates.retain=mydata[,3], model.type="reg",
q=5, covariates.test=mydata[,4:9], response=mydata[,2], nsim=25)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|