| Type: | Package |
| Title: | Grouped Latin Hypercube Designs with Controlled Correlations |
| Version: | 1.1-1 |
| Description: | We provide a method of constructing grouped Latin hypercube designs by controlling correlations. Details of the algorithm can be found in Wenlong Li, Jian-Feng Yang and Peter Chien (2026). Grouped Latin hypercube designs with controlled correlations. Technometrics, published online. Important function in this package is "GLHD_CC". |
| License: | LGPL (≥ 3) |
| Imports: | stats |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.2 |
| NeedsCompilation: | no |
| Packaged: | 2026-08-05 06:47:10 UTC; wenlo |
| Author: | Wenlong Li [aut, cre], Jian-Feng Yang [aut], Peter Chien [aut] |
| Maintainer: | Wenlong Li <wlli1@bjtu.edu.cn> |
| Repository: | CRAN |
| Date/Publication: | 2026-08-09 08:10:19 UTC |
Generate a Grouped Latin Hypercube Design with Controlled Correlations
Description
Constructs a Grouped Latin Hypercube Design GLHD_CC(n, p, (u1, ..., ug)), which is an n x p Latin hypercube design whose p = u1 + ... + ug columns are partitioned into g disjoint groups of sizes u1, ..., ug. The algorithm alternates between between-group and within-group correlation control steps.
Usage
GLHD_CC(n, p, group_sizes, seed = 123, n_between = 1, n_within = 9)
Arguments
n |
A positive integer specifying the number of runs. |
p |
A positive integer specifying the total number of factors,
equal to |
group_sizes |
An integer vector |
seed |
An integer random seed for reproducibility. Default is
|
n_between |
Number of between-group correlation control iterations.
Default is |
n_within |
Number of within-group correlation control iterations.
Default is |
Value
An n x p integer matrix whose columns form a Latin hypercube design with reduced within-group and between-group correlations.
Examples
library(GLHD)
n <- 20
p <- 15
group_sizes <- c(4, 5, 6)
D <- GLHD_CC(n, p, group_sizes)
D
Whole, Within-Group, and Between-Group RMS Correlations
Description
Computes the root mean square (RMS) correlation for a given design matrix, decomposed into three components: the overall (whole) RMS correlation across all variable pairs, the within-group RMS correlation among variables sharing the same group, and the between-group RMS correlation across variables belonging to different groups.
Usage
compute_rms(D, groups)
Arguments
D |
A numeric matrix representing the design, where columns correspond to variables and rows to observations. |
groups |
A list of integer vectors, each specifying the column indices
belonging to one group. Typically created via |
Value
A named list with three components:
WholeRMS correlation computed over all pairs of variables.
WithinRMS correlation computed over pairs within the same group. Returns
0if every group contains only a single variable.BetweenRMS correlation computed over pairs from different groups. Returns
0if only one group is provided.
Examples
library(GLHD)
p <- 15
group_sizes <- c(4, 5, 6)
groups <- create_groups(p, group_sizes)
D <- matrix(rnorm(p * 30), nrow = 30, ncol = p)
compute_rms(D, groups)
Create Group Index Lists
Description
Partitions the column indices 1:p into consecutive groups according
to group_sizes.
Usage
create_groups(p, group_sizes)
Arguments
p |
Total number of columns; must equal |
group_sizes |
Integer vector of group sizes |
Value
A list of length length(group_sizes), where the i-th element
is an integer vector of column indices for group i.
Examples
create_groups(15, c(4, 5, 6))
Generate a Random Latin Hypercube Design
Description
Generate a Random Latin Hypercube Design
Usage
generate_LHD(n, p)
Arguments
n |
A positive integer: number of runs. |
p |
A positive integer: number of factors. |
Value
An n x p integer matrix where each column is a random permutation
of 1:n.