Type: Package
Title: Fractional Factorial Designs with Alias and Trend-Free Analysis
Version: 1.0
Description: Constructs mixed-level and regular fractional factorial designs using coordinate-exchange optimization and automatic generator search. Design quality is evaluated with J2 and balance (H-hat) criteria, alias structures are computed via correlation-based chaining, and deterministic trend-free run orders can be produced following Coster (1993) <doi:10.1214/aos/1176349410>. Mixed-level design construction follows the NONBPA approach of Pantoja-Pacheco et al. (2021) <doi:10.3390/math9131455>. Regular fraction identification follows Guo, Simpson and Pignatiello (2007) <doi:10.1080/00224065.2007.11917691>. Alias structure computation follows Rios-Lira et al.(2021) <doi:10.3390/math9233053>.
License: GPL-3
Encoding: UTF-8
RoxygenNote: 7.3.3
Imports: stats, utils
Suggests: knitr, rmarkdown, testthat (≥ 3.0.0)
VignetteBuilder: knitr
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2025-12-08 06:58:46 UTC; Sukanta
Author: Sukanta Dash [aut, cre]
Maintainer: Sukanta Dash <sukanta.iasri@gmail.com>
Repository: CRAN
Date/Publication: 2025-12-12 21:20:14 UTC

Generate Mixed-Level or Regular Fractional Factorial Designs

Description

generate_ff() constructs mixed-level fractional factorial designs or, when all factors share the same number of levels s, automatically searches for a regular s^{k-p} fractional factorial using generator relations.

#' The function performs:

Output printing can be controlled via the parts argument.

Usage

generate_ff(
  levels_spec,
  n_runs,
  max_iter = 100,
  a = 1,
  b = 1,
  max_int_order = 3,
  alias_min_abs_corr = 0.9,
  tf = FALSE,
  parts = c(1, 2, 3),
  verbose = TRUE
)

Arguments

levels_spec

A numeric vector such as c(2,3,4) (levels per factor), or a named list of level labels (e.g. list(A = 1:2, B = 1:3, C = 1:4)).

n_runs

Number of experimental runs required.

max_iter

Maximum number of iterations for coordinate exchange or unique-subset improvement (default: 100).

a

Weight for the J2 near-orthogonality criterion.

b

Weight for the Hhat balance criterion.

max_int_order

Highest-order interaction used when building model matrices for alias calculations. Default is 3.

alias_min_abs_corr

Minimum absolute correlation required for a pair of model terms to appear in the strong confounding summary table.

tf

Logical. When TRUE, computes a trend-free run order (Part 3) based on deterministic pairwise swapping.

parts

Integer vector selecting which sections to print:

  • 1 -> Part 1: Design

  • 2 -> Part 2: Properties & alias

  • 3 -> Part 3: Trend-free order

To print all: parts = c(1,2,3) (default).

verbose

Logical. When TRUE, prints results. When FALSE, performs all computations silently.

Details

Automatic Regular Fractional Factorial Detection

When all factors have the same number of levels s, and when n\_runs = s^{k-p}, the function attempts to find a regular s^{k-p} fraction via a heuristic generator search inspired by Guo et al. (2007). The objective minimized is:

The objective function minimized is Z = a * J2 + b * Hhat.

If no acceptable generator set is found, the algorithm reverts to a mixed-level design strategy.

Mixed-Level Fractional Factorials

Mixed-level designs are constructed using the Pantoja-Pacheco et al. (2021) NONBPA skeleton for nonmultiple levels, followed by a Guo-style coordinate exchange improvement on the Z-criterion.

Alias Structure (Rios-Lira et al., 2021)

Alias relationships are computed from the correlation matrix of the model matrix (main effects + interactions). Chains are built by selecting the pair of terms with the highest absolute correlation, choosing the lower-order term as the chain leader.

Trend-Free Run Order (Coster, 1993)

When tf = TRUE, a deterministic pairwise-swap algorithm produces a run order orthogonal to polynomial time trends (linear by default).

Value

A list containing:

Returned invisibly unless assigned.

References

Guo, Y., Simpson, J. R., & Pignatiello, J. J. (2007). Construction of Efficient Mixed-Level Fractional Factorial Designs. Journal of Quality Technology, 39(3), 241-257. doi:10.1080/00224065.2007.11917691

Pantoja-Pacheco, Y. V. et al. (2021). One Note for Fractionation and Increase for Mixed-Level Designs When the Levels Are Not Multiple. Mathematics, 9(13), 1455. doi:10.3390/math9131455

Rios-Lira, A. J. et al. (2021). Alias Structures and Sequential Experimentation for Mixed-Level Designs. Mathematics, 9(23), 3053. doi:10.3390/math9233053

Coster, D. C. (1993). Trend-Free Run Orders of Mixed-Level Fractional Factorial Designs. Annals of Statistics, 21(4), 2072-2086. doi:10.1214/aos/1176349410

Examples



# Mixed-level design (2 x 3 x 4), 12 runs, all parts printed
generate_ff(c(2,3,4), 12, tf = TRUE)

# Only Part 1 (design)
generate_ff(c(2,3,4), 12, parts = 1, tf = FALSE)

# Parts 1 and 2 only
generate_ff(c(2,3,4), 12, parts = c(1,2), tf = FALSE)

# Only Part 3 (trend-free run order)
generate_ff(c(2,3,4), 12, parts = 3, tf = TRUE)