Skip to main content
11 events
when toggle format what by license comment
Sep 21, 2022 at 8:29 comment added idlatva @Noah thanks for your reply! I wrote some code with this first but wasn't sure if it took one row of the matrix X at a time. But compared them now and saw that the answers were equivalent. So thanks for the insight!
Sep 21, 2022 at 8:27 comment added idlatva @JohnMadden Thanks for you answer and thanks for the correction, I didn't know that you could check the function so this was really helpful!
Sep 21, 2022 at 8:01 vote accept idlatva
Sep 21, 2022 at 3:48 history edited Ben CC BY-SA 4.0
Edit to improve clarity, notation and question title and tags
Sep 21, 2022 at 2:57 answer added Ben timeline score: 3
Sep 21, 2022 at 2:48 comment added nwaldo @JohnMadden could you write your suggestion out as a full answer?
Sep 21, 2022 at 0:10 comment added Noah FYI, it will be faster (and clearer) to just do p <- 1/(1+exp(-X%*%beta))). You can always benchmark it against R's glm() function.
Sep 20, 2022 at 23:55 comment added John Madden Good question! However "I have no way to check if my function is correct" is not quite true :) The best way to check an implementation of a likelihood function (and the only way to check if you've developed a new likelihood) is to simulate data with known parameters, put the likelihood and the data in an optimizer (like R's "optim" with method="BFGS"), and see if you can recover your true parameters.
Sep 20, 2022 at 23:17 history edited idlatva CC BY-SA 4.0
added 63 characters in body
S Sep 20, 2022 at 23:13 review First questions
Sep 20, 2022 at 23:49
S Sep 20, 2022 at 23:13 history asked idlatva CC BY-SA 4.0