Skip to Content

Sensitivity Analysis

Context

When you enter evidence in BayesiaLab, inference uses the probabilities stored in the network. A conditional probability table might give a single value for the probability of chest pain given a particular condition. How precisely is that value known? A table learned from a finite sample carries sampling uncertainty. In a table elicited from several experts, the experts may disagree about the same probability.

A Credible Intervals Report shows how precisely each probability in a learned table has been estimated. Sensitivity analysis takes the next step. It shows how much a result calculated from those tables can vary, such as a marginal probability or a measure of association with a Target Node.

Usage

In Validation Mode, open Menus > Analysis > Visual > Sensitivity. Choose the analysis that answers your question.

  • Which configurations contribute to a node’s marginal probability? Joint Probability breaks down that probability across combinations of states of the parameter nodes.
  • How much could a result vary because the tables were learned from a finite sample? Credible Intervals draws plausible probability tables from their posterior distributions and repeats inference for each draw.
  • How much does a result depend on whose judgments you use? Expert Assessments generates networks from the individual assessments behind a consensus model.

Example

CoronaryArteryDisease.xbl
XBL

The network contains 303 cases. Condition\mathit{Condition} is the target and a parent of Age\mathit{Age}, BMI\mathit{BMI}, and Typical Chest Pain\mathit{Typical\ Chest\ Pain}. We will read the conditional probabilities for these three nodes, then simulate how uncertainty in the tables affects the age distribution and the association between chest pain and the target.

Read the Three Conditional Probability Tables

Open the network and select Age\mathit{Age}, Body Mass Index\mathit{Body\ Mass\ Index} (shown as BMI\mathit{BMI} in the report), and Typical Chest Pain\mathit{Typical\ Chest\ Pain}. On macOS, click the first node, then Command-click each of the other two. The three selected nodes have handles in the graph.

Loading SVG...

Choose Menus > Network > Reports > Credible Intervals. Set Confidence Level to 90% and click OK.

Confidence Level set to 90% in the Credible Interval Report dialog.

Each table has one row for each state of Condition\mathit{Condition}. In the Typical Chest Pain\mathit{Typical\ Chest\ Pain} table, follow the Normal\mathrm{Normal} row to the column for state 1\mathrm{1}. The estimated probability is 11.7143%, with a 90% credible interval from 6.6288% to 17.7971%. In the row for Coronary Artery Disease\mathrm{Coronary\ Artery\ Disease}, the estimate for the same state is 71.2471%.

Credible Interval Report at 90%, showing the complete Age, BMI, and Typical Chest Pain tables by Condition.

Run the Simulation

Close the report and choose Menus > View > Validation Mode. Leave the network without evidence and select the same three nodes. Choose Menus > Analysis > Visual > Sensitivity > Credible Intervals. Check that the confirmation shows 3 selected nodes, then click OK.

BayesiaLab asks for confirmation to run the analysis on the three selected nodes.

Set Number of Samples to 10,000. Enable Compute Metrics on Target to include measures of association with Condition\mathit{Condition}. Leave both effect options clear. Enable Fixed Seed, enter 31, and click OK. Each sample draws a set of probability tables and recalculates the results using those tables.

Credible Intervals settings with 10,000 samples, Compute Metrics on Target enabled, and fixed seed 31.

Inspect the Age Probabilities

In the results window, select Age\mathit{Age} and States' Probabilities. Choose Density Function and set Number of Intervals to 100. Each color shows how often the simulation produced a given probability for one of the three age groups.

Density histograms of the simulated probabilities for the three age groups, with peaks near 0.51, 0.29, and 0.20.

The Age\mathit{Age} table above gives a 76.7619% probability of age 58.5 or younger given Condition\mathit{Condition} = Normal\mathrm{Normal}. Here the network has no evidence on Condition\mathit{Condition}, so inference averages over both condition states. Across the 10,000 draws, the mean probability of age 58.5 or younger is 51.0882%. The means for the middle and oldest age groups are 29.4006% and 19.5112%, respectively.

Inspect the Association With the Target

Select Typical Chest Pain\mathit{Typical\ Chest\ Pain}, then Relative Mutual Information. Relative Mutual Information measures the fraction of uncertainty about Condition\mathit{Condition} explained by observing Typical Chest Pain\mathit{Typical\ Chest\ Pain}. The simulated mean is 0.2667, or about 27% of the uncertainty about the target. The standard deviation is 0.0448.

Distribution of Relative Mutual Information between Typical Chest Pain and Condition, with mean 0.2667 and standard deviation 0.0448.

Click Report to read the exact values for all three nodes. For each state probability and each metric, the report lists the minimum and maximum observed across the draws, the mean, and the standard deviation.

Credible Interval Analysis report listing simulation summaries for Age, BMI, and Typical Chest Pain.