Abstract
Expected Threat (xT) describes a spatial potential for scoring before a shot is taken. This study separates state valuation from action accounting and decision quality. We process the 101,759 Wyscout records for all 64 matches of the 2018 men's FIFA World Cup, retain 56,520 regular-half passes and shots, and evaluate an explicitly restricted chain-threat model on chronologically later matches. A 96-zone grid selected by validation achieves held-out Brier loss 0.0041684; deleting pass-chain terminations increases loss to 0.0050891 and mean predicted probability to 3.414% against 0.447% observed. Against a direct empirical location model, the Markov advantage is small and uncertain. An independent flow audit reconciles signed pass and shot values to numerical precision. A separate decision-theoretic counterexample demonstrates why successful-move credit cannot rank attempted actions without their continuation probability and defensive consequence. These are historical event-chain results, not a full-possession xT benchmark or causal player rankings.
1. The value of an action before a shot
An assist identifies the final credited pass before a goal. Expected goals evaluates the quality of a shot. Neither alone describes the movements that made the opportunity possible. A switch of play, an escape from pressing or a sequence that creates a passing lane may change the probability of scoring without yielding an immediate shot. Expected Threat (xT) formalizes a useful narrower question: how promising is a location when historical attacking behavior can move the ball onward?
Three propositions guided this analysis before the calculations; they were not externally preregistered. First, removing observed pass-chain terminations from the fitted transition denominator raises estimated threat and worsens probability calibration for the original target. Second, increasing spatial resolution need not improve performance on later matches, because the rare goal signal must be estimated from fewer observations in each cell. Third, positive-only progression accounting and signed accounting with a terminal debit can differ substantially. We separately test whether a recursive location model improves upon an empirical location-frequency baseline, a stronger comparator than a constant prior. Its superiority is not assumed. Our contribution is an executed, reproducible audit of these questions on a complete historical tournament, not a claim to have invented xT or Markov models.
The research distinguishes four quantities: the probability associated with a state, the realized change of state value after an action, the expected value of an attempted action before its result is known, and the causal contribution of a particular player. These quantities have different information requirements. Confusing them creates attractive visualizations but unreliable conclusions about decision-making, player recruitment and team strength.
2. Prior work and competing approaches
Singh's original formulation [1] models shot versus move probabilities, the conversion of shots and transitions among pitch zones. Its key advantage is interpretability: a move can receive credit before a shot exists. The reference implementation documented by socceraction [2] rates successful ball movements, not failed movements or defensive actions. This is a legitimate narrower action-value definition; it should not be presented as a complete accounting of attempts. The original exposition explicitly identifies successful-move selection and the path-independence property as simplifying choices.
VAEP, introduced by Decroos and colleagues [3], uses contextual event features and distinguishes probabilities of scoring and conceding. Van Roy and colleagues [4] compare VAEP with xT and describe differences in player rankings and action interpretation. A turnover can carry defensive consequences even when its offensive continuation value is zero; a backwards pass can also open space while receiving negative static spatial credit. Our ablation is not a reimplementation of VAEP or a claim that every published xT fit omits failed attempts. It is an intentionally incomplete fit to a fixed, well-defined chain target.
Tracking-based expected possession value [5] conditions the forecast on spatial configurations of players and the ball. Hassani, Ramdani and Lotfi's 2025 dynamic xT research [6] extends spatial evaluation using off-ball positions. Le Coz, Boustila and Imbach's May 18, 2026 paper [7] studies temporal possession value using semi-Markov durations and compares time-bounded models against a matched horizon baseline. The authors report advantages at some horizons but also note an infinite-horizon model has better Brier loss at their long-horizon comparison. The results address a different event target and dataset, so their scores cannot be ranked against ours. Discrete-step Markov xT itself does not imply exponentially distributed physical waiting times unless one adds that assumption. The distinction motivates testing spatial, temporal and contextual improvements separately.
Role-aware assessment is also important: Pappalardo and colleagues' PlayeRank research [8] offers a different multivariate framework. A central defender and winger face different opportunities to advance the ball. More complex state representations may improve prediction but increase variance, data requirements and the difficulty of auditing estimates. The correct comparator depends on the intended use, and no action-value metric alone measures the complete footballer.
3. Data provenance, population and exclusions
We accessed the Wyscout collection described in Scientific Data [9], published October 28, 2019, and the Pappalardo–Massucco collection [10] on December 3, 2026 (Dallas local date). The 2018 World Cup took place June 14–July 15 [11]. The open collection is attributed to Wyscout and its authors, with CC BY 4.0 release documented by the dataset materials. We retrieved the 64 individually indexed processed-v2 match files from Koen Vossen's mirror [12] at immutable commit ebc4c54c1093c420a81ce442c69e4186fab33bb4. Direct Figshare download was unavailable from this runtime; the mirror is the actual ingestion source, and its transformation and original-source byte equivalence have not been independently verified. Its aggregate event count exactly matches the published 101,759-record inventory. We do not imply the whole seven-competition collection was analyzed.
The observation unit is a valid regular-half pass (eventId 8) or shot (eventId 10), in original file order. Retain periods 1H and 2H only, exclude extra time and shootouts, free-kick event category and other annotations. Require valid attacking-relative coordinates in [0,100] at the origin, also at the destination for passes, a finite event timestamp and a nonzero team identifier. Reject duplicate event IDs or mismatched match IDs. Accurate pass means tag 1801 and not 1802; goal means a shot with tag 101. Every retained pass has an unambiguous accuracy tag. Four otherwise eligible records fail coordinate/time/team validation. We do not attempt to reproduce the official 169 tournament goals: this restricted event target retains 125 goal-tagged shots, excluding certain goals outside the regular-half shot category.
Define a strict continuation when an accurate pass is immediately followed in the original, unfiltered record stream by another eligible pass or shot from the same team in the same half, with nondecreasing timestamp. Use the next eligible action's start zone only when it is literally adjacent in the raw list; an intervening excluded event breaks the chain. A shot always terminates, as does any pass without a qualifying continuation. Consequently a successful pass followed by a dribble, duel, restart, a different team event or a missing annotation can terminate a chain without actually losing the ball. This deliberately conservative rule does not identify full football possessions, and a terminal debit below is not a measured turnover penalty. The target label is one if the current action or a continuation of its strict chain ends with a goal-tagged shot, otherwise zero. Derive labels by backwards traversal within a match; never use them as prediction features. This measures probability at the start of a recorded eligible action, not the probability for an arbitrary second of match time.
Training uses the first two group rounds, 32 matches from June 14–24; validation uses the 16 final group matches, June 25–28; test uses all 16 knockout-phase fixtures including the third-place match, June 30–July 15. Only the regular halves count even in knockout matches that proceeded to extra time. We choose the grid by validation Brier loss, fit all model parameters exclusively on the training block and do not refit on validation. No model selection is based on test outcomes. This is a retrospective, temporally separated study; teams repeat across blocks and knockout qualification changes the population, so it is not external league validation or a prospective live feed.
Across 64 files we retain 55,143 passes and 1,377 shots (56,520 eligible events). Among 46,999 accurate passes, 36,545 qualify as continuations and 10,454 do not. There are 213 positive action labels, only 125 terminal goals. A goal-ending chain may create several positive labels, so treating them as independent goals would be incorrect. The three splits respectively contain 28,266, 14,155 and 14,099 eligible records, with 93, 57 and 63 positive labels. The training prior is 93/28,266=0.00329017; validation and test prevalence are 0.00402685 and 0.00446840. Rare events and dependency govern the evaluation.
| Split | Matches | Records | Eligible | Passes | Shots | Positive |
|---|---|---|---|---|---|---|
| Training | 32 | 49,890 | 28,266 | 27,579 | 687 | 93 |
| Validation | 16 | 24,585 | 14,155 | 13,830 | 325 | 57 |
| Test | 16 | 27,284 | 14,099 | 13,734 | 365 | 63 |
4. Absorbing chains and estimators
Let i be an origin zone and j a continuation zone. The coordinate convention is already attacking-relative, so x=100 points toward the opponent's goal for both teams and no halftime flip is needed [9]. Partition the unit-normalized pitch into 6×4, 12×8 and 16×12 rectangular grids. The index is row-major, with x increasing toward goal, and coordinates at 100 clipped into the final cell. For each training cell record Nᵢ eligible actions, Gᵢ immediate goal endings, Lᵢ pass terminations, Yᵢ positive labels and Cᵢⱼ continuations. All remaining eligible actions are shots ending the chain. The derived match-level aggregates contain these counts, plus accurate pass endpoint counts for the separate accounting audit.
Set α=5 pseudo-actions per zone and μ to the training label prevalence; this fixed smoothing is an illustrative regularizer, not empirically optimized. The full estimator sets gᵢ=(Gᵢ+αμ)/(Nᵢ+α) and Qᵢⱼ=Cᵢⱼ/(Nᵢ+α). A synthetic terminal goal with probability μ and non-goal with probability 1−μ is added in the same prior mass. As Q is nonnegative with every row sum strictly below one, the spectral radius is below one and the unique fixed point V=g+QV exists in [0,1]. Starting at zero, V^(k)=Σ_{h=0}^{k−1}Qʰg is the k-step scoring probability under the fitted pseudo-count model. The limit is (I−Q)⁻¹g. This is an observational pooled policy, not the Bellman optimality equation; replacing the historical transition mixture by a maximum over possible passes would change the estimand and require an action-specific model.
Compare four forecasts on precisely the same test labels. The constant baseline is μ. The direct baseline is Dᵢ=(Yᵢ+αμ)/(Nᵢ+α), which measures empirical strict-chain success from each origin without imposing spatial memorylessness. The full recursive model uses all eligible actions. The pass-termination-blind ablation replaces its denominator by Nᵢ−Lᵢ+α while keeping G and C unchanged. This estimates a different synthetic transition policy that deletes both inaccurate passes and accurate boundary-ending passes. Its intentionally mismatched use on the original target is a diagnostic of selection, not an assertion about a named provider's methodology.
Elementwise g_blind≥g_full and Q_blind≥Q_full, so monotonic iteration establishes V_blind≥V_full for each cell. The inequality follows without a statistical test. Whether it damages out-of-sample prediction is empirical. The smoothing mass ensures contraction even where a zone rarely terminates naturally. We independently solve each of six systems by pivoted Gaussian elimination and compare against the iterative method, requiring agreement within 10⁻¹⁰. All three grids have no empty training cells. The fine grid still has greater data fragmentation and a fixed pseudo-count can exert a stronger influence.
The primary proper score is binary Brier loss, mean (p−y)². Log loss is mean −[y log p+(1−y)log(1−p)]; both reward honest probabilities under the usual expected-score conditions [13]. Report mean prediction versus prevalence and tie-adjusted ROC AUC, which evaluates ranking but not probability calibration. Because several records share outcomes within chains, use a paired match-cluster bootstrap on the 16 test matches: 2,000 resamples of 16 matches with replacement, event-weighted losses, fixed LCG seed 20261203, percentile endpoints at zero-based ranks 50 and 1949. The interval is conditional on the fitted training model, the split and this small set of matches; it does not include training, source or population-shift uncertainty. No formal multiple-testing significance claim is made.
5. Held-out performance: what spatial recursion really adds
Validation chooses 12×8. Full-model Brier losses for 6×4, 12×8 and 16×12 are 0.00384399, 0.00362592 and 0.00365285. Held-out losses are 0.00428701, 0.00416842 and 0.00428969 respectively. The 192-cell model is worse than the 96-cell model here, despite greater spatial detail; this is not proof that 96 is universally optimal. The fixed smoothing strength, rare terminal goals, and knockout shift are plausible explanations. Our independent solver agrees to better than 2.5×10⁻¹² across the six systems. The 96-cell full fit needs 57 iterations at the stated tolerance.
The selected full model has test Brier 0.00416842, log loss 0.02135997, AUC 0.897524, and mean predicted probability 0.415322% versus observed 0.446840%. The constant prior Brier is 0.00444982 and log loss 0.02882590. The matched direct model has Brier 0.00417634, log loss 0.02220228 and AUC 0.900201. Thus recursion improves Brier relative to direct by only 0.00000792 while direct actually ranks slightly better by AUC. The paired bootstrap interval for direct minus full Brier is [−0.00000661, 0.00002068]. The point estimate favors recursion but the interval includes zero. We cannot establish superiority to the simpler empirical location estimator. In contrast, constant minus full Brier is 0.00028140, with interval [0.00006222, 0.00050943].
The blind model predicts a mean 3.413561%, 7.64 times the observed 0.446840%. Its Brier is 0.00508909, log loss 0.04660318 and AUC 0.825367. The full model reduces Brier by approximately 18.09% relative to the blind ablation, with paired absolute loss difference 0.00092067 and interval [0.00074583, 0.00102761]. The result confirms that the termination denominator matters for this particular chain target. It does not quantify how much conventional full-possession xT overestimates risk in the real world. The ablation intentionally discards accurate chain boundaries as well as failed passes.
The surface's maximum value is 0.264411 in a central zone immediately before the opponent's goal. Origin zones in the final x column average 0.045113 weighted by training action counts; the first column averages 0.0004434. These values should not be compared directly to published xT maps because our chain definition is substantially shorter. The calibration table exposes meaningful departures from perfect calibration, especially in the 1–5% bin, where 570 events yield 17 positives. The high-probability bin contains only 233 events, 24 positives and a predicted mean of 12.208%. Calibration-in-the-large is not a substitute for reliability across zones or action types. Low absolute Brier losses partly reflect a rare target, not near-perfect football forecasting.
| Grid | Validation | Test |
|---|---|---|
| 6×4 | 0.00384399 | 0.00428701 |
| 12×8 | 0.00362592 | 0.00416842 |
| 16×12 | 0.00365285 | 0.00428969 |
| Model | Brier | Log loss | AUC | Mean prediction |
|---|---|---|---|---|
| Constant | 0.00444982 | 0.028826 | 0.500000 | 0.329017% |
| Direct location frequency | 0.00417634 | 0.022202 | 0.900201 | 0.338135% |
| Full chain | 0.00416842 | 0.021360 | 0.897524 | 0.415322% |
| Pass-termination blind | 0.00508909 | 0.046603 | 0.825367 | 3.413561% |
| Comparator | Difference | Lower bound | Upper bound |
|---|---|---|---|
| Constant | 0.00028140 | 0.00006222 | 0.00050943 |
| Direct location frequency | 0.00000792 | -0.00000661 | 0.00002068 |
| Pass-termination blind | 0.00092067 | 0.00074583 | 0.00102761 |
| y/x | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 0.051% | 0.031% | 0.037% | 0.041% | 0.051% | 0.070% | 0.100% | 0.131% | 0.226% | 0.309% | 0.639% | 0.399% |
| 2 | 0.053% | 0.041% | 0.037% | 0.050% | 0.073% | 0.089% | 0.119% | 0.186% | 0.294% | 0.590% | 0.611% | 0.645% |
| 3 | 0.050% | 0.035% | 0.040% | 0.051% | 0.079% | 0.100% | 0.175% | 0.261% | 0.351% | 1.584% | 6.744% | 1.044% |
| 4 | 0.036% | 0.034% | 0.045% | 0.069% | 0.079% | 0.110% | 0.155% | 0.256% | 0.443% | 1.497% | 10.322% | 26.012% |
| 5 | 0.033% | 0.028% | 0.049% | 0.053% | 0.073% | 0.109% | 0.140% | 0.283% | 0.706% | 1.058% | 7.538% | 26.441% |
| 6 | 0.054% | 0.033% | 0.040% | 0.055% | 0.076% | 0.098% | 0.156% | 0.230% | 0.434% | 1.492% | 1.311% | 1.845% |
| 7 | 0.055% | 0.039% | 0.037% | 0.048% | 0.077% | 0.089% | 0.121% | 0.191% | 0.285% | 0.530% | 0.838% | 1.337% |
| 8 | 0.049% | 0.037% | 0.031% | 0.043% | 0.050% | 0.069% | 0.108% | 0.143% | 0.289% | 0.325% | 0.591% | 0.154% |
| Bin | N | Positive | Predicted mean | Observed |
|---|---|---|---|---|
| 0.0%–0.1% | 6,512 | 4 | 0.0587% | 0.0614% |
| 0.1%–0.3% | 4,975 | 4 | 0.1878% | 0.0804% |
| 0.3%–1.0% | 1,809 | 14 | 0.4895% | 0.7739% |
| 1.0%–5.0% | 570 | 17 | 1.4205% | 2.9825% |
| 5.0%–100.0% | 233 | 24 | 12.2082% | 10.3004% |
6. Signed action accounting: conservation and the cost of censoring
On the frozen test block there are 13,734 passes; 11,664 have accurate tags, 9,031 continue the strict chain and 4,703 terminate. Of the terminations, 2,633 are accurate passes and 2,070 are inaccurate. Using the selected surface, score continuation as V(next start)−V(origin) and a pass termination as −V(origin). Positive-only continuation credit sums to 16.187612; signed continuation credit is 11.415571; terminal debit is −16.628213. Net pass accounting becomes −5.212642. Among continuing passes, 4,787 are positive, 3,842 negative and 402 exactly zero. Positive-only credit discards negative moves even before terminating actions are considered. These sums are dimensionless probability units across actions, not observed goals, xG or an estimate of how many goals a player caused.
The distinct endpoint diagnostic instead rates all 11,664 accurate passes by their tagged destination rather than the next eligible start. Positive-only credit is 36.974069 and signed credit 30.773369. These numbers are not commensurable with the restricted chain-flow sum, because an endpoint need not be the origin of the next state. The contrast demonstrates why two pipelines with the same spatial surface can disagree just through action and boundary conventions. Neither diagnostic demonstrates that completed passes are bad or good in an absolute sense.
An independent conservation check uses incoming transition counts to recover 5,068 test-chain starts. Summed starting-state threat is 27.905283. There are 36 terminal goal shots; signed shot credit Σ(1_goal−V(origin))=13.307360. Hence signed pass plus shot credit is 8.094717, equal to terminal goals minus initial threat (36−27.905283) within 2.5×10⁻¹⁴. Telescoping is an accounting identity on coherent states: Σ(V_next−V_current)=V_terminal−V_start. A backward pass can enable a later advance; a static potential cannot allocate extra credit to a closed spatial loop unless state variables change. Positive-only credit intentionally breaks this conservation. The identity is an audit, not causal proof or a calibration guarantee.
| Method | Credit |
|---|---|
| Positive continuation only | 16.187612 |
| Signed continuation | 11.415571 |
| Termination debit | -16.628213 |
| All signed passes | -5.212642 |
7. Counterexample: decision quality is not successful-action credit
Consider a hypothetical origin V=0.02. Action A succeeds with probability 0.30 and moves to value 0.15; B succeeds with probability 0.90 and moves to 0.07. Assume an offensive failure has zero continuation value, no competing reward, and known probabilities. Conditional successful-action changes are +0.13 and +0.05, favoring A. Before execution the offensive changes are pV_destination−V_origin: +0.025 and +0.043, favoring B. If a failure instead gives an opponent expected value of 0.04 on a compatible signed utility scale, the net decision values become −0.003 and +0.039. These are illustrative exact calculations; no actual player, completion model or opponent danger estimate is inferred.
The offensive break-even continuation probability is V_origin/V_destination=13.33% for A. With the stipulated counterattack cost it is (V_origin+0.04)/(V_destination+0.04)=31.58%. The threshold is conditional on the simplified binary outcome model, not a universal passing rule. Real options include deflections, recoveries, foul wins, shots, and new possessions; opposing threat must be estimated over the same horizon and reward definition. A model that observes only successful moves cannot infer unchosen destinations or the probability of an attempt succeeding. Decision quality requires an opportunity set and an explicit counterfactual model.
| Action | Success | Successful credit | Expected offense | Expected net |
|---|---|---|---|---|
| A | 30% | 0.130 | 0.025 | -0.003 |
| B | 90% | 0.050 | 0.043 | 0.039 |
8. Implications, limitations and falsification protocol
The next empirical question is whether richer possession segmentation and a time-, score-, pressure- and role-conditioned state produce lower chronological held-out proper scores than both the direct spatial estimator and the full recursive baseline. Preregister comparable labels before evaluation. Acquire lawful event and, where available, tracking data, preserve direction, event lineage and provenance, and validate possession boundaries against a reviewed sample. Freeze features at action start; do not use realized destination, subsequent action, final score or end-of-possession labels as inputs to pre-action predictions. A separate realized-action valuation may use the observed post-action state. Estimate pass completion, continuation and counterattack models independently; evaluate calibration by action type, role and competition. Quantify uncertainty with blocks or clusters and refitting, and test league, season and women's football transfer independently. If contextual models fail to improve held-out proper scores, or gains vanish under alternate boundary definitions, the proposed advantage is unsupported.
The current tournament is historical men's international football, not a contemporary representative club census. The strict chain can end at ordinary event annotations; possession segmentation is its largest limitation. No carries or off-ball tracking enter this model, no pressure or opponent state is used, and the location-only Markov property is an approximation. The mirror may differ from the original publication at record level, and the cluster bootstrap has only 16 independent match units under its resampling assumption. Teams repeat, training uncertainty is unaccounted for and the full test results for all grids are sensitivity reporting rather than a license to choose a new winning grid. No causal ranking, live model skill claim or betting recommendation follows.
Cateo's verified public Academy and methodology document probabilistic evaluation and historical evidence boundaries. A research extension can place an explicitly versioned threat layer between player event data and forecast features: boundary contract, fitted spatial baseline, direct empirical comparator, time-dependent state, defensive risk, and held-out validation. These are proposed engineering capabilities, not claims that Atlas, Vortex, Titan, Axiom or NEXUS already use this model. Preserve successful-move xT for a narrow descriptive purpose, publish signed and positive-only credit separately, and expose attempted-action denominators and uncertainty. Do not add summed xT to summed xG as though they were independent goals; both describe related opportunities.
Data and code availability: the pinned CC BY 4.0 historical mirror and original dataset are linked; all 64 source files were retrieved for this research. Match-level transformed counts, transition matrices, calibration, paired match losses, execution code and results are preserved in the journal repository. The public page includes a self-contained extraction and calculation script that can obtain the same versioned public inputs; it does not require private repository access. No raw player records are republished, no paid provider or private forecasting records were used. Research and source-access cutoff December 3, 2026; event cutoff July 15, 2018. AI-assisted research by Cateo Research, Tira Palos LLC, operator of the commercial platform Cateo.ai; no institutional affiliation or external peer review. Internal numerical checks are not peer review. No external funding or neutrality claim is made.
Reproducible code and provenance
Save as reproduce.mjs and run with Node.js 20 or later and Internet access. Original data are from Wyscout and Pappalardo et al.; counts and surfaces are Cateo Research transformations. CC BY 4.0.
// CRJ-2026-010 | Node.js 20+ | save as reproduce.mjs and run: node reproduce.mjs
// Data: Wyscout, Pappalardo et al. (2019), DOI 10.1038/s41597-019-0247-7
// Pappalardo & Massucco, https://doi.org/10.6084/m9.figshare.c.4415000.v5
// Source data CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
// Transformed event-chain counts; no raw files are published by Cateo.
// Actual source: Vossen processed-v2 match mirror at fixed revision.
// Source files are fetched from their public repository, not from Cateo.
// Wyscout event data, Pappalardo et al. 2019, CC BY 4.0. Derived counts only.
function extract(id,events){
const grids=[[6,4],[12,8],[16,12]],stats={raw:events.length,invalid:0,passes:0,shots:0,accurate:0,ambiguous:0,goals:0,continued:0,terminalAcc:0,backwards:0,positive:0},seen=new Set();
const valid=p=>p&&Number.isFinite(p.x)&&Number.isFinite(p.y)&&p.x>=0&&p.x<=100&&p.y>=0&&p.y<=100;
const has=(e,t)=>e.tags?.some(x=>x.id===t)===true;
const a=events.map(e=>{if(e.matchId!==id||seen.has(e.id))throw Error("ID mismatch/duplicate "+id);seen.add(e.id);if(!["1H","2H"].includes(e.matchPeriod)||![8,10].includes(e.eventId))return null;if(!valid(e.positions?.[0])||(e.eventId===8&&!valid(e.positions?.[1]))||!Number.isFinite(e.eventSec)||!e.teamId){stats.invalid++;return null;}const pass=e.eventId===8,ok=pass&&has(e,1801)&&!has(e,1802),goal=!pass&&has(e,101);stats.passes+=+pass;stats.shots+=+!pass;stats.accurate+=+ok;stats.ambiguous+=+(pass&&has(e,1801)===has(e,1802));stats.goals+=+goal;return {p:e.matchPeriod,t:e.eventSec,team:e.teamId,pos:e.positions[0],end:pass?e.positions[1]:null,pass,ok,goal}});
const agg=grids.map(([nx,ny])=>({nx,ny,N:{},Q:{},A:{}}));let label=0;
for(let i=a.length-1;i>=0;i--){const r=a[i],n=a[i+1];if(!r){label=0;continue}if(n&&r.p===n.p&&r.t>n.t)stats.backwards++;
const link=!!(r.ok&&n&&r.team===n.team&&r.p===n.p&&r.t<=n.t);
label=r.goal?1:link?label:0;stats.continued+=+link;stats.terminalAcc+=+(r.ok&&!link);stats.positive+=label;
for(const g of agg){const z=p=>Math.min(g.ny-1,Math.floor(p.y*g.ny/100))*g.nx+Math.min(g.nx-1,Math.floor(p.x*g.nx/100)),j=z(r.pos);const v=g.N[j]??(g.N[j]=[0,0,0,0]);v[0]++;v[1]+=+r.goal;v[2]+=+(r.pass&&!link);v[3]+=label;if(link){const k=j+":"+z(n.pos);g.Q[k]=(g.Q[k]??0)+1}if(r.ok){const k=j+":"+z(r.end);g.A[k]=(g.A[k]??0)+1}}}
return {id,split:id>=2058002?"test":((id-2057954)%6<4?"train":"validation"),...stats,agg};
}
function analyse(matches){
const grids=[[6,4],[12,8],[16,12]],alpha=5;
const sum=(xs,fn)=>xs.reduce((s,x)=>s+fn(x),0),group=s=>matches.filter(m=>m.split===s),train=group("train"),val=group("validation"),test=group("test");
if(matches.length!==64||new Set(matches.map(x=>x.id)).size!==64||sum(matches,m=>m.raw)!==101759)throw Error("source coverage mismatch");
const counts=xs=>Object.fromEntries(["raw","invalid","passes","shots","accurate","ambiguous","goals","continued","terminalAcc","backwards","positive"].map(k=>[k,sum(xs,m=>m[k])]).concat([["matches",xs.length],["eligible",sum(xs,m=>m.passes+m.shots)]]));
const bySplit={train:counts(train),validation:counts(val),test:counts(test),all:counts(matches)},prior=bySplit.train.positive/bySplit.train.eligible;
function fit(idx){
const [nx,ny]=grids[idx],n=nx*ny,N=Array(n).fill(0),G=N.slice(),L=N.slice(),Y=N.slice(),Q=Array.from({length:n},()=>Array(n).fill(0));
for(const m of train){let a=m.agg[idx];for(const [i,v] of Object.entries(a.N)){N[i]+=v[0];G[i]+=v[1];L[i]+=v[2];Y[i]+=v[3]}for(const [k,c] of Object.entries(a.Q)){let [i,j]=k.split(":").map(Number);Q[i][j]+=c}}
if(sum(N,x=>x)!==bySplit.train.eligible||sum(Y,x=>x)!==bySplit.train.positive||sum(G,x=>x)!==bySplit.train.goals||sum(Q,r=>sum(r,x=>x))!==bySplit.train.continued||sum(L,x=>x)!==bySplit.train.passes-bySplit.train.continued)throw Error("aggregate integrity mismatch");
const direct=N.map((v,i)=>(Y[i]+alpha*prior)/(v+alpha)),constant=N.map(()=>prior);
function solve(blind){
const denom=N.map((v,i)=>v+alpha-(blind?L[i]:0)),g=G.map((v,i)=>(v+alpha*prior)/denom[i]),q=Q.map((r,i)=>r.map(v=>v/denom[i]));
let v=Array(n).fill(0),iterations=0,err;do{const w=g.map((x,i)=>x+sum(q[i],(a)=>0));for(let i=0;i<n;i++)for(let j=0;j<n;j++)w[i]+=q[i][j]*v[j];err=Math.max(...w.map((x,i)=>Math.abs(x-v[i])));v=w;iterations++;if(iterations>100000)throw Error("convergence")}while(err>1e-13);
const A=q.map((r,i)=>r.map((x,j)=>(i===j?1:0)-x).concat(g[i]));
for(let i=0;i<n;i++){let p=i;for(let j=i+1;j<n;j++)if(Math.abs(A[j][i])>Math.abs(A[p][i]))p=j;[A[i],A[p]]=[A[p],A[i]];let pivot=A[i][i];if(Math.abs(pivot)<1e-14)throw Error("singular");for(let k=i;k<=n;k++)A[i][k]/=pivot;for(let j=0;j<n;j++)if(j!==i){const f=A[j][i];for(let k=i;k<=n;k++)A[j][k]-=f*A[i][k];}}
const agreement=Math.max(...v.map((x,i)=>Math.abs(x-A[i][n])));if(agreement>1e-10||v.some(x=>x<0||x>1))throw Error("solution check");return {v,iterations,agreement}
}
const full=solve(false),blind=solve(true);if(full.v.some((x,i)=>x>blind.v[i]+1e-12))throw Error("termination ablation inequality");
function score(xs,vs){let n=0,b=0,l=0,mean=0,pos=0;const cells=Array.from({length:vs.length},()=>[0,0]);for(const m of xs)for(const [i,a] of Object.entries(m.agg[idx].N)){const p=vs[i],c=a[0],y=a[3];n+=c;b+=y*(1-p)**2+(c-y)*p*p;l-=y*Math.log(p)+(c-y)*Math.log1p(-p);mean+=c*p;pos+=y;cells[i][0]+=c;cells[i][1]+=y;}
const ranked=cells.map(([count,positive],i)=>({p:vs[i],count,positive})).filter(c=>c.count).sort((a,b)=>a.p-b.p);let below=0,concord=0;for(let i=0;i<ranked.length;){let j=i,c=0,y=0;while(j<ranked.length&&ranked[j].p===ranked[i].p){c+=ranked[j].count;y+=ranked[j].positive;j++}concord+=y*(below+(c-y)/2);below+=c-y;i=j}
return {n,brier:b/n,logloss:l/n,mean:mean/n,observed:pos/n,auc:concord/(pos*(n-pos))}}
const models={constant,direct,full:full.v,blind:blind.v};const metrics=Object.fromEntries(Object.entries(models).map(([k,v])=>[k,{validation:score(val,v),test:score(test,v)}]));
return {nx,ny,N,G,L,Y,Q,models,metrics,iterations:[full.iterations,blind.iterations],agreement:[full.agreement,blind.agreement],empty:N.filter(x=>!x).length}
}
const fitted=grids.map((_,idx)=>fit(idx)),chosen=fitted.reduce((a,b)=>a.metrics.full.validation.brier<=b.metrics.full.validation.brier?a:b),idx=fitted.indexOf(chosen);
const {nx,ny,models}=chosen;
let kept=0,positiveOnly=0,successNet=0,terminalDebit=0,negativeKept=0,positiveKept=0,completedEndpointNet=0,completedEndpointPositive=0,completed=0;
const cluster=[];for(const m of test){let delta=0,directDelta=0,fullConstant=0,n=0;const a=m.agg[idx];
for(const [i,v] of Object.entries(a.N)){const p=models.full[i],c=v[0],y=v[3],loss=q=>y*(1-q)**2+(c-y)*q*q;n+=c;delta+=loss(models.blind[i])-loss(p);directDelta+=loss(models.direct[i])-loss(p);fullConstant+=loss(models.constant[i])-loss(p);terminalDebit-=v[2]*p}
for(const [k,c] of Object.entries(a.Q)){const [i,j]=k.split(":").map(Number),d=models.full[j]-models.full[i];kept+=c;successNet+=c*d;positiveOnly+=c*Math.max(0,d);if(d<0)negativeKept+=c;if(d>0)positiveKept+=c}
for(const [k,c] of Object.entries(a.A)){const [i,j]=k.split(":").map(Number),d=models.full[j]-models.full[i];completed+=c;completedEndpointNet+=c*d;completedEndpointPositive+=c*Math.max(0,d)}
cluster.push({id:m.id,n,delta,directDelta,fullConstant})}
let seed=20261203;const rnd=()=>{seed=(Math.imul(seed,1664525)+1013904223)>>>0;return seed/4294967296};
const boot={};for(const key of ["delta","directDelta","fullConstant"]){let draws=[];for(let b=0;b<2000;b++){let num=0,den=0;for(let k=0;k<cluster.length;k++){let c=cluster[Math.floor(rnd()*cluster.length)];num+=c[key];den+=c.n}draws.push(num/den)}draws.sort((a,b)=>a-b);boot[key]=[draws[50],draws[1949]];}
const regions=[];for(let x=0;x<nx;x++){let w=0,p=0,b=0,g=0;for(let y=0;y<ny;y++){let j=y*nx+x;w+=chosen.N[j];p+=chosen.N[j]*models.full[j];b+=chosen.N[j]*models.blind[j];g+=chosen.G[j]}regions.push({x,n:w,full:w?p/w:null,blind:w?b/w:null,immediate:w?g/w:null});}
return {bySplit,prior,alpha,chosen:{nx,ny},fits:fitted.map(f=>({nx:f.nx,ny:f.ny,empty:f.empty,metrics:f.metrics,iterations:f.iterations,agreement:f.agreement})),regions,attribution:{pass:bySplit.test.passes,kept,completed,positiveOnly,successNet,allNet:successNet+terminalDebit,terminalDebit,negativeKept,positiveKept,completedEndpointNet,completedEndpointPositive},bootstrap:boot,cluster,surface:models.full,blindSurface:models.blind,trainZoneCounts:chosen.N,trainGoalCounts:chosen.G,trainPassTerminalCounts:chosen.L,trainLabelCounts:chosen.Y,trainTransitionCounts:chosen.Q,matchCounts:matches.map(({agg,...m})=>m)}
}
function audit(matches,R){
const v=R.surface,idx=1, n=v.length;let total=0,shotValue=0,starts=0,startThreat=0,goal=0,passValue=0;
const bins=[0,.001,.003,.01,.05,1.000001].slice(0,-1).map((lo,i)=>({lo,hi:[.001,.003,.01,.05,1.000001][i],n:0,y:0,p:0}));
for(const m of matches){let a=m.agg[idx],incoming=Array(n).fill(0),out=Array(n).fill(0);for(const [k,c] of Object.entries(a.Q)){let [i,j]=k.split(":").map(Number);incoming[j]+=c;out[i]+=c;passValue+=c*(v[j]-v[i])}
for(const [i0,[N,G,L,Y]] of Object.entries(a.N)){let i=+i0, start=N-incoming[i],shot=N-L-out[i];if(start<0||shot<0)throw Error("flow conservation");starts+=start;startThreat+=start*v[i];goal+=G;shotValue+=G-shot*v[i];passValue-=L*v[i];total+=N;
let b=bins.find(b=>v[i]>=b.lo&&v[i]<b.hi);b.n+=N;b.y+=Y;b.p+=N*v[i]}}
if(Math.abs(passValue+shotValue-(goal-startThreat))>1e-9)throw Error("telescoping failed");
const risks=[{name:"A",p:.3,d:.15},{name:"B",p:.9,d:.07}].map(r=>({...r,delta:r.d-.02,expected:r.p*r.d-.02,net:r.p*r.d-(1-r.p)*.04-.02}));
return {starts,startThreat,goal,shotValue,passValue,identity:passValue+shotValue,identityCheck:goal-startThreat,identityError:Math.abs(passValue+shotValue-(goal-startThreat)),bins:bins.map(({p,y,...b})=>({...b,mean:p/b.n,observed:y/b.n,positive:y})),risks,threshold:{offense:.02/.15,withCounter:(.02+.04)/(.15+.04)}}
}
const pin="ebc4c54c1093c420a81ce442c69e4186fab33bb4";
const matches=[];
for(let id=2057954;id<=2058017;id++){
const response=await fetch("https://raw.githubusercontent.com/koenvo/wyscout-soccer-match-event-dataset/"+pin+"/processed-v2/files/"+id+".json");
if(!response.ok)throw Error("HTTP "+response.status+" "+id);
matches.push(extract(id,(await response.json()).events));
}
const result=analyse(matches);
console.log(JSON.stringify({result,audit:audit(matches.filter(m=>m.split==="test"),result)},null,2));
References and sources
- Karun Singh. Introducing Expected Threat (xT). Original methodological exposition.
- socceraction documentation 1.5.3. Expected Threat (xT). Reference implementation and scope.
- Decroos, Bransen, Van Haaren & Davis (2019). Actions Speak Louder than Goals: Valuing Player Actions in Soccer. KDD, 1851–1861.
- Van Roy, Robberechts, Decroos & Davis (2020). Valuing On-the-Ball Actions in Soccer: A Critical Comparison of xT and VAEP. AAAI workshop paper.
- Fernández, Bornn & Cervone (2021). A framework for the fine-grained evaluation of the instantaneous expected value of soccer possessions. Machine Learning.
- Hassani, Ramdani & Lotfi (2025). Dynamic Expected Threat (DxT) Model: Addressing the Deficit of Realism in Football Action Evaluation. Applied Sciences 15(8), 4151.
- Le Coz, Boustila & Imbach (18 May 2026). A Semi-Markov framework for modeling football possessions and temporal expected threat. Scientific Reports 16, 22590.
- Pappalardo et al. (2019). PlayeRank: Data-driven Performance Evaluation and Player Ranking in Soccer via a Machine Learning Approach. ACM TIST 10(5), 59.
- Pappalardo, Cintia, Rossi, Massucco, Ferragina, Pedreschi & Giannotti (2019). A public data set of spatio-temporal match events in soccer competitions. Scientific Data 6, 236.
- Pappalardo & Massucco. Soccer match event dataset. Figshare, collection v5; historical data collected by Wyscout, CC BY 4.0.
- UEFA. 2018 FIFA World Cup: Russia. Official tournament dates.
- Vossen. Wyscout soccer match event dataset, processed-v2, immutable retrieval revision ebc4c54c1093c420a81ce442c69e4186fab33bb4; transformation of cited public dataset.
- Gneiting & Raftery (2007). Strictly Proper Scoring Rules, Prediction, and Estimation. JASA 102(477), 359–378.