Skip to content

DOptimization · simulate.sensitivity

Sensitivity analysis of a scenario model

Which uncertain inputs move a KPI the most?

How a scenario model's KPI responds to its inputs: one-way tornado and spider charts around the base case, variance-based Sobol indices (first-order and total, Saltelli/Jansen estimators with bootstrap intervals) and Morris elementary-effects screening. Every design point is drawn from the shared random stream and evaluated with the same formula semantics, so Python and R rank the inputs identically.

Verified in Python and R Python and R agree to 6 decimals Seeded

A real result

Example “Tornado default”, recorded in both engines. In the app, “Try this example” loads it into Analyze.

Sensitivity (Tornado): ProfitRecorded · Python and R agreeRecorded 2026-11-25 · 22 values compared
R

demand moves Profit the most.

Base case
3733.33
Largest effect
3681.87

Plots

TornadoWhich uncertain inputs move the outcome most when each is varied alone?
View data
KPI at high valueInputKPI at low value
4766.67demand1084.79
2853.33unit_cost4613.33
4625.40price2947.72

One-way sensitivity (largest swing first)

InputLow valueHigh valueKPI at lowKPI at highSwing
demand743.691256.311084.794766.673681.87
unit_cost5.2006.8004613.332853.331,760
price9.54811.2252947.724625.401677.68
  • Inputs are set by their quantile functions; the base case uses each input's base value (its mean unless set).
Python

demand moves Profit the most.

Base case
3733.33
Largest effect
3681.87

To keep this page light, the plots are shown once, under the R tab.

One-way sensitivity (largest swing first)

InputLow valueHigh valueKPI at lowKPI at highSwing
demand743.691256.311084.794766.673681.87
unit_cost5.2006.8004613.332853.331,760
price9.54811.2252947.724625.401677.68
  • Inputs are set by their quantile functions; the base case uses each input's base value (its mean unless set).

Do it in CodeSplash Run it on your own data, in Python or R, with the code to prove it.

Worked examples in the app

  • Tornado defaultNo data needed
  • Tornado decisionsNo data needed
  • SpiderNo data needed
  • SobolNo data needed
  • MorrisNo data needed
  • Sobol ishigamiNo data needed

In the guides

Where it sits in the decision guides

  • Prescriptive analytics (simulation, OR, causal RL) · DS & ML Decision Guide · Optimize / decide

Choices you make

hypothesis

Scenario model (JSON)default {"inputs":[{"name":"demand","dist":"normal","params":{"mean":1000,"sd":200},"min":0},{"name":"price","dist":"triangular","params":{"min":9,"mode":10,"max":12}},{"name":"unit_cost","dist":"uniform","params":{"min":5,"max":7}}],"decisions":[{"name":"order","value":1100,"min":600,"max":1600}],"formulas":[{"name":"sales","expr":"min(demand, order)"},{"name":"profit","expr":"price * sales - unit_cost * order"}],"kpis":[{"name":"profit","label":"Profit"}],"correlations":[]}

The scenario model built by the Scenario studio (inputs, decisions, formulas, KPIs).

Analysisdefault tornado

Kind of sensitivity analysis: one-at-a-time tornado or spider, Sobol variance shares, or Morris screening.

  • Tornado (one input at a time, low vs high)(default) — Moves each input from low to high with the others fixed; a quick ranking of which inputs matter most.
  • Spider (each input ± a share of its base value) — Moves each input by a share of its base value; shows how steep and how curved each input's effect is.
  • Sobol indices (share of variance per input) — Splits the output's variance among the inputs, interactions included; the fullest view and the slowest.
  • Morris screening (elementary effects) — Runs elementary effects along random paths; a cheap screen for ruling out inputs when there are many.
KPIdefault —

Name of the KPI (formula, input or decision) to analyze; empty = the model's first KPI.

options

Low value (percentile)default 10

Inputs without an explicit low value are set to this percentile of their distribution.

High value (percentile)default 90

Percentile used as each input's high value in the tornado (the low value mirrors it).

Include decisions (min ↔ max)default off

Also vary decision inputs between their minimum and maximum.

Changes from base (%)default -50,-25,-10,0,10,25,50

Percent changes from the base value applied to each input in the spider plot.

Base sample size (N)default 1024

The model is evaluated N × (inputs + 2) times.

Bootstrap resamplesdefault 200

Number of bootstrap resamples. More gives steadier intervals but takes longer; use 1,000 or more for reporting.

Confidence leveldefault 0.95

How sure the intervals should be: 0.95 gives 95% confidence intervals. Higher confidence means wider intervals.

Trajectories (r)default 20

Number of Morris trajectories. More gives steadier effect estimates.

Grid levels (p, even)default 4

Grid levels per input for Morris screening. Use an even number; 4 is typical.

Random seeddefault 1

Fixes the random numbers so reruns give identical results, in Python and in R.

What it reports

kpi
Model name of the KPI the sensitivity results describe: the one chosen, or else the model's first KPI.
kpi_label
The headline KPI's display label, as used in the summary; falls back to its model name when no label was set.
analysis
Which sensitivity analysis ran: tornado or spider (one input at a time), Sobol variance shares, or Morris screening.
n_factors
How many independent units the analysis used; it sets precision and power.
top_input
The input that moves the result most, and by how much: tornado swing, spider range, Sobol total-effect index or Morris mean |effect|.
top_value
The input that moves the result most, and by how much: tornado swing, spider range, Sobol total-effect index or Morris mean |effect|.

Per group, level or term: base, variance, evaluations, swing[<input>], kpi_low[<input>], kpi_high[<input>], low_value[<input>], high_value[<input>], spider[<input>,<change>], s1[<input>], st[<input>], s1_low[<input>], s1_high[<input>], st_low[<input>], st_high[<input>], mu[<input>], mu_star[<input>], sigma[<input>]

Python and R

Python and R agree to 6 decimals (relative tolerance 1e-9). Python uses numpy, scipy, codesplash; R uses jsonlite, codesplashr.

Default traps between the two languages

  • Design points are quantiles of the same shared uniforms (closed forms exact; ndtri ↔ qnorm and the incomplete beta/gamma inverses ~1e-15 relative), so indices agree to the last digits.
  • Sobol indices assume independent inputs: correlations in the model are ignored (the Monte Carlo method honours them).
Python

The exact script CodeSplash ran for example “Tornado default” · Python 3.13.5 · scipy 1.18.1 · pandas 3.1.0

# Sensitivity analysis of a scenario model
# Generated by CodeSplash Analytics 1.0.0 on 2026-11-09 · method simulate.sensitivity 1.0.0 · spec 7d839170de4c7937
# Runs on its own: outside the app, cs.publish() writes $CS_RESULT_PATH or prints the result JSON.

# %% Setup
import json

import numpy as np

import codesplash as cs
from codesplash.sim import mc, sens  # sensitivity designs on the shared random stream (twin of R cs_sim_*)

# %% Model
model = mc.load(json.loads("{\"inputs\":[{\"name\":\"demand\",\"dist\":\"normal\",\"params\":{\"mean\":1000,\"sd\":200},\"min\":0},{\"name\":\"price\",\"dist\":\"triangular\",\"params\":{\"min\":9,\"mode\":10,\"max\":12}},{\"name\":\"unit_cost\",\"dist\":\"uniform\",\"params\":{\"min\":5,\"max\":7}}],\"decisions\":[{\"name\":\"order\",\"value\":1100,\"min\":600,\"max\":1600}],\"formulas\":[{\"name\":\"sales\",\"expr\":\"min(demand, order)\"},{\"name\":\"profit\",\"expr\":\"price * sales - unit_cost * order\"}],\"kpis\":[{\"name\":\"profit\",\"label\":\"Profit\"}],\"correlations\":[]}"))
ANALYSIS = "tornado"  # tornado | spider | sobol | morris
KPI = "" or None  # empty = the model's first KPI
warnings, tables, charts = [], [], []
labels = {str(k["name"]): (k.get("label") or str(k["name"])) for k in model["kpis"]}

# %% Analyze
values = {"analysis": ANALYSIS}
if ANALYSIS == "tornado":
    # One input at a time at its low / high value, everything else at its base case.
    res = sens.tornado(model, KPI, 10, 90, False)
    rows = res["rows"]
    for r in rows:
        nm = r["input"]
        values[f"swing[{nm}]"] = r["swing"]
        values[f"kpi_low[{nm}]"] = r["kpi_low"]
        values[f"kpi_high[{nm}]"] = r["kpi_high"]
        values[f"low_value[{nm}]"] = r["low_value"]
        values[f"high_value[{nm}]"] = r["high_value"]
    top = rows[0] if rows else None
    values.update({"top_input": top["input"] if top else None, "top_value": top["swing"] if top else None})
    tables.append({
        "key": "tornado", "title": "One-way sensitivity (largest swing first)",
        "columns": [
            {"key": "input", "label": "Input", "type": "string"}, {"key": "low_value", "label": "Low value", "type": "number"},
            {"key": "high_value", "label": "High value", "type": "number"}, {"key": "kpi_low", "label": "KPI at low", "type": "number"},
            {"key": "kpi_high", "label": "KPI at high", "type": "number"}, {"key": "swing", "label": "Swing", "type": "number"},
        ],
        "rows": rows,
    })
    charts.append(cs.chart(
        "tornado", "tornado", "Tornado",
        {"input": cs.col("Input", [r["input"] for r in rows]), "low": cs.col("KPI at low value", [r["kpi_low"] for r in rows]),
         "high": cs.col("KPI at high value", [r["kpi_high"] for r in rows])},
        controls={"base": res["base"]},
    ))
elif ANALYSIS == "spider":
    changes = [-50, -25, -10, 0, 10, 25, 50]
    res = sens.spider(model, KPI, changes, False)
    rows = res["rows"]
    for r in rows:
        values[f"spider[{r['input']},{r['change']:g}]"] = r["kpi"]
    ranges = {}
    for r in rows:
        lo, hi = ranges.get(r["input"], (np.inf, -np.inf))
        ranges[r["input"]] = (min(lo, r["kpi"]), max(hi, r["kpi"]))
    order = sorted(ranges, key=lambda nm: -(ranges[nm][1] - ranges[nm][0]))
    values.update({"top_input": order[0] if order else None, "top_value": (ranges[order[0]][1] - ranges[order[0]][0]) if order else None})
    if res["skipped"]:
        warnings.append("Left out (base value 0, so a percentage change is undefined): " + ", ".join(res["skipped"]) + ".")
    tables.append({
        "key": "spider", "title": "KPI as each input changes from its base value",
        "columns": [{"key": "input", "label": "Input", "type": "string"}, {"key": "change", "label": "Change (%)", "type": "number"},
                    {"key": "value", "label": "Input value", "type": "number"}, {"key": "kpi", "label": "KPI", "type": "number"}],
        "rows": rows,
    })
    charts.append(cs.chart(
        "spider", "spider", "Spider",
        {"change": cs.col("Change from base (%)", [r["change"] for r in rows]), "kpi": cs.col("KPI", [r["kpi"] for r in rows]),
         "input": cs.col("Input", [r["input"] for r in rows])},
    ))
elif ANALYSIS == "sobol":
    # Saltelli A/B/AB_i design from the shared stream; Saltelli (2010) first-order, Jansen total indices.
    # Equivalent idiom: SALib.sample.sobol + SALib.analyze.sobol (Python) / sensitivity::soboljansen (R).
    res = sens.sobol(model, KPI, int(1024), int(1), int(200), 0.95)
    rows = res["rows"]
    for r in rows:
        for key in ("s1", "st", "s1_low", "s1_high", "st_low", "st_high"):
            values[f"{key}[{r['input']}]"] = r[key]
    top = max(rows, key=lambda r: r["st"]) if rows else None
    values.update({"top_input": top["input"] if top else None, "top_value": top["st"] if top else None, "variance": res["variance"], "evaluations": res["evaluations"]})
    tables.append({
        "key": "sobol", "title": "Sobol indices",
        "columns": [
            {"key": "input", "label": "Input", "type": "string"}, {"key": "s1", "label": "First order S₁", "type": "number"},
            {"key": "s1_low", "label": "S₁ low", "type": "number"}, {"key": "s1_high", "label": "S₁ high", "type": "number"},
            {"key": "st", "label": "Total S_T", "type": "number"}, {"key": "st_low", "label": "S_T low", "type": "number"},
            {"key": "st_high", "label": "S_T high", "type": "number"},
        ],
        "rows": rows,
    })
    srt = sorted(rows, key=lambda r: -r["st"])
    charts.append(cs.chart(
        "sobol", "importance-bar", "Total-effect Sobol indices",
        {"feature": cs.col("Input", [r["input"] for r in srt]), "importance": cs.col("Total index S_T", [r["st"] for r in srt]),
         "low": cs.col("Lower", [r["st_low"] for r in srt]), "high": cs.col("Upper", [r["st_high"] for r in srt])},
        controls={"top": 20},
    ))
    if sum(r["s1"] for r in rows) > 1.05 or any(r["s1"] < -0.05 for r in rows):
        warnings.append("Some first-order indices are outside [0, 1] beyond sampling noise — increase N for stable estimates.")
    if model["correlations"]:
        warnings.append("Sobol indices treat inputs as independent; the model's correlations are ignored here.")
else:
    res = sens.morris(model, KPI, int(20), int(4), int(1))
    rows = res["rows"]
    for r in rows:
        for key in ("mu", "mu_star", "sigma"):
            values[f"{key}[{r['input']}]"] = r[key]
    top = rows[0] if rows else None
    values.update({"top_input": top["input"] if top else None, "top_value": top["mu_star"] if top else None, "evaluations": res["evaluations"]})
    tables.append({
        "key": "morris", "title": "Morris elementary effects",
        "columns": [{"key": "input", "label": "Input", "type": "string"}, {"key": "mu_star", "label": "μ* (mean |effect|)", "type": "number"},
                    {"key": "mu", "label": "μ", "type": "number"}, {"key": "sigma", "label": "σ", "type": "number"}],
        "rows": rows,
    })
    charts.append(cs.chart(
        "morris", "scatter", "Morris: importance (μ*) vs interaction / non-linearity (σ)",
        {"x": cs.col("μ* (mean |elementary effect|)", [r["mu_star"] for r in rows]), "y": cs.col("σ", [r["sigma"] for r in rows]),
         "color": cs.col("Input", [r["input"] for r in rows])},
        controls={"fit": "none"},
    ))
values["kpi"] = res["kpi"]
values["kpi_label"] = labels.get(res["kpi"], res["kpi"])
values["base"] = res.get("base")
values["n_factors"] = len(rows) if ANALYSIS != "spider" else len({r["input"] for r in rows})

# %% Result
names = {"tornado": "Tornado", "spider": "Spider", "sobol": "Sobol indices", "morris": "Morris screening"}
cs.publish({
    "method": "simulate.sensitivity",
    "methodVersion": "1.0.0",
    "title": f"Sensitivity ({names[ANALYSIS]}): {values['kpi_label']}",
    "engine": cs.engine_info("numpy", "scipy"),
    "summary": f"{values['top_input']} moves {values['kpi_label']} the most." if values.get("top_input") else "No inputs to analyze.",
    "statistics": [s for s in [
        {"key": "base", "label": "Base case", "value": values.get("base")} if values.get("base") is not None else None,
        {"key": "top_value", "label": "Largest effect", "value": values.get("top_value")} if values.get("top_value") is not None else None,
        {"key": "evaluations", "label": "Model evaluations", "value": values.get("evaluations"), "format": "integer"} if values.get("evaluations") else None,
    ] if s],
    "tables": tables,
    "charts": charts,
    "warnings": warnings,
    "notes": ["Inputs are set by their quantile functions; the base case uses each input's base value (its mean unless set)."],
    "values": values,
})
R

The exact script CodeSplash ran for example “Tornado default” · R version 4.5.1 (2025-06-13)

# Sensitivity analysis of a scenario model
# Generated by CodeSplash Analytics 1.0.0 on 2026-11-09 · method simulate.sensitivity 1.0.0 · spec 7d839170de4c7937
# Runs on its own: outside the app, cs_publish() writes $CS_RESULT_PATH or prints the result JSON.

# %% Setup
library(codesplashr) # cs_sim_*: sensitivity designs on the shared random stream (twin of codesplash.sim)

# %% Model
model <- cs_sim_load("{\"inputs\":[{\"name\":\"demand\",\"dist\":\"normal\",\"params\":{\"mean\":1000,\"sd\":200},\"min\":0},{\"name\":\"price\",\"dist\":\"triangular\",\"params\":{\"min\":9,\"mode\":10,\"max\":12}},{\"name\":\"unit_cost\",\"dist\":\"uniform\",\"params\":{\"min\":5,\"max\":7}}],\"decisions\":[{\"name\":\"order\",\"value\":1100,\"min\":600,\"max\":1600}],\"formulas\":[{\"name\":\"sales\",\"expr\":\"min(demand, order)\"},{\"name\":\"profit\",\"expr\":\"price * sales - unit_cost * order\"}],\"kpis\":[{\"name\":\"profit\",\"label\":\"Profit\"}],\"correlations\":[]}")
ANALYSIS <- "tornado" # tornado | spider | sobol | morris
KPI <- "" # empty = the model's first KPI
if (!nzchar(KPI)) KPI <- NULL
warnings <- list(); tables <- list(); charts <- list()
labels <- list()
for (k in model$kpis) labels[[as.character(k$name)]] <- if (!is.null(k$label) && nzchar(k$label)) k$label else as.character(k$name)
col_of <- function(rows, key) vapply(rows, function(r) as.numeric(r[[key]]), numeric(1))
chr_of <- function(rows, key) vapply(rows, function(r) as.character(r[[key]]), character(1))

# %% Analyze
values <- list(analysis = ANALYSIS)
if (ANALYSIS == "tornado") {
  # One input at a time at its low / high value, everything else at its base case.
  res <- cs_sim_tornado(model, KPI, 10, 90, FALSE)
  rows <- res$rows
  for (r in rows) {
    nm <- r$input
    values[[sprintf("swing[%s]", nm)]] <- r$swing
    values[[sprintf("kpi_low[%s]", nm)]] <- r$kpi_low
    values[[sprintf("kpi_high[%s]", nm)]] <- r$kpi_high
    values[[sprintf("low_value[%s]", nm)]] <- r$low_value
    values[[sprintf("high_value[%s]", nm)]] <- r$high_value
  }
  values$top_input <- if (length(rows)) rows[[1]]$input else NA
  values$top_value <- if (length(rows)) rows[[1]]$swing else NA
  tables[[1]] <- list(
    key = "tornado", title = "One-way sensitivity (largest swing first)",
    columns = list(
      list(key = "input", label = "Input", type = "string"), list(key = "low_value", label = "Low value", type = "number"),
      list(key = "high_value", label = "High value", type = "number"), list(key = "kpi_low", label = "KPI at low", type = "number"),
      list(key = "kpi_high", label = "KPI at high", type = "number"), list(key = "swing", label = "Swing", type = "number")
    ),
    rows = rows
  )
  charts[[1]] <- cs_chart(
    "tornado", "tornado", "Tornado",
    list(input = cs_col("Input", chr_of(rows, "input")), low = cs_col("KPI at low value", col_of(rows, "kpi_low")),
         high = cs_col("KPI at high value", col_of(rows, "kpi_high"))),
    controls = list(base = res$base)
  )
} else if (ANALYSIS == "spider") {
  changes <- c(-50, -25, -10, 0, 10, 25, 50)
  res <- cs_sim_spider(model, KPI, changes, FALSE)
  rows <- res$rows
  for (r in rows) values[[sprintf("spider[%s,%s]", r$input, sprintf("%g", r$change))]] <- r$kpi
  ins <- unique(chr_of(rows, "input"))
  rng <- vapply(ins, function(nm) {
    k <- col_of(Filter(function(r) r$input == nm, rows), "kpi")
    max(k) - min(k)
  }, numeric(1))
  ord <- order(-rng, seq_along(ins))
  values$top_input <- if (length(ins)) ins[ord[1]] else NA
  values$top_value <- if (length(ins)) unname(rng[ord[1]]) else NA
  if (length(res$skipped)) warnings <- c(warnings, sprintf("Left out (base value 0, so a percentage change is undefined): %s.", paste(res$skipped, collapse = ", ")))
  tables[[1]] <- list(
    key = "spider", title = "KPI as each input changes from its base value",
    columns = list(list(key = "input", label = "Input", type = "string"), list(key = "change", label = "Change (%)", type = "number"),
                   list(key = "value", label = "Input value", type = "number"), list(key = "kpi", label = "KPI", type = "number")),
    rows = rows
  )
  charts[[1]] <- cs_chart(
    "spider", "spider", "Spider",
    list(change = cs_col("Change from base (%)", col_of(rows, "change")), kpi = cs_col("KPI", col_of(rows, "kpi")),
         input = cs_col("Input", chr_of(rows, "input")))
  )
} else if (ANALYSIS == "sobol") {
  # Saltelli A/B/AB_i design from the shared stream; Saltelli (2010) first-order, Jansen total indices.
  # Equivalent idiom: sensitivity::soboljansen(model, X1, X2, nboot) — with R's own random draws.
  res <- cs_sim_sobol(model, KPI, 1024, 1, 200, 0.95)
  rows <- res$rows
  for (r in rows) for (key in c("s1", "st", "s1_low", "s1_high", "st_low", "st_high")) values[[sprintf("%s[%s]", key, r$input)]] <- r[[key]]
  st <- col_of(rows, "st")
  top <- which.max(st)
  values$top_input <- if (length(rows)) rows[[top]]$input else NA
  values$top_value <- if (length(rows)) st[top] else NA
  values$variance <- res$variance
  values$evaluations <- res$evaluations
  tables[[1]] <- list(
    key = "sobol", title = "Sobol indices",
    columns = list(
      list(key = "input", label = "Input", type = "string"), list(key = "s1", label = "First order S₁", type = "number"),
      list(key = "s1_low", label = "S₁ low", type = "number"), list(key = "s1_high", label = "S₁ high", type = "number"),
      list(key = "st", label = "Total S_T", type = "number"), list(key = "st_low", label = "S_T low", type = "number"),
      list(key = "st_high", label = "S_T high", type = "number")
    ),
    rows = rows
  )
  srt <- rows[order(-st, seq_along(rows))]
  charts[[1]] <- cs_chart(
    "sobol", "importance-bar", "Total-effect Sobol indices",
    list(feature = cs_col("Input", chr_of(srt, "input")), importance = cs_col("Total index S_T", col_of(srt, "st")),
         low = cs_col("Lower", col_of(srt, "st_low")), high = cs_col("Upper", col_of(srt, "st_high"))),
    controls = list(top = 20)
  )
  if (sum(col_of(rows, "s1")) > 1.05 || any(col_of(rows, "s1") < -0.05)) {
    warnings <- c(warnings, "Some first-order indices are outside [0, 1] beyond sampling noise — increase N for stable estimates.")
  }
  if (length(model$correlations)) warnings <- c(warnings, "Sobol indices treat inputs as independent; the model's correlations are ignored here.")
} else {
  res <- cs_sim_morris(model, KPI, 20, 4, 1)
  rows <- res$rows
  for (r in rows) for (key in c("mu", "mu_star", "sigma")) values[[sprintf("%s[%s]", key, r$input)]] <- r[[key]]
  values$top_input <- if (length(rows)) rows[[1]]$input else NA
  values$top_value <- if (length(rows)) rows[[1]]$mu_star else NA
  values$evaluations <- res$evaluations
  tables[[1]] <- list(
    key = "morris", title = "Morris elementary effects",
    columns = list(list(key = "input", label = "Input", type = "string"), list(key = "mu_star", label = "μ* (mean |effect|)", type = "number"),
                   list(key = "mu", label = "μ", type = "number"), list(key = "sigma", label = "σ", type = "number")),
    rows = rows
  )
  charts[[1]] <- cs_chart(
    "morris", "scatter", "Morris: importance (μ*) vs interaction / non-linearity (σ)",
    list(x = cs_col("μ* (mean |elementary effect|)", col_of(rows, "mu_star")), y = cs_col("σ", col_of(rows, "sigma")),
         color = cs_col("Input", chr_of(rows, "input"))),
    controls = list(fit = "none")
  )
}
values$kpi <- res$kpi
values$kpi_label <- if (!is.null(labels[[res$kpi]])) labels[[res$kpi]] else res$kpi
values$base <- if (is.null(res$base)) NA else res$base
values$n_factors <- if (ANALYSIS != "spider") length(rows) else length(unique(chr_of(rows, "input")))

# %% Result
names_map <- c(tornado = "Tornado", spider = "Spider", sobol = "Sobol indices", morris = "Morris screening")
stats_list <- list()
if (!is.na(values$base)) stats_list[[length(stats_list) + 1]] <- list(key = "base", label = "Base case", value = values$base)
if (!is.na(values$top_value)) stats_list[[length(stats_list) + 1]] <- list(key = "top_value", label = "Largest effect", value = values$top_value)
if (!is.null(values$evaluations)) stats_list[[length(stats_list) + 1]] <- list(key = "evaluations", label = "Model evaluations", value = values$evaluations, format = "integer")
cs_publish(list(
  method = "simulate.sensitivity",
  methodVersion = "1.0.0",
  title = sprintf("Sensitivity (%s): %s", names_map[[ANALYSIS]], values$kpi_label),
  engine = cs_engine_info("stats", "jsonlite"),
  summary = if (!is.na(values$top_input)) sprintf("%s moves %s the most.", values$top_input, values$kpi_label) else "No inputs to analyze.",
  statistics = stats_list,
  tables = tables,
  charts = charts,
  warnings = warnings,
  notes = "Inputs are set by their quantile functions; the base case uses each input's base value (its mean unless set).",
  values = values
))

Sources

  • Saltelli A, Annoni P, Azzini I, Campolongo F, Ratto M, Tarantola S (2010). Variance based sensitivity analysis of model output. Computer Physics Communications 181:259–270.
  • Jansen MJW (1999). Analysis of variance designs for model output. Computer Physics Communications 117:35–43.
  • Morris MD (1991). Factorial sampling plans for preliminary computational experiments. Technometrics 33(2):161–174.
  • Campolongo F, Cariboni J, Saltelli A (2007). An effective screening design for sensitivity analysis of large models. Environmental Modelling & Software 22:1509–1518.

From the CodeSplash method registry · simulate.sensitivity v1.0.0.