Re: [R] Using optim() function to find MLE

2024-07-28 Thread Ivan Krylov via R-help
В Mon, 29 Jul 2024 09:52:22 +0530 Christofer Bogaso пишет: > LL = function(b0, b1) help(optim) documents that the function to be optimised takes a single argument, a vector containing the parameters. Here's how your LL function can be adapted to this interface: LL <- function(par) { b0 <- par[

[R] Using optim() function to find MLE

2024-07-28 Thread Christofer Bogaso
Hi, I am trying to fit a GLM on below data. While R does provide direct estimation, I wanted to go with manual calculation as below dat = structure(list(PurchasedProb = c(0.37212389963679, 0.572853363351896, 0.908207789994776, 0.201681931037456, 0.898389684967697, 0.944675268605351, 0.66079779248