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]]
NumericQquestion / answer. – Leonid Shifrin Jan 14 at 17:09cnet[x_?NumericQ,b_?NumericQ,c_?NumericQ]:=...(did not test for this particular piece of code). – Leonid Shifrin Jan 14 at 17:11Printto see the value of an expression at top-level. Just type the expression and press shift-enter (Win) or shift-return or keypad-enter (OS X) – m_goldberg Jan 14 at 17:17shift-return, orenter. Unfortunately many keyboards (such as mine) incorrectly have "enter" written on the return key. I even saw a Toshiba laptop that produced the same scan code (that of enter) for both the return and enter keys. Using Mathematica on that one was more or less impossible... – Oleksandr R. Jan 14 at 17:27