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!