필터 지우기
필터 지우기

Uncertainties in polyfit having error in dependent variable (y)

조회 수: 5 (최근 30일)
Chris Martin
Chris Martin 2014년 8월 22일
댓글: Star Strider 2014년 8월 25일
Suppose I have data set... t=y(t)+- error, then what will be the error on the fitted line using polyfit...please.........

답변 (1개)

Star Strider
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
Chris Martin
Chris Martin 2014년 8월 25일
My query was if y value is having some plus minus value then how to include that error in fitting along with uncertainties in polyfit. polyfit will give the uncertainties in fitting to y, but what what will be the uncertainties of polyfit to y+- something
Star Strider
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 CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by