I am trying to use gam in a scatterplot smoothing problem. The data being smoothed have greater 1000 observation and have multiple "humps". I can smooth the data fine using a function something like:
out <- ksmooth(x,y,"normal",bandwidth=0.25) plot(x,out$y,type="l")
The problem is when I try to fit the same data using gam
out <- predict.gam(gam(y~s(x)),se=TRUE) plot(x,out$fit,type="l")
I only seem to get fits that would correspond to "big" bandwidths using ksmooth, and straight lines are always fit to the data. I do not appear to appreciate how to "control bandwidth" using gam. As even if I apply something like the gam model above to the smoothed "out$y" generated using ksmooth it tends to flatten out the smoothing curve.
--
###########################
Tony Long
Ecology and Evolutionary Biology Steinhaus Hall University of California at Irvine Irvine, CA 92697-2525
Tel: (949) 824-2562 (office) Tel: (949) 824-5994 (lab) Fax: (949) 824-2181
email: [EMAIL PROTECTED] http://hjmuller.bio.uci.edu/~labhome/
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help