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

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

[复制链接]
发表于 2012-10-1 15:56:51 | 显示全部楼层 |阅读模式
vgam(VGAM)
vgam()所属R语言包:VGAM

                                         Fitting Vector Generalized Additive Models
                                         配件向量广义可加模型

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

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

Fit a vector generalized additive model (VGAM).  This is a large class of models that includes generalized additive models (GAMs) and vector generalized linear models (VGLMs) as special cases.
装的向量广义相加模型(VGAM)。这是一个大的类模型,包括广义加性模型(GAMS)和矢量广义线性的模型(VGLMs)作为特殊情况。


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


vgam(formula, family, data = list(), weights = NULL, subset = NULL,
     na.action = na.fail, etastart = NULL, mustart = NULL,
     coefstart = NULL, control = vgam.control(...), offset = NULL,
     method = "vgam.fit", model = FALSE, x.arg = TRUE, y.arg = TRUE,
     contrasts = NULL, constraints = NULL,
     extra = list(), qr.arg = FALSE, smart = TRUE, ...)



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

参数:formula
a symbolic description of the model to be fit. The RHS of the formula is applied to each linear/additive predictor. Different variables in each linear/additive predictor can be chosen by specifying constraint matrices.  
一个象征性的模型来描述是合适的。式的RHS被施加到每一个线性/添加剂预测。可以选择不同的变量在每一个线性/添加剂的预测中,通过指定约束矩阵。


参数:family
a function of class "vglmff" (see vglmff-class) describing what statistical model is to be fitted. This is called a “VGAM family function”.  See CommonVGAMffArguments for general information about many types of arguments found in this type of function.  
一个类的函数"vglmff"(vglmff-class)描述统计模型是被安装。这就是所谓的“VGAM家庭功能”。见CommonVGAMffArguments的一般信息,发现这种类型的函数的参数的多种类型的。


参数:data
an optional data frame containing the variables in the model. By default the variables are taken from environment(formula), typically the environment from which vgam is called.  
一个可选的数据框包含在模型中的变量。默认情况下,变量的environment(formula),通常是vgam被称为环境。


参数:weights
an optional vector or matrix of (prior) weights to be used in the fitting process. If weights is a matrix, then it must be in matrix-band form, whereby the first M  columns of the matrix are the diagonals, followed by the upper-diagonal band, followed by the band above that, etc. In this case, there can be up to M(M+1) columns, with the last column corresponding to the (1,M) elements of the weight matrices.  
在嵌合过程中要使用的可选的(现有)的权重向量或矩阵。如果weights是一个矩阵,那么它必须是在矩阵带的形式,由此,第一M列的矩阵的对角线,随后由上部对角线频带,随后由上述频带中该在这种情况下,有可高达M(M+1)列,与最后一列相对应的(1,M)的权重矩阵的元素。


参数:subset
an optional logical vector specifying a subset of observations to be used in the fitting process.  
一个可选的逻辑矢量指定的装配过程中可以使用的观测值的一个子集。


参数:na.action
a function which indicates what should happen when the data contain NAs. The default is set by the na.action setting of options, and is na.fail if that is unset. The “factory-fresh” default is na.omit.  
一个函数,它表示当数据包含NA的,应该发生什么。默认设置是由na.action的options,是na.fail,如果是没有设置的。 “出厂时的默认是na.omit。


参数:etastart, mustart, coefstart
Same as for vglm.  
与为vglm相同。


参数:control
a list of parameters for controlling the fitting process. See vgam.control for details.  
的参数,用于控制的嵌合过程的列表。见vgam.control的详细信息。


参数:offset
a vector or M-column matrix of offset values. These are a priori known and are added to the linear/additive predictors during fitting.  
一个向量或M的列矩阵的偏移值。这些是先验已知的,被添加到的线性/添加剂预测期间嵌合。


参数:method
the method to be used in fitting the model. The default (and presently only) method vgam.fit uses iteratively reweighted least squares (IRLS).  
该方法被用于拟合模型。默认情况下,(目前)的方法vgam.fit使用迭代加权最小二乘(IRLS)。


参数:model
a logical value indicating whether the model frame should be assigned in the model slot.  
一个逻辑值,该值指示是否应该被分配在model插槽的模型框架。


参数:x.arg, y.arg
logical values indicating whether the model matrix and response vector/matrix used in the fitting process should be assigned in the x and y slots.  Note the model matrix is the LM model matrix; to get the VGAM model matrix type model.matrix(vgamfit) where vgamfit is a vgam object.  
逻辑值指示是否模型矩阵和的响应向量/矩阵在装修过程中使用应分配在x和y槽。注意的模型矩阵的LM模型矩阵;,到得到的VGAM的模型的矩阵式model.matrix(vgamfit)其中vgamfit是vgam对象。


参数:contrasts
an optional list. See the contrasts.arg of model.matrix.default.  
可选列表。请参阅contrasts.argmodel.matrix.default。


参数:constraints
an optional list  of constraint matrices.  The components of the list must be named with the term it corresponds to (and it must match in character format exactly). Each constraint matrix must have M rows, and be of full-column rank. By default, constraint matrices are the M by M identity matrix unless arguments in the family function itself override these values. If constraints is used it must contain all the terms; an incomplete list is not accepted.  
约束矩阵的可选列表。的列表中的组件必须被命名为与它对应的术语(及它必须匹配以字符格式完全相同)。每个约束矩阵必须有M行,全列秩。默认情况下,约束矩阵M的M的的身份矩阵,除非在家庭中的参数函数本身覆盖这些值。如果constraints使用它必须包含的所有条款,不接受不完整的名单。


参数:extra
an optional list with any extra information that might be needed by the VGAM family function.  
任何额外的信息可能需要VGAM家庭功能的可选列表。


参数:qr.arg
logical value indicating whether the slot qr, which returns the QR decomposition of the VLM model matrix, is returned on the object.  
逻辑值,该值指示该时隙是否qr,它返回的的VLM模型矩阵的QR分解,则返回的对象。


参数:smart
logical value indicating whether smart prediction (smartpred) will be used.  
逻辑值,该值指示是否智能预测(smartpred)的使用。


参数:...
further arguments passed into vgam.control.  
进一步的参数传递到vgam.control。


Details

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

A vector generalized additive model (VGAM) is loosely defined as a statistical model that is a function of M additive predictors. The central formula is given by
宽泛地定义为一个向量广义相加模型(VGAM)的统计模型是一个函数的M添加剂的预测。由中央式由下式给出

where x_k is the kth explanatory variable (almost always x_1=1 for the intercept term), and f_{(j)k} are smooth functions of x_k that are estimated by smoothers. The first term in the summation is just the intercept. Currently only one type of smoother is implemented and this is called a vector (cubic smoothing spline) smoother. Here, j=1,…,M where M is finite. If all the functions are constrained to be linear then the resulting model is a vector generalized linear model (VGLM).  VGLMs are best fitted with vglm.
x_k是k个解释变量(几乎总是x_1=1截距项),f_{(j)k}是光滑函数x_k估计平滑。中的第一项的总和拦截。目前只有一种类型的平滑实施,这被称为一个向量(三次样条)平滑。在这里,j=1,…,M其中M是有限的。“如果所有的功能都被限制为线性,然后将生成的模型是一个向量,广义线性模型(VGLM)。 VGLMs是最好的配备vglm。

Vector (cubic smoothing spline) smoothers are represented by s() (see s). Local regression via lo() is not supported. The results of vgam will differ from the gam() (in the gam) because vgam() uses a different knot selection algorithm. In general, fewer knots are chosen because the computation becomes expensive when the number of additive predictors M is large.
表示向量(三次样条)平滑s()(见s)。局部回归通过lo()不被支持。的结果vgam从gam()(在gam)不同,因为vgam()使用一个不同的结选择算法。在一般情况下,更少的结被选择添加剂预测变量的数目时,M大,因为计算变得昂贵。

The underlying algorithm of VGAMs is iteratively reweighted least squares (IRLS) and modified vector backfitting using vector splines. B-splines are used as the basis functions for the vector (smoothing) splines.  vgam.fit() is the function that actually does the work.  The smoothing code is based on F. O'Sullivan's BART code.
底层算法的VGAMs迭代加权最小二乘(IRLS)和修改后的向量回切向量样条。用作矢量(平滑)样条基函数的B-样条。 vgam.fit()的功能是实际的工作。平滑的代码是基于F.奥沙利文的BART代码。

A closely related methodology based on VGAMs called constrained additive ordination (CAO) first forms a linear combination of the explanatory variables (called latent variables) and then fits a GAM to these. This is implemented in the function cao for a very limited choice of family functions.
与此密切相关的基础上VGAMs约束添加剂协调的方法(CAO)首先形成的解释变量的线性组合(称为潜变量),然后,这些适合GAM。这是实现的功能cao家庭功能非常有限的选择。


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

An object of class "vgam" (see vgam-class for further information).
类的一个对象"vgam"(见vgam-class欲了解更多信息)。


注意----------Note----------

This function can fit a wide variety of statistical models. Some of these are harder to fit than others because of inherent numerical difficulties associated with some of them. Successful model fitting benefits from cumulative experience. Varying the values of arguments in the VGAM family function itself is a good first step if difficulties arise, especially if initial values can be inputted. A second, more general step, is to vary the values of arguments in vgam.control. A third step is to make use of arguments such as etastart, coefstart and mustart.
此功能可以适合各种各样的统计模型。其中有些是比别人更难适应,因为与其中一些固有的数值困难。成功的模型拟合累积的经验。不同的参数值在VGAM家庭功能本身是一个很好的第一步,如果出现困难,特别是如果输入初始值可以使用。第二,更多的一般步骤,是在vgam.control改变参数的值。第三步是使用的参数,如etastart,coefstart和mustart。

Some VGAM family functions end in "ff" to avoid interference with other functions, e.g., binomialff, poissonff, gaussianff, gammaff. This is because VGAM family functions are incompatible with glm (and also gam in the gam library and gam in the mgcv library).
一些VGAM家庭功能以"ff",以避免干扰其他功能,例如,binomialff,poissonff,gaussianff,gammaff。这是因为VGAM的家庭功能不兼容glm(和gamgam库和gammgcv库)。

The smart prediction (smartpred) library is packed with the VGAM library.
智能预测(smartpred)VGAM库库是挤满了。

The theory behind the scaling parameter is currently being made more rigorous, but it it should give the same value as the scale parameter for GLMs.
缩放参数背后的理论,目前正在作出更严格的,但它应该得到相同的值作为尺度参数GLMS。


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


Thomas W. Yee



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

Vector generalized additive models. Journal of the Royal Statistical Society, Series B, Methodological, 58, 481–493.
The <code>VGAM</code> Package. R News, 8, 28&ndash;39.
http://www.stat.auckland.ac.nz/~yee contains further information and examples.

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

vgam.control, vgam-class, vglmff-class, plotvgam, vglm, s, vsmooth.spline, cao.
vgam.control,vgam-class,vglmff-class,plotvgam,vglm,s,vsmooth.spline,cao。


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


pneumo = transform(pneumo, let = log(exposure.time))
vgam(cbind(normal, mild, severe) ~ s(let),
     cumulative(parallel = TRUE), pneumo)

# Nonparametric logistic regression [非参数logistic回归]
fit = vgam(agaaus ~ s(altitude, df = 2), binomialff, hunua)
## Not run:  plot(fit, se = TRUE) [#未运行图(适合,SE = TRUE)]
pfit = predict(fit, type = "terms", raw = TRUE, se = TRUE)
names(pfit)
head(pfit$fitted)
head(pfit$se.fit)
pfit$df
pfit$sigma

# Fit two species simultaneously [同时适合两个物种]
fit2 = vgam(cbind(agaaus, kniexc) ~ s(altitude, df = c(2, 3)),
            binomialff(mv = TRUE), hunua)
coef(fit2, matrix = TRUE) # Not really interpretable [没有真正解释]
## Not run:  plot(fit2, se = TRUE, overlay = TRUE, lcol = 1:2, scol = 1:2)[#未运行图(FIT2,SE = TRUE,覆盖= TRUE,LCOL = 1:2,SCOL = 1:2)]

ooo = with(hunua, order(altitude))
with(hunua, matplot(altitude[ooo], fitted(fit2)[ooo,], ylim = c(0, .8),
     xlab = "Altitude (m)", ylab = "Probability of presence", las = 1,
     main = "Two plant species' response curves", type = "l", lwd = 2))
with(hunua, rug(altitude))
## End(Not run)[#(不执行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-26 13:27 , Processed in 0.021512 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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