Curve fitting equation does not give the input z back

2 views (last 30 days)
I have made a 3D plot of experimental data to use the curve fitter in order to get an equation. When I use the equation and insert an x and y value, the value of z is way higher than in de 3D plot.
Curve fit data:
Linear model Poly33:
f(x,y) = p00 + p10*x + p01*y + p20*x^2 + p11*x*y + p02*y^2 + p30*x^3 + p21*x^2*y
+ p12*x*y^2 + p03*y^3
where x is normalized by mean 8.327e+06 and std 6.911e+06
and where y is normalized by mean 330 and std 22.62
Coefficients (with 95% confidence bounds):
p00 = 2.653e-05 (2.273e-05, 3.033e-05)
p10 = 2.195e-05 (1.646e-05, 2.744e-05)
p01 = -1.158e-05 (-1.83e-05, -4.858e-06)
p20 = 5.127e-06 (1.941e-06, 8.312e-06)
p11 = -1.045e-05 (-1.238e-05, -8.524e-06)
p02 = 4.16e-06 (1.917e-06, 6.402e-06)
p30 = -4.23e-06 (-7.447e-06, -1.013e-06)
p21 = 3.459e-06 (1.103e-06, 5.814e-06)
p12 = 2.015e-06 (-2.528e-07, 4.284e-06)
p03 = -1.098e-06 (-4.878e-06, 2.683e-06)
Goodness of fit:
SSE: 1.113e-09
R-square: 0.9555
Adjusted R-square: 0.9438
RMSE: 5.722e-06
Validation of equation:
pA = 8300000;
T = 323;
mu = 2.653e-05 + 2.195e-05*pA + -1.158e-05*T + 5.127e-06*pA^2 + -1.045e-05*pA*T + 4.16e-06*T^2 + -4.23e-06*pA^3 + 3.459e-06*pA^2*T + 2.015e-06*pA*T^2 + -1.098e-06*T^3
mu =
-2.4186e+15
The input z valeus are in order of 10^-5 which is logical but I don't understand why the formula gives a value of -2.4186e+15. Does anyone have experience with this kind of deviations?
I would like to thank you in advance!
  2 Comments
Star Strider
Star Strider on 12 Oct 2022
What were the original ‘x’, ‘y’ and ‘z’ values used to estimate the parameters?
Olaf Schipper
Olaf Schipper on 12 Oct 2022
Moved: Star Strider on 12 Oct 2022
y x z
300 100000 0.00001502
300 500000 0.00001505
300 1000000 0.00001511
300 2500000 0.00001539
300 5000000 0.00001667
300 7500000 0.000061
300 10000000 0.00007244
300 12500000 0.00007974
300 15000000 0.00008555
300 17500000 0.00009053
300 20000000 0.00009496
320 100000 0.00001598
320 500000 0.00001601
320 1000000 0.00001606
320 2500000 0.0000163
320 5000000 0.00001719
320 7500000 0.00001969
320 10000000 0.0000324
320 12500000 0.00005096
320 15000000 0.00006004
320 17500000 0.00006654
320 20000000 0.00007188
340 100000 0.00001693
340 500000 0.00001696
340 1000000 0.000017
340 2500000 0.00001721
340 5000000 0.00001791
340 7500000 0.00001941
340 10000000 0.0000227
340 12500000 0.00002995
340 15000000 0.00004006
340 17500000 0.00004833
340 20000000 0.00005477
360 100000 0.00001787
360 500000 0.00001789
360 1000000 0.00001793
360 2500000 0.00001812
360 5000000 0.0000187
360 7500000 0.0000198
360 10000000 0.00002175
360 12500000 0.00002507
360 15000000 0.00003014
360 17500000 0.00003631
360 20000000 0.00004233

Sign in to comment.

Accepted Answer

Torsten
Torsten on 12 Oct 2022
Edited: Torsten on 12 Oct 2022
Did you read that you have to use the normalized values for pA and T to evaluate mu(pA,T) ?
f(x,y) = p00 + p10*x + p01*y + p20*x^2 + p11*x*y + p02*y^2 + p30*x^3 + p21*x^2*y
+ p12*x*y^2 + p03*y^3
where x is normalized by mean 8.327e+06 and std 6.911e+06
and where y is normalized by mean 330 and std 22.62
So my guess is you have to evaluate the function with x' = (x-8.327e+06)/6.911e+06 and y' = (y-330)/22.62.
But you should use the parameters in full length. Use f(x,y) directly to evaluate the fit result for given values of x and y.
pA = (8300000-8.327e+06)/6.911e+06;
T = (323-330)/22.62;
mu = 2.653e-05 + 2.195e-05*pA + -1.158e-05*T + 5.127e-06*pA^2 + -1.045e-05*pA*T + 4.16e-06*T^2 + -4.23e-06*pA^3 + 3.459e-06*pA^2*T + 2.015e-06*pA*T^2 + -1.098e-06*T^3
mu = 3.0445e-05
  1 Comment
Olaf Schipper
Olaf Schipper on 12 Oct 2022
Thank you very much Torsten. I totally read over that information and thought x was directly usable. I should read more carefully. But thank you very much! This helped a lot!

Sign in to comment.

More Answers (0)

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!