Re: nonlinearfit for data with errors in both coordinates

*To*: mathgroup at smc.vnet.net*Subject*: [mg112193] Re: nonlinearfit for data with errors in both coordinates*From*: Bill Rowe <readnews at sbcglobal.net>*Date*: Sat, 4 Sep 2010 04:00:23 -0400 (EDT)

On 9/3/10 at 6:07 AM, ruth.lazkoz at ehu.es (Ruth Lazcoz Saez) wrote: >It is not clear to me if mathematica can fit to a curve data with >explicit errors in both variables=C3=82=C5=BD(x,y). If this is the case, can >someone drop me a correct syntax line if my data are >x={2.0,4.0,7.0} and xerrors={0.1,0.15,0.12} y={8.0,16.0,15.00} and >yerrors={0.3,0.35,0.42} All of the built in Mathematica functions for doing curve fits are designed to deal with uncertainty in the y-coordinate only. But it is possible to create fitting functions that deal with uncertainty in both coordinates. Here, I assume when you say error you really mean statistical uncertainty. If you actually know the coordinates are in error by a fixed amount, the obvious thing to do is adjust your data so the error term is zero then do the curve fitting. I note, you only have three data points. That is too few data points to make any really useful estimate of confidence limites for the parameters of whatever model you are fitting to your data. And it is the confidence limits that are changed by including uncertainty estimates into the fitting algorithm not the best estimate of the model parameters. I also note a plot of your data indicates the model to be fitted must be non-linear given the values you have indicated for uncertainty. Doing non-linear fitting is significantly more challenging than doing linear fitting. Unless you have a very simple model that can be transformed into a linear model, you almost certainly don't have enough data to get robust estimates of the model parameters. The message here is, you are almost certainly proceeding down a path that requires some fairly sophisticated mathematical/statistical background that is very unlikely to produce a better or more reliable answer than what you would get by simply ignoring the uncertainty data.