Issue with rounding of smoothing parameter in fit

2 visualizzazioni (ultimi 30 giorni)
Jacob Simon
Jacob Simon il 29 Nov 2020
Commentato: Mathieu NOE il 30 Nov 2020
I am trying to use the fit() function to produce smoothed spline curves, and display multiple curves on one plot for comparison. I used the Curve Fitting app to determine the best smoothing param based on relative smoothness and fit stats
s_param = [0.99985344]
spartcurve = fit(x_elev,y_spart,'smoothingspline')
spartop = fitoptions(spartcurve)
spartop.SmoothingParam = s_param
Everything works smoothly, except Matlab seems to be rounding my smoothing parameter to 1, which is a problem because small numerical changes produce large changes in the roughness/smoothness of the curve. The console shows the following after running the above:
spartop =
Normalize: 'off'
Exclude: []
Weights: []
Method: 'SmoothingSpline'
SmoothingParam: 1.0000
This seems like something that might be related to how Matlab handles floating point numbers but I am not well versed enough to figure it out.
Thank you for your help!
  3 Commenti
Jacob Simon
Jacob Simon il 29 Nov 2020
To my knowledge, what I included originally is what spartop.SmoothingParam returns; viewing it in the object window shows the same values.
Thank you for your help, I wasn't aware of the format options! That kept the parameter value precise, although the plotted curve is not changing to reflect that... I believe you maybe right in saying that the process is flawed so i might just be at an impasse here
Mathieu NOE
Mathieu NOE il 30 Nov 2020
well
in case that could be of any help , this is a simple code to do some data (experimental or model) smoothing
might be enough for simple tasks and you have only one parameter to dela with
regards,

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Get Started with Curve Fitting Toolbox in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by