How can I do a convex smoothing to a set of points in Matlab?

Hi
I'm using the function spline to do a cubic spline interpolation, nevertheless given the nature of that functions some parts are not convex. I need to ensure the convexity of the smoothed function, is there a way to do something similar like the spline but keeping it convex?
Many Thanks

1 Comment

Please post a screenshot (type alt-printscreen) to http://snag.gy so we can see what you're talking about.

Sign in to comment.

 Accepted Answer

This FEX file let's you constrain a spline fit to be convex

4 Comments

What does convex mean in this context? If your widely sampled "curve" is a sawtooth waveform (say it's peaks and valleys of a sine wave), what would a more finely sampled, interpolated, convex spline interpolation look like?
I haven't used SLM myself, only noticed that John had a convexity-enforcing setting there. I would assume it forces the interpolated spline to be convex. So, in your example with the sawtooth, I assume the resulting fitted curve would just be flat at zero.
Well then it wouldn't go through the knots. It would be a regression rather than an interpolation. Or do some kinds of splines not need to go through the knots?
Yes, it would be a regression, but I assume that's what the OP wants, as the title of the post mentions "convex smoothing".

Sign in to comment.

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!