score_vals_phi <- function(phi, data, inits, crit) {
mles <- optim(
inits[2:4], log_likelihood_phi, phi = phi, data = data,
lower = c(1e-5, 1e-5, 1e-5), upper = c(100, 1 - 1e-5, 1 - 1e-5),
method = "L-BFGS-B", control = list(fnscale = -1)
)$par
val <- solve(info_matrix(c(phi, mles), data))[1, 1]
(score_function_phi(mles, phi, data))^2 * val - crit
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.