fsf: Fast Structural Filtering

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/fsf.R

Description

This function solves the generalized structural filtering problem via the primal dual active set algorithm. It fits a non-parametric regression model by minimizing the least squares error with penalty matrix D on coefficient beta.

Usage

1
 fsf(y, D, s = 20, K.max = 5, ddinv=NULL)

Arguments

y

Response sequence to be filtered.

D

Penalty matrix on coeffient beta.

s

Number of knots in the penalized coefficient(breaks in the D*beta), default is 20.

K.max

The maximum number of steps for the algorithm to take before termination. Default is 5.

ddinv

The inverse matrix of D*t(D), could be NULL input.

Value

y

The observed response vector. Useful for plotting and other methods.

beta

Fitted value.

v

Primal coefficient. The indexes of the nonzero values correspond to the locations of the breaks in D*beta.

Author(s)

Canhong Wen, Xueqin Wang, Yanhe Shen, Aijun Zhang

References

Wen,C., Wang, X., Shen, Y., and Zhang, A. (2017). "L0 trend filtering", technical report.

See Also

plotl0.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
require(limSolve)
n <- 1000
sigma <- 0.5
y0 <- rep(0,n)
y0[100:150] <- 2
y0[400:600] <- -1
y0[800:810] <- 4
y <- y0 + sigma*rnorm(n)
y[800:810] <- y0[800:810] + sigma*rnorm(11)
D0 <- matrix(0, n-1,n)
diag(D0) <- -1
for(i in 1:(n-1)) D0[i,i+1] <- 1
m <- dim(D0)[1]

re = fsf(y, D0)

FastSF documentation built on May 2, 2019, 8:27 a.m.

Related to fsf in FastSF...