Curve Fitting Toolbox: The interpolated curve is going beyond the limit

1 view (last 30 days)
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

Answers (1)

Atharva
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:
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!