R/my.AIC.R

#Calcualtes the AIC-Criteria for the estimated density.
my.AIC <- function(penden.env,lambda0,opt.Likelihood=NULL) {
  if(!is.null(opt.Likelihood)) {val1 <- -opt.Likelihood}
  if(is.null(opt.Likelihood)) {val1 <- -pen.log.like(penden.env,lambda0=0)}
  df <- my.positive.definite.solve(get("Derv2.pen",penden.env))%*%get("Derv2.cal",penden.env)
  mytrace <- sum(diag(df))
  return(list(myAIC=(val1+mytrace),mytrace=mytrace))
}

Try the pendensity package in your browser

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

pendensity documentation built on May 2, 2019, 3:58 a.m.