User`s guide
Nonparametric Fitting
3-69
The type of interpolant you should use depends on the characteristics of the
data being fit, the required smoothness of the curve, speed considerations,
postfit analysis requirements, and so on. The linear and nearest neighbor
methods are fast, but the resulting curves are not very smooth. The cubic spline
and shape-preserving methods are slower, but the resulting curves are often
very smooth.
For example, the nuclear reaction data from the file
carbon12alpha.mat is
shown below with a nearest neighbor interpolant fit and a shape-preserving
(PCHIP) interpolant fit. Clearly, the nearest neighbor interpolant does not
follow the data as well as the shape-preserving interpolant. The difference
between these two fits can be important if you are interpolating. However, if
you want to integrate the data to get a sense of the total unormalized strength
of the reaction, then both fits provide nearly identical answers for reasonable
integration bin widths.
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5
0
50
100
150
200
250
300
350
angle
counts
C12Alpha
nearest
pchip