How to fit data to a curve with known error bars and draw it?

101 ビュー (過去 30 日間)
tensorisation
tensorisation 2019 年 8 月 12 日
コメント済み: Adam Danz 2019 年 8 月 17 日
Using built-in functions like fit(...) or nlinfit(...), how exactly do I fit data to a curve with known error bars?
Let's say in general I have
[x,y,err_x,err_y]
And now I want to make a fit for it, say: fit=fit(x,y,'exp1')
And later want to draw everything with the errorbars using errorbar(...)
How exactly do I do that?
EDIT: knowing how to do this for the more simple case of no errors in the X axis would also help. Say I have:
[x,y,err_y]
And now I want to make a fit for it, say: fit=fit(x,y,'exp1')
  7 件のコメント
darova
darova 2019 年 8 月 17 日
Try to pass red curve instead of original one
img12.png
tensorisation
tensorisation 2019 年 8 月 17 日
I don't think that this produces what I'm looking for

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

回答 (1 件)

the cyclist
the cyclist 2019 年 8 月 17 日
編集済み: the cyclist 2019 年 8 月 17 日
Do you mean that you want to do a fit where both your x and y variables have known measurement error? (Unlike, say, an ordinary least squares fit, where all error is assumed to be in y?)
To my knowledge, MATLAB does not have a built-in function for that. I have done Deming regression using this function from the File Exchange.
  2 件のコメント
tensorisation
tensorisation 2019 年 8 月 17 日
編集済み: tensorisation 2019 年 8 月 17 日
Knowing how to do this for the case of only errors in y would also help me.
Let's say I have:
[x,y,err_y]
And now I want to make a fit for it, say: fit=fit(x,y,'exp1')

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

カテゴリ

Help Center および File ExchangeErrorbars についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by