Skip to contents

This function samples the parameter space using Latin Hypercube Sampling (LHS).

Usage

sample_lhs(par, n)

Arguments

par

A matrix or data frame specifying the parameter ranges.

n

The number of samples to generate.

Value

A tibble containing the sampled parameter values.

Examples

# Define parameter ranges
parameters <- data.frame(
  param1 = c(0, 1),
  param2 = c(0, 2),
  param3 = c(0, 10)
)

# Sample the parameter space
sample_space <- sample_lhs(parameters, 3)
sample_space
#> # A tibble: 3 × 3
#>   param1 param2 param3
#>    <dbl>  <dbl>  <dbl>
#> 1  0.181  0.868   1.61
#> 2  0.965  1.74    5.88
#> 3  0.511  0.508   8.25