Perform inverse weighted least squares regression

9 次查看(过去 30 天)
I have a dataset for a calibration curve that is linear, but due to the nature of regular least squares regression, the regression line is far less accurate at the lower end of the curve. This is due to the fact that linear regression minimizes the sum of squares of absolute error.
To get a more accurate fit at the lower end of my dataset, it has been reccomended to use an "Inverse Weighted Linear" regression. This is performed by minimizing the sum of squares of (1/error). In theory this makes perfect sense, the regression will fit much better at the lower end of the dataset, which is what I need.
However, I have not been able to find a tool that can do this, nor have I figured out how to do it by hand. When I search weighted linear, the results imply that I should know the weight of each datapoint. Would this be 1/error of each point?

采纳的回答

Star Strider
Star Strider 2021-5-16
Would this be 1/error of each point?
That would appear to be a reasonable approach, since the data with the smallest errors would get large weights, and the data with large errors would get smaller weights.
There are several linear and nonlilnear parameter estimation techniques that do this automatically, for example nlinfit and specifically the section on Nonlinear Regression Using Observation Weights.
  2 个评论
Aaron Goodman
Aaron Goodman 2021-5-16
Thanks for the response!
Are there any tools to do this while keeping the regression linear?
Ideally I'd just like to use the same exact least squares idea, but simply change it so that it minimizes the sum of squares of 1/error.
Star Strider
Star Strider 2021-5-16
Sure! However ‘curve’ implied nonlinear to me, so I went there first.
The fitlm function does linear regression, and has the option to include an observation Weights vector.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Regression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by