Function File: yy = monotone_smooth (x, y, h)

Produce a smooth monotone increasing approximation to a sampled functional dependence

A kernel method is used (an Epanechnikov smoothing kernel is applied to y(x); this is integrated to yield the monotone increasing form. See Reference 1 for details.)

Arguments

  • x is a vector of values of the independent variable.
  • y is a vector of values of the dependent variable, of the same size as x. For best performance, it is recommended that the y already be fairly smooth, e.g. by applying a kernel smoothing to the original values if they are noisy.
  • h is the kernel bandwidth to use. If h is not given, a "reasonable" value is computed.

Return values

  • yy is the vector of smooth monotone increasing function values at x.

Examples

x = 0:0.1:10;
y = (x .^ 2) + 3 * randn(size(x)); %typically non-monotonic from the added noise
ys = ([y(1) y(1:(end-1))] + y + [y(2:end) y(end)])/3; %crudely smoothed via
moving average, but still typically non-monotonic
yy = monotone_smooth(x, ys); %yy is monotone increasing in x
plot(x, y, '+', x, ys, x, yy)

References

  1. Holger Dette, Natalie Neumeyer and Kay F. Pilz (2006), A simple nonparametric estimator of a strictly monotone regression function, Bernoulli, 12:469-490
  2. Regine Scheder (2007), R Package ’monoProc’, Version 1.0-6, http://cran.r-project.org/web/packages/monoProc/monoProc.pdf (The implementation here is based on the monoProc function mono.1d)

Package: statistics