Description Usage Arguments Value Author(s) See Also Examples
Performs a K-fold cross-validation for GAMBoost
in search for the optimal number of boosting steps.
1 2 3 4 5 6 |
x |
|
y |
response vector of length |
x.linear |
optional |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
maxstepno |
maximum number of boosting steps to evaluate. |
family,weights,calc.hat,calc.se |
arguments passed to |
trace |
logical value indicating whether information on progress should be printed. |
parallel |
logical value indicating whether computations in the cross-validation folds should be performed in parallel on a compute cluster, using package |
upload.x |
logical value indicating whether |
multicore |
indicates whether computations in the cross-validation folds should be performed in parallel, using package |
folds |
if not |
K |
number of folds to be used for cross-validation. |
type, pred.cutoff |
goodness-of-fit criterion: likelihood ( |
just.criterion |
logical value indicating wether a list with the goodness-of-fit information should be returned or a |
... |
miscellaneous parameters for the calls to |
GAMBoost
fit with the optimal number of boosting steps or list with the following components:
criterion |
vector with goodness-of fit criterion for boosting step |
se |
vector with standard error estimates for the goodness-of-fit criterion in each boosting step. |
selected |
index of the optimal boosting step. |
folds |
list of length |
Harald Binder binderh@uni-mainz.de
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
## Generate some data
x <- matrix(runif(100*8,min=-1,max=1),100,8)
eta <- -0.5 + 2*x[,1] + 2*x[,3]^2
y <- rbinom(100,1,binomial()$linkinv(eta))
## Fit the model with smooth components
gb1 <- GAMBoost(x,y,penalty=400,stepno=100,trace=TRUE,family=binomial())
## 10-fold cross-validation with prediction error as a criterion
gb1.crit <- cv.GAMBoost(x,y,penalty=400,maxstepno=100,trace=TRUE,
family=binomial(),
K=10,type="error",just.criterion=TRUE)
## Compare AIC and estimated prediction error
which.min(gb1$AIC)
which.min(gb1.crit$criterion)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.