predict.betaboost {betaboost}R Documentation

Predictions for betaboost models

Description

Make predictions for betaboost models

Usage

## S3 method for class 'betaboost'
predict(object, newdata = NULL,
        type = c("link", "response", "class"), which = NULL,
        aggregate = c("sum", "cumsum", "none"), ...)

Arguments

object

a fitted model object of class betaboost for which the predictions should be made.

newdata

optional; A data frame in which to look for variables with which to predict or with which to plot the marginal prediction intervals.

type

the type of prediction required. The default is on the scale of the predictors; the alternative "response" is on the scale of the response variable. Thus for a binomial model the default predictions are on the log-odds scale (probabilities on logit scale) and type = "response" gives the predicted probabilities. The "class" option returns predicted classes.

which

a subset of base-learners to take into account when computing predictions or coefficients. If which is given (as an integer vector or characters corresponding to base-learners), a list or matrix is returned. In plot_PI the argument which must be specified and it must be given as a character string containing the name of the variable.

aggregate

a character specifying how to aggregate predictions or coefficients of single base-learners. The default returns the prediction or coefficient for the final number of boosting iterations. "cumsum" returns a matrix with the predictions for all iterations simultaneously (in columns). "none" returns a list with matrices where the jth columns of the respective matrix contains the predictions of the base-learner of the jth boosting iteration (and zero if the base-learner is not selected in this iteration).

...

additional arguments. Currently, only parameter is supported. See predict.mboostLSS for further details.

Details

The predict function can be used for predictions for the distribution parameters depending on new observations.

Author(s)

Benjamin Hofner <benjamin.hofner@pei.de>

See Also

predict.mboost and predict.mboostLSS

Examples


## load data
data(QoLdata)

## define test data
test  <- QoLdata[1:10,]
train <- QoLdata[11:nrow(QoLdata),]

## fit model on training data
b1 <- betaboost(formula = QoL ~ arm + pain, data = train, 
                iterations = 500)

## predict on test data
predict(b1, newdata = test, type = "response")

## nuissance parameter phi
nuisance(b1)

## the same, but modelling also phi 
b2 <- betaboost(formula = QoL ~ arm + pain, data = train, 
                iterations = 1000,
                phi.formula = QoL ~ arm + pain)

## now also estimates for phi
predict(b2, newdata = test, type = "response")


[Package betaboost version 1.0.1 Index]