Uncertainties in polyfit having error in dependent variable (y)
3 ビュー (過去 30 日間)
古いコメントを表示
Suppose I have data set... t=y(t)+- error, then what will be the error on the fitted line using polyfit...please.........
0 件のコメント
回答 (1 件)
Star Strider
2014 年 8 月 23 日
If you request the ‘S’-structure from polyfit, polyval will produce error bounds if you ask it for delta. See the documentation for details.
2 件のコメント
Star Strider
2014 年 8 月 25 日
It seems you want to do weighted fitting, probably inverse-variance fitting.
You cannot do weighted fitting with polyfit, at least to the best of my knowledge.
Since polynomial fitting is essentially a linear regression, you can use the core MATLAB lscov function to do weighted regression with a polynomial fit. (See the ‘Examples’ section.) I haven’t done that (I have the Statistics Toolbox that has its own functions for weighted fitting), but I would experiment with the X matrix in Example 1 and Example 2 as something like:
X = [ones(size(x)) x x.^2 x.^3];
(with x and y as column vectors), and so on for as many powers of x as you want.
参考
カテゴリ
Help Center および File Exchange で Polynomials についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!