I am fitting a two dimensional smoother in gam, say junk =
gam(y~s(x1,x2)), to a response variable y that is always positive and
pretty well behaved, both x1 and x2 are contained within [0,1].

 

I then create a new dataset for prediction with values of (x1,x2) within
the range of the original data.

 

predict(junk,newdata,type="response")

 

My predicted values are a bit strange (some negative and some large
positive values).

 

When I plot the predicted surface, it looks well behaved with no strange
dips/etc.

 

Could it be a problem with the predict command? 

Is there a "safe" version of predict for higher-dimensional smoothers in
gam?

 

Elizabeth Johnson

Research Associate

Johns Hopkins Unviersity

Department of Biostatistics

 

 


        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch 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