R/cond.multinom.R

Defines functions cond.multinom

Documented in cond.multinom

cond.multinom <- function(model) {
  if (!"multinom" %in% class(model)) {stop("model not recognized")}
  if (!"Hessian" %in% names(model)) {
    model <- update(model,.~.,Hess=TRUE,trace=FALSE)
  }
  evd <- eigen(model$Hessian,symmetric=TRUE,only.values=TRUE)$values
  cond <- sqrt(max(evd)/min(evd))
  result <- c("Condition number"=cond,"Log10(condition)"=log10(cond))
  return(result)
}

Try the RVAideMemoire package in your browser

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

RVAideMemoire documentation built on Nov. 6, 2023, 5:07 p.m.