The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Package {GLHD}


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 sum(group_sizes).

group_sizes

An integer vector (u1, ..., ug) giving the size of each group, with sum(group_sizes) == p.

seed

An integer random seed for reproducibility. Default is 123.

n_between

Number of between-group correlation control iterations. Default is 1.

n_within

Number of within-group correlation control iterations. Default is 9.

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 create_groups.

Value

A named list with three components:

Whole

RMS correlation computed over all pairs of variables.

Within

RMS correlation computed over pairs within the same group. Returns 0 if every group contains only a single variable.

Between

RMS correlation computed over pairs from different groups. Returns 0 if 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 sum(group_sizes).

group_sizes

Integer vector of group sizes (u1, ..., ug).

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.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.