October 4th, 2003, 3:50 pm
Please see the warning at the end!!!!!Sorry. I cannot reproduce your error in the following versions of Mathematica: 4.0 Linux, 4.2.0 Linux, 4.2.1 Linux, and 5.0.0 Win32.The error message you get is due to the failure of NonlinearRegress. I accidentally found out this when I failed to define VolDataBut. After I redefine the VolData, it works and gives me the same results as before. Please restart the math kernel, and copy and paste the following codes.<< Statistics`NonlinearFit`;VolModel = Integrate[((a + b*(T - t))*Exp[-c*(T - t)] + d)*((a + b*(T - t))* Exp[-c*(T - t)] + d), {t, 0, T}];VolData = {{0.5, .180253}, {1, 0.191478}, {1.5, .186154}, {2, 0.177294}, { 2.5, .167887}, { 3, .158123}, {3.5, 0.152688}, {4, 0.148709}, {4.5, 0.144703}, {5, \0.141259}, {5.5, 0.137982}, {6, 0.134708}, {6.5, 0.131428}, {7, 0.128148}, { 7.5, 0.1271}, {8, 0.126822}, {8.5, 0.126539}, {9, 0.126257}, { 9.5, 0.12597}};Param=BestFitParameters /. NonlinearRegress[VolData, VolModel, T, {a, b, c, d}, \RegressionReport -> BestFitParameters, MaxIterations -> 10000]WARNING: Even the above codes work, but the result it generate is far from satisfying. Try ListPlot[VolData] and Plot[VolModel/.Param, {T,0,10}] and you will see. Two suggestions: 1. Use a better data fitting tools (or MatLab); 2. Choose better starting values for your parameters. This can be done by replacing {a,b,c,d} with {{a,1}, {b,2}, {c,3}, {d,4}}. See the help of NonlinearRegress for details.Overall, curvefitting is no easy task. I am so glad that I only waste one year of my life for it.