As shown in the documentation
data = {{1, 1}, {2, 2}, {3, 3.2}};
fitFuncExactNoLosses[a_, b_, x_] =
a*x^2 + b + x;
(nlm1 = NonlinearModelFit[data,
{fitFuncExactNoLosses[a, b, x], b > 0},
{{a, 1}, {b, 1}}, x]) // Normal
7.890764227861177*^-7 + x +
0.018364206486339258*x^2
nlm1["FitResiduals"]
{-0.018365, -0.0734576, 0.0347214}
(nlm2 = NonlinearModelFit[data,
{fitFuncExactNoLosses[a, b, x], b > 0},
{a, b}, x]) // Normal
0.011226160044776182 + x +
0.016760582112590634*x^2
nlm2["FitResiduals"]
{-0.0279867, -0.0782685, 0.0379286}
Plot[{nlm1[x], nlm2[x]}, {x, 0, 4},
Epilog -> {Red,
AbsolutePointSize[4],
Point[data]}]
Bob Hanlon