How do I fit data to a two-term power law while propagating uncertainties in data?
Mostra commenti meno recenti
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
strat944
il 26 Ago 2015
Risposte (1)
Star Strider
il 26 Ago 2015
0 voti
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
strat944
il 26 Ago 2015
Star Strider
il 26 Ago 2015
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.
strat944
il 26 Ago 2015
Star Strider
il 26 Ago 2015
You might want to contact the authors then and see if they can suggest something. That’s the best I can do.
Categorie
Scopri di più su Linear Predictive Coding in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!