R/score_values_phi.R

Defines functions score_vals_phi

Documented in score_vals_phi

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
}
BriceonWiley/IntegratedLikelihood.R documentation built on Aug. 21, 2020, 11 p.m.