Piecewise constant fitting
We observe a noisy timeseries (encoded in a finitedimensional vector ) which is almost piecewise constant. The goal in piecewise constant fitting is to find what the constant levels are. In biological or medical applications, such levels might have interpretations as ‘‘states’’ of the system measured.
Unfortunately, the signal is not exactly piecewise constant, but a noisy version of such a signal. Thus, we seek to obtain an estimate of the signal, say , such that has as few changes in it as possible. We model the latter by minimizing the cardinality of the ‘‘difference’’ vector , where is the difference matrix
Matrix is constructed so that .
We are led to the problem
where is an estimate on the number of jumps in the signal. Here, objective function in the problem is a measure of the error between the noisy measurement and the estimate .
The norm heuristic consists in replacing the top (hard) problem by the QP:
CVX implementation
cvx_begin
variable x(n)
minimize( sum_square(yx) )
subject to
norm(D*x,1) <= K;
cvx_end
