Skip to contents

Predicts outcomes for new data using a fitted AddiVortesFit model object. It can return mean predictions, quantiles and optionally calculate the Root Mean Squared Error (RMSE) if true outcomes are provided.

Usage

# S3 method for class 'AddiVortesFit'
predict(
  object,
  newdata,
  type = c("response", "quantile"),
  quantiles = c(0.025, 0.975),
  showProgress = TRUE,
  ...
)

Arguments

object

An object of class AddiVortesFit, typically the result of a call to AddiVortes().

newdata

A matrix of covariates for the new test set. The number of columns must match the original training data.

type

The type of prediction required. The default "response" gives the mean prediction. The alternative "quantile" returns the quantiles specified by the quantiles argument.

quantiles

A numeric vector of probabilities with values in 0, 1 to compute for the predictions when type = "quantile".

showProgress

Logical; if TRUE (default), a progress bar is shown during prediction.

...

Further arguments passed to or from other methods (currently unused).

Value

If type = "response", a numeric vector of mean predictions. If type = "quantile", a matrix where each row corresponds to an observation in newdata and each column to a quantile.

Details

This function relies on the internal helper function applyScaling_internal being available in the environment, which is used by the main AddiVortes function.