Curve Fitting Toolbox: The interpolated curve is going beyond the limit
1 view (last 30 days)
Show older comments
Hello,
I am using the curve fitting toolbox to construct a interpolated curve from the given data point using the fit type smoothing spline.
While doing so, the curve is going beyond the permisible limit, for exmaple, the following curve should be bounded between 0 to 100% but it is going below the 0% mark in the Y-axis. Is there any way to fix this issue?
Thanks
1 Comment
Answers (1)
Atharva
on 24 May 2023
Hey Sanju,
Yes, there are ways to address the issue of the interpolated curve going beyond the permissible limits. Here are a few suggestions:
- Specify boundary conditions: You can impose boundary conditions on the curve fitting problem to ensure that the interpolated curve stays within the desired limits. In your case, you can set the lower bound to 0% and the upper bound to 100%. MATLAB's Curve Fitting Toolbox provides options to specify boundary conditions for smoothing splines.
- Modify the data points: If the data points themselves are causing the curve to go beyond the permissible limits, you may need to modify or remove some of the data points. Consider analyzing your data set and removing any outliers or erroneous points that are causing the issue.
- Adjust the smoothing parameter: Smoothing splines have a tuning parameter that controls the trade-off between fitting the data closely and producing a smooth curve. By adjusting this parameter, you can influence the behavior of the curve. Try increasing the smoothing parameter to obtain a smoother curve that stays within the desired limits.
- Use a different interpolation method: If the smoothing spline method is consistently producing curves that violate the limits, you can explore other interpolation methods provided by MATLAB's Curve Fitting Toolbox, such as piecewise polynomials or interpolating splines, and see if they yield better results.
- Post-process the curve: After obtaining the interpolated curve, you can manually adjust any points that fall outside the desired limits. For example, you can set any negative values to 0% and any values greater than 100% to 100%.
Remember to consider the characteristics of your data and the specific requirements of your application when choosing and applying these methods.
0 Comments
See Also
Categories
Find more on Smoothing 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!