Taguchi: State-of-the-Art Orthogonal Array Library in Rust
Taguchi is a robust, world-class Rust library for constructing and analyzing orthogonal arrays (OAs). Orthogonal arrays are fundamental to Design of Experiments (DOE), Monte Carlo simulation, combinatorial software testing (OATS), and quasi-random sampling.
Key Features
- Robust Construction Algorithms: Includes Bose, Bush, Bose-Bush, Addelman-Kempthorne, Hadamard (Sylvester & Paley), and Rao-Hamming.
- Mixed-Level Support: SOTA support for arrays with different levels per factor via level collapsing.
- Custom Galois Field Arithmetic: Full control over $GF(q)$ arithmetic for both prime and extension fields with zero dependencies.
- Statistical Analysis: Built-in utilities for balance checking, correlation analysis, and Generalized Word Length Pattern (GWLP).
- Parallel Construction: High-performance row generation using
rayonfor large-scale experimental designs. - DOE Analysis: Complete Taguchi analysis with main effects, S/N ratios, ANOVA, and optimal settings prediction.
- Modern API: Fluent builder pattern with automatic optimal construction selection.
Quick Start
use OABuilder;
Mixed-Level Design
use OABuilder;
// Construct mixed-level OA(16, 2^3 4^1, 2)
let oa = new
.mixed_levels
.strength
.build
.unwrap;
assert_eq!;
Standard Taguchi Arrays (Catalogue)
If you are familiar with standard Taguchi array names (e.g., L8, L9, L18), you can use the catalogue:
use get_by_name;
let l9 = get_by_name.unwrap;
assert_eq!;
assert_eq!;
DOE Analysis
Analyze experimental results with the doe feature:
[]
= { = "0.2", = ["doe"] }
use OABuilder;
use ;
Performance
Taguchi uses precomputed arithmetic tables for small fields and optimized ndarray storage.
Recent optimizations include batch polynomial evaluation and direct table access, yielding ~10x speedups for common constructions.
For massive arrays, enable the parallel feature:
[]
= { = "0.2", = ["parallel"] }
Mathematical Background
An orthogonal array $OA(N, k, s, t)$ is an $N \times k$ matrix with entries from a set of $s$ symbols such that in any $N \times t$ subarray, every possible $t$-tuple appears exactly $\lambda = N/s^t$ times.
Taguchi supports:
- Strength 2: Main effects are clear of each other.
- Higher Strength: Interaction analysis support via Bush construction.
- Linear Codes: SOTA Rao-Hamming construction for maximum factor density.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.