Issue with rounding of smoothing parameter in fit

2 visualizaciones (últimos 30 días)
Jacob Simon
Jacob Simon el 29 de Nov. de 2020
Comentada: Mathieu NOE el 30 de Nov. de 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 comentarios
Jacob Simon
Jacob Simon el 29 de Nov. de 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 el 30 de Nov. de 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,

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by