Borrar filtros
Borrar filtros

Why do I get different results for gauss fit performed on different computer?

13 visualizaciones (últimos 30 días)
I am performing gaussian fits with fit()-method and observed different results (coefficients) depending on the PC I am using. I first encountered this issue when finished my code in Matlab (R2022b), compiled an .exe-file and ran that file on another pc with the runtime compiler (9.13). Let me list what I have tried since to analyze this behavior:
  • Same code with same input data run in Matlab R2022b and with runtime compiler on another PC yield different gauss-fit results (4, 5, 6, 7 and 8 terms all tested).
  • Checked input data, they are indeed the same in both instances up to 1e-64 decimal points.
  • Defined fixed values (all 0) for starting points as fitoption. Results between two versions are the same, but fit-quality is misrable.
  • Installed Matlab (2023b) on computer where I ran the .exe-file, ran same code with same data and got exaclty same results as with .exe, which means different than on the other computer with Matlab 2022b.
  • Extracted one set of data and used "curve fitter"-app to perform gauss-fit on both computers, all fit options equal. Resulting coefficients (and SSE) are different, but coefficient constraints, namely StartPoints, are the same.
At one point, I thought the starting points are calculated differently between the two computers, but the results from he curve fitter app give me pause. Can somebody provide clarity in this case?

Respuesta aceptada

Drew
Drew el 15 de Nov. de 2023
What is the magnitude of the differences you are observing in the resulting coefficients and SSE? Gaussian curve fitting uses the NonlinearLeastSquares method which involves iterative floating point computations. Any change, however small, in the underlying mathematical libraries could lead to differences in the computed fit. Within the range of the stability/usefulness/suitableness of this gaussian functional form to fit your data, the high-level expectation is that the resulting fit from both computers should be similarly acceptable and useful for the intended purpose. In other words, the differences between the fits are expected to be relatively small.
If this answer helps you, please remember to accept the answer.
  1 comentario
Peter Cam
Peter Cam el 16 de Nov. de 2023
The differences are small, it is hard to quantify though, as it is dependend on the data set and fit method (number of terms). But I can confirm that in both cases the resulting fit is qualitatively good and useful.

Iniciar sesión para comentar.

Más 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

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by