Skip to content

sdm package gam model smoothing

1 message · Kelly McCaffrey

#
Hello everyone,
I'm working on some species distribution models using the package 'sdm' to
perform the multiple-model k-fold cross validation. But, upon viewing the
results, I'm concerned that smoothing parameters are not being applied to
the gam model formula. Unfortunately, I'm not able to provide you with the
example data, but here's the piece of code I'm working with:

data<-sdmData(pa~SBT+Chla+PAR+Kd+Wave+Depth,train=new_sdmdata)
model1<-sdm(pa~SBT+Chla+PAR+Kd+Wave+Depth, data=data,
family=gaussian(link="logit"),
            methods=c("glm", "gam"),
            replication="sub", test.percent=25, n=5)
getModelInfo(model1)
model1
##This code functions, but does not seem to apply smoothing parameters to
the gam model

model1<-sdm(pa~s(SBT)+s(Chla)+s(PAR)+s(Kd)+s(Wave)+s(Depth), data=data,
            family=gaussian(link="logit"), methods=c("glm", "gam"),
            replication="sub", test.percent=25, n=5)
getModelInfo(model1)
model1
##This piece of code returns: Error in u[[i]] <- list() :
 ## attempt to select less than one element in OneIndex

Does anyone know of the proper way to specify that smoothing parameters be
applied to gam models?
Thank you!
Kelly McCaffrey