Re: "Error" definition for nonlinear fit deviating from data points

*To*: mathgroup at smc.vnet.net*Subject*: [mg129989] Re: "Error" definition for nonlinear fit deviating from data points*From*: craigloehle at gmail.com*Date*: Sat, 2 Mar 2013 03:46:31 -0500 (EST)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*Delivered-to*: l-mathgroup@wolfram.com*Delivered-to*: mathgroup-newout@smc.vnet.net*Delivered-to*: mathgroup-newsend@smc.vnet.net*References*: <kgmn8s$8he$1@smc.vnet.net>

On Wednesday, February 27, 2013 10:43:08 PM UTC-6, max.u... at bioss.uni-freiburg.de wrote: > Hello, > > > > I am doing a fit to a series of data points with NonlinearModelFit. The fit works well but the fitted function does not exactly match the data. Now the standard error from the parameter confidence interval table is very small, which I understand. > > > > A simple example: > > > > data = Table[{x, x + Sin[x]}, {x, 0, 30, 0.01}]; > > nlf = NonlinearModelFit[data, a*x, a, x]; > > bf = a*x /. nlf["BestFitParameters"]; > > Show[Plot[bf, {x, 0, 30}], ListPlot[data]] > > nlf[{"ParameterConfidenceIntervalTable"}] > > > > The last result shows a standard error of 0.00075, but the plot shows that the fit and the data deviate a lot. Is there a measure that reflects how the fit deviates from the data? Can this also be expressed as some type of "error" in the parameter estimate? > > I.e. is there a way to write a = 1.0 +- xxx where x reflects the deviation of fit and curve? > > > > Thanks a lot for your help, > > > > Max The value of the fit you see is not the fit of the curve to the data but the error estimate of the parameter a which is constrained quite tightly by the sin wave. The fit of the curve is obtained with nlf[{"RSquared"}] in your example. Craig Loehle