R语言-mgcv包-gam()函数中文帮助文档(中英文对照)Word文件下载.docx
《R语言-mgcv包-gam()函数中文帮助文档(中英文对照)Word文件下载.docx》由会员分享,可在线阅读,更多相关《R语言-mgcv包-gam()函数中文帮助文档(中英文对照)Word文件下载.docx(17页珍藏版)》请在冰豆网上搜索。
![R语言-mgcv包-gam()函数中文帮助文档(中英文对照)Word文件下载.docx](https://file1.bdocx.com/fileroot1/2022-10/3/afe1b4b1-8fb9-42ee-8aca-ca6a5bbcf0ab/afe1b4b1-8fb9-42ee-8aca-ca6a5bbcf0ab1.gif)
userscanaddsmooths.
适合一个广义相加模型(GAM)的数据,“GAM”被视为包括任何二次处罚GLM。
模型计算的平滑度估计作为拟合的一部分。
gam也可以适用于任何GLM多个二次处罚(包括估计程度的处罚)。
各向同性或规模不变平滑的任意数量的变量的模型计算,这样的线性泛函平滑的信心/可信区间都是现成的使用拟合模型预测任何数量,“gam是可扩展的:
用户可以添加平滑。
Smoothtermsarerepresentedusingpenalizedregressionsplines(orsimilarsmoothers)withsmoothingparametersselectedbyGCV/UBRE/AIC/REMLorbyregressionsplineswithfixeddegreesoffreedom(mixturesofthetwoarepermitted).Multi-dimensionalsmoothsare
availableusingpenalizedthinplateregressionsplines(isotropic)ortensorproductsplines
(whenanisotropicsmoothisinappropriate).Foranoverviewofthesmoothsavailableseesmooth.terms.
Formoreonspecifyingmodelsseegam.models,random.effectsandlinear.functional.terms.Formoreonmodelselectionseegam.selection.Doreadgam.checkandchoose.k.
平滑术语表示使用惩罚回归花键(或类似的平滑)与由GCV/UBRE的/AIC/REML或由固定的自由度(两个的混合物被允许)的的回归花键与选择的平滑化参数。
多维平滑可使用惩罚薄板回归样条曲线(各向同性)或张量积样条线(各向同性的光滑是不恰当的)。
的平滑的概述,请参阅smooth.terms。
欲了解更多有关指定模型gam.models,random.effects和linear.functional.terms。
模型选择的更多信息,请参阅gam.selection。
不要读为gam.check和choose.k。
Seegamfrompackagegam,forGAMsviatheoriginalHastieandTibshiraniapproach(seedetailsfordifferencestothisimplementation).
见GAM包gam,GAMS通过原来的Hastie和Tibshirani方法(详情请参阅本实施方案的差异)。
Forverylargedatasetsseebam,formixedGAMseegammandrandom.effects.
对于非常大的数据集,请参阅bam,混合GAM看到gamm和random.effects。
用法----------Usage----------
gam(formula,family=gaussian(),data=list(),weights=NULL,subset=NULL,
na.action,offset=NULL,method="
GCV.Cp"
optimizer=c("
outer"
"
newton"
),control=list(),scale=0,
select=FALSE,knots=NULL,sp=NULL,min.sp=NULL,H=NULL,gamma=1,
fit=TRUE,paraPen=NULL,G=NULL,in.out,...)
参数----------Arguments----------
参数:
formula
AGAMformula(seeformula.gamandalsogam.models).
ThisisexactlyliketheformulaforaGLMexceptthatsmoothterms,sandtecanbeadded
totherighthandsidetospecifythatthelinearpredictordependsonsmoothfunctionsofpredictors
(orlinearfunctionalsofthese).
一个GAM的公式(见formula.gam和gam.models)。
这是完全一样的公式,除非GLM那光滑的条款,s和te可以被添加到指定的线性预测依赖于光滑函数的预测(或线性泛函的右手边这些)。
family
Thisisafamilyobjectspecifyingthedistributionandlinktouseinfittingetc.Seeglmandfamilyformoredetails.Anegativebinomialfamilyisprovided:
seenegbin.
quasifamiliesactuallyresultintheuseofextendedquasi-likelihood
ifmethodissettoaRE/MLmethod(McCullaghandNelder,1989,9.6).
这是一个家庭对象指定的分配和使用链接配件等glm和family更多的细节。
负二项分布家庭提供:
看到negbin。
quasi家庭实际上导致在使用扩展的拟似然method设置为一个RE/ML方法(McCullagh和Nelder,1989年,9.6)。
data
Adataframeorlistcontainingthemodelresponsevariableand
covariatesrequiredbytheformula.Bydefaultthevariablesaretaken
fromenvironment(formula):
typicallytheenvironmentfrom
whichgamiscalled.
式所需的一个数据框或列表包含模型响应变量,协变量。
默认情况下,变量从environment(formula):
gam被称为典型的环境。
weights
priorweightsonthedata.
现有的数据上的权重。
subset
anoptionalvectorspecifyingasubsetofobservationstobeusedinthefittingprocess.
一个可选的矢量指定的装配过程中可以使用的观测值的一个子集。
na.action
afunctionwhichindicateswhatshouldhappenwhenthedatacontain"
NA"
s.
Thedefaultissetbythe"
na.action"
settingof"
options"
andis"
na.fail"
ifthatisunset.
The&
ldquo;
factory-fresh&
rdquo;
defaultis"
na.omit"
.
一个函数,它表示时会发生什么数据包含“NA”。
默认设置是“na.action设置选项,na.fail”如果是没有设置的。
“工厂新鲜的”默认“na.omit。
offset
Canbeusedtosupplyamodeloffsetforuseinfitting.Notethatthisoffsetwillalwaysbecompletelyignoredwhenpredicting,unlikeanoffset
includedinformula:
thisconformstothebehaviouroflmandglm.
可以用来提供一个模型偏移量用于接头。
请注意,此偏移量总是被完全忽略当预测,不像一个偏移量包含在formula:
这符合的lm和glm的行为。
control
Alistoffitcontrolparameterstoreplacedefaultsreturnedby
gam.control.Valuesnotsetassumedefaultvalues.
一个合适的控制参数,以取代默认值返回gam.control。
未设置假设值默认值。
method
Thesmoothingparameterestimationmethod."
touseGCVforunknownscaleparameterandMallows'
Cp/UBRE/AICforknownscale."
GACV.Cp"
isequivalent,butusingGACVinplaceofGCV."
REML"
forREMLestimation,includingofunknownscale,"
P-REML"
forREMLestimation,butusingaPearsonestimate
o