Is there a way to check if sample obeys the Latin Hypercube Sampling rule? I was wondering if there is a way to check if a certain sample of a large size obeys the Latin Hypercube Sampling rule. I know that for smaller samples, I can easily visualize the sample points to see if they are stratified according to the Latin Hypercube rule, but was wondering if there would be way to check this for larger sizes of samples.
 A: There are a couple of strategies for you to consider.  I'll use R, but you should be able to adapt this to your language.  These strategies assume a uniform Latin hypercube on (0,1).  If you have already transformed the margins of the hypercube, you might want to transform them back.
# from the lhs package

require(lhs)

checkLatinHypercube <- function(X)
{
  if (any(apply(X, 2, min) <= 0))
    return(FALSE)
  if (any(apply(X, 2, max) >= 1))
    return(FALSE)
  if (any(is.na(X)))
    return(FALSE)
  # check that the matrix is a latin hypercube
  g <- function(Y)
  {
    # check that this column contains all the cells
    breakpoints <- seq(0, 1, length = length(Y) + 1)
    h <- hist(Y, plot = FALSE, breaks = breakpoints)
    all(h$counts == 1)
  }
  # check all the columns
  return(all(apply(X, 2, g)))
}

set.seed(10923)
X <- randomLHS(10, 3)
checkLatinHypercube(X)

# if you are in another language, then you can use these strategies

# check all numbers are between 0 and 1
for (i in 1:3)
{
  for (j in 1:10)
  {
    if (X[j,i] >= 1 | X[j,i] <= 0)
    {
      stop("error")
    }
  }
}

# check the sums in integer space
for (i in 1:3)
{
  temp <- floor(X[,i] * 10) + 1
  if (sum(temp) != 10*(10+1)/2)
  {
    stop("error")
  }
}

# check you have exactly 3 of each bin
temp <- floor(X * 10) + 1
for (i in 1:10)
{
  if (length(which(temp == i)) != 3)
  {
    stop("error")
  }
}

