CommonVGAMffArguments(VGAM)
CommonVGAMffArguments()所属R语言包:VGAM
Common VGAM family function Arguments
公共VGAM家庭的功能参数
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Here is a description of some common and typical arguments found in many VGAM family functions, e.g., lsigma, isigma, nsimEI, parallel and zero.
下面是一些常见的典型的发现在许多VGAM家庭功能,如参数的描述,lsigma,isigma,nsimEI,parallel和<X >。
用法----------Usage----------
TypicalVGAMfamilyFunction(lsigma = "loge", esigma = list(), isigma = NULL,
parallel = TRUE, shrinkage.init = 0.95,
nointercept = NULL, imethod = 1,
prob.x = c(0.15, 0.85), mv = FALSE,
whitespace = FALSE,
oim = FALSE, nsimEIM = 100, zero = NULL)
参数----------Arguments----------
参数:lsigma
Character. Link function applied to a parameter and not necessarily a mean. See Links for a selection of choices. If there is only one parameter then this argument is often called link.
字符。 Link功能参数,不一定是一个意思。见Links的选择的选择。如果只有一个参数,这个参数通常被称为link。
参数:esigma
List. Extra argument allowing for additional information, specific to the link function. See Links for more information. If there is only one parameter then this argument is often called earg.
列表。额外的参数,允许更多的信息,特定的纽带作用。见Links更多信息。如果只有一个参数,这个参数通常被称为earg。
参数:isigma
Optional initial values can often be inputted using an argument beginning with "i". For example, "isigma" and "ilocation", or just "init" if there is one parameter. A value of NULL means a value is computed internally, i.e., a self-starting VGAM family function. If a failure to converge occurs make use of these types of arguments.
可选的初始值通常可以使用参数开头的"i"输入。例如,"isigma"和"ilocation",或只是"init",如果有一个参数。 NULL值是指内部计算的值,即自启动VGAM家庭功能。如果收敛失败时,使用这些类型的参数。
参数:parallel
A logical, or formula specifying which terms have equal/unequal coefficients. This argument is common in VGAM family functions for categorical responses, e.g., cumulative, acat, cratio, sratio. For the proportional odds model (cumulative) having parallel constraints applied to each explanatory variable (except for the intercepts) means the fitted probabilities do not become negative or greater than 1. However this parallelism or proportional-odds assumption ought to be checked.
一个逻辑,或指定的条款有平等/不平等系数,公式。这种说法是常见的VGAM明确的反应,例如,cumulative,acat,cratio,sratio家庭功能。对于比例优势模型(cumulative),其具有平行的约束施加到每个解释变量(截距除外)装置的拟合概率不成为负或大于1。然而,这种并行或比例赔率假设应该进行检查。
参数:nsimEIM
Some VGAM family functions use simulation to obtain an approximate expected information matrix (EIM). For those that do, the nsimEIM argument specifies the number of random variates used per observation; the mean of nsimEIM random variates is taken. Thus nsimEIM controls the accuracy and a larger value may be necessary if the EIMs are not positive-definite. For intercept-only models (y ~ 1) the value of nsimEIM can be smaller (since the common value used is also then taken as the mean over the observations), especially if the number of observations is large. Some VGAM family functions provide two algorithms for estimating the EIM. If applicable, set nsimEIM = NULL to choose the other algorithm.
一些VGAM家庭功能使用模拟得到近似的预期的信息矩阵(EIM)。对于那些确实,nsimEIM参数指定了每个观察的随机变数; nsimEIM随机变数的平均值。因此nsimEIM控制的准确性和EIMS是不是正定的,一个较大的值可能是必要的。对于仅截距模型(y ~ 1)的值nsimEIM可以较小(由于所使用的共同的值,然后也视为在观测值的平均值),特别是,如果观测值的数量是很大的某些VGAM的家庭功能提供了两种算法的EIM估计,如果适用,nsimEIM = NULL选择其他算法。
参数:imethod
An integer with value 1 or 2 or 3 or ... which specifies the initialization method for some parameters or a specific parameter. If failure to converge occurs try the next higher value, and continue until success. For example, imethod = 1 might be the method of moments, and imethod = 2 might be another method. If no value of imethod works then it will be necessary to use arguments such as isigma. For many VGAM family functions it is advisable to try this argument with all possible values to safeguard against problems such as converging to a local solution. VGAM family functions with this argument usually correspond to a model or distribution that is relatively hard to fit successfully, therefore care is needed to ensure the global solution is obtained. So using all possible values that this argument supplies is a good idea.
一个整数值1或2或3或...其中指定某些参数或一个特定的参数的初始化方法。如果收敛失败时,尝试下一个更高的价值,并继续下去,直到成功。例如,imethod = 1可能是矩量法,和imethod = 2可能是另一种方法。如果没有价值的imethod的工作,那么这将是使用参数如isigma所需。对于许多VGAM家庭功能,它是可取的尝试所有可能的参数值,以防止问题,如收敛到本地的解决方案。 VGAM的家庭功能与此参数通常对应于一个模型或分布是比较难适应成功,因此需要谨慎,以确保获得全球性的解决方案。因此,使用所有可能的值,这种说法用品是一个好主意。
参数:prob.x
Numeric, of length two. The probabilites that define quantiles with respect to some vector, usually an x of some sort. This is used to create two subsets of data corresponding to "low" and "high" values of x. Each value is separately fed into the probs argument of quantile. If the data set size is small then it may be necessary to increase/decrease slightly the first/second values respectively.
数字,长度为2。的probabilites与一些向量,通常是x某种形式的定义位数。这是用来建立两个子集相对应的数据“低”和“高”的x值。每个值都分别加入到probs的quantile参数。如果数据集的大小是小的,那么,它可能需要稍微以增加/减少的第一/第二值分别。
参数:whitespace
Logical. Should white spaces (" ") be used in the labelling of the linear/additive predictors? Setting TRUE usually results in more readability but it occupies more columns of the output.
逻辑。如若空格(" ")的标签中使用的线性/添加剂预测因子?设置TRUE通常会导致更多的可读性,但它占据更多的列的输出。
参数:oim
Logical. Should the observed information matrices (OIMs) be used for the working weights? In general, setting oim = TRUE means the Newton-Raphson algorithm, and oim = FALSE means Fisher-scoring. The latter uses the EIM, and is usually recommended. If oim = TRUE then nsimEIM is ignored.
逻辑。如果所观察到的信息的矩阵(OIMs)用于工作重量?在一般情况下,在oim = TRUE是指牛顿 - 拉夫逊算法,并oim = FALSE是指费舍尔得分。后者使用的EIM,通常建议。如果oim = TRUE然后nsimEIM被忽略。
参数:zero
An integer specifying which linear/additive predictor is modelled as intercepts-only. That is, the regression coefficients are set to zero for all covariates except for the intercept. If zero is specified then it is a vector with values from the set \{1,2,…,M\}. The value zero = NULL means model all linear/additive predictors as functions of the explanatory variables. Here, M is the number of linear/additive predictors. Some VGAM family functions allow the zero argument to accept negative values; if so then its absolute value is recycled over each (usual) response. For example, zero = -2 for the two-parameter negative binomial distribution would mean, for each response, the second linear/additive predictor is modelled as intercepts-only. That is, for all the k parameters in negbinomial (this VGAM family function can handle a matrix of responses). Suppose zero = zerovec where zerovec is a vector of negative values. If G is the usual M value for a univariate response then the actual values for argument zero are all values in c(abs(zerovec), G + abs(zerovec), 2*G + abs(zerovec), ... ) lying in the integer range 1 to M. For example, setting zero = -c(2, 3) for a matrix response of 4 columns with zinegbinomial (which usually has G = M = 3 for a univariate response) would be equivalent to zero = c(2, 3, 5, 6, 8, 9, 11, 12). This example has M = 12. Note that if zerovec contains negative values then their absolute values should be elements from the set 1:G. Note: zero may have positive and negative values, for example, setting zero = c(-2, 3) in the above example would be equivalent to zero = c(2, 3, 5, 8, 11).
一个整数,指定,其中线性/添加剂的预测中,拦截只为蓝本。即,回归系数被设置到零的所有协变量除截距。如果zero指定,那么它是一个矢量的值从集合\{1,2,…,M\}。值zero = NULL是指所有功能解释变量的线性/添加剂的预测模型。在这里,M是的线性/添加剂的预测。一些VGAM家庭功能允许zero参数接受负值,如果这样的话,其绝对值回收了每一个(通常)响应。例如,zero = -2两个参数的负二项分布将意味着,对于每个响应,第二个线性/添加剂的预测中是仿照作为截获只。也就是说,对于所有的k参数negbinomial(这VGAM家庭功能可以处理的响应矩阵)。假设zero = zeroveczerovec是一个向量的负值。如果G是通常的“M一个单变量的响应,为参数的实际值zero中的所有值c(abs(zerovec), G + abs(zerovec), 2*G + abs(zerovec), ... )躺在在整数范围1中 M。例如,设置zero = -c(2, 3)4列的矩阵响应zinegbinomial(通常有G = M = 3单变量的响应),相当于zero = c(2, 3, 5, 6, 8, 9, 11, 12)。这个例子M = 12。请注意,如果zerovec包含负值,那么它们的绝对值应该是元素的集合1:G。注意:zero可能有正面和负面的价值,例如,设置zero = c(-2, 3)在上面的例子中,将相当于zero = c(2, 3, 5, 8, 11)的。
参数:shrinkage.init
Shrinkage factor s used for obtaining initial values. Numeric, between 0 and 1. In general, the formula used is something like s*mu + (1-s)*y where mu is a measure of central tendency such as a weighted mean or median, and y is the response vector. For example, the initial values are slight perturbations of the mean towards the actual data. For many types of models this method seems to work well and is often reasonably robust to outliers in the response. Often this argument is only used if the argument imethod is assigned a certain value.
收缩因子s用于获得初始值。数值,在0和1之间。在一般情况下,所使用的公式是类似s*mu + (1-s)*y其中mu是一个措施,如集中趋势的加权平均值或中位数,和y是响应向量。例如,初始值是对实际数据的平均值的轻微的扰动。对于许多类型的模型,这种方法似乎运作良好,往往是合理的鲁棒性离群值的响应。这种说法往往只用,如果参数imethod被分配一定的价值。
参数:nointercept
An integer-valued vector specifying which linear/additive predictors have no intercepts. Any values must be from the set {1,2,...,M}. A value of NULL means no such constraints.
指定一个整数值向量的线性/添加剂的预测有没有拦截。任何值都必须是集合{1,2,...,M}。 NULL值是指没有这样的约束。
参数:mv
Logical. Some VGAM family functions allow a multivariate or vector response. If so, then usually the response is a matrix with columns corresponding to the individual response variables. They are all fitted simultaneously. Arguments such as parallel may then be useful to allow for relationships between the regressions of each response variable. If mv = TRUE then sometimes the response is interpreted differently, e.g., posbinomial chooses the first column of a matrix response as success and combines the other columns as failure, but when mv = TRUE then each column of the response matrix is the number of successes and the weights argument is of the same dimension as the response and contains the number of trials.
逻辑。一些VGAM家庭功能允许多变量或向量的响应。如果是的话,那么通常的响应是一个矩阵的列对应的各个响应变量。他们同时都配备。如parallel的参数可能是有益的,允许每个响应变量之间的回归关系。如果mv = TRUE然后有时响应不同的解释,例如posbinomial选择成功的响应作为一个矩阵的第一列中,并结合其它列作为故障,但是当mv = TRUE然后每一列响应矩阵是成功的次数和weights参数是相同尺寸的响应,其中包含的试验次数。
Details
详细信息----------Details----------
Full details will be given in documentation yet to be written, at a later date!
详情将在文件还没有写出来,在以后的日子!
值----------Value----------
An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm and vgam.
类的一个对象"vglmff"(见vglmff-class)。该对象被用于建模功能如vglm和vgam。
警告----------Warning ----------
The zero argument is supplied for convenience but conflicts can arise with other arguments, e.g., the constraints argument of vglm and vgam. See Example 5 below for an example. If not sure, use, e.g., constraints(fit) and coef(fit, matrix = TRUE) to check the result of a fit fit.
zero参数提供了方便,但冲突可能会出现与其他参数,例如,constraintsvglm和vgam参数。例5,下面是一个例子。如果不能确定,使用,例如,constraints(fit)和coef(fit, matrix = TRUE)一个合适的fit检查结果。
The arguments zero and nointercept can be inputted with values that fail. For example, multinomial(zero = 2, nointercept = 1:3) means the second linear/additive predictor is identically zero, which will cause a failure.
的参数zero和nointercept可以输入值,失败。例如,multinomial(zero = 2, nointercept = 1:3)是指第二个线性/添加剂的预测是相同的零,这将导致失败。
Be careful about the use of other potentially contradictory constraints, e.g., multinomial(zero = 2, parallel = TRUE ~ x3). If in doubt, apply constraints() to the fitted object to check.
小心使用其他潜在的矛盾制约,例如,multinomial(zero = 2, parallel = TRUE ~ x3)。如果有疑问,用constraints()拟合的对象进行检查。
VGAM family functions with the nsimEIM may have inaccurate working weight matrices. If so, then the standard errors of the regression coefficients may be inaccurate. Thus output from summary(fit), vcov(fit), etc. may be misleading.
VGAMnsimEIM家庭功能可能有不正确的工作权值矩阵。如果是的话,那么标准的回归系数的错误可能不准确。因此,输出summary(fit),vcov(fit),等可能会产生误导。
(作者)----------Author(s)----------
T. W. Yee
参见----------See Also----------
Links, vglmff-class.
Links,vglmff-class。
实例----------Examples----------
# Example 1[例1]
cumulative()
cumulative(link = "probit", reverse = TRUE, parallel = TRUE)
# Example 2[例2]
wdata <- data.frame(x = runif(nn <- 1000))
wdata <- transform(wdata,
y = rweibull(nn, shape = 2 + exp(1+x), scale = exp(-0.5)))
fit = vglm(y ~ x, weibull(lshape = "logoff", eshape = list(offset = -2),
zero = 2), wdata)
coef(fit, mat = TRUE)
# Example 3; multivariate (multiple) response[例3;多元(多个)响应]
ndata <- data.frame(x = runif(nn <- 500))
ndata <- transform(ndata,
y1 = rnbinom(nn, mu = exp(3+x), size = exp(1)), # k is size[k是大小]
y2 = rnbinom(nn, mu = exp(2-x), size = exp(0)))
fit <- vglm(cbind(y1, y2) ~ x, negbinomial(zero = -2), ndata)
coef(fit, matrix = TRUE)
# Example 4[例4]
## Not run: [#不运行:]
# fit1 and fit2 are equivalent[FIT1和FIT2是等价的]
fit1 <- vglm(ymatrix ~ x2 + x3 + x4 + x5,
cumulative(parallel = FALSE ~ 1 + x3 + x5), mydataframe)
fit2 <- vglm(ymatrix ~ x2 + x3 + x4 + x5,
cumulative(parallel = TRUE ~ x2 + x4), mydataframe)
## End(Not run)[#(不执行)]
# Example 5[例5]
gdata <- data.frame(x = rnorm(nn <- 200))
gdata <- transform(gdata,
y1 = rnorm(nn, mean = 1 - 3*x, sd = exp(1 + 0.2*x)),
y2 = rnorm(nn, mean = 1 - 3*x, sd = exp(1)))
args(normal1)
fit1 <- vglm(y1 ~ x, normal1, gdata) # This is ok[这是确定的]
fit2 <- vglm(y2 ~ x, normal1(zero = 2), gdata) # This is ok[这是确定的]
# This creates potential conflict[这会造成潜在的冲突]
clist <- list("(Intercept)" = diag(2), "x" = diag(2))
fit3 <- vglm(y2 ~ x, normal1(zero = 2), gdata,
constraints = clist) # Conflict![冲突!]
coef(fit3, matrix = TRUE) # Shows that clist[["x"]] was overwritten,[可见,CLIST [“X”]被覆盖,]
constraints(fit3) # i.e., 'zero' seems to override the 'constraints' arg[即“零”似乎覆盖的“约束”ARG]
# Example 6 ('whitespace' argument)[例6(空白参数)]
pneumo = transform(pneumo, let = log(exposure.time))
fit1 = vglm(cbind(normal, mild, severe) ~ let,
sratio(whitespace = FALSE, parallel = TRUE), pneumo)
fit2 = vglm(cbind(normal, mild, severe) ~ let,
sratio(whitespace = TRUE, parallel = TRUE), pneumo)
head(predict(fit1), 2) # No white spaces[没有空格]
head(predict(fit2), 2) # Uses white spaces[使用空格]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|