Curve fitting equation does not give the input z back
2 views (last 30 days)
Show older comments
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
on 12 Oct 2022
What were the original ‘x’, ‘y’ and ‘z’ values used to estimate the parameters?
Accepted Answer
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
More Answers (0)
See Also
Categories
Find more on Fit Postprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!