[81de4e]: / FindBestTransform.R

Download this file

11 lines (9 with data), 252 Bytes

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