Can you help me with a logistic regression?
2 次查看(过去 30 天)
显示 更早的评论
I need to solve the following system:
log(pR,i/pL,i)=SIGMA{ alpha_j [(rR,i-j)-(rL,i-j)]}+SIGMA{ beta_j [(cR,i-j)-(cL,i-j)]}+gamma
rR, rL, cR, cL: are known binary vectors (0,1) that describe the state of a system at different discrete times i=1,2,3,.... 'r' stands for reward, 'c' for choice, 'R' for right and 'L' for left (i.e. this is derived from a choice task with 2 options, L or R).
Note how the components for each summation are weighting the relative influence of past events as j increases.
PROBLEM 1: Im still uncertain on how to estimate the log odds (left portion of the equation). pR,i is the probability that cR,i==1.... and pL,i=1-pR,i. Likewise cL,i=1-cR,i.
PROBLEM 2: get alpha_j (function of j), beta_j (function of j), and gamma.
0 个评论
回答(1 个)
Tom Lane
2013-5-10
I don't understand your notation, in particular log(pR,i/pL,i). I guess you tried to explain that in PROBLEM 1, but I still don't understand what you intend to use as the response (or output or y) in this problem.
The Statistics Toolbox has a glmfit function (also GeneralizedLinearModel.fit) for fitting binary logistic regression. That can cope with estimating odds even when the inputs are all 0 or 1. But I suspect from the fact that I don't follow your notation that this will not be adequate.
Can you explain any further, or point to a reference?
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!