Reputation: 20345
I am facing the following dilemma.
"Natural" or periodic interpolating cubic spline curve (cscvn
) allows me to fit an interpolating spline curve that passes all the control points. However, in my problem the data points are noisy, so an interpolating spline curve has many zig-zags.
So I thought maybe I need an approximating (instead of interpolating) spline curve that doesn't necessarily pass through all the points. Then I came across cubic smoothing spline (csaps
).
Now the curve is indeed smoother, but it has problems when I have multiple y values around an x value. So the fitting result is not really "correct".
How do I have a smooth and "correct" fitting?
Upvotes: 0
Views: 1116
Reputation:
You should take the maximum von the y values and that's it.
Or if you believe that the noisy end is correct you should enlarge the bin size (variable bin size). This will lead to a good spline but the curve will drop.
It depends on what you believe is correct. In anyway enlarging the bin size also in the "smooth" part of the curve (<200) should improve the smoothness of the spline.
Upvotes: 2