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.)
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)
Package: statistics