GAMBoost
.
"predict"(object,newdata=NULL,newdata.linear=NULL, at.step=NULL,type=c("link","response","terms"),...)
GAMBoost
call.n.new * p
matrix with new covariate values for smooth components. If just prediction for the training data is wanted or just a generalized linear model has been fitted, it can be omitted.type="terms"
is used, only one step is admissible. If no step is given, the final boosting step is used."link"
gives prediction at the level of the predictor, "response"
at the response level. "terms"
returns individual contributions of the smooth components to the predictor.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.
## 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")
Run the code above in your browser using DataLab