How do the 'weights' work in the glmfit function?
3 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Cell Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!