robust spline smoothing of 1-D to N-D data
Description
A fast, automatic and robust discretized spline smoothing of uniformly sampled data of arbitrary dimension. Non finite values (NaN or Inf) are treated as missing. Without a smoothing parameter, it is determined by minimizing the generalized cross-validation score. Vector fields or multicomponent data are given as a cell array of their components. The author's original help, kept in the source, lists the details and eight examples.
Syntax
z = smoothn(y)Automatic smoothing.
z = smoothn(y,s)Smoothing parameter s, the larger the smoother.
z = smoothn(y,W,s)With nonnegative weights W of the size of y.
z = smoothn({Vx,Vy})Smooth a vector field.
z = smoothn(y,'robust')Minimize the influence of outliers.
opt = struct('TolZ',1e-3,'MaxIter',100,'Spacing',[1 2]);
[z,s,exitflag] = smoothn(y,opt)Termination of the iteration and spacing of the grid.
Input
| y | N-D double, or cell array of the components of a vector field |
| s | smoothing parameter, a positive scalar, [] for automatic |
| W | weights, 0 for a missing value |
| opt | struct of options, the last argument |
Options
| TolZ | termination tolerance on z, in ]0,1[ (default 1e-2) |
| MaxIter | maximum number of iterations (default 100) |
| Initial | initial value of the iteration (default y) |
| Weight | weight function of the robust smoothing, 'bisquare' (default), 'talworth' or 'cauchy' |
| Spacing | spacing [d1 d2 ...] of the grid in each dimension |
| Order | order 0, 1 or 2 of the smoothing (default 2) |
Flags
| robust | robust smoothing |
Output
| z | smoothed data |
| s | the smoothing parameter used |
| exitflag | true if the iteration converged |
References
- D. Garcia, Robust smoothing of gridded data in one and higher dimensions with missing values, Computational Statistics & Data Analysis, 2010;54:1167-1178, doi:10.1016/j.csda.2009.09.020
- D. Garcia, A fast all-in-one method for automated post-processing of PIV data, Exp Fluids, 2011;50:1247-1259, doi:10.1007/s00348-010-0985-y
Citing this page.
This page is part of the documentation of
MTEX, a free and open
source MATLAB toolbox for analyzing and modeling crystallographic textures.
It was written by The MTEX Developers and is published at
https://mtex-toolbox.github.io/smoothn.html.
If you use MTEX, or reuse text or figures from this page, in your research,
please cite
F. Bachmann, R. Hielscher, H. Schaeben: Texture Analysis with MTEX - Free and Open Source Software Toolbox, Solid State Phenomena 160 (2010), 63-68. 10.4028/www.scientific.net/SSP.160.63
BibTeX
@article{bachmann2010mtex,
author = {F. Bachmann and R. Hielscher and H. Schaeben},
title = {Texture Analysis with MTEX - Free and Open Source Software Toolbox},
journal = {Solid State Phenomena},
volume = {160},
pages = {63-68},
year = {2010},
doi = {10.4028/www.scientific.net/SSP.160.63},
url = {https://doi.org/10.4028/www.scientific.net/SSP.160.63}
}
Other papers describing specific MTEX methods are listed under Publications — please cite the one that best fits your application. The MTEX source code is licensed under the GNU General Public License v2.0; the text and figures of this documentation are licensed under CC BY 4.0, which permits reuse — including by automated systems — provided The MTEX Developers and this page are credited.