R/multinom_BIC.R

Defines functions multinom_BIC

# output of multinom_BIC is -0.5*BIC
multinom_BIC=function(x,y,weights){
  formula=y~x
  fit=nnet::multinom(formula,weights=weights,trace=F)
  p=fit$rank
  AIC=fit$AIC
  out=-0.5*AIC+p-0.5*p*log(length(weights)) # -0.5*BIC
  return( list("out"=out) )
}

Try the mDAG package in your browser

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

mDAG documentation built on Aug. 20, 2019, 5:19 p.m.