fsfused: Fast Sparse Fused Regression

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

View source: R/fsfused.R

Description

This is a function that solves the L0 fused problem via the primal dual active set algorithm in sparse condition. It fits a piecewise constant regression model by minimizing the least squares error with constraints on the number of breaks in their discrete derivative.

Usage

1
 fsfused(y, s = 10, T, K.max=5)

Arguments

y

Response sequence to be fitted.

s

Number of knots in the piecewise constant(breaks in the derivative), default is 10.

T

Number of non-zero values in fitted coefficient.

K.max

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

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.

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
n <- 1000
sigma <- 0.5
y0 <- rep(0,n)
y0[100:150] <- 2.5
y0[400:600] <- -2.4
y0[800:810] <- 4
y <- y0 + sigma*rnorm(n)

re = fsfused(y, s = 10, T = 300)

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

Related to fsfused in FastSF...