Fit using nlinfit with uncertainties on x and y accounted for in the fit

18 ビュー (過去 30 日間)
Henriette Ravn Larsen
Henriette Ravn Larsen 2021 年 8 月 24 日
編集済み: Henriette Ravn Larsen 2021 年 8 月 26 日
I would like to include uncertainties on x values and y values during the fit procedure such that the uncertainties are accounted for during the fitting. I am currently using the matlab function nlinfit as I am dealing with a mono-exponential decay but I am open to using another fit function if this does the job.
Can anyone tell me how to do that?
Thanks, Henriette

回答 (2 件)

Bjorn Gustavsson
Bjorn Gustavsson 2021 年 8 月 25 日
Have a look at the total least squares tools on the file exchange: total-least-squares-with-mixed-and-or-weighted-disturbances and total-least-squares-method - they might at least give you somewhere to start solving this type of problem (which is much more intricate than the standard least-squares fitting-problem...).
HTH

Image Analyst
Image Analyst 2021 年 8 月 25 日
Not sure what you mean. Of course all fitting routines can handle "uncertainties" in x and y in that they don't expect the actual data to lie perfectly on the fitted line. Attached is a demo of how to use fitnlm() to get exponential decay formula:
  4 件のコメント
Bjorn Gustavsson
Bjorn Gustavsson 2021 年 8 月 25 日
@Image Analyst, there are some additional complexities with uncertainties in both x and y - see for example the wikipedia-page on Total_least_squares. The standard fitting-functions only do the normal least-square-fitting as far as I know.
Henriette Ravn Larsen
Henriette Ravn Larsen 2021 年 8 月 26 日
編集済み: Henriette Ravn Larsen 2021 年 8 月 26 日
I think you still misunderstand me. No, u_x and u_y is not just to add noise, they are the associated uncertainties to the x- and y-values. Those that you would also put on as errorbars. The data is worth nothing without the uncertainties. And since the uncertainty can vary a lot from datapoint to datapoint I would like to take that into account in the fitting - like a weighting, but where I actually give the uncertainties for x- and y-values.
Makes more sense now? :)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDescriptive Statistics and Visualization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by