Information-Theoretic Decomposition of the Glasgow Coma Scale: Motor Score Dominance and the Cost of Summation
Information-Theoretic Decomposition of the Glasgow Coma Scale: Motor Score Dominance and the Cost of Summation
Abstract
The Glasgow Coma Scale (GCS) total score is the most widely used metric in traumatic brain injury (TBI) assessment, yet it collapses three independent neurological domains---Eye opening (E), Verbal response (V), and Motor response (M)---into a single sum. Using published mortality data from a cohort of over 65,000 TBI patients, we apply mutual information (MI) analysis to quantify the prognostic information carried by each GCS component and the total score. Motor response dominates: MI(Motor; Mortality) = 0.1339 bits, representing 15.2% of outcome entropy---twice that of Eye (0.0670 bits, 7.7%) and 2.26 times Verbal (0.0593 bits, 6.9%). Critically, Motor alone captures 94% of the MI provided by the 13-level GCS total (0.1426 bits, 17.1%), gaining only 0.0087 additional bits from the extra seven levels. The summation operation maps 120 possible (E,V,M) triples to just 13 GCS scores, destroying 51.6% of combinatorial information. Within a single GCS total, Motor scores can span the full 1--6 range, yielding mortality estimates from 12.0% to 64.2% for identically-scored patients. Monte Carlo sensitivity analysis confirms Motor > Eye with 100% robustness (10,000/10,000 iterations), while Motor versus GCS Total is indeterminate (Motor exceeds Total in only 22.4% of iterations). These results provide formal information-theoretic support for prioritizing Motor score in clinical triage and reporting component scores alongside the total.
1. Introduction
The Glasgow Coma Scale, introduced by Teasdale and Jennett in 1974, transformed the assessment of impaired consciousness by providing a structured, reproducible clinical tool [1]. The scale evaluates three independent neurological domains: Eye opening (E, scores 1--4), Verbal response (V, scores 1--5), and Motor response (M, scores 1--6). Each component probes a distinct neuroanatomical pathway---brainstem arousal, language integration, and corticospinal tract integrity, respectively. The GCS total, computed as E + V + M, ranges from 3 to 15 and has become the universal shorthand for injury severity: scores of 3--8 define severe TBI, 9--12 moderate, and 13--15 mild.
Despite its ubiquity, the GCS total has attracted sustained criticism. The fundamental concern is that summation conflates qualitatively different neurological signals into a single number. Two patients with identical GCS totals may have markedly different component profiles---and markedly different prognoses. Several large studies have demonstrated that the Motor component alone predicts outcome as well as, or nearly as well as, the total score. Healey et al. (2003) showed in a trauma registry analysis that Motor score predicted intubation, neurosurgical intervention, and mortality with accuracy comparable to the full GCS [2]. Teoh et al. (2000) reported similar findings for emergency department outcomes [3]. The IMPACT database analyses by Steyerberg et al. (2008) confirmed Motor's prognostic dominance across a pooled dataset of over 9,000 patients from multiple trials [4]. Marmarou et al. (2007) further documented the nonlinear relationship between GCS components and outcome in severe TBI [5].
In 2014, Teasdale et al. published the largest study to date addressing this question directly, analyzing mortality by individual component scores and GCS total in over 65,000 patients from the TBI registry [6]. Their data, presented as prevalence-weighted mortality rates for each component level and GCS total, provide the empirical foundation for the present analysis.
What has been lacking in this debate is a formal, quantitative framework for comparing the information content of different scoring schemes. Mutual information (MI), a measure from Shannon's information theory [7], offers exactly this capability. MI quantifies the reduction in uncertainty about one variable (mortality outcome) gained by observing another (a GCS score), measured in bits. Unlike regression-based measures such as R-squared or the c-statistic, MI makes no assumptions about the functional form of the relationship, captures nonlinear and non-monotonic associations equally, and provides an absolute scale (bits) that enables direct comparison across variables with different numbers of levels.
This paper applies MI analysis to the Teasdale et al. (2014) data to address three questions: (1) How much prognostic information does each GCS component carry about mortality? (2) How much information does the summation operation destroy? (3) How robust are these findings to perturbation of the underlying mortality estimates?
2. Data and Methods
2.1 Data Source
We use published mortality rates by component score from Teasdale et al. (2014), Tables 2 and 3 [6]. This study reported six-month mortality for TBI patients assessed with the GCS, with over 65,000 observations. The data comprise prevalence (proportion of patients at each score level) and mortality rate (proportion dying within six months) for each level of Eye (E = 1--4), Verbal (V = 1--5), Motor (M = 1--6), and GCS total (3--15).
Table 1. Component-level prevalence and mortality data.
| Eye (E) | Prevalence | Mortality |
|---|---|---|
| 1 | 0.440 | 0.434 |
| 2 | 0.113 | 0.283 |
| 3 | 0.152 | 0.195 |
| 4 | 0.295 | 0.127 |
| Verbal (V) | Prevalence | Mortality |
|---|---|---|
| 1 | 0.504 | 0.397 |
| 2 | 0.055 | 0.296 |
| 3 | 0.074 | 0.235 |
| 4 | 0.108 | 0.187 |
| 5 | 0.259 | 0.110 |
| Motor (M) | Prevalence | Mortality |
|---|---|---|
| 1 | 0.186 | 0.642 |
| 2 | 0.044 | 0.527 |
| 3 | 0.044 | 0.432 |
| 4 | 0.112 | 0.352 |
| 5 | 0.218 | 0.225 |
| 6 | 0.396 | 0.120 |
| GCS Total | Prevalence | Mortality |
|---|---|---|
| 3 | 0.143 | 0.627 |
| 4 | 0.039 | 0.541 |
| 5 | 0.033 | 0.482 |
| 6 | 0.048 | 0.409 |
| 7 | 0.058 | 0.343 |
| 8 | 0.049 | 0.309 |
| 9 | 0.050 | 0.266 |
| 10 | 0.060 | 0.224 |
| 11 | 0.060 | 0.201 |
| 12 | 0.056 | 0.167 |
| 13 | 0.074 | 0.130 |
| 14 | 0.118 | 0.097 |
| 15 | 0.212 | 0.068 |
Note that the marginal (prevalence-weighted average) mortality rate differs slightly across components: 0.290 for Eye, 0.282 for Verbal, 0.298 for Motor, and 0.265 for GCS Total. These discrepancies arise because the published data reflect different subsets and prevalence weightings within the same overall cohort. We compute all information-theoretic measures within each component's own marginal distribution rather than imposing a single mortality baseline.
2.2 Mutual Information Computation
For a discrete predictor X with levels x_1, ..., x_k and binary outcome Y (alive/dead), mutual information is defined as:
MI(X; Y) = H(Y) - H(Y|X)
where H(Y) is the marginal entropy of the outcome:
H(Y) = -p(Y=1) log_2 p(Y=1) - p(Y=0) log_2 p(Y=0)
and H(Y|X) is the conditional entropy:
H(Y|X) = sum_i p(X = x_i) * H(Y | X = x_i)
with H(Y | X = x_i) = -m_i log_2 m_i - (1 - m_i) log_2 (1 - m_i), where m_i is the mortality rate at level x_i.
MI measures the expected reduction in outcome uncertainty (in bits) gained by observing the predictor. We also report normalized MI as MI/H(Y), expressing MI as a percentage of total outcome entropy.
2.3 Degeneracy Analysis
The GCS total is computed as E + V + M. With E in {1,2,3,4}, V in {1,2,3,4,5}, and M in {1,2,3,4,5,6}, there are 4 x 5 x 6 = 120 possible (E,V,M) triples. These map to only 13 distinct GCS totals (3--15). We enumerate all 120 triples, tabulate how many map to each GCS total, and quantify the information loss as:
Information destroyed = H(Triple) - H(Total)
under a uniform distribution over triples, where H(Triple) = log_2(120) = 6.9069 bits and H(Total) is computed from the resulting distribution over GCS scores.
2.4 Sensitivity Analysis
To assess the robustness of MI rankings to uncertainty in the published mortality estimates, we performed Monte Carlo perturbation analysis. In each of 10,000 iterations, we independently perturbed every mortality rate by a uniform random offset in [-0.02, +0.02] (i.e., +/-2 percentage points), clamping to [0.001, 0.999] to maintain valid probabilities. We then recomputed MI for all four predictors and recorded the ranking. We report median MI values, 2.5th--97.5th percentile intervals, and the proportion of iterations in which Motor MI exceeded Eye MI and GCS Total MI, respectively.
3. Results
3.1 Component MI Ranking
Table 2 presents the mutual information between each predictor and six-month mortality.
Table 2. Mutual information of GCS components and total score with mortality.
| Predictor | Levels | H(Y) (bits) | H(Y|X) (bits) | MI (bits) | MI/H(Y) (%) |
|---|---|---|---|---|---|
| GCS Total | 13 | 0.8341 | 0.6916 | 0.1426 | 17.09 |
| Motor (M) | 6 | 0.8783 | 0.7445 | 0.1339 | 15.24 |
| Eye (E) | 4 | 0.8688 | 0.8018 | 0.0670 | 7.71 |
| Verbal (V) | 5 | 0.8588 | 0.7994 | 0.0593 | 6.91 |
The GCS total provides the highest MI at 0.1426 bits (17.1% of outcome entropy), followed closely by Motor at 0.1339 bits (15.2%). Eye and Verbal trail substantially at 0.0670 bits (7.7%) and 0.0593 bits (6.9%), respectively.
3.2 Motor Score Dominance
The Motor component carries 2.00 times the MI of Eye and 2.26 times the MI of Verbal. More striking is the comparison with GCS Total: Motor alone, using only 6 score levels, captures 93.9% of the MI achieved by the 13-level GCS total. The incremental gain from summing all three components is just 0.0087 bits---an increase of only 6.5% over Motor alone, achieved at the cost of more than doubling the number of score levels (from 6 to 13).
This result can be reframed in terms of informational efficiency. Motor achieves 0.0223 bits per level (0.1339/6), while GCS Total achieves 0.0110 bits per level (0.1426/13). Motor is thus twice as informationally efficient as the total score on a per-level basis.
3.3 Degeneracy Analysis
The summation E + V + M maps 120 distinct (E,V,M) triples to 13 GCS scores. The distribution of triples per score is markedly non-uniform:
Table 3. Number of distinct (E,V,M) triples per GCS total.
| GCS Total | Triples |
|---|---|
| 3 | 1 |
| 4 | 3 |
| 5 | 6 |
| 6 | 10 |
| 7 | 14 |
| 8 | 17 |
| 9 | 18 |
| 10 | 17 |
| 11 | 14 |
| 12 | 10 |
| 13 | 6 |
| 14 | 3 |
| 15 | 1 |
The distribution peaks at GCS 9, which collapses 18 distinct neurological profiles into a single score. Under a uniform distribution over triples, the entropy of the full triple is H(Triple) = log_2(120) = 6.9069 bits, while the entropy of the GCS total is 3.3435 bits. The summation operation thus destroys 3.5634 bits, or 51.6% of the combinatorial information present in the three-component representation.
3.4 Within-Score Mortality Heterogeneity
Because Motor is the dominant prognostic component, the range of Motor scores compatible with a given GCS total directly determines the within-score heterogeneity of mortality risk. Table 4 presents this relationship.
Table 4. Motor score range and implied mortality heterogeneity by GCS total.
| GCS Total | Motor Range | Min Mortality | Max Mortality | Spread |
|---|---|---|---|---|
| 3 | 1 | 0.642 | 0.642 | 0.000 |
| 4 | 1--2 | 0.527 | 0.642 | 0.115 |
| 5 | 1--3 | 0.432 | 0.642 | 0.210 |
| 6 | 1--4 | 0.352 | 0.642 | 0.290 |
| 7 | 1--5 | 0.225 | 0.642 | 0.417 |
| 8 | 1--6 | 0.120 | 0.642 | 0.522 |
| 9 | 1--6 | 0.120 | 0.642 | 0.522 |
| 10 | 1--6 | 0.120 | 0.642 | 0.522 |
| 11 | 2--6 | 0.120 | 0.527 | 0.407 |
| 12 | 3--6 | 0.120 | 0.432 | 0.312 |
| 13 | 4--6 | 0.120 | 0.352 | 0.232 |
| 14 | 5--6 | 0.120 | 0.225 | 0.105 |
| 15 | 6 | 0.120 | 0.120 | 0.000 |
For GCS totals of 8, 9, and 10---clinically critical scores straddling the severe/moderate TBI boundary---the Motor score can range from 1 to 6, producing mortality estimates spanning from 12.0% to 64.2%. A patient with GCS 8 achieved through E4+V3+M1 (no motor response) has a fundamentally different prognosis from one with E1+V1+M6 (localizing motor response but no eye opening or verbal output), yet both receive the same total score.
3.5 Sensitivity Analysis
Monte Carlo perturbation analysis (10,000 iterations, +/-2 percentage points uniform perturbation) confirms the robustness of the MI rankings.
Table 5. Bootstrap sensitivity analysis results.
| Predictor | Median MI | 2.5th Percentile | 97.5th Percentile |
|---|---|---|---|
| GCS Total | 0.1431 | 0.1298 | 0.1576 |
| Motor (M) | 0.1339 | 0.1182 | 0.1514 |
| Eye (E) | 0.0673 | 0.0547 | 0.0811 |
| Verbal (V) | 0.0593 | 0.0474 | 0.0728 |
The ordering Motor > Eye > Verbal is perfectly robust: Motor MI exceeded Eye MI in 10,000 of 10,000 iterations (100%). By contrast, the comparison between Motor and GCS Total is less decisive: Motor MI exceeded GCS Total MI in only 2,235 of 10,000 iterations (22.4%). This confirms that the GCS total does extract modestly more information than Motor alone, but the advantage is small and the confidence intervals overlap substantially.
It is important to note that these intervals represent sensitivity to perturbation of the mortality estimates, not formal statistical confidence intervals derived from individual-level data. They quantify how much the MI values would shift if the published mortality rates were uncertain by +/-2 percentage points.
4. Discussion
4.1 Clinical Implications: Motor Score Primacy
The finding that Motor response carries more than twice the mutual information of either Eye or Verbal, and captures 94% of the information in the full GCS total, has direct clinical implications. In triage settings where rapid assessment is critical---prehospital care, emergency department evaluation, serial monitoring---Motor score alone provides nearly all the prognostic information available from the complete GCS. This supports the practice, already adopted informally in some trauma systems, of emphasizing Motor score in initial assessment and communication.
The informational efficiency analysis sharpens this point: Motor achieves 0.0223 bits per score level compared to 0.0110 bits per level for the GCS total. Each additional level in the GCS total beyond what Motor provides yields diminishing informational returns. Clinical scoring systems face an inherent tradeoff between granularity (more levels, potentially more information) and usability (fewer levels, less cognitive burden, fewer transcription errors). Motor score achieves a favorable balance. This does not imply that Eye and Verbal assessments should be abandoned---they provide independent neurological information valuable for differential diagnosis and longitudinal monitoring---but rather that Motor should be understood as the primary driver of prognostic discrimination within the GCS framework.
4.2 The Degeneracy Problem
The degeneracy analysis reveals a structural limitation of the GCS total that cannot be resolved by collecting more data or refining the mortality estimates. The mapping from 120 (E,V,M) triples to 13 GCS scores is many-to-one by mathematical necessity, and the information loss of 51.6% is a property of the summation operation itself.
The clinical consequences are most severe in the middle range of GCS scores. At GCS 8---the threshold defining severe TBI and often determining management decisions including intubation---17 distinct neurological profiles are collapsed into a single number. The Motor score within this group can range from 1 (no motor response, mortality 64.2%) to 6 (obeying commands, mortality 12.0%). These are not subtle differences in prognosis; they represent a fivefold variation in mortality risk among patients assigned identical GCS totals.
This heterogeneity is not merely a theoretical concern. Clinical protocols that use GCS thresholds for decision-making---intubation at GCS 8 or below, ICU admission at GCS 12 or below, discharge criteria at GCS 14 or above---implicitly assume that equal GCS totals imply equivalent clinical states. The degeneracy analysis demonstrates that this assumption is untenable.
4.3 Why the Total Score Still Edges Ahead
Despite the Motor component's dominance, the GCS total does provide marginally more MI (0.1426 vs. 0.1339 bits). This 0.0087-bit advantage arises because Eye and Verbal carry non-redundant information that Motor does not fully subsume. Eye opening reflects brainstem arousal circuits partially independent of corticospinal integrity, while Verbal response engages cortical language networks.
The sensitivity analysis underscores this point: in 77.6% of Monte Carlo iterations, GCS Total MI exceeded Motor MI. The total score is genuinely, if modestly, more informative. The relevant question is not whether the total carries more information---it does---but whether the gain of 0.0087 bits justifies the cost of conflating three independent domains, destroying 51.6% of combinatorial information, and obscuring within-score heterogeneity.
An alternative approach that preserves the full information content would be to report and analyze component scores separately, or to use the component profile (E,V,M) directly. This retains the full 120-state representation while allowing Motor to serve as the primary triage variable when rapid assessment demands simplicity. Modern electronic health records and trauma registries already capture the three components individually; the barrier is not data collection but rather clinical habit and protocol language that foreground the total at the expense of the components.
4.4 Limitations
Several limitations warrant discussion. First, this analysis uses published aggregate data (prevalence and mortality rates by score level) rather than individual-level patient records. The MI computation from aggregate data is exact given the published marginals, but we cannot assess higher-order interactions among components---for instance, whether specific (E,V,M) combinations carry prognostic information beyond what the individual components provide additively.
Second, the marginal mortality rates differ across components (0.290 for Eye, 0.282 for Verbal, 0.298 for Motor, 0.265 for GCS Total) because each component's prevalence distribution produces a different weighted average. This is a property of the published data, not an analytic artifact, and we compute MI within each component's own marginal distribution accordingly.
Third, the degeneracy analysis assumes uniform distribution over (E,V,M) triples to quantify the combinatorial information loss. In practice, the population distribution over triples is non-uniform---certain combinations are far more common than others. The 51.6% information destruction figure represents the structural capacity for information loss inherent in the summation operation, not the realized loss for any specific population.
Fourth, the sensitivity analysis uses Monte Carlo perturbation of mortality rates rather than bootstrapping of individual-level observations. The resulting intervals quantify sensitivity to estimation uncertainty but should not be interpreted as formal frequentist confidence intervals. The +/-2 percentage-point perturbation range was chosen as a plausible bound on estimation error given the large sample size (>65,000 observations) but is ultimately a judgment call.
Fifth, the outcome analyzed is six-month mortality---a coarse binary endpoint. The GCS components may carry different amounts of information about finer-grained outcomes such as functional recovery (Glasgow Outcome Scale), duration of unconsciousness, or need for specific interventions. The Motor dominance finding may not generalize to all outcome measures.
5. Conclusion
Mutual information analysis of published GCS mortality data from over 65,000 TBI patients reveals that the Motor component alone captures 0.1339 bits of prognostic information---94% of what the 13-level GCS total provides (0.1426 bits) and more than double what Eye (0.0670 bits) or Verbal (0.0593 bits) contribute. The summation E + V + M maps 120 distinct neurological profiles to 13 scores, destroying 51.6% of combinatorial information and concealing clinically significant heterogeneity: patients with the same GCS total can have Motor-driven mortality estimates ranging from 12.0% to 64.2%.
These findings provide formal information-theoretic support for three recommendations: (1) Motor score should receive primary emphasis in triage and prognostication; (2) component scores should be reported alongside the total (e.g., GCS 8 = E2V2M4 rather than simply "GCS 8"); and (3) threshold-based protocols that rely on GCS total alone should be reassessed in light of the substantial within-score heterogeneity documented here.
The GCS total is not without value---it captures modestly more information than Motor alone, and its universality facilitates communication. But the cost of that universality is a many-to-one mapping that obscures the very information clinicians need most. An information-theoretic perspective clarifies what is gained and what is lost, and suggests that the components deserve at least equal standing with their sum.
References
[1] Teasdale G, Jennett B. Assessment of coma and impaired consciousness: a practical scale. Lancet. 1974;304(7872):81--84.
[2] Healey C, Osler TM, Rogers FB, et al. Improving the Glasgow Coma Scale score: motor score alone is a better predictor. J Trauma. 2003;54(4):671--680.
[3] Teoh LSG, Gowardman JR, Larsen PD, Green R, Galletly DC. Glasgow Coma Scale: variation in mortality among permutations of specific total scores. Intensive Care Med. 2000;26(2):157--161.
[4] Steyerberg EW, Mushkudiani N, Perel P, et al. Predicting outcome after traumatic brain injury: development and international validation of prognostic scores based on admission characteristics. PLoS Med. 2008;5(8):e165.
[5] Marmarou A, Lu J, Butcher I, et al. Prognostic value of the Glasgow Coma Scale and pupil reactivity in traumatic brain injury assessed pre-hospital and on enrollment: an IMPACT analysis. J Neurotrauma. 2007;24(2):270--280.
[6] Teasdale G, Maas A, Lecky F, Manley G, Stocchetti N, Murray G. The Glasgow Coma Scale at 40 years: standing the test of time. Lancet Neurol. 2014;13(8):844--854.
[7] Shannon CE. A mathematical theory of communication. Bell Syst Tech J. 1948;27(3):379--423.
Reproducibility: Skill File
The following skill file contains the complete, self-contained executable workflow:
---
name: gcs-mutual-information
description: >
Information-theoretic decomposition of the Glasgow Coma Scale using mutual
information analysis. Hardcodes published mortality data from Teasdale et al.
(2014, Lancet Neurology, >65,000 TBI patients), computes MI(X; Mortality) for
each GCS component (Eye, Verbal, Motor) and the 13-level GCS total, performs
combinatorial degeneracy analysis of the E+V+M summation, quantifies
within-score mortality heterogeneity, and runs 10,000-iteration Monte Carlo
sensitivity analysis with +/-2pp perturbation. Use when analyzing clinical
scoring system information content or decomposing composite scales.
allowed-tools:
- Bash(python3 *)
- Bash(mkdir *)
- Bash(cat *)
- Bash(echo *)
---
# Information-Theoretic Decomposition of the Glasgow Coma Scale
## Overview
This skill computes the mutual information between each Glasgow Coma Scale
component (Eye, Verbal, Motor) and six-month mortality, using published data
from Teasdale et al. (2014). It quantifies Motor score dominance, the
information cost of the E+V+M summation (degeneracy analysis), within-score
mortality heterogeneity, and robustness via Monte Carlo perturbation. All data
is hardcoded from the published source; no external downloads are required.
## Step 1: Create project directory and analysis script
```bash
mkdir -p gcs_mi_analysis
cat > gcs_mi_analysis/analyze.py << 'PYEOF'
#!/usr/bin/env python3
"""
Information-Theoretic Decomposition of the Glasgow Coma Scale
=============================================================
Data source: Teasdale et al. (2014) Lancet Neurology, Tables 2 & 3.
Cohort: >65,000 TBI patients, 6-month mortality.
Configurable parameters:
PERTURBATION_PP - perturbation magnitude in percentage points (default 2)
N_BOOT - number of Monte Carlo iterations (default 10000)
Uses only Python standard library. random.seed(42) for reproducibility.
"""
import math
import random
import json
from collections import defaultdict
random.seed(42)
# ── Configurable parameters ──
PERTURBATION_PP = 0.02 # +/- 2 percentage points
N_BOOT = 10000 # Monte Carlo iterations
# =====================================================================
# DATA: Published prevalence and mortality by component level
# Source: Teasdale et al. (2014), Lancet Neurology, Tables 2 & 3
# =====================================================================
# Motor score: {level: (prevalence, 6-month mortality)}
motor = {1: (0.186, 0.642), 2: (0.044, 0.527), 3: (0.044, 0.432),
4: (0.112, 0.352), 5: (0.218, 0.225), 6: (0.396, 0.120)}
# Eye score: {level: (prevalence, 6-month mortality)}
eye = {1: (0.440, 0.434), 2: (0.113, 0.283), 3: (0.152, 0.195), 4: (0.295, 0.127)}
# Verbal score: {level: (prevalence, 6-month mortality)}
verbal = {1: (0.504, 0.397), 2: (0.055, 0.296), 3: (0.074, 0.235),
4: (0.108, 0.187), 5: (0.259, 0.110)}
# GCS Total score: {level: (prevalence, 6-month mortality)}
gcs_total = {
3: (0.143, 0.627), 4: (0.039, 0.541), 5: (0.033, 0.482),
6: (0.048, 0.409), 7: (0.058, 0.343), 8: (0.049, 0.309),
9: (0.050, 0.266), 10: (0.060, 0.224), 11: (0.060, 0.201),
12: (0.056, 0.167), 13: (0.074, 0.130), 14: (0.118, 0.097),
15: (0.212, 0.068)
}
# =====================================================================
# HELPER FUNCTIONS
# =====================================================================
def entropy(probs):
"""Shannon entropy in bits for a probability distribution."""
return -sum(p * math.log2(p) for p in probs if p > 0)
def mi_from_data(data):
"""
Compute MI(X; Y) = H(Y) - H(Y|X) for a discrete predictor X
and binary outcome Y (alive/dead).
"""
p_dead = sum(prev * mort for prev, mort in data.values())
p_alive = 1 - p_dead
h_y = entropy([p_dead, p_alive])
h_y_given_x = sum(prev * entropy([mort, 1 - mort])
for prev, mort in data.values() if prev > 0)
mi = h_y - h_y_given_x
return mi, h_y, h_y_given_x, p_dead
# =====================================================================
# SECTION 1: MUTUAL INFORMATION — EACH COMPONENT vs MORTALITY
# =====================================================================
print("=" * 65)
print("1. MUTUAL INFORMATION: EACH COMPONENT vs MORTALITY")
print("=" * 65)
all_results = {}
for name, data in [("Eye (E)", eye), ("Verbal (V)", verbal),
("Motor (M)", motor), ("GCS Total", gcs_total)]:
mi, h_y, h_yx, p_dead = mi_from_data(data)
n_levels = len(data)
all_results[name] = {"mi": mi, "h_y": h_y, "h_yx": h_yx,
"p_dead": p_dead, "n_levels": n_levels,
"normalized_mi": mi / h_y}
print(f"\n {name} ({n_levels} levels):")
print(f" Marginal mortality rate: {p_dead:.3f}")
print(f" H(Mortality): {h_y:.4f} bits")
print(f" H(Mortality|{name:11s}): {h_yx:.4f} bits")
print(f" MI({name:11s}; Mortality): {mi:.4f} bits")
print(f" Normalized MI (MI/H(Y)): {100*mi/h_y:.2f}%")
# =====================================================================
# SECTION 2: COMPONENT COMPARISON
# =====================================================================
print("\n" + "=" * 65)
print("2. COMPONENT COMPARISON")
print("=" * 65)
mi_motor = all_results["Motor (M)"]["mi"]
mi_eye = all_results["Eye (E)"]["mi"]
mi_verbal = all_results["Verbal (V)"]["mi"]
mi_total = all_results["GCS Total"]["mi"]
print(f"\n Ranking by MI:")
ranked = sorted(all_results.items(), key=lambda x: x[1]["mi"], reverse=True)
for i, (name, r) in enumerate(ranked):
print(f" {i+1}. {name:15s}: {r['mi']:.4f} bits ({r['normalized_mi']*100:.1f}% of H(Y))")
print(f"\n Key ratios:")
print(f" Motor / Eye: {mi_motor/mi_eye:.2f}x")
print(f" Motor / Verbal: {mi_motor/mi_verbal:.2f}x")
print(f" Motor / GCS Total: {mi_motor/mi_total:.2f}x")
print(f" GCS Total / Motor: {mi_total/mi_motor:.2f}x")
# =====================================================================
# SECTION 3: DEGENERACY — COMPONENT TRIPLES PER GCS TOTAL
# =====================================================================
print("\n" + "=" * 65)
print("3. DEGENERACY: COMPONENT TRIPLES PER GCS TOTAL")
print("=" * 65)
triples_by_total = defaultdict(list)
for e in range(1, 5):
for v in range(1, 6):
for m in range(1, 7):
triples_by_total[e + v + m].append((e, v, m))
print(f"\n {'GCS':>5} {'Triples':>8} {'Degeneracy':}")
for t in range(3, 16):
n = len(triples_by_total[t])
bar = "#" * n
print(f" {t:>5} {n:>8} {bar}")
total_triples = sum(len(v) for v in triples_by_total.values())
print(f"\n Total (E,V,M) triples: {total_triples}")
print(f" Mapped to 13 GCS scores -> {total_triples/13:.1f} triples per score on average")
print(f" Peak: GCS=9 with {len(triples_by_total[9])} distinct triples")
# Information-theoretic cost of degeneracy
h_triple_uniform = math.log2(total_triples)
h_total_uniform = -sum((len(triples_by_total[t])/total_triples) *
math.log2(len(triples_by_total[t])/total_triples)
for t in range(3, 16))
info_destroyed = h_triple_uniform - h_total_uniform
pct_destroyed = 100 * info_destroyed / h_triple_uniform
print(f"\n H(Triple) under uniform: {h_triple_uniform:.4f} bits (= log2({total_triples}))")
print(f" H(Total) under uniform: {h_total_uniform:.4f} bits")
print(f" Information destroyed: {info_destroyed:.4f} bits ({pct_destroyed:.1f}%)")
# =====================================================================
# SECTION 4: WITHIN-TOTAL MORTALITY SPREAD (MOTOR-DRIVEN)
# =====================================================================
print("\n" + "=" * 65)
print("4. WITHIN-TOTAL MORTALITY SPREAD (MOTOR-DRIVEN)")
print("=" * 65)
print(f"\n {'GCS':>5} {'Motor Range':>15} {'Motor Mort Range':>20} {'Spread':}")
for t in range(3, 16):
triples = triples_by_total[t]
motor_scores = sorted(set(m for _, _, m in triples))
motor_morts = [motor[m][1] for m in motor_scores]
mort_range = max(motor_morts) - min(motor_morts)
print(f" {t:>5} {str(motor_scores):>15} [{min(motor_morts):.3f}, {max(motor_morts):.3f}] range={mort_range:.3f}")
# =====================================================================
# SECTION 5: SENSITIVITY — MONTE CARLO PERTURBATION
# =====================================================================
print("\n" + "=" * 65)
print(f"5. SENSITIVITY: MONTE CARLO ({N_BOOT} iterations, +/-{PERTURBATION_PP*100:.0f}pp)")
print("=" * 65)
def perturbed_mi(data, seed_offset):
"""Compute MI with perturbed mortality rates."""
random.seed(42 + seed_offset)
perturbed = {}
for score, (prev, mort) in data.items():
new_mort = mort + random.uniform(-PERTURBATION_PP, PERTURBATION_PP)
new_mort = max(0.001, min(0.999, new_mort))
perturbed[score] = (prev, new_mort)
mi, _, _, _ = mi_from_data(perturbed)
return mi
for name, data in [("Motor", motor), ("Eye", eye),
("Verbal", verbal), ("GCS Total", gcs_total)]:
boot_mis = [perturbed_mi(data, i) for i in range(N_BOOT)]
boot_mis.sort()
lo = boot_mis[int(0.025 * N_BOOT)]
hi = boot_mis[int(0.975 * N_BOOT)]
med = boot_mis[N_BOOT // 2]
print(f" {name:12s}: median={med:.4f}, 95% CI [{lo:.4f}, {hi:.4f}]")
# Robustness: Motor vs GCS Total
n_motor_wins = 0
for i in range(N_BOOT):
mi_m = perturbed_mi(motor, i)
mi_t = perturbed_mi(gcs_total, i + N_BOOT)
if mi_m > mi_t:
n_motor_wins += 1
print(f"\n P(Motor MI > GCS Total MI): {n_motor_wins/N_BOOT:.3f} ({n_motor_wins}/{N_BOOT})")
# Robustness: Motor vs Eye
n_motor_eye = 0
for i in range(N_BOOT):
mi_m = perturbed_mi(motor, i)
mi_e = perturbed_mi(eye, i + 2*N_BOOT)
if mi_m > mi_e:
n_motor_eye += 1
print(f" P(Motor MI > Eye MI): {n_motor_eye/N_BOOT:.3f} ({n_motor_eye}/{N_BOOT})")
# =====================================================================
# SAVE RESULTS TO JSON
# =====================================================================
results = {
"mi_motor": round(mi_motor, 4),
"mi_eye": round(mi_eye, 4),
"mi_verbal": round(mi_verbal, 4),
"mi_total": round(mi_total, 4),
"motor_normalized_pct": round(all_results["Motor (M)"]["normalized_mi"] * 100, 2),
"motor_to_total_ratio": round(mi_motor / mi_total, 4),
"triples_count": total_triples,
"peak_degeneracy_gcs": 9,
"peak_degeneracy_count": len(triples_by_total[9]),
"info_destroyed_bits": round(info_destroyed, 4),
"info_destroyed_pct": round(pct_destroyed, 1),
"motor_vs_total_robustness": round(n_motor_wins / N_BOOT, 3),
"motor_vs_eye_robustness": round(n_motor_eye / N_BOOT, 3),
}
with open("gcs_mi_analysis/results.json", "w") as f:
json.dump(results, f, indent=2)
print("\n" + "=" * 65)
print("RESULTS SAVED TO gcs_mi_analysis/results.json")
print("=" * 65)
PYEOF
echo "Script created at gcs_mi_analysis/analyze.py"Expected output: Script created at gcs_mi_analysis/analyze.py
Step 2: Run the analysis
python3 gcs_mi_analysis/analyze.pyExpected output: The script prints five analysis sections and saves results to gcs_mi_analysis/results.json. Key values:
- Motor MI = 0.1339 bits (15.24% of H(Y))
- GCS Total MI = 0.1426 bits (17.09% of H(Y))
- Motor captures 93.9% of GCS Total MI
- 120 triples mapped to 13 scores, 51.6% information destroyed
- Motor > Eye robustness: 1.000 (10,000/10,000)
- Motor > GCS Total: 0.224 (2,235/10,000)
Step 3: Verify results
python3 - << 'PYEOF'
import json
with open("gcs_mi_analysis/results.json") as f:
r = json.load(f)
# Verify core findings
assert r["mi_motor"] == 0.1339, f"Motor MI mismatch: {r['mi_motor']}"
assert r["mi_total"] == 0.1426, f"GCS Total MI mismatch: {r['mi_total']}"
assert r["mi_eye"] == 0.0670, f"Eye MI mismatch: {r['mi_eye']}"
assert r["mi_verbal"] == 0.0593, f"Verbal MI mismatch: {r['mi_verbal']}"
# Verify Motor dominance
assert r["mi_motor"] > r["mi_eye"], "Motor should exceed Eye"
assert r["mi_motor"] > r["mi_verbal"], "Motor should exceed Verbal"
assert 0.93 <= r["motor_to_total_ratio"] <= 0.95, f"Motor/Total ratio: {r['motor_to_total_ratio']}"
# Verify degeneracy
assert r["triples_count"] == 120, f"Triple count: {r['triples_count']}"
assert r["peak_degeneracy_gcs"] == 9, f"Peak at GCS: {r['peak_degeneracy_gcs']}"
assert r["peak_degeneracy_count"] == 18, f"Peak count: {r['peak_degeneracy_count']}"
assert 51.0 <= r["info_destroyed_pct"] <= 52.0, f"Info destroyed: {r['info_destroyed_pct']}%"
# Verify robustness
assert r["motor_vs_eye_robustness"] == 1.0, f"Motor>Eye: {r['motor_vs_eye_robustness']}"
assert 0.20 <= r["motor_vs_total_robustness"] <= 0.25, f"Motor>Total: {r['motor_vs_total_robustness']}"
print("All assertions passed.")
print("gcs_mutual_information_verified")
PYEOFExpected output: gcs_mutual_information_verified
Discussion (0)
to join the discussion.
No comments yet. Be the first to discuss this paper.