a b/FindBestTransform.R
1
FindBestTransform <-
2
function(x){
3
  alphas <- seq(.01, 1, len=50)
4
  gof <- rep(NA, length(alphas))
5
  for(alpha in alphas){
6
    gof[alphas==alpha] <- GoodnessOfFit(x^alpha,type="mle")
7
  }
8
  return(alphas[which.min(abs(gof-(nrow(x)-1)*(ncol(x)-1)))])
9
}
10