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
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.
References
Wen,C., Wang, X., Shen, Y., and Zhang, A. (2017). "L0 trend filtering", technical report.