Learn R Programming

cmaRs (version 0.1.3)

predict.cmaRs: A prediction function for a new data set for prediction purpose

Description

This function allows you to obtain the predicted values of a CMARS model.

Usage

# S3 method for cmaRs
predict(object, new = NULL, ...)

Value

y The predicted values.

Arguments

object

A cmaRs object which is obtained by prediction.

new

The data for which the fitted values will be constructed.

...

Additional parameters affecting the predictions.

Examples

Run this code
if (FALSE) {
# Without \code{MOSEK}, the example code is not executable.
# For installation of Mosek, plese see the documentation of 'Rmosek'.
data("trees", package = "earth")
model.prediction <- cmaRs(Volume ~ ., degree = 5, nk = 20, data = trees)
predict.cmaRs(model.prediction, data = trees)
}

Run the code above in your browser using DataLab