How do I fit data to a two-term power law while propagating uncertainties in data?

I have a set of values for independent variable xdata and dependent variable ydata, as well as values for measurement error in xdata but not ydata. I want to fit those values to a two-term power-law equation
ydata = xdata .^ a + (1 - xdata) .^ b
where a and b are fit parameters. I am able to fit the data using Matlab's Curve-Fitting Toolbox, but I need confidence intervals of a and b that take into account the measurement error. Is there an algorithm -- preferably one that is already written that can accomplish this task?

1 Commento

So I think I found what sort of tool. I need a software that will fit nonlinear functions using the Orthogonal Distance Regression (ORD) algorithm. I was only able to find a proprietary software from OrginLabs (attached is a screenshot) but I would prefer freeware. Does anyone have any suggestions?

Accedi per commentare.

Risposte (1)

I don’t have the Curve Fitting Toolbox, but if you have access to the Statistics Toolbox, use the nlinfit function to fit your data, and the nlparci function to give you the confidence intervals on the parameters.
The ‘error’ you see is a combination of process error (thermal noise and other noise sources in the process you’re measuring) and measurement error. All are modeled as Gaussian. It is likely not possible to separate them unless you already have calibrated your measuring equipment and have a reasonably precise estimate of its error in the range of values you’re measuring.

4 Commenti

Not quite. This is a good comment; however I do not have uniform measurement uncertainty. In addition to the values xdata and ydata, I also have an estimatation of each measurement uncertainty for xdata that I want to take into account. I have not constrained the uncertainty of ydata values.
Thank you.
If you have uncertainties in your independent variable as well, you need to use Total Least Squares. Petras and Bednarova published ‘Total Least Squares Approach to Modeling: A Matlab Toolbox’ Acta Montanistica Slovaca 50 (2010) 158-170, and also provided the necessary code in a File Exchange contribution Total Least Squares Method. The paper and the available FEX page documentation mention that it can handle linear and nonlinear regression. I don’t know if it will give you confidence limits as well, since I haven’t read the paper. The Total Least Squares Toolbox requires the MATLAB Statistics Toolbox.
I have no experience with the Total Least Squares Toolbox, but if I needed to do a total least-squares regression, it is where I would begin. I included a link to a free version of the paper (also linked to in the FEX page), so I would start by reading it, as necessary theory and documentation.
Thank you for looking into this. I saw this code as well. Yes, total least squares or orthogonal distance regression is what I want. However, I took a look at their source code and I don't see an input variable where I can specify the error for each measurement.
You might want to contact the authors then and see if they can suggest something. That’s the best I can do.

Accedi per commentare.

Richiesto:

il 25 Ago 2015

Commentato:

il 26 Ago 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by