Weighted fit using fmincon

4 次查看(过去 30 天)
I am trying to fit a logistic function to some data, and I've been using fmincon with success. One thing that I would like to implement in my fitting procedure is to fit the data in a weighted fashion... that is, if I have fewer observations for one of the data points I'm trying to fit, the fitting procedure will be less sensitive to that data point.
nlinfit in matlab has this functionality, but in general I find that function too hard to customize and have had better results with fmincon. I'm relatively unfamiliar with adding constraints to fmincon, but maybe there is an easy way to implement this? I appreciate any ideas!

采纳的回答

Fabio Freschi
Fabio Freschi 2020-3-3
How about to repeat the samples of the points you want to weight more?
  3 个评论
Fabio Freschi
Fabio Freschi 2020-3-3
Can you share (part of) the data, and show what's wrong with the result?
Chris Angeloni
Chris Angeloni 2020-3-3
编辑:Chris Angeloni 2020-3-3
Actually, my apologies, I think there was something else in my code that was causing those fits to look poor. It works really well! I'll edit my past comment.
And FWIW, fitting individual observations is an equivalent way of doing this, and seems to work with binary observations.

请先登录,再进行评论。

更多回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by