# Choi, B. and Kim, K. (2006), 
# 'Testing goodness-of-fit for Laplace distribution based on maximum entropy', 
# Statistics, Vol. 40, No. 6, pp. 517-531. 

# Regenerate table 5 from choi2006 (page 525) 
law.index <- 1
M <- 5*10^4
vectn <- c(10,20,35,50) 
levels <- 0.05
stat.indices <- c(51,53,52) 
law.indices <- c(1) 
alter <- list(stat51=4,stat53=4,stat52=4) 
l <- list(l1=c(1,0.5),l2=c(1,2),l3=c(1,4)) 

for (i in 1:length(l)) { 
  cat(paste('mu=',l[[i]][1],',','sigma=',l[[i]][2],'',sep='')) 
  eval(parse(text=paste('parlaws <- list(',paste('law',law.indices,'=c(',paste(l[[i]],collapse=','),')',sep='',collapse=','),')',sep=''))) 
  for (n in vectn) { 
    critval <- many.crit(law.index,stat.indices,M,n,levels,alter,law.pars=NULL,parstats=NULL) 
    table5 <- powcomp.fast(law.indices,stat.indices,n,M,levels,critval,alter,parlaws,parstats=NULL,nbclus=1,null.law.index=law.index) 
    print(table5,digits=1,latex.output=FALSE)
  } 
} 

# LaTex output : latex.output=TRUE 


