We are receiving many error messages when using NIntegrate with NonlinearModelFit. Here is a much-simplified version of the code. It arrives at the correct answer after several messages saying that it is stopping the integration. In the real version, which is fitting Beta distributions, the situation is similar but more complicated, and it is not clearly getting the best fit.
data = {{0, 0}, {1, 1}, {2, 4}}
cnet[x_, b_, c_] := NIntegrate[b + 2 c u, {u, 0, x}]
Print[cnet[0, 0, 1]]
Print[cnet[1, 0, 1]]
Print[cnet[2, 0, 1]]
Print[cnet[3, 0, 1]]
Chop[NonlinearModelFit[data, cnet[x, b, c], {b, c}, x]]
Comments
Post a Comment