필터 지우기
필터 지우기

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

조회 수: 13 (최근 30일)
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?

채택된 답변

Drew
Drew 2023년 11월 15일
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
Peter Cam
Peter Cam 2023년 11월 16일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by