Skip to contents

Fits the fixed-operator S-LPL-TF estimator $$\hat f = \arg\min_f \frac12\|y-f\|_2^2 + \lambda_1\|A_{\mathrm{LPL}}f\|_1 + \frac{\lambda_2}{2}\|C_{\mathrm{sync}}f\|_2^2.$$

Usage

fit.slpl.tf(
  X = NULL,
  y,
  operator = NULL,
  lambda1 = NULL,
  lambda2 = 0,
  lambda1.grid = NULL,
  lambda2.grid = NULL,
  lambda.selection = c("fixed", "cv"),
  operator.grid = NULL,
  foldid = NULL,
  cv.folds = 5L,
  cv.loss = c("mse", "rmse", "mae"),
  cv.seed = NULL,
  cv.repeats = 1L,
  solver = c("genlasso"),
  selection = c("min", "one.se"),
  maxsteps = 2000L,
  minlam = 0,
  approx = FALSE,
  rtol = 1e-07,
  btol = 1e-07,
  eps = 1e-04,
  verbose = FALSE,
  ...
)

Arguments

X

Optional coordinate matrix used to build slpl.tf.operator when operator is NULL.

y

Numeric response vector.

operator

Optional "slpl_tf_operator" object.

lambda1

Fixed LPL-TF \(\ell_1\) penalty, or a shortcut for lambda1.grid when lambda.selection = "cv".

lambda2

Fixed quadratic synchronization penalty, or a shortcut for lambda2.grid when lambda.selection = "cv".

lambda1.grid

Optional nonnegative \(\lambda_1\) grid for CV.

lambda2.grid

Optional nonnegative \(\lambda_2\) grid for CV.

lambda.selection

"fixed" or "cv". CV uses materialized folds and a deterministic Cartesian grid over lambda1.grid and lambda2.grid.

operator.grid

Optional operator candidate grid. Supply a data frame with one row per candidate or a list of named lists.

foldid

Optional deterministic fold assignments for CV.

cv.folds

Number of generated folds when foldid = NULL.

cv.loss

Cross-validation loss, "mse", "rmse", or "mae".

cv.seed

Optional seed for reproducible generated folds.

cv.repeats

Number of CV repeats. The current implementation supports only one repeat.

solver

Current implementation supports only "genlasso".

selection

Selection rule, "min" or "one.se". For the two-parameter one-standard-error rule, the most regularized eligible pair is chosen by decreasing lambda1 and then decreasing lambda2.

maxsteps, minlam, approx, rtol, btol, eps

Genlasso controls.

verbose

Logical.

...

Additional arguments passed to slpl.tf.operator when the operator is built internally.

Value

A list of class "slpl_tf".

Examples

if (requireNamespace("genlasso", quietly = TRUE)) {
  X <- matrix(seq(0, 1, length.out = 18), ncol = 1)
  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")
}
#> Synchronized 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: lambda1=0.1, lambda2=0 
#>   Prediction scope: stored training vertices only