How to generate Latin Hypercube samples for many variables simultaneously

Hi all
I don't know how to generate a set of Latin Hypercube samples in R. For example, I have 3 variables in a list var.list= c(var1, var2, var3). Each variable should be sampled within a range. var1 should be within (0,1), var2 should be within (0,10), var3 should be within (0,100), and the resolutions for them are all 0.01.

I want to generate 100 rows of the possible values, but I don't know how to set the resolution as 0.01 and how to vary the three variables all together rather than separately? The current code is shown below. Thanks for your help.

# install.packages('lhs')
library(lhs)

Y <- randomLHS(100, 3)

Y[,1] <- qunif(Y[,1], 0, 1) 
Y[,2] <- qunif(Y[,2], 0, 10)
Y[,3] <- qunif(Y[,3], 0, 100)
1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.