Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.refmodel

Predict method for reference model objects


Description

Compute the predictions using the reference model, that is, compute the expected value for the next observation, or evaluate the log-predictive density at a given point.

Usage

## S3 method for class 'refmodel'
predict(
  object,
  newdata,
  ynew = NULL,
  offsetnew = NULL,
  weightsnew = NULL,
  type = "response",
  ...
)

Arguments

object

The object of class refmodel.

newdata

Matrix of predictor values used in the prediction.

ynew

New (test) target variables. If given, then the log predictive density for the new observations is computed.

offsetnew

Offsets for the new observations. By default a vector of zeros. By default we take the weights from newdata as in the original model. Either NULL or right hand side formulas.

weightsnew

Weights for the new observations. For binomial model, corresponds to the number trials per observation. Has effect only if ynew is specified. By default a vector of ones. By default we take the weights from newdata as in the original model. Either NULL or right hand side formulas.

type

Scale on which the predictions are returned. Either 'link' (the latent function value, from -inf to inf) or 'response' (the scale on which the target y is measured, obtained by taking the inverse-link from the latent value).

...

Currently ignored.

Value

Returns either a vector of predictions, or vector of log predictive densities evaluated at ynew if ynew is not NULL.


projpred

Projection Predictive Feature Selection

v2.0.2
GPL-3
Authors
Juho Piironen [aut], Markus Paasiniemi [aut], Alejandro Catalina [cre, aut], Aki Vehtari [aut], Jonah Gabry [ctb], Marco Colombo [ctb], Paul-Christian Bürkner [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.