资源描述:
《the r book generalized additive models》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、18GeneralizedAdditiveModelsUptothispoint,continuousexplanatoryvariableshavebeenaddedtomodelsaslinearfunctions,linearizedparametrictransformations,orthroughvariouslinkfunctions.Inallcases,anexplicitorimplicitassumptionwasmadeabouttheparametricformofth
2、efunctiontobefittedtothedata(whetherquadratic,logarithmic,exponential,logistic,reciprocalorwhatever).Inmanycases,however,youhaveoneormorecontinuousexplanatoryvariables,butyouhavenoapriorireasontochooseoneparticularparametricformoveranotherfordescribin
3、gtheshapeoftherelationshipbetweentheresponsevariableandtheexplanatoryvariable(s).Generalizedadditivemodels(GAMs)areusefulinsuchcasesbecausetheyallowyoutocapturetheshapeofarelationshipbetweenyandxwithoutprejudgingtheissuebychoosingaparticularparametri
4、cform.Generalizedadditivemodels(implementedinRbythegamfunction)extendtherangeofapplicationofgeneralizedlinearmodels(glm)byallowingnon-parametricsmoothersinadditiontoparametricforms,andthesecanbeassociatedwitharangeoflinkfunctions.Alloftheerrorfamilie
5、sallowedwithglmareavailablewithgam(binomial,poisson,Gamma,etc.).Indeed,gamhasmanyoftheattributesofbothglmandlm,andtheoutputcanbemodifiedusingupdate.Youcanuseallofthefamiliarmethodssuchasprint,plot,summary,anova,predictandfittedafteraGAMhasbeenfittedtod
6、ata.ThegamfunctionusedinthisbookisinthemgcvpackagecontributedbySimonWood:library(mgcv)TherearemanywaysofspecifyingthemodelinaGAM:allofthecontinuousexplanatoryvariablesx,wandzcanenterthemodelasnon-parametricallysmoothedfunctionslikethis:y~s(x)+s(w)+s(
7、z)Alternatively,themodelcancontainamixofparametricallyestimatedparameters(xandz)andsmoothedvariabless(w):y~x+s(w)+zFormulaecaninvolvenested(two-dimensional)termsinwhichthesmoothings()termshavemorethanoneargument,implyinganisotropicsmooth:y~s(x)+s(z)+
8、s(x,z)Alternativelythesmootherscanhaveoverlappingtermssuchasy~s(x,z)+s(z,w)TheRBook,SecondEdition.MichaelJ.Crawley.©2013JohnWiley&Sons,Ltd.Published2013byJohnWiley&Sons,Ltd.GENERALIZEDADDITIVEMODELS667Theuserhasahighdegreeofcontroloverthewaythatinter