Dear R-list members,
Once a gam (package gam) model has been fitted with family=poisson, is there some R function that could extract the diagonal elements of the smoother matrix S, to be used in a cross-validation for the selection of the best smoothing parameter, following equation 3.19 on page 48 of the book T.J. Hastie and R.J. Tibshirani, Generalized Additive Models, Chapman and Hall/CRC, 1990 ? A sample code for fitting the model is: n <- 100 x <- runif(n,-5,5) y <- round(25 - x^2 + rpois(n,3), 0) plot(x,y,xlim=c(-5,5),ylim=c(0,40)) library(gam) r <- gam(y~lo(x,span=0.5),family=poisson) pr <- predict(r,type='response') o <- order(x) lines(x[o],pr[o]) Thank you very much. Regards, Paulo Barata ------------------------------------------------------------------ Paulo Barata Fundacao Oswaldo Cruz - Oswaldo Cruz Foundation Rua Leopoldo Bulhoes 1480 - 8A 21041-210 Rio de Janeiro - RJ Brazil E-mail: pbar...@infolink.com.br Alternative e-mail: paulo.bar...@ensp.fiocruz.br ______________________________________________ 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.