Skip to main content
added 206 characters in body
Source Link
Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456
data = {{1, 1}, {2, 1.4}, {3, 1.8}, {4, 2.4}, {5, 2.9}};
fitfunc[a_, b_, x_] := y /. Solve[a y + b Log[y] == x, {y},InverseFunctions -> True];
FindFit[data, fitfunc[a, b, x], {a, b}, x]

When inverse functions are allowed, Solve solves for f[expr] first, then applies InverseFunction[f] to the result, equates it to expr, and continues trying to solve for the remainder of the variables.

data = {{1, 1}, {2, 1.4}, {3, 1.8}, {4, 2.4}, {5, 2.9}};
fitfunc[a_, b_, x_] := y /. Solve[a y + b Log[y] == x, {y},InverseFunctions -> True];
FindFit[data, fitfunc[a, b, x], {a, b}, x]
data = {{1, 1}, {2, 1.4}, {3, 1.8}, {4, 2.4}, {5, 2.9}};
fitfunc[a_, b_, x_] := y /. Solve[a y + b Log[y] == x, {y},InverseFunctions -> True];
FindFit[data, fitfunc[a, b, x], {a, b}, x]

When inverse functions are allowed, Solve solves for f[expr] first, then applies InverseFunction[f] to the result, equates it to expr, and continues trying to solve for the remainder of the variables.

Source Link
Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456

data = {{1, 1}, {2, 1.4}, {3, 1.8}, {4, 2.4}, {5, 2.9}};
fitfunc[a_, b_, x_] := y /. Solve[a y + b Log[y] == x, {y},InverseFunctions -> True];
FindFit[data, fitfunc[a, b, x], {a, b}, x]