Message Boards Message Boards

Evaluate the quality of the fit ?

Hi, I performed the fit of my data and I would like to obtain various information concerning the quality of the fit. Curiously, Mathematica doesn't respond as it normally would. Here is the code used

Clear[k3, k4, ea, eh, ef]
sol = ParametricNDSolve[{Derivative[1][a][t] == -k3*a[t], 
    Derivative[1][h][t] == k3*a[t] - 2*k4*h[t]*h[t], 
    Derivative[1][f][t] == 2*k4*h[t]*h[t], a[0] == 0.000006, 
    h[0] == 0, f[0] == 0}, {a, h, f}, {t, 0, 2000}, {k3, k4}];
{aFunc, hFunc, fFunc} = {a, h, f} /. sol;
model2[k3_, k4_, ea_, eh_, ef_][
   t_] := ((aFunc[k3, k4][t]*ea) + (eh*hFunc[k3, k4][t]) + (ef*
       fFunc[k3, k4][t]))*100/aFunc[k3, k4][0];
fit1 = FindFit[
   dataabs380, {model2[k3, k4, ea, eh, ef][t], 0.00050 < k3 < 0.02, 
    700 < k4 < 1200, 0.0001 < ea < 0.0008, 0.0001 < eh < 0.0008, 
    0.0001 < ef < 0.0008}, {k3, k4, ea, eh, ef}, t];
fit1["ParameterTable"]
fit1["ParameterErrors"]

The output for Fit["ParameterTable"] is Ok. It leads to {k3 -> 0.0085098, k4 -> 912.36, ea -> 0.000360078, eh -> 0.000316874, ef -> 0.000559417}["ParameterTable"]

But the output for Fit["ParameterErrors"] is similar to the previous one. {k3 -> 0.0085098, k4 -> 912.36, ea -> 0.000360078, eh -> 0.000316874, ef -> 0.000559417}["ParameterErrors"] I tried several others options available to estimate the quality of the fit, but none works. I don't understand this strangeness. It is not a problem of syntax.

Thanks in advance for all your advice and help. Sincerely Helene

2 Replies

Many thanks for your advice. Hélène

Posted 4 years ago

Hi Helene,

FindFit does not return a FittedModel, try using NonlinearModelFit.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract