Why do my coeffvalues not produce a sensible result?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Nicholas Turton
am 28 Aug. 2019
Kommentiert: Torsten
am 28 Aug. 2019
I have a script that uses the fit fuction on some data using a poly55 fit type. I then use this to get the coeffvalues for the fittted curve and try to replot the surface using the coeffvalues but the result produced is orders of magnitude different from the original data.
Script attached as well as some example data.
Can anyone explain what is happening or recommend a way forward?
0 Kommentare
Akzeptierte Antwort
Torsten
am 28 Aug. 2019
If you use the 'Normalize','on' fitting option, your polynomial has powers of (x-meanx)/stdx and (y-meany)/stdy instead of x and y.
2 Kommentare
Torsten
am 28 Aug. 2019
if you switch the mentioned option off, you can use the polynomial you defined in the calculation.
Otherwise you will have to insert (x-meanx)/stdx for x and (y-meany)/stdy for y in the calculation for your polynomial value:
f(x,y) = p00 + p10*(x-meanx)/stdx + p01*(y-meany)/stdy + p20*((x-meanx)/stdx))^2 + ...
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Linear and Nonlinear Regression finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!