Determine the the slope and its uncertainty?
古いコメントを表示
Hi,
I am trying to linearly fit a set of data points, find the slope and then compute the uncertainty of the slope, +, - uncertainty. How can I do this in MATLAB?
I have tried to look into regression and regress but are getting very confused.
Additional questions:
What is the outputs of Regress? Does it gives the slope of the linear fit? And the 95% confidence intervals? I noticed that b not the same as the polyfit?
Likewise, the polyfit does not give the same slope as regression. And Regression gives me matrix of result.. shouldn't slope just be one value. The inputs are just vectors of x,y data.
Thanks
採用された回答
その他の回答 (1 件)
Ganessen Moothooveeren
2013 年 3 月 14 日
0 投票
But still how to find the uncertainty in the slope using the polyfit function??
2 件のコメント
Venkatessh
2013 年 3 月 14 日
In order to estimate the uncertainties of the coefficients obtained from polyfit function, you may follow the following steps:
[b, bint] = polyfit(x,y,1);
b_err = sqrt(diag((bint.R)\inv(bint.R'))./bint.normr.^2./bint.df);
where, b_err contains the uncertainty of the coefficients
Ankan Biswas
2018 年 1 月 28 日
Hi Venkatessh, Can you explain the rationale behind your error calculation? Thanks in advance.
カテゴリ
ヘルプ センター および File Exchange で Linear Regression についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!