Skip to main content

Module sensitivity

Module sensitivity 

Source
Expand description

Sensitivity analysis: which of a model’s uncertain inputs move its output most.

Guide: Sensitivity analysis runs both methods on test functions whose answers are known, then on a rocket’s apogee, and says how far to trust them.

Two methods, both over factors: inputs each spread evenly between a low and a high value (Factor), independent of each other.

  • morris: Morris’s screening. A few cheap runs, stepping one factor at a time along random paths through a grid, rank the factors by how much a step in each moves the output. It finds the factors that don’t matter, at about ten runs per factor.
  • sobol: Sobol’ indices. Many runs split the output’s variance among the factors: the share each causes alone (its first-order index) and the share it has any part in, with the others (its total index). It costs thousands of runs per factor.
  • benchmark: two test functions whose indices are known in closed form, Ishigami and Homma’s and Sobol’s g, which the tests hold both methods to.

Each method lays out its points first (a design), takes the model’s output at each, in the design’s order, and then analyses them. The model can be anything: a flight, flown with the factors set into its inputs, or a function. So the runs can be made however the caller likes, on many threads or on many machines; each method also has a shortcut that takes a closure.

§Reproducibility

A design is drawn from a seed. Each Morris path and each Sobol’ sample row has its own random stream (SeededRng::for_stream), keyed by the seed and its index, so path or row k is the same however many are drawn. Every sum runs in the design’s order, so on one platform an analysis is bit for bit the same every time.

§Left out

Factors are uniform and independent: no other distributions, no correlations. A normal input can be given as a range about its mean (say ±2 standard deviations), which spreads it more evenly than it is. Sobol’ samples are pseudo-random, not quasi-random. Second-order Sobol’ indices, and Campolongo’s choice of the most spread-out Morris paths among many, are not computed.

Modules§

benchmark
Test functions whose Sobol’ indices are known in closed form, to check an analysis against.
morris
Morris’s screening: elementary effects along random one-at-a-time paths through a grid.
sobol
Sobol’ indices: the share of the output’s variance each factor causes, alone and in all.

Structs§

Factor
An uncertain input, spread evenly between low and high. It serializes as its three fields, and reads back through Factor::new’s checks.

Constants§

MAX_DESIGN_POINTS
The most points a design lays out: 1,048,576, far more than flights can be flown for. With MAX_DESIGN_VALUES it keeps a design’s points under about 200 MiB (a point costs its coordinates, 8 bytes each, and a list of them, about 40 bytes).
MAX_DESIGN_VALUES
The most coordinates (points times factors) a design holds: 16,777,216, 128 MiB.