sa_create_design
Generate a sensitivity-analysis design of experiments and write LSD configuration, design tables, and JSON files from factor ranges and the selected method.
Instructions
Create a design of experiments for a sensitivity analysis and write it in
LSD's own file layout in the model folder: .sa, the design table
_1_N.csv (and for meta-model designs the out-of-sample table
_N+1_N+V.csv), numbered configurations _1.lsd ..., and
_design.json (our file: method and parameters).
factors maps an element to [min, max], or [min, max, "int"] for integers.
An element is a parameter name, or a variable name for the variable's
initial value at its first lag, or "Name -2", "Name -3" ... (name, space,
negative lag) for the initial value at that lag. Functions, variables with
no lags and lags beyond the variable's lags are refused, and an element can
be a factor only once (LSD's design table names a factor by its label, so
the result files and the analysis tables show the plain name, for example
"X"; the design file _design.json records each factor's lag, 0 for
a parameter). method:
'lhs' (Latin hypercube) or 'random': samples points (required, at least 2)
plus validation_samples uniform out-of-sample points, for a Kriging or
polynomial meta-model.
'nolh': near-orthogonal Latin hypercube made by LSD's own NOLH tables. LSD
chooses the table from the number of factors (17 points for 1-7 factors,
33 for 8-11, 65 for 12-16, 129 for 17-22, 257 for 23-29, 512 for 30-100;
extended=True uses LSD's extended size for the table: 33, 65, 129, 257,
257, 512), so samples is not used; the result says how
many points LSD produced. Plus validation_samples out-of-sample points by
LSD's Monte Carlo range sampling. For meta-model analysis.
'ee': elementary effects (Morris) design made by LSD's own code:
trajectories (default 10) each of factors + 1 points, chosen from a pool of
pool random trajectories (default 100) on levels levels (even, default
4) with jump (default 2). No out-of-sample set; validation_samples and
samples are ignored. An ee design made on macOS differs from one made on
Linux for the same seed (the C++ library's shuffle differs); both are valid
designs. Analyse it with sa_analyze (metamodel 'ee').
Each point runs runs_per_point times (at least 2) with its own seeds.
seed seeds the sampling. Refuses to replace an existing design unless
overwrite=True. A warning is returned for integer factors with few levels
(a hypercube collapses onto them). Variables whose results will be analysed
must be saved (set_saved).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| jump | No | ||
| pool | No | ||
| seed | No | ||
| model | Yes | ||
| config | Yes | ||
| levels | No | ||
| method | No | lhs | |
| factors | Yes | ||
| samples | No | ||
| extended | No | ||
| overwrite | No | ||
| trajectories | No | ||
| runs_per_point | No | ||
| validation_samples | No |