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

2 views (last 30 days)
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 Comment
strat944
strat944 on 26 Aug 2015
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?

Sign in to comment.

Answers (1)

Star Strider
Star Strider on 26 Aug 2015
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 Comments
strat944
strat944 on 26 Aug 2015
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.
Star Strider
Star Strider on 26 Aug 2015
You might want to contact the authors then and see if they can suggest something. That’s the best I can do.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!