# Approximate Epps-Pulley normality test # # Author: Francois Pelletier # # LGPL 3.0 ############################################################################### #' Approximate Epps-Pulley normality test #' #' An Approximation to the Limit Distribution #' of the Epps-Pulley Test Statistic for Normality #' By N. Henze #' Metrika (1990) 37:7-18 #' @param x Sample #' @param alpha Tolerance level #' @return A list containing the test statistics #' #' @author François Pelletier EppsPulley.test <- function(x,alpha=0.05) { ## Statistics n <- length(x) if (n<10) stop("n must be > 10") xbar <- mean(x) S <- sd(x) ## Constants gamma <- 3.55295 delta <- 1.23062 lambda <- 2.26664 xi <- -0.020682 ## Calculations T <- 2/n*sum(outer(x,x,function(x,y) exp(-0.5*(x-y)^2 / S^2))* outer(1:n,1:n,function(x,y) x