How do the 'weights' work in the glmfit function?
3 次查看(过去 30 天)
显示 更早的评论
I am working with the glmfit function. The current line of code is:
b = glmfit(X,y,'binomial','link','logit');
In certain cases, some data points in X are more important than others and I want to modify the log-likelihood with weights.
Lets say I have data points x1, x2, ... , x10. x1 is the least important and x10 is the most important, and it follows with a linear increasing order.
From the documentation (mathworks.com/help/stats/glmfit.html): "such as the inverses of the relative variance of each observation". That sentence suggests that the weights will be in units matching square of variables, so that would suggest (10:-1:1).^2' is what I am looking for. However, it could be that the help wasn't written well and (10:-1:1) is what I want. Which one is correct?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!