num_iterations
Examples
loglike <- function(theta) {
-sum(dnorm(theta, mean = theta[1], sd = theta[2], log = TRUE))
}
score <- function(theta) {
-numDeriv::grad(loglike, theta)
}
sol <- mle_gradient_raphson(theta0 = theta, score = score, loglike = loglike)
#> Error in mle_gradient_raphson(theta0 = theta, score = score, loglike = loglike): could not find function "mle_gradient_raphson"
num_iterations(sol)
#> Error in is_mle_numerical(x): object 'sol' not found