This is a reference implementation in Matlab for the algorithms described in the paper
M. Storath, A. Weinmann, "Smoothing splines for discontinuous signals", Journal of Computational and Graphical Statistics, 2023, [Preprint]
-
cssd.m computes a cubic smoothing spline with discontinuities (CSSD) for data (x,y). It is a solution of the following model of a smoothing spline
$f$ with a-priori unknown discontinuities$J$
where
-
$y_i = g(x_i) + \epsilon_i$ are samples of piecewise smooth function$g$ at data sites$x_1, \ldots, x_N$ , and an estimate$\delta_i$ of the standard deviation of the errors$\epsilon_i$ - the minimum is taken over all possible sets of discontinuities between two data sites
$J \subset [x_1, x_N]\setminus {x_1, \ldots, x_N}$ and all functions$f$ that are twice continuously differentiable away from the discontinuities. - The model parameter
$p \in (0, 1)$ controls the relative weight of the smoothness term (second term) and the data fidelity term. - The last term is a penalty for the number of discontinuities
$|J|$ weighted by a parameter$\gamma > 0.$
-
cssd_cv.m automatically determines values for the model parameters
$p$ and$\gamma$ based on K-fold cross validation.
- Execute "install_cssd.m" which adds the folder and all subfolders to the Matlab path.
- Execute any m-file from the demos folder
M. Storath, A. Weinmann, "Smoothing splines for discontinuous signals", Journal of Computational and Graphical Statistics, 2023