Timeline for Problems optimizing a likelihood function in R
Current License: CC BY-SA 3.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 12, 2012 at 4:43 | vote | accept | user1172558 | ||
Dec 10, 2012 at 21:51 | history | edited | user88 | CC BY-SA 3.0 |
added 9 characters in body; edited title
|
Dec 10, 2012 at 13:30 | answer | added | Elvis | timeline score: 8 | |
Dec 10, 2012 at 13:07 | history | migrated | from stackoverflow.com (revisions) | ||
Dec 8, 2012 at 21:41 | comment | added | Carl Witthoft |
I'm not sure you want to try to simultaneously minimize both x*theta and (1-x)*(1-theta) . I would recommend moving this to stats.stackexchange to get some advice on algorithms to evaluate experiments of this sort. Meanwhile, have you looked at alternative approaches, such as stackoverflow.com/questions/8085361/… ?
|
|
Dec 8, 2012 at 21:03 | comment | added | user1172558 | Ok, so maybe I'm not understanding how this is working. Can you help me fixing the code? I have two independent samples of subjects, the control group and the treatment group. I want to compare the proportion of sick subjects in the control and treatment groups. Am I writing the likelihood correctly? Thanks! | |
Dec 8, 2012 at 20:47 | comment | added | flodel |
I confirm your function needs to return a scalar, otherwise what is there to maximize? Also note that nlm does a minimization so you'll have to negate your objective function.
|
|
Dec 8, 2012 at 20:42 | comment | added | user1172558 | In fact, I want binom.ll to return a vector: the MLE for group 1 and MLE for group 2. I am trying to compare the proportion of two groups. That's why my log-likelihood function is the sum of two binomial functions. You are right about the log(0). Thanks! | |
Dec 8, 2012 at 20:38 | comment | added | flodel |
Shouldn't binom.ll return a scalar? Right now it is trying to add vectors of different lengths (and you have mismatching parenthesis in multiple places). Also note that log(0) is not finite so you might want to start at (0.5, 0.5) .
|
|
Dec 8, 2012 at 20:24 | history | asked | user1172558 | CC BY-SA 3.0 |