Description Usage Arguments Value Author(s) Examples
Obtains predictions at specified boosting steps from a GAMBoost object fitted by GAMBoost
.
1 2 3 |
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.