R/multispml.mle.R

Defines functions multispml.mle

Documented in multispml.mle

multispml.mle <- function(x, ina, tol = 1e-07, ell = FALSE) {
  ni <- tabulate(ina)
  ni <- ni[ni > 0]
  g <- length(ni)
  loglik <- gi <- numeric(g)
  mi <- matrix(nrow = g, ncol = 2)
  for (i in 1:g) {
    mod <- Rfast::spml.mle( x[ina == i], tol = tol )
    loglik[i] <- mod$loglik
    gi <- mod$gamma
    mi[i, ] <- mod$mu
  }
  if ( !ell )  loglik <- NULL
  list(loglik = loglik, gi = gi, mi = mi)
}

Try the Directional package in your browser

Any scripts or data that you put into this service are public.

Directional documentation built on Oct. 12, 2023, 1:07 a.m.