Skip to contents

Predict From A Fixed-Operator Synchronized LPL-TF Model

Usage

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

Arguments

object

A "slpl_tf" fit.

newdata

Must be NULL; prediction is currently available only at the training points.

type

Prediction type. The current implementation supports only "response".

...

Reserved.

Value

Fitted values at the training points.

Examples

if (requireNamespace("genlasso", quietly = TRUE)) {
  X <- matrix(seq(0, 1, length.out = 18), ncol = 1)
  fit <- fit.slpl.tf(X, sin(2 * pi * X[, 1]), degree = 1L,
                     support.type = "knn", support.size = 7L,
                     lambda1 = 0.1, lambda2 = 0,
                     lambda.selection = "fixed")
  predict(fit)
}
#>  [1]  0.08487544  0.35109733  0.59379848  0.86574578  1.00627490  0.98586848
#>  [7]  0.78858770  0.48655514  0.15890011 -0.15890011 -0.48655514 -0.78858770
#> [13] -0.98586848 -1.00627490 -0.86574578 -0.59379848 -0.35109733 -0.08487544