points = {{144, 18, 52}, {142, 24, 40}, {124, 12, 40}, {64, 30, 48}, {96, 30,
32}, {74, 26, 56}, {136, 26, 24}, {54, 22, 64}, {92, 22, 16}, {96, 14,
64}, {92, 10, 56}, {82, 10, 24}, {76, 6, 48}, {68, 6, 32}};
Previous answer from belisarius:
fit = Fit[RotateRight /@ points, {1, x, z, x x, z z, x z}, {x, z}]
(* -9.44205 + 0.824875*x + 0.000781796*x^2 + 0.175003*z - 0.0102413*x*z + 0.00150438*z^2 *)
Alternate
fit == ((lmf =
LinearModelFit[RotateRight /@ points, {x, z, x^2, z^2, x*z}, {x, z}]) // Normal)
(* True *)
Note that built-in symbols (e.g., E) cannot be used as user-defined symbols. As a general rule, all user-defined symbols should start with a lower case letter to avoid naming conflicts with built-in symbols.
equation2 = a + b*x + c*z + d*x^2 + e*z^2 + f*x*z;
(nlm = NonlinearModelFit[RotateRight /@ points,
equation2, {a, b, c, d, e, f}, {x, z}, Method -> NMinimize]) // Normal // Quiet
(* -9.49492 + 0.825614*x + 0.000777544*x^2 + 0.175796*z - 0.0102451*x*z + 0.00150132*z^2 *)
nlm["BestFitParameters"]
(* {a -> -9.49492, b -> 0.825614, c -> 0.175796, d -> 0.000777544, e -> 0.00150132, f -> -0.0102451} *)
However, since you said that y is the dependent variable, RotateLeft should be used above rather than RotateRight
RotateRight[{y, z, x}]
(* {x,y,z} *)
RotateLeft[{y, z, x}]
(* {z,x,y} *)
Fit[RotateRight[#, 1] & /@ points, {1, x, z, x x , z z, x z}, {x, z}]
$\endgroup$