VGAM-package(VGAM)
VGAM-package()所属R语言包:VGAM
Vector Generalized Linear and Additive Models
向量广义线性和添加剂模型
译者:生物统计家园网 机器人LoveR
描述----------Description----------
VGAM provides functions for fitting vector generalized linear and additive models (VGLMs and VGAMs), and associated models (Reduced-Rank VGLMs, Quadratic RR-VGLMs, Reduced-Rank VGAMs). This package fits many models and distributions by maximum likelihood estimation (MLE) or penalized MLE. Also fits constrained ordination models in ecology such as constrained quadratic ordination (CQO).
VGAM提供为配件向量广义线性和添加剂模型(VGLMs和VGAMs),以及相关的模型(降秩VGLMs,二次RR-VGLMs,降秩VGAMs)的功能。这个包适合许多模型和分布的最大似然估计(MLE)或惩罚MLE。此外,还适合约束二次协调(CQO)如在生态约束协调模型。
Details
详细信息----------Details----------
This package centers on the iteratively reweighted least squares (IRLS) algorithm. Other key words include Fisher scoring, additive models, penalized likelihood, reduced-rank regression and constrained ordination. The central modelling functions are vglm, vgam, rrvglm, cqo, cao. For detailed control of fitting, each of these has its own control function, e.g., vglm.control. The package uses S4 (see methods-package).
这个包中心迭代加权最小二乘(IRLS)算法“。其他关键词包括费舍尔得分,加模型,受到惩罚的可能性,降秩回归和约束协调。中央的建模功能是vglm,vgam,rrvglm,cqo,cao。配件的详细控制,每一个都有其自己的控制功能,例如,vglm.control。该包使用S4(见methods-package“)。
The classes of GLMs and GAMs are special cases of VGLMs and VGAMs. The VGLM/VGAM framework is intended to be very general so that it encompasses as many distributions and models as possible. VGLMs are limited only by the assumption that the regression coefficients enter through a set of linear predictors. The VGLM class is very large and encompasses a wide range of multivariate response types and models, e.g., it includes univariate and multivariate distributions, categorical data analysis, time series, survival analysis, generalized estimating equations, extreme values, correlated binary data, bioassay data and nonlinear least-squares problems.
GLMS和GAMS类是特殊情况下的VGLMs和VGAMs。的VGLM / VGAM框架的目的是很一般的,因此,它包含尽可能多的分布和模型尽可能。 VGLMs只限于由回归系数假设输入通过一组的线性预测因子。 VGLM类是非常大的,多元的响应类型和型号,例如涵盖范围广泛,包括单变量和多变量的分布,分类数据分析,时间序列,生存分析,广义估计方程,极值,相关的二进制数据,生物测定数据和非线性最小二乘问题。
VGAMs are to VGLMs what GAMs are to GLMs. Vector smoothing (see vsmooth.spline) allows several additive predictors to be estimated as a sum of smooth functions of the covariates.
VGAMs是,以VGLMs GAMS是GLMS。矢量平滑(vsmooth.spline),允许多种添加剂的预测来估计光滑函数的协变量的总和。
For a complete list of this package, use library(help = "VGAM"). New VGAM family functions are continually being written and added to the package. A monograph about VGLM and VGAMs etc. is in the making but unfortunately will not be finished for a while.
这个包的完整列表,请使用library(help = "VGAM")。新的VGAM家庭功能正在不断地被写和添加到包中。一本专着约VGLM和VGAMs等正在形成,但不幸的是无法完成的一段时间。
(作者)----------Author(s)----------
Thomas W. Yee, <a href="mailto:t.yee@auckland.ac.nz">t.yee@auckland.ac.nz</a>.
Maintainer: Thomas Yee <a href="mailto:t.yee@auckland.ac.nz">t.yee@auckland.ac.nz</a>.
参考文献----------References----------
Vector Generalized Linear and Additive Models. Monograph in preparation.
The <code>VGAM</code> package for categorical data analysis. Journal of Statistical Software, 32, 1–34. http://www.jstatsoft.org/v32/i10/.
Reduced-rank vector generalized linear models. Statistical Modelling, 3, 15–41.
Vector generalized linear and additive extreme value models. Extremes, 10, 1–19.
Vector generalized additive models. Journal of the Royal Statistical Society, Series B, Methodological, 58, 481–493.
A new technique for maximum-likelihood canonical Gaussian ordination. Ecological Monographs, 74, 685–701.
Constrained additive ordination. Ecology, 87, 203–213.
The <code>VGAM</code> Package. R News, 8, 28–39.
http://www.stat.auckland.ac.nz/~yee/VGAM contains further information and examples.
参见----------See Also----------
vglm, vgam, rrvglm, TypicalVGAMfamilyFunction, CommonVGAMffArguments.
vglm,vgam,rrvglm,TypicalVGAMfamilyFunction,CommonVGAMffArguments。
实例----------Examples----------
# Example 1; proportional odds model[例1的比例优势模型]
pneumo = transform(pneumo, let = log(exposure.time))
(fit = vglm(cbind(normal, mild, severe) ~ let, propodds, pneumo))
fit@y # Sample proportions[样本比例]
depvar(fit) # Better than using fit@y; dependent variable (response)[优于使用适合@ Y;因变量(响应)]
weights(fit, type = "prior") # Number of observations[若干意见]
coef(fit, matrix = TRUE) # p.179, in McCullagh and Nelder (1989)[第179页,在McCullagh和Nelder(1989)]
constraints(fit) # Constraint matrices[约束矩阵]
summary(fit)
# Example 2; zero-inflated Poisson model[例2,零膨胀泊松模型]
zdata = data.frame(x2 = runif(nn <- 2000))
zdata = transform(zdata, pstr0 = logit(-0.5 + 1*x2, inverse = TRUE),
lambda = loge( 0.5 + 2*x2, inverse = TRUE))
zdata = transform(zdata, y = rzipois(nn, lambda, pstr0 = pstr0))
with(zdata, table(y))
fit = vglm(y ~ x2, zipoisson, zdata, trace = TRUE)
coef(fit, matrix = TRUE) # These should agree with the above values[这些应该同意上述值]
# Example 3; fit a two species GAM simultaneously[例3,同时适合两个物种GAM]
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,], type = "l", lwd = 2,
xlab = "Altitude (m)", ylab = "Probability of presence", las = 1,
main = "Two plant species' response curves", ylim = c(0, 0.8)))
with(hunua, rug(altitude))
## End(Not run)[#(不执行)]
# Example 4; LMS quantile regression[例4 LMS位数回归]
fit = vgam(BMI ~ s(age, df = c(4, 2)), lms.bcn(zero = 1), dat = bmi.nz,
trace = TRUE)
head(predict(fit))
head(fitted(fit))
head(bmi.nz) # Person 1 is near the lower quartile among people his age[1人是附近的下四分位数之间的人他的年龄]
head(cdf(fit))
## Not run: par(mfrow = c(1, 1), bty = "l", mar = c(5,4,4,3)+0.1, xpd = TRUE)[#不跑杆(mfrow = C(1,1),BTY =“L”,月= C(5,4,4,3)+0.1,XPD = TRUE)]
qtplot(fit, percentiles = c(5,50,90,99), main = "Quantiles", las = 1,
xlim = c(15, 90), ylab = "BMI", lwd = 2, lcol = 4) # Quantile plot[分量图]
ygrid = seq(15, 43, len = 100) # BMI ranges[BMI范围]
par(mfrow = c(1, 1), lwd = 2) # Density plot[密度图]
aa = deplot(fit, x0 = 20, y = ygrid, xlab = "BMI", col = "black",
main = "Density functions at Age = 20 (black), 42 (red) and 55 (blue)")
aa
aa = deplot(fit, x0 = 42, y = ygrid, add = TRUE, llty = 2, col = "red")
aa = deplot(fit, x0 = 55, y = ygrid, add = TRUE, llty = 4, col = "blue",
Attach = TRUE)
aa@post$deplot # Contains density function values[包含密度函数值]
## End(Not run)[#(不执行)]
# Example 5; GEV distribution for extremes[例5 GEV分布极端]
(fit = vglm(maxtemp ~ 1, egev, data = oxtemp, trace = TRUE))
head(fitted(fit))
coef(fit, matrix = TRUE)
Coef(fit)
vcov(fit)
vcov(fit, untransform = TRUE)
sqrt(diag(vcov(fit))) # Approximate standard errors[近似的标准误]
## Not run: rlplot(fit) [#不运行:rlplot的(适合)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|