Dear Simon, Thank you for your quick reply!

I used to perform the GAMsetup in the following manner:

GAMsetup sintax:

x.summer: vector used for construct the spline

knots<-14

N<-length(x.summer)

x<-array(x.summer,dim=c(1,N))

G<-list(m=1,n=N,nsdf=0,df=knots+1,dim=1,s.type=0,by=0,by.exists=FALSE,p.order=0,x=x,n.knots=knots,fit.method="mgcv")

H<-GAMsetup(G)

with the new version mgcv 1.4.1 gam.setup this does no longer work and gives
me the following error:

Error in gam.setup(G) : First argument is no sort of formula!

What is the correct new syntax?

I also tried to obtain H with gam function under mgcv and I thought that
with the gam function I could obtain H using s(). Is this wrong?

e.g.

mod_spline<-gam(yy~s(x.summer,k=16,bs="cr",fx=FALSE,by=NA,m=1),sp=c(0.001),data=dstime,family=poisson,fit.method="mgcv")


H<-predict.gam(mod_spline,type="lpmatrix")

H<-H[,2:16]

I presume that the vectors obtained using the predict.gam() are different
from the ones obtained using GAM.setup().

Thank for your help.

Looking forward to hearing from you.

Michela

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to