Generalized additive models with integrated smoothness estimation 广义加性模型与集成的平滑估计
描述----------Description----------
Fits a generalized additive model (GAM) to data, the term \any quadratically penalized GLM. The degree of smoothness of model terms is estimated as part of fitting. gam can also fit any GLM subject to multiple quadratic penalties
(including estimation of degree of penalization). Isotropic or scale invariant smooths of any number of variables are available as model terms, as are linear functionals of such smooths; confidence/credible intervals are readily available for any quantity predicted using a fitted model; gam is extendable: users can add smooths.
适合一个广义相加模型(GAM)的数据,“GAM”被视为包括任何二次处罚GLM。模型计算的平滑度估计作为拟合的一部分。 gam也可以适用于任何GLM多个二次处罚(包括估计程度的处罚)。各向同性或规模不变平滑的任意数量的变量的模型计算,这样的线性泛函平滑的信心/可信区间都是现成的使用拟合模型预测任何数量,“gam是可扩展的:用户可以添加平滑。
Smooth terms are represented using penalized regression splines (or similar smoothers) with smoothing parameters selected by GCV/UBRE/AIC/REML or by regression splines with fixed degrees of freedom (mixtures of the two are permitted). Multi-dimensional smooths are available using penalized thin plate regression splines (isotropic) or tensor product splines (when an isotropic smooth is inappropriate). For an overview of the smooths available see smooth.terms. For more on specifying models see gam.models,
random.effects and linear.functional.terms. For more on model selection see gam.selection. Do read gam.check and choose.k.
平滑术语表示使用惩罚回归花键(或类似的平滑)与由GCV / UBRE的/ AIC / REML或由固定的自由度(两个的混合物被允许)的的回归花键与选择的平滑化参数。多维平滑可使用惩罚薄板回归样条曲线(各向同性)或张量积样条线(各向同性的光滑是不恰当的)。的平滑的概述,请参阅smooth.terms。欲了解更多有关指定模型gam.models,random.effects和linear.functional.terms。模型选择的更多信息,请参阅gam.selection。不要读为gam.check和choose.k。
See gam from package gam, for GAMs via the original Hastie and Tibshirani approach (see details for differences to this implementation).
见GAM包gam,GAMS通过原来的Hastie和Tibshirani方法(详情请参阅本实施方案的差异)。
For very large datasets see bam, for mixed GAM see gamm and random.effects. 对于非常大的数据集,请参阅bam,混合GAM看到gamm和random.effects。
用法----------Usage----------
gam(formula,family=gaussian(),data=list(),weights=NULL,subset=NULL, na.action,offset=NULL,method=\.Cp\
optimizer=c(\
select=FALSE,knots=NULL,sp=NULL,min.sp=NULL,H=NULL,gamma=1, fit=TRUE,paraPen=NULL,G=NULL,in.out,...)
参数----------Arguments----------
参数:formula
A GAM formula (see formula.gam and also gam.models). This is exactly like the formula for a GLM except that smooth terms, s and te can be added to the right hand side to specify that the linear predictor depends on smooth functions of predictors (or linear functionals of these).
一个GAM的公式(见formula.gam和gam.models)。这是完全一样的公式,除非GLM那光滑的条款,s和te可以被添加到指定的线性预测依赖于光滑函数的预测(或线性泛函的右手边这些)。
参数:family
This is a family object specifying the distribution and link to use in fitting etc. See glm and family for more details. A negative binomial family is provided: see negbin. quasi families actually result in the use of extended quasi-likelihood if method is set to a RE/ML method (McCullagh and Nelder, 1989, 9.6).
这是一个家庭对象指定的分配和使用链接配件等glm和family更多的细节。负二项分布家庭提供:看到negbin。 quasi家庭实际上导致在使用扩展的拟似然method设置为一个RE / ML方法(McCullagh和Nelder,1989年,9.6)。
参数:data
A data frame or list containing the model response variable and covariates required by the formula. By default the variables are taken from environment(formula): typically the environment from which gam is called.
式所需的一个数据框或列表包含模型响应变量,协变量。默认情况下,变量从environment(formula):gam被称为典型的环境。
参数:weights
prior weights on the data. 现有的数据上的权重。
参数:subset
an optional 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 \is set by the \“factory-fresh” default is \
一个函数,它表示时会发生什么数据包含“NA”。默认设置是“na.action设置选项,na.fail”如果是没有设置的。 “工厂新鲜的”默认“na.omit。
参数:offset
Can be used to supply a model offset for use in fitting. Note that this offset will always be completely ignored when predicting, unlike an offset included in formula: this conforms to the behaviour of lm and glm.
可以用来提供一个模型偏移量用于接头。请注意,此偏移量总是被完全忽略当预测,不像一个偏移量包含在formula:这符合的lm和glm的行为。
参数:control
A list of fit control parameters to replace defaults returned by gam.control. Values not set assume default values.
一个合适的控制参数,以取代默认值返回gam.control。未设置假设值默认值。
参数:method
The smoothing parameter estimation method. \.Cp\parameter and Mallows' Cp/UBRE/AIC for known scale. \.Cp\GACV in place of GCV. \for REML estimation, but using a Pearson estimate of the scale. \similar, but using maximum likelihood in place of REML.
平滑参数估计方法。 \.Cp\使用GCV对未知的尺度参数和锦葵“的CP / UBRE / AIC已知的规模。 \.Cp\是等价的,但使用的GCV GACV的地方。 \估计,包括不明刻度,\估计,但使用的Pearson估计规模。 \和\是相似的,但用最大似然的地方REML。
参数:optimizer
An array specifying the numerical optimization method to use to optimize the
smoothing parameter estimation criterion (given by method). \iteration. \optimizers, specified in the second element of optimizer: \
\and is very slow).
一个数组,指定的数值优化方法,使用优化的平滑参数估计准则(method)。 \性能迭代。 \更稳定的直接方法。 \可以使用optimizer:\(默认),\,\,\和第二个元素中指定的几种可供选择的优化, \(后者则是完全基于上有限差分衍生工具,很慢)。
参数:scale
If this is positive then it is taken as the known scale parameter. Negative signals that the scale parameter is unknown. 0 signals that the scale parameter is 1 for Poisson and binomial and unknown otherwise. Note that (RE)ML methods can only work with scale parameter 1 for the Poisson and binomial cases.
如果这是正的,那么它被当作已知尺度参数。负信号,规模参数是未知的。 0信号泊松分布和二项分布和未知的,否则,尺度参数为1。需要注意的是(RE)的ML方法只能工作与尺度参数的泊松分布和二项式情况下。
参数:select
If this is TRUE then gam can add an extra penalty to each term so that it can be penalized to zero. This means that the smoothing parameter estimation that is part of fitting can completely remove terms from the model. If the corresponding smoothing parameter is estimated as zero then the extra penalty has no effect.
如果这是TRUE然后gam可以添加一个额外的处罚,以每学期,以便它可以被扣分零。这意味着平滑参数估计是拟合的一部分的,可以完全除去从模型中的条款。如果相应的平滑参数估计值为零,那么额外的罚款没有任何效果。
参数:knots
this is an optional list containing user specified knot values to be used for basis
construction. For most bases the user simply supplies the knots to be used, which must match up with the k value supplied (note that the number of knots is not always just k). See tprs for what happens in the \numbers of knots, unless they share a covariate. 这是一个可选的列表,其中包含用户指定的节点值用于基础建设。对于最基础的用户只需提供要使用的节,它必须匹配的k值(附注的节点数不是永远只是k)。见tprs\情况下会发生什么。不同的术语可以使用不同的节数,除非他们共享一个协。
参数:sp
A vector of smoothing parameters can be provided here. Smoothing parameters must be supplied in the order that the smooth terms appear in the model formula. Negative
elements indicate that the parameter should be estimated, and hence a mixture of fixed and estimated parameters is possible. If smooths share smoothing parameters then
length(sp) must correspond to the number of underlying smoothing parameters.
平滑化参数的一种向量,可以提供在这里。必须提供平滑参数的顺序,顺利的词出现在模型公式。负性元件表明应当估计的参数,因此,固定和估计参数的混合物是可能的。如果平滑份额平滑参数,那么length(sp)必须符合相关的平滑参数的数量。
参数:min.sp
Lower bounds can be supplied for the smoothing parameters. Note that if this option is used then the smoothing parameters full.sp, in the returned object, will need to be added to what is supplied here to get the smoothing parameters actually multiplying the
penalties. length(min.sp) should always be the same as the total number of penalties (so it may be longer than sp, if smooths share smoothing parameters).
下界能够供给的平滑化参数。请注意,如果使用此选项,然后平滑参数full.sp,返回的对象中,将需要添加什么是这里提供的平滑参数乘以处罚。 length(min.sp)应始终是相同的刑罚(所以它可能是长于sp,如果平滑份额平滑参数)的总人数。
参数:H
A user supplied fixed quadratic penalty on the parameters of the GAM can be supplied, with this as its coefficient matrix. A common use of this term is to add a ridge penalty to the parameters of the GAM in circumstances in which the model is close to un-identifiable on the scale of the linear predictor, but perfectly well defined on the response scale. 用户提供的固定二次罚的GAM的参数可以提供,这是系数矩阵。使用这一术语是一个常见的添加脊处罚,GAM的情况下,该模型是未识别的线性预测的规模,但完全定义的响应规模的参数。
参数:gamma
It is sometimes useful to inflate the model degrees of freedom in the GCV or UBRE/AIC score by a constant multiplier. This allows such a multiplier to be supplied. 有时它是有用的GCV或UBRE的/ AIC得分由一个常乘数充气模型的自由度。这允许将要提供这样一个乘法器。
参数:fit
If this argument is TRUE then gam sets up the model and fits it, but if it is FALSE then the model is set up and an object G containing what would be required to fit is returned is returned. See argument G.
如果这种说法是TRUE然后gam设置模式和适合它,但如果它是FALSE然后对模型进行设置和对象G包含将需要,以适应返回返回。请参阅参数G。
参数:paraPen
optional list specifying any penalties to be applied to parametric model terms. gam.models