R/predict.mars.R

predict.mars <-
function (object, newdata, ...) 
{
    if (missing(newdata)) {
        z <- fitted(object)
        if (is.null(z)) 
            stop("need to supply newdata")
        else return(z)
    }
    model.matrix.mars(object, newdata) %*% object$coefficients
}

Try the mda package in your browser

Any scripts or data that you put into this service are public.

mda documentation built on July 9, 2023, 7:14 p.m.