'nlm() Error in f(x, ...) : could not find function "f"
Trying to use the nlm() function by incorporating a log likelihood function I used before.
mle_nlm <- function(n,m1,m2,x,x1,x2,initial){
negative_log_likelihood <- -1*log_likelihood(p=initial,n,m1,m2,x,x1,x2)
mlenlm <- nlm(negative_log_likelihood,initial)
return(mlenlm)
}
When I call the function, I get the error below.
> mle_nlm(130,25,25,75,20,5,c(0.8,0.24))
Error in f(x, ...) : could not find function "f"
Called from: (function (x)
f(x, ...))(c(0.8, 0.24))
Browse[1]> Q
When I try to troubleshoot, every line except for the nlm() line seems to work fine. I don't know what's wrong with the way I'm utilizing the nlm() function.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
