Skip to contents

Predict from an LPS Fit

Usage

# S3 method for class 'lps'
predict(object, newdata = NULL, type = c("response", "raw"), ...)

Arguments

object

A fitted "lps" object.

newdata

Optional prediction matrix. Defaults to the fitted object's stored X.eval.

type

Prediction scale. "response" returns response-scale predictions; for outcome.family = "bernoulli" or "binomial" these are probabilities in [0,1]. "raw" returns the unmodified local least-squares predictions for "bernoulli" and the fitted probabilities for "binomial".

...

Unused.

Value

A numeric vector of predictions.

Examples

X <- matrix(seq(0, 1, length.out = 12), ncol = 1)
fit <- fit.lps(X, sin(2 * pi * X[, 1]), support.grid = 6L)
predict(fit)
#>  [1] -0.01017431  0.56843940  0.90254013  0.98210438  0.74985744  0.27953605
#>  [7] -0.27953605 -0.74985744 -0.98210438 -0.90254013 -0.56843940  0.01017431