predict.GAMBoost {GAMBoost} | R Documentation |
Obtains predictions at specified boosting steps from a GAMBoost object fitted by GAMBoost
.
## S3 method for class 'GAMBoost' predict(object,newdata=NULL,newdata.linear=NULL, at.step=NULL,type=c("link","response","terms"),...)
object |
fitted GAMBoost object from a |
newdata |
|
newdata.linear |
matrix with new covariate values for linear components. If linear components have been fitted and this is not given, the contribution of the linear components will be ignored for prediction. |
at.step |
scalar or vector of boosting step(s) at which prediction is wanted. If |
type |
type of prediction to be returned: |
... |
miscellaneous arguments, none of which is used at the moment. |
For type="link"
and type="response"
a vector of length n.new
(at.step
being a scalar) or a n.new * length(at.step)
matrix (at.step
being a vector) with predictions is returned.
For type="terms"
a n.new * p+1
matrix with contributions of the smooth components to the predictor is returned.
Harald Binder binderh@uni-mainz.de
## Generate some data x <- matrix(runif(100*3,min=-1,max=1),100,3) eta <- -0.5 + 2*x[,1] + 4*x[,3]^2 y <- rbinom(100,1,binomial()$linkinv(eta)) ## Fit the model with smooth components gb1 <- GAMBoost(x,y,penalty=200,stepno=100,trace=TRUE,family=binomial()) ## Extract predictions # at final boosting step predict(gb1,type="response") # at 'optimal' boosting step (with respect to AIC) predict(gb1,at.step=which.min(gb1$AIC),type="response") # matrix with predictions at predictor level for all boosting steps predict(gb1,at.step=1:100,type="link")