predict.simfast: Predict values of a 'simfast' object with a data frame or a...

View source: R/predict_generic.R

predict.simfastR Documentation

Predict values of a simfast object with a data frame or a matrix

Description

Predict values of a simfast object with a data frame or a matrix. Can also be called by running predict on simfast object. Note that simfast fits models on the response level, so only 'response' values are predicted.

Usage

## S3 method for class 'simfast'
predict(object, newdata, rule = 1, oob = FALSE, ...)

Arguments

object

an object of class simfast

newdata

optional numeric matrix or data frame of new data. If none is provided, the original data will be used. If a data frame is provided, predictions cannot be made unless returnmodel = TRUE was selected when fitting your simfast object (this is the default value). New numeric matrix or data frame must match the structure of the original data (unused columns in data frames need not be included). Note that rows with NA values will be removed.

rule

integer that describes how to handle predictor values outside the range of the original data. By default, the value is 1, which uses linear extrapolation to estimate outside values, but can take value 2 which provides the value of the closest edge point.

oob

logical parameter that, if TRUE, provides a second row of logical values that indicates if the data used to predict this value was out of the bounds of the original data

...

further arguments passed to predict

Value

a numeric vector of the specified prediction values on the response scale, unless oob = TRUE, then returns a matrix with the first row of prediction values on the response scale and a second row of logical values indicating if data used to predict was out of bounds.

Author(s)

Hanna Jankowski hkj@yorku.ca Konstantinos Ntentes kntentes@yorku.ca (maintainer)

Examples


# See the example provided in the \code{\link{simfast}} documentation.


ntentes/simfast documentation built on April 24, 2023, 10:10 p.m.