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

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

[复制链接]
发表于 2012-2-26 15:59:18 | 显示全部楼层 |阅读模式
vbmp(vbmp)
vbmp()所属R语言包:vbmp

                                        Variational Bayesian Multinomial Probit Regression with Gaussian Process Priors.
                                         高斯过程先验变分贝叶斯多项Probit回归。

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

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

Used to fit a Multinomial Probit Regression model, specified by giving the  matrix design X, the associated response variables t.class, kernel type and covariate  scaling parameters. Covariance paramters can be inferred from the data.
使用适合多项Probit回归模型,给予矩阵设计X,相关的响应变量t.class,内核类型和协缩放参数指定。从数据可以推断协方差参数研究。


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


vbmp(X, t.class, X.TEST, t.class.TEST, theta, control = list())



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

参数:X
Feature matrix for parameter 'estimation'
特征矩阵参数的估计“


参数:t.class
Target values, integer number used for class labels.  
目标值,类标签所用的整数。


参数:X.TEST
Feature matrix to compute out-of-sample (test) prediction errors and likelihoods  
特征矩阵计算出样本(测试)预测误差和似然性


参数:t.class.TEST
Target values for test data  
测试数据的目标值


参数:theta
The covariance function parameters (e.g. scaling coefficients for each dimension)  
协方差函数的参数(例如缩放系数为每个维度)


参数:control
A list of control parameters. See Details
控制参数的列表。详细


Details

详情----------Details----------

In this implementation a single covariance function is shared across all classes. Compute the predictive posteriors on the test set and the associated likelihood  and test errors at each iteration.
在此实现所有类共享一个单一的协方差函数。计算测试集和相关的可能性,并在每一次迭代的测试错误的预测后验。

The control argument is a list that can supply any of the following components:
控制参数是一个列表,可以提供以下组件:




InfoLevel  0 to suppress tracing ( > 0  to print different levels
InfoLevel 0压制跟踪(> 0打印不同层次




sFILE.TRACE  File name where to redirect output (default NULL)
sFILE.TRACE文件名,输出重定向(默认为NULL)




bThetaEstimate  if covariance parameter estimation switched on. Defaults to FALSE (switched off)
bThetaEstimate协方差参数估计,如果接通。默认为false(关闭)




sKernelType  Kernel function used in training and predicting.  Currently implemented kernels are Gaussian ("gauss"),  Cauchy ("cauchy"), Laplace ("laplace"), Polynomial ("poly"), Homogeneous polynomial ("hpoly"), 'Thin-plate' spline ("tps"), 'linear' spline ("lsp") and Inner product("iprod").
sKernelType核函数用在训练和预测。目前正在执行的内核是高斯("gauss"),柯西("cauchy"),拉普拉斯("laplace"),多项式("poly"),齐次多项式("hpoly"), “薄板样条("tps"),”线性“样条("lsp")和内蒙古的产品("iprod")。




maxIts  Maximum number of variational EM steps to take.
maxIts变电磁的最大数量,要采取的步骤。




Thresh Convergence threshold on marginal likelihood lowerbound.
阈值上边际可能性下界的收敛阈值。




method Integral computation method: "quadrature" (Gaussian quadrature)
方法积分计算方法:“正交”(高斯正交)




nNodesQuad Number of nodes used for quadrature. Defaults to 49.
正交使用的节点nNodesQuad号码。默认到49。




nSampsTG Number of samples used in obtaining mean of truncated
nSampsTG取得样本数平均截断




nSampsIS Number of samples used in the importance sampler.
nSampsIS号码中的重要性采样样本。




nSmallNo Small number used to prevent numerical problems
nSmallNo少数用于防止数值问题




parGammaTau,parGammaSigma The location and scale parameters of the
parGammaTau,parGammaSigma的位置和尺度参数




bMonitor TRUE to collect monitor convergence diagnostics at each
bMonitor TRUE收集在每个显示器的收敛诊断




bPlotFitting TRUE to plot test performance results at each iteration
bPlotFitting TRUE,图性能测试结果,在每一次迭代


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

vbmp returns an object of class "VBMP.obj".  An object of class "VBMP.obj" is a list containing at least the following components:
vbmp返回一个类“VBMP.obj”的对象。一个类“VBMP.obj”的对象是一个列表,其中至少包含以下组件:


参数:Kc
Number of classes
班数


参数:Ptest
Matrix of multinomial class predictive posterior probabilities for the test data  
多项式类的测试数据的预测后验概率矩阵


参数:X
Feature matrix
特征矩阵


参数:invPHI
Inverse of the Kernel matrix
核矩阵的逆


参数:Y
Matrix of auxiliary variables
基质辅助变量


参数:M
Matrix of GP random variables     
GP的随机变量的矩阵


参数:theta
covariance kernel hyperparameters (estimates computed during  model fitting, if inferred     
协的内核hyperparameters(估计计算模型拟合过程中,如果推断


参数:sKernelType
Kernel function used in training and predicting     
在训练和预测所使用的内核函数


参数:Test.Err
Out-of-Sample Percent Prediction error estimates computed  during model fitting (0-1 error loss).
估计在模型拟合(0-1误差损失)计算出样本的预测误差百分比。


参数:PL
Predictive Likelihood estimates computed during model fitting
预测似然估计在模型拟合计算


参数:LOWER.BOUND
Lower bound estimates computed during model fitting     
在模型拟合的计算界估计


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


N Lama <a href="mailto:nicola.lama@unina2.it">nicola.lama@unina2.it</a>, MA Girolami <a href="mailto:girolami@dcs.gla.ac.uk">girolami@dcs.gla.ac.uk</a>



参考文献----------References----------

Lama N, Girolami M vbmp: Variational Bayesian Multinomial Probit Regression for multi-class classification in R, Bioinformatics 24(1):135-136 (2008).  http://bioinformatics.oxfordjournals.org/cgi/content/short/btm535v1

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

See Also as predictCPP, covParams,  lowerBound, predError,
另外,看到predictCPPcovParams,lowerBound,predError


举例----------Examples----------



## -----------------------------------------------------------------------------[#------------------------------------------------- ----------------------------]
## EXAMPLE 1 - Theta estimate with synthetic data[#示例1  - 西塔估计与合成数据]
## -----------------------------------------------------------------------------[#------------------------------------------------- ----------------------------]
## Samples of 2-D data points drawn from three nonlinearly separable[#2-D数据点的样品得出三个非线性可分]
## classes which take the form of two annular rings and one zero-centered[#类两个环环的形式和零为本]
## Gaussian are used in this little illustrative example. [#高斯在这个小例子。]
genSample <- function(n, noiseVar=0) {
    ## class 1 and 2 (x ~ U(0,1))[#1级和2(X~U(0,1))]
    u <- 4. * matrix(runif(2*n), nrow=n, ncol=2) - 2.;
    i <- which(((u[, 1]^2 + u[, 2]^2) > .1) &amp; ((u[, 1]^2 + u[, 2]^2) < .5) );
    j <- which(((u[, 1]^2 + u[, 2]^2) > .6) &amp; ((u[, 1]^2 + u[, 2]^2) < 1) );
    X <- u[c(i, j),];
    t.class <- c(rep(1, length(i)),rep(2, length(j)));
    ## class 3 (x ~ N(0,1))[#3级(X~N(0,1))]
    x <- 0.1 * matrix(rnorm(2*length(i)), ncol=2, nrow=length(i) );
    k <- which((x[, 1]^2 + x[, 2]^2) < 0.1);
    X <- rbind(X, x[k, ]);
    t.class <- c(t.class, rep(3, length(k)));
    ## add random coloumns[#随机coloumns添加]
    if (noiseVar>0) X <- cbind(X, matrix(rnorm(noiseVar*nrow(X)), ncol=noiseVar, nrow=nrow(X)));
    structure( list( t.class=t.class, X=X), class="MultiNoisyData");
}

set.seed(123); ## Init random number generator[#初始化随机数发生器]

## Generate training and test samples as an independent [#生成的培训和测试样本作为一个独立的]
## test set to assess out-of-sample prediction error [#测试评估的样本预测误差]
## and predictive likelihoods.[#和预测似然性。]
nNoisyInputs &lt;- 0;       ## number of additional noisy input parameters[#额外的嘈杂输入参数的数量]
Ntest &lt;- Ntrain &lt;- 500;  ## sample sizes[#样本大小]
dataXt.train <- genSample(Ntrain, nNoisyInputs);
dataXt.test  <- genSample(Ntest,  nNoisyInputs);

## Not run:  [#无法运行:]
theta <- runif(ncol(dataXt.train$X));
res <- vbmp( dataXt.train$X, dataXt.train$t.class,
        dataXt.test$X, dataXt.test$t.class, theta,
         control=list(bThetaEstimate = T,
         bPlotFitting=T, maxIts=50));

## End(Not run)[#结束(不运行)]

## set theta params (previously estimated) [#设置THETA的params(原先估计)]
theta <- c(0.09488309, 0.16141604);   
## Fit the vbmp[#适合的vbmp]
res <- vbmp( dataXt.train$X, dataXt.train$t.class,
        dataXt.test$X, dataXt.test$t.class, theta,
        control=list(maxIts=5));
## print out-of-sample error estimate[#打印出的样本误差估计]
predError(res);

## Not run: [#无法运行:]
## ----------------------------------------------------------[#------------------------------------------------- ---------]
## EXAMPLE 2 - BRCA12 genomic data[#范例2  -  BRCA12基因组数据]
## ----------------------------------------------------------[#------------------------------------------------- ---------]
## Leave-one-out (LOO) cross-validation prediction error of the probabilistic [#留一法(LOO)交叉验证预测误差的概率]
## Gaussian process classifier used in Zsofia Kote-Jarai et al. [#高斯过程分类,在Zsofia甲手,Jarai等。]
## Clin Cancer Res 2006;12(13);3896-3901[#临床癌症研究2006年; 12(13)3896-3901]

  if(any(installed.packages()[,1]=="Biobase")) {
    library("Biobase");
    data("BRCA12");
    brca.y <- BRCA12$Target.class;
    brca.x <- t(exprs(BRCA12));
  } else {
    print("Deprecated.....");
    load(url("http://www.dcs.gla.ac.uk/people/personal/girolami/pubs_2005/VBGP/BRCA12.RData"));
    brca.y <- as.numeric(BRCA12$y);
    brca.x <- as.matrix(BRCA12[,-1]);
  }
  
  sKernelType &lt;- "iprod";  ## Covariance function type[#方差函数类型]
  Thresh &lt;- 1e-8;  ## Iteration threshold[#迭代阈值的]
  InfoLevel <- 1;
  theta <- rep(1.0, ncol(brca.x));
  ITER.THETA <- 24;
  n     <- nrow(brca.x) ;
  Kfold &lt;- n; # number of folds , if equal to n then LOO[褶皱的数量,如果等于n然后LOO]
  samps <- sample(rep(1:Kfold, length=n), n, replace=FALSE);
  res   <- rep(NA, n);
  print(paste("LOO crossvalidation started...... (",n,"steps)"));
  for (x in 1:Kfold) {
      cat(paste(x,", ",sep="")); flush.console();
      resX <- vbmp( brca.x[samps!=x,], brca.y[samps!=x],
                    brca.x[samps==x,], brca.y[samps==x],
                    theta,  control=list(bThetaEstimate=F,
                    bPlotFitting=F, maxIts=ITER.THETA,
                    sKernelType=sKernelType, Thresh=Thresh));   
      res[samps==x] <- predClass(resX);
  }
  print("(end)");
  print(paste("Crossvalidated error rate", round(sum(res!=brca.y)/n,2)));

## End(Not run)   [#结束(不运行)]



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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-22 20:52 , Processed in 0.023091 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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