[R] derivative estimation using GAM
rtorgovi at hsph.harvard.edu
Wed Jul 18 21:12:14 CEST 2007
I have a question about Simon Wood's gam function.
Suppose I have a simple model
x <- runif(n, 0, 1);
ct<-gam(y~ s(x,k = 5))
how could I estimate first derivative of the smooth. From what I understand, i could get coefficients of the fit from
ct2<-gam(y~ s(x,k = 5),control =gam.control(absorb.cons = FALSE))
to get unconstrained coefficient estimates for the model (this was suggested in response to a similar question in 2005), but how could I get derivative of the basis?
Department of Biostatistics
More information about the R-help