Technical Reference

Complete CLI, Configuration, Design & Analysis Specification
doe-helper · doehelper on PyPI

Part 1: CLI Reference

The doe command-line interface provides 23 subcommands for generating, running, analyzing, and managing experimental designs. All commands follow the pattern:

Terminal
$ doe <command> [options]

Global Behavior

The --config flag accepts any valid JSON file path. Relative paths are resolved from the current working directory. Most commands that read results use the out_directory field from the config unless overridden with --results-dir.

doe generate

Generate a design matrix and write a runner script that executes all experimental runs.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file defining factors, responses, and design settings.
--output PATHstringrun_experiments.shOutput path for the generated runner script.
--format {sh,py}choiceshScript format. sh produces a Bash script; py produces a Python script.
--seed INTintegernoneRandom seed for run-order randomization. If omitted, run order is not randomized.
--dry-runflagoffPrint the design matrix to stdout without writing any files.
--session [PREFIX]stringoffEach runner invocation writes results into a fresh <out>/<PREFIX>-<TIMESTAMP>/ directory and updates the <out>/latest symlink.
--resolution INTintegernoneFractional factorial only: bump the run count until the design reaches at least Resolution N.
--replicate-center INTintegernoneAppend N center-point runs to each block for a pure-error estimate.
--parallel INTinteger1Emit a thread-pool Python runner that executes N runs concurrently.
--executor {local,slurm}choicelocalslurm emits an sbatch --array script. Tune it with --slurm-partition, --slurm-time, --slurm-cpus-per-task, --slurm-mem, and --slurm-max-concurrent.
Example
$ doe generate --config experiment.json --seed 42 --format py $ doe generate --config experiment.json --dry-run

doe analyze

Analyze completed experiment results. Computes effects, ANOVA, generates plots, and produces an HTML report.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--results-dir DIRstringfrom configOverride the out_directory setting from the config file.
--no-plotsflagoffSkip generating Pareto, main effects, interaction, and diagnostic plots.
--no-reportflagoffSkip generating the HTML analysis report.
--csv DIRstringnoneExport analysis results (effects, ANOVA, summaries) as CSV files into DIR.
--partialflagoffAnalyze only the runs that have completed so far (ignore missing results).
--kneeflagoffDetect saturation/knee points in response curves where diminishing returns begin.
--factor NAME [NAME...]string(s)allRestrict analysis to the specified factor(s) only.
--filter-runs N [N...]integer(s)noneExclude the given run IDs (e.g., known outliers) from the analysis without editing result files.
--no-rsmflagoffSkip the quadratic RSM refit and the model-adequacy, stationary-point, and cross-validation sections. Useful for large designs.
--cv-folds INTintegermin(n, 5)Cross-validation fold count for the response surface model. Pass n for leave-one-out.
Example
$ doe analyze --config experiment.json --csv exports/ $ doe analyze --config experiment.json --partial --knee --factor temperature pressure

doe info

Display summary information about a design: number of factors, levels, design type, run count, and design evaluation metrics.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.

doe optimize

Find optimal factor settings from experiment results. Supports single-response optimization, multi-objective desirability, and steepest ascent/descent pathways.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--results-dir DIRstringfrom configOverride the out_directory setting.
--response NAMEstringallOptimize for a specific response variable. By default, considers all responses.
--partialflagoffUse only completed runs for optimization.
--multiflagoffMulti-objective optimization using desirability functions. Requires bounds on responses.
--steepestflagoffShow steepest ascent (for maximize) or descent (for minimize) pathway from the current best point.

doe report

Generate a standalone HTML analysis report without running the full analysis pipeline.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--results-dir DIRstringfrom configOverride the out_directory setting.
--output PATHstringreport.htmlOutput path for the HTML report file.
--partialflagoffGenerate a report using only completed runs.
--include FILEstring (repeatable)noneInline another HTML file (e.g., a compare, trend, or sensitivity page) as an extra report section. Repeat for multiple files.

doe record

Manually record response values for one or all runs. Prompts interactively for each response value.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--run {N|all}stringrequiredRun number (1-based) to record, or all to iterate through all pending runs.
--seed INTinteger42Random seed used to determine run order (must match the seed used in generate).

doe status

Show experiment progress: how many runs are completed, pending, and failed.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--seed INTinteger42Random seed used to determine run order.

doe power

Perform power analysis to determine whether the design has enough runs to detect a given effect size at the specified significance level.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--sigma FLOATfloatestimatedError standard deviation. If omitted and results exist, estimated from residuals.
--delta FLOATfloatnoneMinimum detectable effect size (the smallest effect you care about).
--alpha FLOATfloat0.05Significance level (Type I error rate).
--results-dir DIRstringfrom configOverride the out_directory setting.
--partialflagoffUse only completed runs when estimating sigma from results.

doe augment

Augment an existing design with additional runs. Use to de-alias effects (fold-over), fit quadratic models (star points), or estimate pure error (center points).

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--type {fold_over,star_points,center_points,d_optimal}choicerequiredAugmentation type. fold_over reverses all signs; star_points adds axial points; center_points adds center-point replicates; d_optimal adds the runs that most improve D-efficiency.
--output PATHstringrun_experiments_augmented.shOutput path for the augmented runner script.
--format {sh,py}choiceshScript format for the augmented runner.
--seed INTintegernoneRandom seed for run-order randomization of augmented runs.
--session [PREFIX]stringoffWrite augmented-run results into a fresh timestamped session directory (same semantics as doe generate --session).

doe init

Initialize a new experiment from a use-case template. Creates a config file and optionally a test script scaffold.

FlagTypeDefaultDescription
--template NAMEstringnoneUse-case template name (e.g., web-server, database, ml-hyperparameter).
--listflagoffList all available templates with descriptions.
--output-dir DIRstring.Directory where the config file and scaffold will be written.
--factors INTintegernoneBootstrap a working config from scratch (no template) with this many factors. Requires --budget.
--responses INTinteger1Number of response variables when bootstrapping.
--budget INTintegernoneRun budget when bootstrapping; the design type is chosen to fit it. Required with --factors.
--goal {screening,response_surface,optimization}choicescreeningExperimental goal used to pick the design when bootstrapping.
--categorical INTinteger0Number of categorical factors when bootstrapping.
--with-testflagoffAlso scaffold a test.py beside the new config.
Example
$ doe init --list $ doe init --template web-server --output-dir my-experiment/ $ doe init --factors 4 --budget 20 --goal screening --with-test

doe export-worksheet

Export a blank worksheet showing the design matrix with columns for manually recording responses.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--format {csv,markdown}choicecsvOutput format: CSV or Markdown table.
--output FILEstringstdoutOutput file path. Defaults to printing to stdout.
--seed INTinteger42Random seed for run order.

doe export-data

Export the design matrix and collected response values as a flat data file for use in external analysis tools.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--format {csv,tsv}choicecsvOutput format: comma-separated or tab-separated.
--output FILEstringstdoutOutput file path. Defaults to printing to stdout.
--seed INTinteger42Random seed for run order.
--partialflagoffInclude only completed runs (skip missing results).

doe next-batch

Generate the next batch of runs for sequential experimentation. Analyzes current results and selects new points based on the chosen strategy.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--results-dir DIRstringfrom configOverride the out_directory setting.
--strategy {refine,explore,balanced,model_guided,bayesian,multi_objective}choicefrom configrefine: focus near the best region. explore: maximize space coverage. balanced: mix of both. model_guided: place runs where the fitted surface is most uncertain. bayesian: Gaussian-process expected improvement. multi_objective: desirability-weighted acquisition across responses.
--batch-size INTintegerautoNumber of new runs to generate. Auto-selects based on factor count if omitted.
--output PATHstringrun_next_batch.shOutput path for the batch runner script.
--format {sh,py}choiceshScript format for the batch runner.
--seed INTintegernoneRandom seed for run-order randomization.
--partialflagoffConsider only completed runs when planning the next batch.
--session [PREFIX]stringoffWrite batch results into a fresh timestamped session directory.
--state-name NAMEstringnoneBranch the adaptive trajectory by writing phase state under a named key, so alternative follow-up paths can be explored from the same starting data.

doe suggest

Recommend a design operation, run count, and adaptive strategy for your situation — before writing any config. Answers “which design should I use?” from the factor count, response count, run budget, and goal.

FlagTypeDefaultDescription
--factors INTintegerrequiredNumber of factors you plan to vary.
--responses INTinteger1Number of response variables you will measure.
--budget INTintegerrequiredMaximum number of runs you can afford.
--goal {screening,response_surface,optimization}choicescreeningWhat you want out of the experiment.
--categorical INTinteger0How many of the factors are categorical.
Example
$ doe suggest --factors 5 --budget 24 --goal screening

doe scaffold-config

Write an annotated starter config.json with sample factors, responses, and option hints to edit into your own experiment.

FlagTypeDefaultDescription
--output FILEstringconfig.jsonWhere to write the starter config.
--forceflagoffOverwrite the output file if it already exists.

doe scaffold-test

Write a starter test.py or test.sh that already parses the factors from your config using the configured arg_style and emits a valid result JSON — you only fill in the measurement.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--language {py,sh}choicepyScaffold language.
--output FILEstringautoOutput path. Defaults to test.py / test.sh.
--forceflagoffOverwrite the output file if it already exists.

doe simulate

Evaluate the design directly against a Python function — no runner script, no subprocesses. Each run's factor values are passed as keyword arguments and the function's return dict becomes the result JSON.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--func TARGETstringrequiredPython target as module:function or path/to/file.py:function.
--results-dir DIRstringfrom configOverride the out_directory setting.
--session [PREFIX]stringoffWrite results into a fresh timestamped session directory.
--overwriteflagoffRe-evaluate runs whose result file already exists.
--seed INTinteger42Random seed for run order.
Example
$ doe simulate --config experiment.json --func my_model.py:evaluate

doe compare

Pairwise comparison of two sessions: per-run deltas with a paired t-test and Cohen's d, per-factor effect deltas with sign-flip flags, and an intercept-shift vs slope-shift decomposition.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--baseline DIRstringrequiredResults directory of the baseline session.
--candidate DIRstringrequiredResults directory of the candidate session to compare against the baseline.
--csv DIRstringnoneAlso export the comparison tables as CSV files into DIR.
--html FILEstringnoneAlso write a self-contained HTML comparison page.
Example
$ doe compare --config experiment.json --baseline results/before-tune --candidate results/after-tune --html compare.html

doe trend

Multi-session regression across three or more sessions: per-session response means plus intercept and slope drift per session step. Use it to watch a system change over repeated experiments.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--sessions DIR [DIR...]string(s)requiredTwo or more session result directories, in chronological order.
--csv DIRstringnoneAlso export the trend tables as CSV files into DIR.
--html FILEstringnoneAlso write a self-contained HTML trend page.

doe sensitivity

Global sensitivity analysis on the fitted response surface: Sobol first-order and total-order indices per factor, with optional stacked-bar HTML visualizations.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--results-dir DIRstringfrom configOverride the out_directory setting.
--response NAMEstringallAnalyze a specific response variable only.
--n-samples INTinteger512Number of Sobol samples per index estimate.
--csv FILEstringnoneOptional CSV output path for the index table.
--html FILEstringnoneOptional self-contained HTML report with stacked-bar plots.
--seed INTinteger42Random seed for Sobol sampling.
--partialflagoffAnalyze only completed runs, skipping missing results.

doe calibrate

Fit the free parameters of a parametric Python simulator so that its output matches observed experimental data. The calibrated simulator can then stand in for expensive real runs.

FlagTypeDefaultDescription
--config FILEstringrequiredInput JSON configuration file.
--func TARGETstringrequiredParametric simulator as module:function or path.py:function.
--params SPEC [SPEC...]string(s)requiredParameter specs as name:low:high or name:initial:low:high.
--observed DIRstringrequiredResults directory containing the observed run data to fit against.
--report FILEstringnoneOptional path to write the JSON calibration report.
--seed INTinteger42Random seed.
Example
$ doe calibrate --config experiment.json --func sim.py:reactor --params k1:0.1:2.0 ea:40:120 --observed results/latest

doe archive

Bundle a session into a single .tar.gz with a SHA-256 manifest for sharing or long-term storage. Optionally embeds the config and extra files alongside the results.

FlagTypeDefaultDescription
--session DIRstringrequiredSession results directory to archive.
--output FILEstringrequiredOutput archive path (e.g., experiment.tar.gz).
--config FILEstringnoneOptional config file to embed alongside the session.
--extra FILEstring (repeatable)noneAdditional files to include. Repeat for multiple files.

doe serve

Start a localhost HTTP server (Python stdlib only) that lists sessions under a results root and links to their HTML reports for quick browsing.

FlagTypeDefaultDescription
--root DIRstringresultsRoot directory containing session subdirectories.
--host HOSTstring127.0.0.1Interface to bind.
--port INTinteger8000Port to listen on.

Part 2: Configuration Schema

The configuration file (config.json) is a single JSON object that defines the entire experiment. Every doe command reads this file.

Top-level Fields

FieldTypeRequiredDescription
metadataobjectNoContains name (string) and description (string) for labeling the experiment.
factorsarray of FactorYesArray of factor definitions. Must contain at least 1 factor (2+ for most design types).
fixed_factorsobjectNoKey-value pairs passed to every run but not varied. Useful for constants.
responsesarray of ResponseVarNoResponse variables to collect and analyze. If omitted, all keys in result JSON are treated as responses.
runnerRunnerConfigNoControls how factor values are passed to the test script.
settingsobjectNoDesign type, blocking, output directories, and other operational settings.
constraintsarray of stringsNoBoolean expressions over factor names (e.g., "temperature * pressure <= 400"). Candidate runs violating any constraint are excluded. Expressions are parsed against a safe AST allow-list — no arbitrary code execution.
adaptiveobjectNoSequential experimentation settings for doe next-batch: strategy (one of refine, explore, balanced, model_guided, bayesian, multi_objective; default refine), batch_size (default 4), response_name, and stopping rules stopping_effect_threshold, stopping_power_threshold, stopping_max_phases (default 10).
Minimal config.json
{ "metadata": { "name": "My Experiment", "description": "Testing two factors" }, "factors": [ { "name": "temperature", "levels": ["60", "80"], "type": "continuous" }, { "name": "pressure", "levels": ["1.0", "2.0"], "type": "continuous" } ], "responses": [ { "name": "yield", "optimize": "maximize" } ], "settings": { "operation": "full_factorial", "test_script": "./run_test.sh", "out_directory": "results" } }

Factor Object

FieldTypeDefaultDescription
namestringrequiredUnique identifier for the factor. Used as the argument name in runner scripts and as column headers in output.
levelsarray of stringsrequiredAt least 2 values. For continuous factors, these define the low and high (and optionally center) points. Values are always strings in the config.
typestring"categorical""categorical" — unordered discrete values.
"continuous" — numeric range (enables RSM, CCD, etc.).
"ordinal" — ordered discrete values (enables trend analysis).
unitstringnoneDisplay unit (e.g., "C", "MB", "ms"). Shown in reports and plots.
descriptionstringnoneHuman-readable description of the factor.
dtypestring"" (auto)Force a data type for level values: "int", "float", or "" for automatic detection. "int" values are rounded and clamped by all optimizers.
rolestring"subplot"Split-plot designs only: "whole_plot" marks a hard-to-change factor that stays fixed within each whole plot; "subplot" factors vary within plots. Ignored by other design types.

Level Values Are Strings

All level values in the JSON config must be strings, even for numeric factors. The tool parses them based on the type and dtype fields. Example: "levels": ["100", "200"], not "levels": [100, 200].

ResponseVar Object

FieldTypeDefaultDescription
namestringrequiredMust match a key in the result JSON output by the test script.
optimizestring"maximize""maximize" or "minimize". Determines optimization direction and steepest ascent/descent.
unitstringnoneDisplay unit shown in reports and plots.
descriptionstringnoneHuman-readable description.
weightfloat1.0Relative importance weight for multi-objective optimization. Higher weight gives this response more influence on the overall desirability.
bounds[float, float]noneTwo-element array: [worst, best]. Required for desirability-based multi-objective optimization (--multi). For maximize: worst < best. For minimize: worst > best.

RunnerConfig

FieldTypeDefaultDescription
arg_stylestring"double-dash" How factor values are passed to the test script:
"double-dash"./test.sh --temperature 80 --pressure 2.0
"env"TEMPERATURE=80 PRESSURE=2.0 ./test.sh
"positional"./test.sh 80 2.0 (in factor definition order)
result_filestring"json"Expected output format from the test script. Currently "json" is the supported format.

Settings

FieldTypeDefaultDescription
operationstring"full_factorial"Design type. One of the 14 supported design types (see Part 3).
test_scriptstringnonePath to the test executable. Invoked for each experimental run.
block_countinteger1Number of blocks (replicates) for the design. Values > 1 replicate the entire design matrix.
out_directorystring"results"Directory where result JSON files are stored, one per run.
processed_directorystringnoneDirectory to move result files after processing. If omitted, results stay in out_directory.
lhs_samplesinteger0Number of sample points for Latin Hypercube designs. 0 = auto: max(10, 2 * n_factors).
sweep_pointsinteger0Number of points for linear/log sweep designs. 0 = auto.
min_resolutioninteger0Fractional factorial only: minimum design resolution. The run count is bumped until the resolution is reached. Equivalent to the --resolution flag.
replicate_centerinteger0Append this many center-point runs to each block for a pure-error estimate. Equivalent to the --replicate-center flag.
whole_plot_replicatesinteger1Split-plot designs only: number of times each whole-plot setting group is replicated.

Part 3: Design Types

The operation field in settings selects the experimental design. Each design type has different requirements, run counts, and estimation capabilities.

full_factorial

Full Factorial Design

PropertyValue
Operation string"full_factorial"
PurposeEvaluate all possible combinations of factor levels. The most thorough design — no aliasing, complete information.
Requirements1+ factors, 2+ levels each. No restrictions on factor types.
Run countL1 × L2 × ... × Lk (product of all level counts)
AlgorithmCartesian product of all factor levels. Optionally randomized and/or blocked.
EstimatesAll main effects, all 2-factor interactions, all higher-order interactions up to k-way.

Run count grows exponentially: a 25 design has 32 runs, but a 35 design has 243. Consider fractional or screening designs when k > 4 with 3+ levels.

fractional_factorial

Fractional Factorial Design

PropertyValue
Operation string"fractional_factorial"
PurposeEstimate main effects and some interactions with a fraction of the full factorial runs. Trades resolution for efficiency.
Requirements2+ factors. Exactly 2 levels per factor.
Run count2k−p, where p is chosen automatically to achieve Resolution III or higher.
AlgorithmUses generators to define the fraction. The defining relation determines which effects are aliased (confounded).
EstimatesMain effects (aliased with higher-order interactions at Resolution III). At Resolution IV+, main effects are clear of 2-factor interactions.

plackett_burman

Plackett-Burman Design

PropertyValue
Operation string"plackett_burman"
PurposeScreening: identify which factors have significant main effects with minimal runs. Resolution III.
Requirements2+ factors. Exactly 2 levels per factor.
Run countN = smallest multiple of 4 that is ≥ k + 1 (e.g., 12 runs for up to 11 factors).
AlgorithmConstructs a Hadamard-like matrix. Extra columns beyond k factors become dummy factors for error estimation.
EstimatesMain effects only. All 2-factor interactions are partially aliased with main effects.

latin_hypercube

Latin Hypercube Sampling

PropertyValue
Operation string"latin_hypercube"
PurposeSpace-filling design for exploring a continuous factor space. Good for computer experiments and metamodeling.
Requirements1+ continuous factors with exactly 2 levels (defining the range endpoints).
Run countConfigurable via lhs_samples. Default: max(10, 2k).
AlgorithmDivides each factor range into n equal strata and places exactly one sample in each stratum per factor. Optimized for maximin distance criterion.
EstimatesNo formal aliasing structure. Provides a response surface approximation via regression or interpolation. Not orthogonal.

central_composite

Central Composite Design (CCD)

PropertyValue
Operation string"central_composite"
PurposeResponse Surface Methodology (RSM). Fits a full second-order (quadratic) model to find optima.
Requirements2+ continuous factors with exactly 2 levels.
Run count2k + 2k + nc (factorial points + star points + center points). For k=3: 8 + 6 + 6 = 20.
AlgorithmCombines a factorial core (2k), axial/star points at distance α along each axis, and center-point replicates. The α value is set to make the design rotatable (α = 2k/4).
EstimatesAll main effects, all 2-factor interactions, all quadratic (squared) terms. Full second-order model.

box_behnken

Box-Behnken Design

PropertyValue
Operation string"box_behnken"
PurposeRSM design that avoids extreme corner points. Useful when corners are infeasible or dangerous.
Requirements3+ continuous factors with exactly 2 levels.
Run countDepends on k. For k=3: 12 + center points. For k=4: 24 + center points. Generally fewer runs than CCD.
AlgorithmCombines 22 factorials for each pair of factors while holding remaining factors at the center level. Adds center-point replicates.
EstimatesAll main effects, all 2-factor interactions, all quadratic terms. Full second-order model.

definitive_screening

Definitive Screening Design (DSD)

PropertyValue
Operation string"definitive_screening"
PurposeModern screening design that can detect curvature and some 2-factor interactions, unlike traditional screening designs.
Requirements3+ factors with exactly 2 levels (continuous). Internally uses 3 levels: low, center, high.
Run count2k + 1 runs for k factors (e.g., 13 runs for 6 factors).
AlgorithmConference matrix construction. Each pair of columns has the property that when one factor is at its center, the other varies across all three levels.
EstimatesMain effects (unaliased with 2-factor interactions). Quadratic effects (detects curvature). Some 2-factor interactions (with k ≥ 6).

taguchi

Taguchi Orthogonal Array

PropertyValue
Operation string"taguchi"
PurposeRobust design methodology. Optimizes signal-to-noise (S/N) ratios to find settings that are robust to noise factors.
Requirements2+ factors, 2+ levels each. Automatically selects the appropriate orthogonal array (L4, L8, L9, L12, L16, L18, L27, etc.).
Run countDetermined by the selected orthogonal array. Depends on factor count and level count.
AlgorithmSelects the smallest standard orthogonal array that can accommodate all factors. Assigns factors to array columns.
EstimatesMain effects. S/N ratios (larger-is-better, smaller-is-better, nominal-is-best). Limited interaction estimation depending on the array.

d_optimal

D-Optimal Design

PropertyValue
Operation string"d_optimal"
PurposeAlgorithmically constructed design that maximizes the determinant of the information matrix. Useful for irregular design spaces and custom run budgets.
Requirements2+ factors, 2+ levels each. Works with any combination of factor types.
Run countUser-specified or auto-calculated. Must be at least p (number of model parameters).
AlgorithmFedorov coordinate-exchange algorithm. Starts from a candidate set of all possible combinations, iteratively swaps points to maximize |X'X|.
EstimatesMain effects and interactions (depending on the model specified). Optimized for the assumed model.

mixture_simplex_lattice

Mixture Simplex-Lattice Design

PropertyValue
Operation string"mixture_simplex_lattice"
PurposeFormulation experiments where components must sum to a constant (e.g., 1 or 100%). Explores the simplex design space on a regular lattice grid.
Requirements2+ factors (mixture components). Levels define proportion increments.
Run countC(q + m - 1, m) where q = number of components, m = lattice degree.
AlgorithmGenerates all lattice points on the simplex where each component takes values 0, 1/m, 2/m, ..., 1 and all components sum to 1.
EstimatesLinear and interaction blending effects in Scheffé polynomial models.

mixture_simplex_centroid

Mixture Simplex-Centroid Design

PropertyValue
Operation string"mixture_simplex_centroid"
PurposeFormulation experiments. Uses centroid points of the simplex for a more focused exploration than the lattice design.
Requirements2+ factors (mixture components).
Run count2q - 1 points (vertices, edge midpoints, face centroids, overall centroid).
AlgorithmGenerates all subsets of components: pure components (vertices), binary blends (edge midpoints), ternary blends (face centroids), up to the overall centroid where all components are equal.
EstimatesFull Scheffé polynomial up to the q-th degree blending terms.

linear_sweep

Linear Parameter Sweep

PropertyValue
Operation string"linear_sweep"
PurposeCharacterize a single factor's effect across its range with evenly spaced points.
RequirementsExactly 1 continuous factor with 2 levels (defining min and max).
Run countConfigurable via sweep_points. Default: auto.
AlgorithmGenerates linearly spaced points from the low level to the high level.
EstimatesResponse curve shape. Enables knee-point detection and saturation analysis.

log_sweep

Logarithmic Parameter Sweep

PropertyValue
Operation string"log_sweep"
PurposeCharacterize a single factor across a wide dynamic range with logarithmically spaced points.
RequirementsExactly 1 continuous factor with 2 levels (both positive). Defines min and max on a log scale.
Run countConfigurable via sweep_points. Default: auto.
AlgorithmGenerates points spaced evenly on a log10 scale between the low and high levels.
EstimatesResponse curve shape on a logarithmic axis. Useful for parameters spanning orders of magnitude.

split_plot

Split-Plot Design

PropertyValue
Operation string"split_plot"
PurposeExperiments where some factors are hard or expensive to change (oven temperature, machine setup) and others are easy. Hard-to-change factors are held fixed within each whole plot while easy factors vary inside it.
RequirementsAt least one factor with "role": "whole_plot" and at least one subplot factor.
Run count(whole-plot level combinations × whole_plot_replicates) × subplot combinations.
AlgorithmCrosses the whole-plot factor levels, replicates each whole plot per whole_plot_replicates, then crosses the subplot factors within each plot. Runs carry a whole_plot_id so analysis can separate the two error strata.
EstimatesWhole-plot and subplot effects tested against their own error terms — ANOVA automatically uses the split-plot error structure instead of a single pooled residual.

Choosing a Design

Start with full_factorial if you have ≤ 4 factors with 2 levels. Use plackett_burman or definitive_screening to screen many factors. Move to central_composite or box_behnken for optimization. Use latin_hypercube for space-filling exploration of continuous spaces.


Part 4: Analysis Output

The doe analyze command produces statistical tables, effect estimates, and diagnostic metrics. This section documents every output structure.

ANOVA Table

The Analysis of Variance table decomposes total variability into components attributable to each factor and error.

ColumnDescription
SourceFactor name, interaction term (e.g., A:B), or Error / Residual.
DFDegrees of freedom. For a factor with L levels: DF = L - 1. For interactions: product of individual DFs. Error DF = N - (total model DF) - 1.
SSSum of squares. The portion of total variability explained by this source.
MSMean square = SS / DF.
FF-statistic = MSsource / MSerror. Measures the ratio of explained to unexplained variance.
p-valueProbability of observing the F-statistic under the null hypothesis. Values < 0.05 are typically considered significant.

Error Estimation Methods

When there are no replicates, error must be estimated by alternative methods:

MethodWhen UsedDescription
Replicate errorblock_count > 1 or center points presentPure error from replicated runs. The gold standard.
Pooled higher-orderFull/fractional factorials without replicatesPools the smallest effects (assumed negligible) into an error term. Uses the sum of squares from the smallest 1/3 of interaction terms.
Lenth's PSEUnreplicated 2-level designsPseudo Standard Error based on the median of absolute effect estimates. Robust to active effects.

Effect Estimates

For each factor and response, the analysis reports:

OutputDescription
Main effect magnitudeFor 2-level factors: mean(high) - mean(low). For multi-level: max(level means) - min(level means). See formulas.
Standard error (SE)Estimated standard error of the effect. Computed from MSerror and the design matrix.
Confidence intervalEffect ± tα/2, df × SE. Default α = 0.05 (95% CI).
Contribution %100 × SSfactor / SStotal. Percentage of total variability attributable to this factor.
Significancep-value from the F-test. Marked as significant if p < 0.05.

Interaction Effects

Two-factor interaction effects measure how the effect of one factor depends on the level of another. Reported for designs with sufficient degrees of freedom (full factorial, CCD, Box-Behnken, etc.).

  • Interaction magnitude: half the difference between the effect of factor A at high B vs. low B.
  • Interaction plot: non-parallel lines indicate a significant interaction.
  • Aliasing: in fractional/PB designs, interactions may be aliased with main effects. The alias structure is reported.

Summary Statistics

For each factor/level combination, the analysis computes:

  • Mean response at each level
  • Standard deviation at each level (when replicates exist)
  • Min and max response at each level
  • Sample count per level
  • Best level (highest mean for maximize, lowest for minimize)

For factors with "type": "ordinal", additional trend analysis is performed:

  • Monotonic trend test: determines if the response increases or decreases consistently with the ordinal levels.
  • Trend direction: increasing, decreasing, or non-monotonic.
  • Trend strength: Spearman rank correlation between level order and response mean.

Knee Point Detection

When --knee is specified (or for sweep designs), the analysis identifies the point of diminishing returns:

  • Knee point location: the factor value where the response curve transitions from steep to flat.
  • Algorithm: maximum curvature method. Finds the point where the second derivative magnitude is largest.
  • Saturation percentage: what fraction of the total response range is achieved at the knee point.

Model Diagnostics

When a regression model is fitted (RSM designs, LHS), the following diagnostics are reported:

MetricDescriptionIdeal
Coefficient of determination. Proportion of variance explained by the model.> 0.80
Adjusted R²R² penalized for number of terms. Decreases if insignificant terms are added.> 0.75
PRESSPredicted Residual Error Sum of Squares. Leave-one-out cross-validation metric.Small relative to SStotal
Predicted R²1 - PRESS / SStotal. Measures predictive ability on held-out points.> 0.70, within 0.2 of Adj R²
Leverage (hii)Diagonal of the hat matrix H = X(X'X)-1X'. Identifies influential runs.< 2p/n (where p = parameters, n = runs)

Part 5: Output Formats

Result JSON

Each test script invocation must output a JSON file containing the measured response values. This is the contract between the test script and the analysis engine.

Result JSON (single run)
{ "yield": 85.3, "purity": 99.1, "cost": 12.50 }
  • Keys must match the name fields in the responses array.
  • Values must be numeric (int or float).
  • The file is written to out_directory/run_NNN.json where NNN is the zero-padded run number.
  • If the test script fails, no result file should be written (the run is marked as failed).

Design Matrix JSON

The design_matrix.json file is generated alongside the runner script. It contains the complete design in a machine-readable format.

design_matrix.json structure
{ "metadata": { "name": "...", "design_type": "full_factorial", "n_runs": 8 }, "factors": ["temperature", "pressure", "catalyst"], "runs": [ { "run": 1, "temperature": "80", "pressure": "2.0", "catalyst": "A" }, { "run": 2, "temperature": "60", "pressure": "2.0", "catalyst": "B" }, ... ] }

CSV & TSV Export

The doe export-data command produces a flat file with one row per run.

CSV format
run,temperature,pressure,catalyst,yield,purity,cost 1,80,2.0,A,85.3,99.1,12.50 2,60,2.0,B,72.1,98.5,10.20 ...
  • First column is always run (1-based run number in execution order).
  • Factor columns appear in definition order.
  • Response columns appear after factor columns, in definition order.
  • TSV format uses tab separators instead of commas.
  • With --partial, missing response values are left empty.

Worksheet Formats

The doe export-worksheet command produces a blank template for manual data recording.

CSV Worksheet

CSV worksheet
run,temperature,pressure,catalyst,yield,purity,cost 1,80,2.0,A,,, 2,60,2.0,B,,, ...

Markdown Worksheet

Markdown worksheet
| run | temperature | pressure | catalyst | yield | purity | cost | |-----|-------------|----------|----------|-------|--------|------| | 1 | 80 | 2.0 | A | | | | | 2 | 60 | 2.0 | B | | | | ...

HTML Report

The analysis HTML report (doe report or doe analyze) is a self-contained file that includes:

  • Experiment summary: metadata, design type, factor/response definitions, run count.
  • Design matrix: full table of all runs and their factor settings.
  • ANOVA tables: one per response variable.
  • Effect estimates: main effects and interactions with confidence intervals.
  • Plots (embedded as base64 PNG): Pareto chart, main effects plots, interaction plots, normal/half-normal probability plots, residual diagnostics.
  • Optimization results: optimal factor settings for each response.
  • Design evaluation: D-efficiency, A-efficiency, G-efficiency metrics.

Part 6: Statistical Formulas

This section documents the key formulas used by the analysis engine. All computations follow standard DOE textbook conventions (Montgomery, Box-Hunter-Hunter).

Effect Calculation

Two-level factors

Effect = mean(Yhigh) - mean(Ylow)

The main effect is the difference in average response between the high (+1) and low (-1) levels, averaged over all other factors.

Multi-level factors

Effect = max(Ȳ1, Ȳ2, ..., ȲL) - min(Ȳ1, Ȳ2, ..., ȲL)

For factors with more than 2 levels, the effect is the range of the level means — the maximum average response minus the minimum average response.

Interaction effect (two-level)

AB interaction = ½ [ (mean(YA+,B+) + mean(YA-,B-)) - (mean(YA+,B-) + mean(YA-,B+)) ]

ANOVA Decomposition

SStotal = ∑i (Yi - Ȳ)2
SSfactor = ∑j=1L nj (Ȳj - Ȳ)2
MSfactor = SSfactor / DFfactor
F = MSfactor / MSerror

Where Ȳj is the mean response at level j, nj is the count at level j, and Ȳ is the grand mean. The p-value is computed from the F-distribution with (DFfactor, DFerror) degrees of freedom.

Lenth's Pseudo Standard Error

s0 = 1.5 × median(|c1|, |c2|, ..., |cm|)
PSE = 1.5 × median(|ci| : |ci| < 2.5 × s0)

Where ci are the contrast (effect) estimates. Lenth's method is used for unreplicated 2-level factorial designs where there is no independent estimate of error. The first step computes a preliminary estimate s0, then the PSE refines it by excluding effects larger than 2.5 × s0 (likely active effects).

Confidence Intervals

CI = effect ± tα/2, dferror × SE
SE = √(MSerror × (1/n+ + 1/n-))

For balanced 2-level designs: SE = √(4 × MSerror / N), where N is the total number of runs. The t-quantile uses the degrees of freedom from the error term.

D-efficiency

D-efficiency = 100 × (|X'X| / n)1/p / n

Where X is the model matrix (n × p), n is the number of runs, and p is the number of model parameters. A D-efficiency of 100% means the design is D-optimal for the assumed model. See Part 7 for interpretation.

Desirability Functions

Individual desirability (maximize)

di = ((yi - worst) / (best - worst))s

Where worst and best come from the bounds field on the response. The exponent s controls the shape: s = 1 (linear), s > 1 (emphasis on reaching best), s < 1 (diminishing returns near best). Default s = 1. Values below worst get d = 0; values above best get d = 1.

Individual desirability (minimize)

di = ((worst - yi) / (worst - best))s

For minimize, worst > best. Values above worst get d = 0; values below best get d = 1.

Overall desirability

D = (∏ diwi)1 / ∑ wi

The weighted geometric mean of individual desirabilities. If any single di = 0, the overall D = 0 regardless of other responses. Weights wi come from the weight field on each response.


Part 7: Design Evaluation Metrics

These metrics quantify how well a design supports parameter estimation. They are reported by doe info and included in analysis reports.

D-efficiency

D-efficiency = 100 × (|X'X|1/p) / n

Interpretation: D-efficiency measures the overall precision of parameter estimates. It is proportional to the p-th root of the determinant of the information matrix X'X, normalized by the number of runs. Higher values mean smaller confidence ellipsoids for the estimated coefficients.

RangeInterpretation
90–100%Excellent. Near-optimal for parameter estimation.
70–89%Good. Suitable for most applications.
50–69%Moderate. Consider augmenting the design.
< 50%Poor. The design may not reliably estimate all parameters.

Orthogonal designs (full factorial, Plackett-Burman) achieve 100% D-efficiency for the main-effects model. D-optimal designs maximize this metric by construction.

A-efficiency

A-efficiency = 100 × p / trace((X'X)-1)

Interpretation: A-efficiency measures the average variance of parameter estimates. It is inversely proportional to the trace (sum of diagonal elements) of (X'X)-1. Minimizing the trace minimizes the average variance across all coefficients.

  • A-efficiency focuses on average precision, while D-efficiency focuses on overall precision.
  • A design can have high D-efficiency but lower A-efficiency if some parameters are estimated much more precisely than others.
  • For orthogonal designs, A-efficiency = D-efficiency = 100%.

G-efficiency

G-efficiency = 100 × p / (n × max(hii))

Where hii are the diagonal elements of the hat matrix H = X(X'X)-1X'.

Interpretation: G-efficiency measures the worst-case prediction variance across the design space. It is related to the maximum leverage point. A design with high G-efficiency has relatively uniform prediction variance — no single point dominates the model.

  • G-efficiency = 100% means all design points have equal leverage (balanced design).
  • Lower G-efficiency indicates that some regions of the factor space are predicted with much less precision than others.
  • Particularly important for response surface designs where prediction across the entire space matters.

No Single Metric Is Sufficient

Always examine D-, A-, and G-efficiency together. A design optimized for one criterion may perform poorly on another. For most practical purposes, D-efficiency above 70% with G-efficiency above 50% indicates an adequate design.


← User Guide Theory →