Skip to contents

Reuses the fixed operator and selected lambda from an existing LPL-TF fit.

Usage

# S3 method for class 'lpl_tf'
refit(object, y, lambda = NULL, reuse.lambda = TRUE, verbose = FALSE, ...)

Arguments

object

A "lpl_tf" object.

y

New numeric response vector.

lambda

Optional fixed lambda.

reuse.lambda

Logical. If TRUE and lambda = NULL, reuse object$lambda.

verbose

Logical.

...

Reserved.

Value

A refitted "lpl_tf" object.

See also

refit for supported fitted objects and migration.

Examples

if (requireNamespace("genlasso", quietly = TRUE)) {
  X <- matrix(seq(0, 1, length.out = 18), ncol = 1)
  fit <- fit.lpl.tf(X, X[, 1]^2, degree = 1L,
                    support.type = "knn", support.size = 7L,
                    lambda = 0.1, lambda.selection = "fixed")
  refit(fit, y = X[, 1]^3)
}
#> Local polynomial lifting trend filtering 
#>   Training rows: 18 ; evaluation rows: 18 ; responses: 1 
#>   Observed responses: 18 ; nonfinite fitted entries: 0 
#>   Output: finite output 
#>   Convergence: unavailable (no stored stopping certificate) 
#>   Selected: lambda=0.1 
#>   Prediction scope: stored training vertices only