Why do I get different results for gauss fit performed on different computer?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Peter Cam
am 15 Nov. 2023
Kommentiert: Peter Cam
am 16 Nov. 2023
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?
0 Kommentare
Akzeptierte Antwort
Drew
am 15 Nov. 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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!