Skip to contents

Predict From A Local Polynomial Lifting Trend Filter

Usage

# S3 method for class 'lpl_tf'
predict(
  object,
  newdata = NULL,
  type = c("response"),
  allow.incomplete = FALSE,
  ...
)

Arguments

object

A "lpl_tf" object.

newdata

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

type

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

allow.incomplete

Reserved.

...

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.lpl.tf(X, sin(2 * pi * X[, 1]), degree = 1L,
                    support.type = "knn", support.size = 7L,
                    lambda = 0.1, 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