This function draws a random Latin hypercube sample from the unit cube,
i.e., the unit interval is divided into n intervals of equal length in
each dimension, and each of them contains exactly one of the n points.
References
McKay, M. D., Beckman, R. J. and Conover, W. J. (1979). A comparison of three methods for selecting values of input variables in the analysis of output from a computer code. Technometrics 21(2), 239–245. doi:10.1080/00401706.1979.10489755
See also
Other simulation helpers:
Simulator,
correlated_regressors(),
ddirichlet_cpp(),
dmixnorm_cpp(),
dmvnorm_cpp(),
dtnorm_cpp(),
dwishart_cpp(),
gaussian_tv(),
halton_points(),
simulate_markov_chain(),
sobol_points()
Examples
set.seed(1)
lhs_points(n = 5, dim = 2)
#> [,1] [,2]
#> [1,] 0.02032206 0.500460152
#> [2,] 0.61106495 0.856476298
#> [3,] 0.46784044 0.001618781
#> [4,] 0.87417719 0.723992964
#> [5,] 0.38764275 0.244510956
