SPB Git

spb/wp35_uqo

Public

WP35 Phase 4–5 (in progress): H1 associations, H2 Seshat results, identification note, simulation model + factorial runs

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Simon-Pierre Boucher committed (Nov 1, 2026) parent 116efb6 Browse files

35 changed files +2,365 −0

35 changed files
Unified Split
added data/processed/modern_h2_sample.parquet +0 −0

Binary file not shown.

added data/processed/seshat_h2_sample.parquet +0 −0

Binary file not shown.

added research/identification.md +62 −0
@@ -0,0 +1,62 @@
1 +# WP35 — Identification: what the designs can and cannot establish
2 +
3 +This document was written during Phase 4, before the paper. It states, for each pre-registered test, the estimand,
4 +the assumptions under which the estimate would be causal, why those assumptions are **not** credible here, and what
5 +the estimate therefore is: a conditional association with pre-specified direction, out-of-sample validation and
6 +falsification tests. No causal language is used in the paper for H1 or H2.
7 +
8 +## 1. H1 (capacity ↔ scale)
9 +Estimand: the partial association between the capacity index K and log scale D given era, region and rival-explanation
10 +covariates. Causal reading would require K to be as-good-as-random given covariates, which is false in both directions:
11 +scale creates the demand for administration (Johnson 1982; Wright & Johnson 1975) and administration enables scale
12 +(Theorems 1–4). We therefore pre-registered H1 as an association without direction, and we report the modern panel in
13 +within-country and 50-year-difference form only to show that the association is not purely cross-sectional.
14 +Non-independence: region fixed effects, region random intercepts, language-family clustering and Conley spatial HAC
15 +errors (EA) address Galton's problem for inference but not for identification.
16 +
17 +## 2. H2-A (Seshat crisis severity)
18 +Estimand: the association between pre-crisis coordination pressure P and the share of adverse consequences recorded for
19 +a crisis, among polities with a CrisisDB record.
20 +Threats, in order of seriousness:
21 +1. **Crisis selection.** CrisisDB covers 150 of 626 polities, selected because a crisis was identified by historians. The
22 + sample is conditioned on an outcome-related event. P is therefore tested as a predictor of *how a crisis unfolds*,
23 + not whether one occurs. The polity-hazard design (Y2) and the modern onset panel (Y4–Y6) are the complements.
24 +2. **Weak temporal precedence.** 93.7% of Polaris facts are undated whole-polity codes; "pre-crisis" K is mostly the
25 + polity's overall K. Coders who know a polity ended in collapse may also code its administration differently
26 + (narrative circularity). Mitigations: inferred codes dropped (sensitivity), crises starting ≥ 25 years after polity
27 + start (sensitivity), dated-only facts (too few to estimate; reported as not estimable).
28 +3. **Collinearity / residual interpretation.** P retains 17% of the variance of z(D)+z(K) and correlates 0.39 with D.
29 + A positive β_P is consistent with "scale raises severity" alone. Decisive checks: D-only and D+K baselines, and the
30 + placebo index built with production infrastructure instead of K. If the placebo performs as well as P, the capacity
31 + component is not identified as the active ingredient.
32 +4. **Omitted mechanisms.** Elite conflict, inequality, climate shocks and military pressure are only partially proxied
33 + (warfare technology, epidemic flag, production infrastructure). Region and era fixed effects absorb slow-moving
34 + confounders only.
35 +5. **Small N and clustering.** 127 crisis records in 42 regions and 10 macro-regions; cluster-robust SE with few clusters
36 + are anti-conservative; we report NGA-, polity- and region-clustered variants and leave-one-region-out stability.
37 +6. **Multiple outcomes.** Y1 (fractional) is primary; Y1b was declared underpowered a priori; reforms are exploratory.
38 +
39 +## 3. H2-B (polity duration, succession)
40 +Polity boundaries in Seshat are coding decisions (e.g. Early vs Late Qing split at 1796), not events; the hazard of
41 +"polity end" therefore mixes genuine breakdowns with periodization. Censoring at 1900 is a databank boundary, not a
42 +survival boundary. Y3 (discontinuous succession) depends on the successor being in the databank (207 coded). Any
43 +association of K or P with duration is reported with this caveat and is not evidence for or against the mechanism.
44 +
45 +## 4. H2-C (modern country-year panel)
46 +Estimand: the association between P_it and any instability event in (t, t+5], conditional on development, electoral
47 +democracy, time since last event (cubic), region and year effects; country fixed effects in the conditional logit and
48 +LPM. Causal reading would need P_it to be exogenous to future shocks given these controls, which fails because:
49 +(i) K is expert-coded with knowledge of subsequent events (V-Dem coders rate the whole period); (ii) population and
50 +capacity respond to anticipated conflict; (iii) K correlates 0.75 with polyarchy, so the "capacity" interpretation
51 +competes with "regime type", the dominant predictor in Goldstone et al. (2010). Mitigations: polyarchy control,
52 +K-only and regime-type-free baselines, the placebo index with polyarchy in place of K, the reverse-window negative
53 +control (past events on current P must not load more strongly than future events), forward-chaining and
54 +leave-region-out validation, Oster (2019) and Cinelli–Hazlett (2020) sensitivity on the LPM. These bound, but do not
55 +remove, confounding.
56 +
57 +## 5. What would have been a credible design and why it is not available
58 +A natural experiment moving D or K independently (e.g. exogenous territorial accretion, or the diffusion of a record-
59 +keeping technology for reasons unrelated to local instability) would identify the effect of mismatch. Seshat does not
60 +code such shocks at the polity level; the modern panel has candidate instruments (printing press, railway, telegraph
61 +diffusion) but their exclusion restrictions are implausible for instability. The paper therefore claims association,
62 +prediction and robustness only, and explicitly declines a causal claim.
added results/empirical/h1_ea.csv +6 −0
@@ -0,0 +1,6 @@
1 +model,term,coef,se,ci_lo,ci_hi,p,n,r2,llf
2 +"H1-E1 OLS log community size ~ hierarchy + X + region, Conley 500 km",hier,0.7019012184637698,0.08907571241746193,0.5273128221255445,0.8764896148019952,3.3306690738754696e-15,579,0.7527057939775872,
3 +"H1-E1 OLS log community size ~ hierarchy + X + region, Conley 1000 km",hier,0.7019012184637698,0.10314085102642803,0.4997451504519709,0.9040572864755688,1.0086154134114622e-11,579,0.7527057939775872,
4 +"H1-E2 same, SE clustered by language family",hier,0.7019012184637698,0.12285506933219323,0.46110528257267114,0.9426971543548686,1.1084134613211683e-08,579,0.7527057939775872,-920.8651248810854
5 +"H1-E3 log population (EA202) ~ hierarchy + X + region, family-clustered",hier,0.5869092532986168,0.10686147087259516,0.37746077038833026,0.7963577362089033,3.9685897094308436e-08,799,0.6682762549654855,-1518.8337220081094
6 +H1-E4 ordered logit hierarchy ~ log community size + X + region (family-clustered),log_community_size,0.488757748642015,0.1163876650200075,0.26063792520280027,0.7168775720812297,2.6762940196434215e-05,579,,-446.26428080820915
added results/empirical/h1_modern.csv +4 −0
@@ -0,0 +1,4 @@
1 +model,term,coef,se,ci_lo,ci_hi,p,n,llf,r2
2 +H1-M1 within-country: log pop ~ K + log gdppc + polyarchy + year FE,K_modern_dm,0.1480460995463701,0.062061798411447426,0.026404974659933148,0.26968722443280707,0.017057656297418396,14647,-5466.940073997608,0.6456763715906837
3 +H1-M2 pooled: log pop ~ K + log gdppc + polyarchy + year FE + region FE,K_modern,0.18802867300196574,0.24031350503956758,-0.2829857968755867,0.6590431428795183,0.43396147546105157,14647,-26282.825236966386,0.22830431261410045
4 +H1-M3 50-year differences: Δlog pop ~ ΔK + Δlog gdppc + Δpolyarchy + year FE,dK_modern,0.1347086795306403,0.05271145178142616,0.03139423403904504,0.23802312502223558,0.010600898059413784,6836,-4135.136061411962,0.16984604162969297
added results/empirical/h1_seshat.csv +12 −0
@@ -0,0 +1,12 @@
1 +model,term,coef,se,ci_lo,ci_hi,p,n,llf,r2,coef_per_sd_K
2 +H1-S1 primary: D_pc1 ~ K_mean + FE,K_mean,2.355547839058853,0.17253256589189617,2.0173840099107365,2.6937116682069697,1.9434199250145317e-42,317,-224.10030673022803,0.7341337565295472,0.7543626189736623
3 +H1-S2: D_pc1 ~ K_mean + X + FE,K_mean,1.214055538878902,0.43197997916361924,0.3673747797182083,2.060736298039596,0.004947319820084662,191,-109.69886483575169,0.8258434843789049,0.3888004738014949
4 +H1-S3: log_pop ~ K_mean + X + FE,K_mean,3.481859149334324,1.9342761356126346,-0.3093220764664397,7.273040375135087,0.07184740612504324,146,-260.308594307084,0.7976459597740313,1.11506306228902
5 +H1-S4: log_terr ~ K_mean + X + FE,K_mean,2.102712427457462,2.376185178983312,-2.5546105233498304,6.760035378264754,0.3762046291939808,158,-320.61299124585537,0.6046575259846271,0.6733922476221238
6 +H1-S5: D_pc1 ~ K_irt + X + FE,K_irt,0.3657916612491654,0.09436571801377959,0.1808348539421574,0.5507484685561734,0.00010604846726457104,208,-122.12148539552345,0.8097442472363011,0.1171445347036116
7 +H1-S6: D_pc1 ~ K blocks + X + FE,K_admin,0.1479468285291261,0.3354626935859551,-0.5095600508993459,0.8054537079575981,0.659196205902273,164,-80.02211388003579,0.8610923072078089,0.047379872820868
8 +H1-S6: D_pc1 ~ K blocks + X + FE,K_rules_money,-0.28969872124472223,0.29408089297923934,-0.8660972714840314,0.28669982899458685,0.32457556536308774,164,-80.02211388003579,0.8610923072078089,-0.09277582159350467
9 +H1-S6: D_pc1 ~ K blocks + X + FE,K_comm_infra,1.085096588215926,0.3503117804841384,0.39848549846701475,1.7717076779648373,0.001951494043931043,164,-80.02211388003579,0.8610923072078089,0.34750145615934575
10 +H1-S6: D_pc1 ~ K blocks + X + FE,K_records,0.220349460400836,0.25323511985269415,-0.27599137451044453,0.7166902953121165,0.3842250802677374,164,-80.02211388003579,0.8610923072078089,0.07056676722125993
11 +"H1-S7: D_pc1 ~ K_mean + X + FE, no quasi-polities",K_mean,1.3595934547221291,0.5300003905105384,0.32079268932147387,2.3983942201227846,0.010309590894861028,155,-80.10096405747547,0.7948159126167196,0.43540889394690385
12 +"H1-S8: D_pc1 ~ K_mean + era, region random intercept",K_mean,2.1802952331707965,0.12609479535756984,1.9331494342699598,2.4274410320716333,5.5064737161461415e-67,317,-228.096616778932,,0.6982380892283888
added results/empirical/h2_modern_cv_folds.csv +61 −0
@@ -0,0 +1,61 @@
1 +model,fold,scheme,error,oos_loglik,brier,n,events,auc,calibration_slope,calibration_intercept
2 +C1 P,"train<=1945,test1946-1975",forward,"predict requires that you use a DataFrame when predicting from a model
3 +that was ",,,,,,,
4 +C1 P,"train<=1975,test1976-2005",forward,,-0.3896968836751431,0.1237495731604952,4547.0,724.0,0.7679012461648962,1.000904248066669,-0.50049484516642
5 +C1 P,"train<=2005,test>=2006",forward,,-0.2786899335020621,0.08173934298756222,2763.0,272.0,0.7783358325265071,0.9009745183312277,-0.18451748271199148
6 +B0 FE+X,"train<=1945,test1946-1975",forward,"predict requires that you use a DataFrame when predicting from a model
7 +that was ",,,,,,,
8 +B0 FE+X,"train<=1975,test1976-2005",forward,,-0.3885312365556662,0.12258455414654446,4547.0,724.0,0.7591963009582883,0.9804629576806113,-0.4201046174537736
9 +B0 FE+X,"train<=2005,test>=2006",forward,,-0.2793662975136024,0.08196035119899624,2763.0,272.0,0.7776938153824356,0.9524381319645183,-0.00552774411451371
10 +B1 D,"train<=1945,test1946-1975",forward,"predict requires that you use a DataFrame when predicting from a model
11 +that was ",,,,,,,
12 +B1 D,"train<=1975,test1976-2005",forward,,-0.38953429694606506,0.12328919822681099,4547.0,724.0,0.7596226243310698,0.9760294958079441,-0.4498223888534745
13 +B1 D,"train<=2005,test>=2006",forward,,-0.2792891777917825,0.08201117617476096,2763.0,272.0,0.7778546886438237,0.938482813587797,-0.0516838253065424
14 +B2 K,"train<=1945,test1946-1975",forward,"predict requires that you use a DataFrame when predicting from a model
15 +that was ",,,,,,,
16 +B2 K,"train<=1975,test1976-2005",forward,,-0.3849801776989598,0.12124847509575513,4547.0,724.0,0.7753077115394897,1.0544389335550675,-0.43796340828142305
17 +B2 K,"train<=2005,test>=2006",forward,,-0.2775428640557777,0.08100321771210951,2763.0,272.0,0.7791889035823081,0.9181391137840416,-0.15288282802850622
18 +B4 persistence,"train<=1945,test1946-1975",forward,"predict requires that you use a DataFrame when predicting from a model
19 +that was ",,,,,,,
20 +B4 persistence,"train<=1975,test1976-2005",forward,,-0.3899986454519143,0.12283225551877612,4547.0,724.0,0.7536183293037344,0.9610769765154307,-0.4222670176145258
21 +B4 persistence,"train<=2005,test>=2006",forward,,-0.2814896865412362,0.08259077047553244,2763.0,272.0,0.7733605686353225,0.9417246650434868,-0.03340252334286143
22 +B5 D+K,"train<=1945,test1946-1975",forward,"predict requires that you use a DataFrame when predicting from a model
23 +that was ",,,,,,,
24 +B5 D+K,"train<=1975,test1976-2005",forward,,-0.3867779967114898,0.12229824702784269,4547.0,724.0,0.7764168748907095,1.0514028348323388,-0.48428868485365767
25 +B5 D+K,"train<=2005,test>=2006",forward,,-0.27773960516612894,0.08117405300471837,2763.0,272.0,0.7815872434883226,0.8953092857560343,-0.22666742134605794
26 +C1 P,loro_1,loro,,-0.28604106913790095,0.08037555228647814,1354.0,122.0,0.7198211624441132,0.7202717664143574,-0.9178588629164446
27 +C1 P,loro_2,loro,,-0.8545932591693702,0.20707500421599742,2619.0,773.0,0.6731820417980067,0.050258268346224065,-0.7573396795185294
28 +C1 P,loro_3,loro,,-0.4889061317680881,0.1555615740338974,1459.0,281.0,0.649233576421826,0.4881779729651372,-0.5803492981909237
29 +C1 P,loro_4,loro,,-0.5141651171538956,0.1680840150947805,3273.0,747.0,0.6687891709355236,0.6355322568001194,-0.3146956772603173
30 +C1 P,loro_5,loro,,-0.47327159597995455,0.08004066802591614,3919.0,350.0,0.6612420445903214,0.0024092654533086092,-2.3134367476854316
31 +C1 P,loro_6,loro,,-0.4910218489609021,0.1625629982222162,1974.0,409.0,0.7165345227586961,0.7162949290641591,-0.7281838669211945
32 +B0 FE+X,loro_1,loro,,-0.2905671519097122,0.08087934576529415,1354.0,122.0,0.7031682456887374,0.6853066453961756,-0.9772801577802834
33 +B0 FE+X,loro_2,loro,,-0.8557860882971616,0.20776424071294652,2619.0,773.0,0.6734203108991295,0.05092649533359051,-0.7571490808018743
34 +B0 FE+X,loro_3,loro,,-0.4940076798830174,0.1563878507489776,1459.0,281.0,0.6345002386577165,0.4625231117526357,-0.6189838429934523
35 +B0 FE+X,loro_4,loro,,-0.5184356062261626,0.17118489820040494,3273.0,747.0,0.6590012729725977,0.6120481944244622,-0.4885235844252921
36 +B0 FE+X,loro_5,loro,,-0.4792678881995545,0.08205765719681389,3919.0,350.0,0.6587795701076733,-0.0012876366789915557,-2.326687313634474
37 +B0 FE+X,loro_6,loro,,-0.46723966615119294,0.15096728971620393,1974.0,409.0,0.7134880523680449,0.8138942090943181,-0.39616669238994273
38 +B1 D,loro_1,loro,,-0.2903237601924835,0.08089028706645629,1354.0,122.0,0.7046186395571641,0.6872507761325369,-0.974762992807576
39 +B1 D,loro_2,loro,,-0.8595579531967988,0.20868132549978732,2619.0,773.0,0.671969672548176,0.049545831807584415,-0.7579122253275613
40 +B1 D,loro_3,loro,,-0.4938309024221851,0.1563553468522629,1459.0,281.0,0.6356482124839132,0.463785644278651,-0.6159683262451083
41 +B1 D,loro_4,loro,,-0.5185941178507459,0.1712825438774896,3273.0,747.0,0.6588020066542231,0.6119013272384245,-0.492656870245138
42 +B1 D,loro_5,loro,,-0.47939940869806885,0.08209700835827424,3919.0,350.0,0.658969299123404,-0.0011830694601739167,-2.326310606851259
43 +B1 D,loro_6,loro,,-0.4705049397174371,0.15262618015293009,1974.0,409.0,0.7145301014708983,0.8123269544478149,-0.4705822573588978
44 +B2 K,loro_1,loro,,-0.28786037215041194,0.07939095691384952,1354.0,122.0,0.6993958909942516,0.7031237381143722,-0.9063360306219664
45 +B2 K,loro_2,loro,,-0.8350593492367202,0.2012296840735442,2619.0,773.0,0.6803973908131844,0.05664057681676268,-0.7576213474744232
46 +B2 K,loro_3,loro,,-0.4844426314424256,0.15512259474512663,1459.0,281.0,0.6513120132439927,0.5057056470586925,-0.5972627525293253
47 +B2 K,loro_4,loro,,-0.5068305225238278,0.1660612533146381,3273.0,747.0,0.6769225224996052,0.6819985530642002,-0.3178711560433633
48 +B2 K,loro_5,loro,,-0.4605597419644665,0.0756869573523636,3919.0,350.0,0.6589837089220671,0.007510949039233791,-2.2933901575924796
49 +B2 K,loro_6,loro,,-0.4773719148809536,0.15649635102052561,1974.0,409.0,0.7109337041174218,0.6232607611125086,-0.5106993939668955
50 +B4 persistence,loro_1,loro,,-0.2902062521971979,0.08069304394519712,1354.0,122.0,0.702596071960826,0.6931620017293897,-0.9686837576803118
51 +B4 persistence,loro_2,loro,,-0.8552566856589786,0.2075386171559939,2619.0,773.0,0.6741295118707067,0.05111727735849174,-0.7568173825178399
52 +B4 persistence,loro_3,loro,,-0.4941761083947784,0.15632627192482743,1459.0,281.0,0.6347298334229559,0.4645221028429317,-0.6095866208639465
53 +B4 persistence,loro_4,loro,,-0.5182643358407806,0.17115229370049168,3273.0,747.0,0.659480360078477,0.6127907685023691,-0.4869914129692327
54 +B4 persistence,loro_5,loro,,-0.4767582775988263,0.08120807318543667,3919.0,350.0,0.6616343113317057,-0.00016604004096815379,-2.3226987765983935
55 +B4 persistence,loro_6,loro,,-0.4686287022546417,0.15125941040837595,1974.0,409.0,0.7111727348711498,0.8021524888807867,-0.4081660474947933
56 +B5 D+K,loro_1,loro,,-0.2861781738979432,0.07922107862067106,1354.0,122.0,0.7074528954651906,0.7174313272085634,-0.8843839476718729
57 +B5 D+K,loro_2,loro,,-0.8360565200635777,0.20148487899444903,2619.0,773.0,0.6799320652745211,0.055229182534372125,-0.7576113141899997
58 +B5 D+K,loro_3,loro,,-0.4834795853642856,0.15508964187203983,1459.0,281.0,0.6561002724927346,0.5094523696480574,-0.5904095126185185
59 +B5 D+K,loro_4,loro,,-0.507601825011439,0.1656841392746702,3273.0,747.0,0.6790964332388939,0.6783626229919831,-0.2535390795968614
60 +B5 D+K,loro_5,loro,,-0.46063634830115807,0.07581305103877756,3919.0,350.0,0.6595392867149662,0.008808050209616622,-2.2884452023016038
61 +B5 D+K,loro_6,loro,,-0.48370822469274244,0.16007015842608954,1974.0,409.0,0.713917682807752,0.6141781750815443,-0.630542591051736
added results/empirical/h2_modern_cv_summary.csv +13 −0
@@ -0,0 +1,13 @@
1 +scheme,model,oos_loglik,auc,brier,calibration_slope
2 +forward,B0 FE+X,-0.3339487670346343,0.7684450581703619,0.10227245267277035,0.9664505448225649
3 +forward,B1 D,-0.33441173736892377,0.7687386564874468,0.10265018720078598,0.9572561546978705
4 +forward,B2 K,-0.33126152087736876,0.7772483075608989,0.10112584640393232,0.9862890236695545
5 +forward,B4 persistence,-0.33574416599657525,0.7634894489695285,0.10271151299715428,0.9514008207794588
6 +forward,B5 D+K,-0.3322588009388094,0.7790020591895161,0.10173615001628053,0.9733560602941865
7 +forward,C1 P,-0.3341934085886026,0.7731185393457016,0.10274445807402871,0.9509393831989483
8 +loro,B0 FE+X,-0.5175506801111335,0.6737262817823165,0.14154021372344017,0.43723516988703176
9 +loro,B1 D,-0.5187018470129532,0.6740896553062964,0.14198878196786674,0.4372712440741397
10 +loro,B2 K,-0.5086874220331342,0.6796575384317537,0.1389979662366746,0.4297067042009617
11 +loro,B4 persistence,-0.5172150603242006,0.6739571372559702,0.14136295172005378,0.43726309987883344
12 +loro,B5 D+K,-0.5096101128885243,0.6826731059990098,0.1395604913711162,0.4305769546123561
13 +loro,C1 P,-0.517999837028352,0.6814670864914145,0.14228330197988096,0.4354907431738843
added results/empirical/h2_modern_cv_wins.csv +21 −0
@@ -0,0 +1,21 @@
1 +model,baseline,folds,win_share,mean_diff,scheme,metric
2 +C1 P,B0 FE+X,2,0.5,-0.00024464155396830556,forward,oos_loglik
3 +C1 P,B0 FE+X,2,1.0,0.0046734811753396666,forward,auc
4 +C1 P,B1 D,2,0.5,0.00021832878032115866,forward,oos_loglik
5 +C1 P,B1 D,2,1.0,0.004379882858254913,forward,auc
6 +C1 P,B2 K,2,0.0,-0.0029318877112338437,forward,oos_loglik
7 +C1 P,B2 K,2,0.0,-0.0041297682151972825,forward,auc
8 +C1 P,B4 persistence,2,1.0,0.0015507574079726416,forward,oos_loglik
9 +C1 P,B4 persistence,2,1.0,0.009629090376173155,forward,auc
10 +C1 P,B5 D+K,2,0.0,-0.001934607649793224,forward,oos_loglik
11 +C1 P,B5 D+K,2,0.0,-0.0058835198438144665,forward,auc
12 +C1 P,B0 FE+X,6,0.8333333333333334,-0.0004491569172183722,loro,oos_loglik
13 +C1 P,B0 FE+X,6,0.8333333333333334,0.007740804709097955,loro,auc
14 +C1 P,B1 D,6,0.8333333333333334,0.000702009984601302,loro,oos_loglik
15 +C1 P,B1 D,6,1.0,0.007377431185118059,loro,auc
16 +C1 P,B2 K,6,0.16666666666666666,-0.009312414995217658,loro,oos_loglik
17 +C1 P,B2 K,6,0.5,0.0018095480596606965,loro,auc
18 +C1 P,B4 persistence,6,0.8333333333333334,-0.0007847767041513446,loro,oos_loglik
19 +C1 P,B4 persistence,6,0.6666666666666666,0.007509949235444328,loro,auc
20 +C1 P,B5 D+K,6,0.16666666666666666,-0.00838972413982759,loro,oos_loglik
21 +C1 P,B5 D+K,6,0.5,-0.0012060195075952462,loro,auc
added results/empirical/h2_modern_primary.csv +16 −0
@@ -0,0 +1,16 @@
1 +model,term,coef,se,ci_lo,ci_hi,p,n,llf,events
2 +C1 primary: Y456 ~ P + X + region FE + year FE,P_modern_z,0.39790378484144,0.08918214639646332,0.2231067779043719,0.5727007917785081,8.131284893393963e-06,14637,-5672.972626457216,2692.0
3 +C2: Y456 ~ P + FE only,P_modern_z,0.7229243246287831,0.07967857684830817,0.5667543140060991,0.8790943352514671,1.1577632379582483e-19,15687,-6528.089258015958,2981.0
4 +C3: Y456 ~ P + K + X + FE (P given K),P_modern_z,0.22924427308006917,0.09387563776277562,0.04524802306502895,0.4132405230951094,0.014606161422636878,14637,-5627.074969974541,2692.0
5 +B1 baseline population only,D_modern_z,0.12594267679623367,0.07109162227063932,-0.013396902854219406,0.26528225644668674,0.07646855355079077,14754,-5769.778570873028,2710.0
6 +B2 baseline capacity only,K_modern_z,-0.6324390571653153,0.12569164780016462,-0.878794686853638,-0.3860834274769927,4.86222381583211e-07,15675,-6150.572623841682,2957.0
7 +B3 baseline development (gdppc) only,log_gdppc,-0.5569688251338336,0.09464003919975214,-0.7424633019653478,-0.3714743483023194,3.977439983972847e-09,15862,-6313.047510446031,2980.0
8 +B4 baseline persistence,y456_b5,0.13566387709403316,0.13289892982966736,-0.12481802537211484,0.39614577956018115,0.30734688842262725,15806,-6275.443015609264,2968.0
9 +B5 D and K separately,D_modern_z,0.16972157501358381,0.06950106487910981,0.033499487850528586,0.30594366217663904,0.01460616142263262,14637,-5627.074969974539,2692.0
10 +B5 D and K separately,K_modern_z,-0.7070134445104032,0.13742936225970592,-0.9763749945394268,-0.43765189448137953,2.681501580305378e-07,14637,-5627.074969974539,
11 +Placebo: P with polyarchy in place of K (polyarchy not separately controlled),P_placebo_z,0.19689648797181336,0.05871082730792415,0.08182326644828203,0.3119697094953447,0.0007974864751106516,14754,-5777.87225067883,2710.0
12 +Placebo comparison: P_main with the same controls as the placebo,P_modern_z,0.446333634501256,0.0828013326218674,0.2840430225623959,0.6086242464401161,7.029473808128925e-08,14676,-5712.556048147622,2706.0
13 +Negative control: past events (t-5..t-1) ~ P_t + gdppc + polyarchy + FE (no duration terms),P_modern_z,0.4359470058900018,0.09815066302576257,0.24357170635950715,0.6283223054204965,8.928811539479297e-06,14608,-5813.946618858069,2757.0
14 +Forward comparison for the negative control: future events ~ P_t + gdppc + polyarchy + FE,P_modern_z,0.475241690571331,0.09908186802752562,0.28104122923738073,0.6694421519052812,1.6149846684551553e-06,14637,-5834.237016756066,2692.0
15 +"C4: conditional logit, country FE + decade FE",P_modern_z,1.313878132712599,0.09775172551732352,1.1222847506986449,1.5054715147265532,3.4784091628447276e-41,14637,,2692.0
16 +"C5: linear probability, country + year FE",P_modern_z_dm,0.11091972996929868,0.031351674099522706,0.049470448734234174,0.17236901120436318,0.0004032914904174095,14637,-4875.021383489231,2692.0
added results/empirical/h2_modern_robustness.csv +14 −0
@@ -0,0 +1,14 @@
1 +model,term,coef,se,ci_lo,ci_hi,p,n,llf,events,oster_beta_full,oster_beta_short,r2_full,r2_short,partial_r2_P,robustness_value
2 +R: horizon h=1,P_modern_z,0.3257542271113133,0.09081766270455952,0.14775160821037664,0.5037568460122499,0.0003346275971506812,14635,-2809.836558711094,902.0,,,,,,
3 +R: horizon h=3,P_modern_z,0.3859734372235748,0.08713084027910899,0.2151969902765212,0.5567498841706284,9.431429129652506e-06,14636,-4668.956267136606,1911.0,,,,,,
4 +R: horizon h=10,P_modern_z,0.453180001872445,0.1005232322313484,0.2561544666990021,0.6502055370458879,6.537635724308696e-06,14639,-6759.637175029395,4143.0,,,,,,
5 +R: component y4_f5,P_modern_z,1.0108347606887813,0.19699525159210712,0.6247240675682513,1.3969454538093113,2.878019958646695e-07,10279,-1799.0294235356334,566.0,,,,,,
6 +R: component y5_f5,P_modern_z,0.19570664298345658,0.1369247476865778,-0.07266586248223594,0.4640791484491491,0.15291781385485442,10853,-3397.20354607048,1460.0,,,,,,
7 +R: component y6_f5,P_modern_z,0.24520063567506914,0.09399153647288098,0.060977224188222406,0.42942404716191585,0.009087299826968763,14636,-5000.87591521976,2068.0,,,,,,
8 +R: K = PC1,P_modern_pc1_z,0.3972334263449546,0.08951641349789637,0.22178125588907774,0.5726855968008315,9.098922495056218e-06,14637,-5673.709489767933,2692.0,,,,,,
9 +R: standardized within year,P_modern_within_year_z,0.40912714945850015,0.09087386000252914,0.23101438385354303,0.5872399150634573,6.727156439169484e-06,14637,-5672.715544195022,2692.0,,,,,,
10 +R: D = (log pop + log area)/2,P_modern_area_z,0.35201470671308055,0.09785002058259724,0.16022866637118996,0.5438007470549712,0.00032129986428979315,11735,-4781.639744406581,2359.0,,,,,,
11 +R: years ≥ 1900,P_modern_z,0.3940733263264095,0.09183407311667917,0.21407854301771834,0.5740681096351007,1.777541709685051e-05,13083,-5223.594464430906,2475.0,,,,,,
12 +R: polyarchy not controlled,P_modern_z,0.446333634501256,0.0828013326218674,0.2840430225623959,0.6086242464401161,7.029473808128925e-08,14676,-5712.556048147622,2706.0,,,,,,
13 +R: + persistence control,P_modern_z,0.39035420906242724,0.08878195519207539,0.21634157688595948,0.564366841238895,1.098715434814722e-05,14598,-5641.175860478964,2682.0,,,,,,
14 +Sensitivity (LPM): Oster bias-adjusted β at Rmax=1.3·R² (δ=1); Cinelli–Hazlett RV,P_modern_z,-0.023790190743910956,,,,,14637,,,0.03827708995287325,0.08187222469624048,0.16093354475530663,0.12702234634493959,0.00556334755160398,0.0718580292018959
added results/empirical/h2_seshat_cv_binary_summary.csv +8 −0
@@ -0,0 +1,8 @@
1 +model,oos_loglik,auc,brier
2 +A2 P,-1.34987025159919,0.6332183406162998,0.25810946028618476
3 +B0 FE only,-1.277565410590492,0.6410582685455134,0.24859475238814943
4 +B1 D only,-1.3389349056151325,0.6337711324956223,0.25689550126921973
5 +B2 K only,-1.3182015924857153,0.6299753251283864,0.25865358661769416
6 +B3 complexity,-1.3215637613178275,0.6290379971502421,0.2609623970447837
7 +B4 persistence,-1.3414549962341589,0.6243098808787584,0.26262025957466023
8 +B5 D+K,-1.3956401024749936,0.621057655496431,0.26819092780677006
added results/empirical/h2_seshat_cv_folds.csv +435 −0
@@ -0,0 +1,435 @@
1 +oos_loglik,n,model,fold,n_train,scheme,error
2 +-0.4880613524495527,3.0,A2 P,loo_Central_Asia,84.0,leave-one-macro-region-out,
3 +-0.6179689032006479,23.0,A2 P,loo_East_Asia,64.0,leave-one-macro-region-out,
4 +-0.5431030904486999,15.0,A2 P,loo_Europe,72.0,leave-one-macro-region-out,
5 +-0.6351336323453667,9.0,A2 P,loo_North_Africa,78.0,leave-one-macro-region-out,
6 +-0.6808994688904817,2.0,A2 P,loo_North_America,85.0,leave-one-macro-region-out,
7 +-0.5396641871002942,3.0,A2 P,loo_South_America,84.0,leave-one-macro-region-out,
8 +-0.5556779398097061,5.0,A2 P,loo_South_Asia,82.0,leave-one-macro-region-out,
9 +-0.5444416294257195,6.0,A2 P,loo_Southeast_Asia_Oceania,81.0,leave-one-macro-region-out,
10 +-0.6043015795250417,17.0,A2 P,loo_Southwest_Asia,70.0,leave-one-macro-region-out,
11 +-0.5829162440745959,4.0,A2 P,loo_Sub_Saharan_Africa,83.0,leave-one-macro-region-out,
12 +-0.49648122248801574,3.0,B0 FE only,loo_Central_Asia,84.0,leave-one-macro-region-out,
13 +-0.6250604270020237,23.0,B0 FE only,loo_East_Asia,64.0,leave-one-macro-region-out,
14 +-0.5398083196722638,15.0,B0 FE only,loo_Europe,72.0,leave-one-macro-region-out,
15 +-0.6375346096250804,9.0,B0 FE only,loo_North_Africa,78.0,leave-one-macro-region-out,
16 +-0.7220199085483197,2.0,B0 FE only,loo_North_America,85.0,leave-one-macro-region-out,
17 +-0.5217824682759374,3.0,B0 FE only,loo_South_America,84.0,leave-one-macro-region-out,
18 +-0.5617711756893108,5.0,B0 FE only,loo_South_Asia,82.0,leave-one-macro-region-out,
19 +-0.5720629248539654,6.0,B0 FE only,loo_Southeast_Asia_Oceania,81.0,leave-one-macro-region-out,
20 +-0.6044692070236013,17.0,B0 FE only,loo_Southwest_Asia,70.0,leave-one-macro-region-out,
21 +-0.6150321505709686,4.0,B0 FE only,loo_Sub_Saharan_Africa,83.0,leave-one-macro-region-out,
22 +-0.48416191268852043,3.0,B1 D only,loo_Central_Asia,84.0,leave-one-macro-region-out,
23 +-0.6154927045326366,23.0,B1 D only,loo_East_Asia,64.0,leave-one-macro-region-out,
24 +-0.5543058313879182,15.0,B1 D only,loo_Europe,72.0,leave-one-macro-region-out,
25 +-0.6322613087171535,9.0,B1 D only,loo_North_Africa,78.0,leave-one-macro-region-out,
26 +-0.6829120580961434,2.0,B1 D only,loo_North_America,85.0,leave-one-macro-region-out,
27 +-0.5219812850414702,3.0,B1 D only,loo_South_America,84.0,leave-one-macro-region-out,
28 +-0.5572203126706954,5.0,B1 D only,loo_South_Asia,82.0,leave-one-macro-region-out,
29 +-0.5380005961660977,6.0,B1 D only,loo_Southeast_Asia_Oceania,81.0,leave-one-macro-region-out,
30 +-0.6025306317512673,17.0,B1 D only,loo_Southwest_Asia,70.0,leave-one-macro-region-out,
31 +-0.5762049031856433,4.0,B1 D only,loo_Sub_Saharan_Africa,83.0,leave-one-macro-region-out,
32 +-0.4962374116819824,3.0,B2 K only,loo_Central_Asia,84.0,leave-one-macro-region-out,
33 +-0.6248569672964271,23.0,B2 K only,loo_East_Asia,64.0,leave-one-macro-region-out,
34 +-0.5407854830332525,15.0,B2 K only,loo_Europe,72.0,leave-one-macro-region-out,
35 +-0.6371071925590664,9.0,B2 K only,loo_North_Africa,78.0,leave-one-macro-region-out,
36 +-0.724521093462311,2.0,B2 K only,loo_North_America,85.0,leave-one-macro-region-out,
37 +-0.5207608968080311,3.0,B2 K only,loo_South_America,84.0,leave-one-macro-region-out,
38 +-0.5617890023264124,5.0,B2 K only,loo_South_Asia,82.0,leave-one-macro-region-out,
39 +-0.5716201572503757,6.0,B2 K only,loo_Southeast_Asia_Oceania,81.0,leave-one-macro-region-out,
40 +-0.6042279843058415,17.0,B2 K only,loo_Southwest_Asia,70.0,leave-one-macro-region-out,
41 +-0.614480512511814,4.0,B2 K only,loo_Sub_Saharan_Africa,83.0,leave-one-macro-region-out,
42 +-0.49613569030529164,3.0,B3 complexity,loo_Central_Asia,84.0,leave-one-macro-region-out,
43 +-0.6253154805860182,23.0,B3 complexity,loo_East_Asia,64.0,leave-one-macro-region-out,
44 +-0.5408574084779093,15.0,B3 complexity,loo_Europe,72.0,leave-one-macro-region-out,
45 +-0.6379062547566421,9.0,B3 complexity,loo_North_Africa,78.0,leave-one-macro-region-out,
46 +-0.7262541192578305,2.0,B3 complexity,loo_North_America,85.0,leave-one-macro-region-out,
47 +-0.5219368338910513,3.0,B3 complexity,loo_South_America,84.0,leave-one-macro-region-out,
48 +-0.5615010883228737,5.0,B3 complexity,loo_South_Asia,82.0,leave-one-macro-region-out,
49 +-0.5717786784269936,6.0,B3 complexity,loo_Southeast_Asia_Oceania,81.0,leave-one-macro-region-out,
50 +-0.6047361088148459,17.0,B3 complexity,loo_Southwest_Asia,70.0,leave-one-macro-region-out,
51 +-0.6144770465919185,4.0,B3 complexity,loo_Sub_Saharan_Africa,83.0,leave-one-macro-region-out,
52 +-0.48265473851259905,3.0,B4 persistence,loo_Central_Asia,84.0,leave-one-macro-region-out,
53 +-0.6205265583512978,23.0,B4 persistence,loo_East_Asia,64.0,leave-one-macro-region-out,
54 +-0.5477744449447155,15.0,B4 persistence,loo_Europe,72.0,leave-one-macro-region-out,
55 +-0.6320692993979519,9.0,B4 persistence,loo_North_Africa,78.0,leave-one-macro-region-out,
56 +-0.6921181974675796,2.0,B4 persistence,loo_North_America,85.0,leave-one-macro-region-out,
57 +-0.518826113170134,3.0,B4 persistence,loo_South_America,84.0,leave-one-macro-region-out,
58 +-0.5597455042562001,5.0,B4 persistence,loo_South_Asia,82.0,leave-one-macro-region-out,
59 +-0.5586279807589243,6.0,B4 persistence,loo_Southeast_Asia_Oceania,81.0,leave-one-macro-region-out,
60 +-0.6088468482433093,17.0,B4 persistence,loo_Southwest_Asia,70.0,leave-one-macro-region-out,
61 +-0.6014078618663397,4.0,B4 persistence,loo_Sub_Saharan_Africa,83.0,leave-one-macro-region-out,
62 +-0.4841547538303477,3.0,B5 D+K,loo_Central_Asia,84.0,leave-one-macro-region-out,
63 +-0.6153225387136638,23.0,B5 D+K,loo_East_Asia,64.0,leave-one-macro-region-out,
64 +-0.5544283583261507,15.0,B5 D+K,loo_Europe,72.0,leave-one-macro-region-out,
65 +-0.6326218199475553,9.0,B5 D+K,loo_North_Africa,78.0,leave-one-macro-region-out,
66 +-0.6783564705568839,2.0,B5 D+K,loo_North_America,85.0,leave-one-macro-region-out,
67 +-0.5282965208177354,3.0,B5 D+K,loo_South_America,84.0,leave-one-macro-region-out,
68 +-0.5560823821545652,5.0,B5 D+K,loo_South_Asia,82.0,leave-one-macro-region-out,
69 +-0.5369885748781366,6.0,B5 D+K,loo_Southeast_Asia_Oceania,81.0,leave-one-macro-region-out,
70 +-0.6030949216167942,17.0,B5 D+K,loo_Southwest_Asia,70.0,leave-one-macro-region-out,
71 +-0.5744541520428678,4.0,B5 D+K,loo_Sub_Saharan_Africa,83.0,leave-one-macro-region-out,
72 +-0.6073319277431232,18.0,A2 P,rep0_fold0,69.0,10x5-fold,
73 +,,A2 P,rep0_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
74 +that was "
75 +-0.5430608999692377,17.0,A2 P,rep0_fold2,70.0,10x5-fold,
76 +-0.6066033552073161,17.0,A2 P,rep0_fold3,70.0,10x5-fold,
77 +-0.6305116194410425,17.0,A2 P,rep0_fold4,70.0,10x5-fold,
78 +-0.6195177999366908,18.0,A2 P,rep1_fold0,69.0,10x5-fold,
79 +-0.5928356372674103,18.0,A2 P,rep1_fold1,69.0,10x5-fold,
80 +-0.5755512951369498,17.0,A2 P,rep1_fold2,70.0,10x5-fold,
81 +-0.622916299479458,17.0,A2 P,rep1_fold3,70.0,10x5-fold,
82 +-0.5852119207254092,17.0,A2 P,rep1_fold4,70.0,10x5-fold,
83 +-0.616472621816557,18.0,A2 P,rep2_fold0,69.0,10x5-fold,
84 +-0.5482053008327218,18.0,A2 P,rep2_fold1,69.0,10x5-fold,
85 +-0.6821407631459,17.0,A2 P,rep2_fold2,70.0,10x5-fold,
86 +-0.6293622469961574,17.0,A2 P,rep2_fold3,70.0,10x5-fold,
87 +-0.545310589513379,17.0,A2 P,rep2_fold4,70.0,10x5-fold,
88 +-0.5540445983633765,18.0,A2 P,rep3_fold0,69.0,10x5-fold,
89 +-0.6415004544963518,18.0,A2 P,rep3_fold1,69.0,10x5-fold,
90 +-0.6258069537622215,17.0,A2 P,rep3_fold2,70.0,10x5-fold,
91 +-0.6058292956883152,17.0,A2 P,rep3_fold3,70.0,10x5-fold,
92 +-0.5859419890086269,17.0,A2 P,rep3_fold4,70.0,10x5-fold,
93 +-0.6170286166705549,18.0,A2 P,rep4_fold0,69.0,10x5-fold,
94 +-0.6898464795595827,18.0,A2 P,rep4_fold1,69.0,10x5-fold,
95 +-0.5876564900362858,17.0,A2 P,rep4_fold2,70.0,10x5-fold,
96 +-0.599407944209624,17.0,A2 P,rep4_fold3,70.0,10x5-fold,
97 +-0.5554073836595318,17.0,A2 P,rep4_fold4,70.0,10x5-fold,
98 +-0.5754837141305577,18.0,A2 P,rep5_fold0,69.0,10x5-fold,
99 +-0.6366553669723513,18.0,A2 P,rep5_fold1,69.0,10x5-fold,
100 +-0.626181965497974,17.0,A2 P,rep5_fold2,70.0,10x5-fold,
101 +-0.5724568522125653,17.0,A2 P,rep5_fold3,70.0,10x5-fold,
102 +-0.5958887681386783,17.0,A2 P,rep5_fold4,70.0,10x5-fold,
103 +-0.6467235094755063,18.0,A2 P,rep6_fold0,69.0,10x5-fold,
104 +-0.5530973471164247,18.0,A2 P,rep6_fold1,69.0,10x5-fold,
105 +-0.5729226848601316,17.0,A2 P,rep6_fold2,70.0,10x5-fold,
106 +-0.6268760451697202,17.0,A2 P,rep6_fold3,70.0,10x5-fold,
107 +-0.6215745903739501,17.0,A2 P,rep6_fold4,70.0,10x5-fold,
108 +-0.6460179014798269,18.0,A2 P,rep7_fold0,69.0,10x5-fold,
109 +-0.615112194855756,18.0,A2 P,rep7_fold1,69.0,10x5-fold,
110 +-0.5649084327318514,17.0,A2 P,rep7_fold2,70.0,10x5-fold,
111 +-0.646666369436335,17.0,A2 P,rep7_fold3,70.0,10x5-fold,
112 +-0.5661568215832,17.0,A2 P,rep7_fold4,70.0,10x5-fold,
113 +-0.5822039715456159,18.0,A2 P,rep8_fold0,69.0,10x5-fold,
114 +-0.6049258779799229,18.0,A2 P,rep8_fold1,69.0,10x5-fold,
115 +-0.6104916839226251,17.0,A2 P,rep8_fold2,70.0,10x5-fold,
116 +-0.620428349688623,17.0,A2 P,rep8_fold3,70.0,10x5-fold,
117 +-0.5804883865855972,17.0,A2 P,rep8_fold4,70.0,10x5-fold,
118 +-0.6800275101477173,18.0,A2 P,rep9_fold0,69.0,10x5-fold,
119 +,,A2 P,rep9_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
120 +that was "
121 +-0.6098519300366266,17.0,A2 P,rep9_fold2,70.0,10x5-fold,
122 +-0.5925777083749647,17.0,A2 P,rep9_fold3,70.0,10x5-fold,
123 +-0.5587977262042823,17.0,A2 P,rep9_fold4,70.0,10x5-fold,
124 +-0.6222589966701738,18.0,B0 FE only,rep0_fold0,69.0,10x5-fold,
125 +,,B0 FE only,rep0_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
126 +that was "
127 +-0.5484545915943224,17.0,B0 FE only,rep0_fold2,70.0,10x5-fold,
128 +-0.6141295916001708,17.0,B0 FE only,rep0_fold3,70.0,10x5-fold,
129 +-0.6431128539272781,17.0,B0 FE only,rep0_fold4,70.0,10x5-fold,
130 +-0.6280493673157582,18.0,B0 FE only,rep1_fold0,69.0,10x5-fold,
131 +-0.597782103219764,18.0,B0 FE only,rep1_fold1,69.0,10x5-fold,
132 +-0.5771116387983672,17.0,B0 FE only,rep1_fold2,70.0,10x5-fold,
133 +-0.6248360038428907,17.0,B0 FE only,rep1_fold3,70.0,10x5-fold,
134 +-0.5924549688245182,17.0,B0 FE only,rep1_fold4,70.0,10x5-fold,
135 +-0.6224244199300977,18.0,B0 FE only,rep2_fold0,69.0,10x5-fold,
136 +-0.5462603369963266,18.0,B0 FE only,rep2_fold1,69.0,10x5-fold,
137 +-0.6913028440869243,17.0,B0 FE only,rep2_fold2,70.0,10x5-fold,
138 +-0.6191640061924059,17.0,B0 FE only,rep2_fold3,70.0,10x5-fold,
139 +-0.5487987002674055,17.0,B0 FE only,rep2_fold4,70.0,10x5-fold,
140 +-0.554652762577848,18.0,B0 FE only,rep3_fold0,69.0,10x5-fold,
141 +-0.642908611052659,18.0,B0 FE only,rep3_fold1,69.0,10x5-fold,
142 +-0.6369788488977463,17.0,B0 FE only,rep3_fold2,70.0,10x5-fold,
143 +-0.6148872113525065,17.0,B0 FE only,rep3_fold3,70.0,10x5-fold,
144 +-0.583431865864677,17.0,B0 FE only,rep3_fold4,70.0,10x5-fold,
145 +-0.6259557612659932,18.0,B0 FE only,rep4_fold0,69.0,10x5-fold,
146 +-0.7014602714988226,18.0,B0 FE only,rep4_fold1,69.0,10x5-fold,
147 +-0.5912995056749891,17.0,B0 FE only,rep4_fold2,70.0,10x5-fold,
148 +-0.5886871480168484,17.0,B0 FE only,rep4_fold3,70.0,10x5-fold,
149 +-0.5545150648412948,17.0,B0 FE only,rep4_fold4,70.0,10x5-fold,
150 +-0.5791119016815003,18.0,B0 FE only,rep5_fold0,69.0,10x5-fold,
151 +-0.6463348653643614,18.0,B0 FE only,rep5_fold1,69.0,10x5-fold,
152 +-0.631423050333644,17.0,B0 FE only,rep5_fold2,70.0,10x5-fold,
153 +-0.5803390702036926,17.0,B0 FE only,rep5_fold3,70.0,10x5-fold,
154 +-0.5893572684192436,17.0,B0 FE only,rep5_fold4,70.0,10x5-fold,
155 +-0.6471485289801452,18.0,B0 FE only,rep6_fold0,69.0,10x5-fold,
156 +-0.5553637502851452,18.0,B0 FE only,rep6_fold1,69.0,10x5-fold,
157 +-0.5636147183157447,17.0,B0 FE only,rep6_fold2,70.0,10x5-fold,
158 +-0.63411451084136,17.0,B0 FE only,rep6_fold3,70.0,10x5-fold,
159 +-0.6319157472426794,17.0,B0 FE only,rep6_fold4,70.0,10x5-fold,
160 +-0.6448266855298942,18.0,B0 FE only,rep7_fold0,69.0,10x5-fold,
161 +-0.6208906825838825,18.0,B0 FE only,rep7_fold1,69.0,10x5-fold,
162 +-0.5755605616448807,17.0,B0 FE only,rep7_fold2,70.0,10x5-fold,
163 +-0.6497659257041098,17.0,B0 FE only,rep7_fold3,70.0,10x5-fold,
164 +-0.5521465560221865,17.0,B0 FE only,rep7_fold4,70.0,10x5-fold,
165 +-0.583620691159712,18.0,B0 FE only,rep8_fold0,69.0,10x5-fold,
166 +-0.6141841607797137,18.0,B0 FE only,rep8_fold1,69.0,10x5-fold,
167 +-0.6167588901383592,17.0,B0 FE only,rep8_fold2,70.0,10x5-fold,
168 +-0.6247229072680537,17.0,B0 FE only,rep8_fold3,70.0,10x5-fold,
169 +-0.5837698591057986,17.0,B0 FE only,rep8_fold4,70.0,10x5-fold,
170 +-0.6655415522114628,18.0,B0 FE only,rep9_fold0,69.0,10x5-fold,
171 +,,B0 FE only,rep9_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
172 +that was "
173 +-0.616058766494441,17.0,B0 FE only,rep9_fold2,70.0,10x5-fold,
174 +-0.598973678147369,17.0,B0 FE only,rep9_fold3,70.0,10x5-fold,
175 +-0.5685000808762086,17.0,B0 FE only,rep9_fold4,70.0,10x5-fold,
176 +-0.6083195876382478,18.0,B1 D only,rep0_fold0,69.0,10x5-fold,
177 +,,B1 D only,rep0_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
178 +that was "
179 +-0.546891347396433,17.0,B1 D only,rep0_fold2,70.0,10x5-fold,
180 +-0.6073616258366199,17.0,B1 D only,rep0_fold3,70.0,10x5-fold,
181 +-0.6312694824979594,17.0,B1 D only,rep0_fold4,70.0,10x5-fold,
182 +-0.6223838629775634,18.0,B1 D only,rep1_fold0,69.0,10x5-fold,
183 +-0.5947180870121573,18.0,B1 D only,rep1_fold1,69.0,10x5-fold,
184 +-0.5822865142697975,17.0,B1 D only,rep1_fold2,70.0,10x5-fold,
185 +-0.6199227847693539,17.0,B1 D only,rep1_fold3,70.0,10x5-fold,
186 +-0.5859938247448637,17.0,B1 D only,rep1_fold4,70.0,10x5-fold,
187 +-0.6175189764440715,18.0,B1 D only,rep2_fold0,69.0,10x5-fold,
188 +-0.5569485312822358,18.0,B1 D only,rep2_fold1,69.0,10x5-fold,
189 +-0.6841572629494984,17.0,B1 D only,rep2_fold2,70.0,10x5-fold,
190 +-0.6200529874225703,17.0,B1 D only,rep2_fold3,70.0,10x5-fold,
191 +-0.546098627091856,17.0,B1 D only,rep2_fold4,70.0,10x5-fold,
192 +-0.5660339371317407,18.0,B1 D only,rep3_fold0,69.0,10x5-fold,
193 +-0.640706101223895,18.0,B1 D only,rep3_fold1,69.0,10x5-fold,
194 +-0.628772500289047,17.0,B1 D only,rep3_fold2,70.0,10x5-fold,
195 +-0.6089885321578207,17.0,B1 D only,rep3_fold3,70.0,10x5-fold,
196 +-0.589291658590394,17.0,B1 D only,rep3_fold4,70.0,10x5-fold,
197 +-0.616508747350852,18.0,B1 D only,rep4_fold0,69.0,10x5-fold,
198 +-0.6943559160937426,18.0,B1 D only,rep4_fold1,69.0,10x5-fold,
199 +-0.5866364532840139,17.0,B1 D only,rep4_fold2,70.0,10x5-fold,
200 +-0.6021887502841344,17.0,B1 D only,rep4_fold3,70.0,10x5-fold,
201 +-0.5618567958922737,17.0,B1 D only,rep4_fold4,70.0,10x5-fold,
202 +-0.5731895159730104,18.0,B1 D only,rep5_fold0,69.0,10x5-fold,
203 +-0.639150680801495,18.0,B1 D only,rep5_fold1,69.0,10x5-fold,
204 +-0.6295445658391886,17.0,B1 D only,rep5_fold2,70.0,10x5-fold,
205 +-0.573692260065334,17.0,B1 D only,rep5_fold3,70.0,10x5-fold,
206 +-0.5995650677337133,17.0,B1 D only,rep5_fold4,70.0,10x5-fold,
207 +-0.6518349304983629,18.0,B1 D only,rep6_fold0,69.0,10x5-fold,
208 +-0.5531610824735905,18.0,B1 D only,rep6_fold1,69.0,10x5-fold,
209 +-0.5763361704012375,17.0,B1 D only,rep6_fold2,70.0,10x5-fold,
210 +-0.6282372771818667,17.0,B1 D only,rep6_fold3,70.0,10x5-fold,
211 +-0.6248206977725752,17.0,B1 D only,rep6_fold4,70.0,10x5-fold,
212 +-0.653125147254194,18.0,B1 D only,rep7_fold0,69.0,10x5-fold,
213 +-0.6143976840991052,18.0,B1 D only,rep7_fold1,69.0,10x5-fold,
214 +-0.5674316594988658,17.0,B1 D only,rep7_fold2,70.0,10x5-fold,
215 +-0.644496996076469,17.0,B1 D only,rep7_fold3,70.0,10x5-fold,
216 +-0.5635400325456037,17.0,B1 D only,rep7_fold4,70.0,10x5-fold,
217 +-0.584929487443215,18.0,B1 D only,rep8_fold0,69.0,10x5-fold,
218 +-0.6051446334858768,18.0,B1 D only,rep8_fold1,69.0,10x5-fold,
219 +-0.6116292761407962,17.0,B1 D only,rep8_fold2,70.0,10x5-fold,
220 +-0.6245369876486837,17.0,B1 D only,rep8_fold3,70.0,10x5-fold,
221 +-0.5802696103002862,17.0,B1 D only,rep8_fold4,70.0,10x5-fold,
222 +-0.6769562064244521,18.0,B1 D only,rep9_fold0,69.0,10x5-fold,
223 +,,B1 D only,rep9_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
224 +that was "
225 +-0.6094913290463297,17.0,B1 D only,rep9_fold2,70.0,10x5-fold,
226 +-0.5936887920747554,17.0,B1 D only,rep9_fold3,70.0,10x5-fold,
227 +-0.5608830070370011,17.0,B1 D only,rep9_fold4,70.0,10x5-fold,
228 +-0.622860733833226,18.0,B2 K only,rep0_fold0,69.0,10x5-fold,
229 +,,B2 K only,rep0_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
230 +that was "
231 +-0.5481025853813067,17.0,B2 K only,rep0_fold2,70.0,10x5-fold,
232 +-0.6157795858450074,17.0,B2 K only,rep0_fold3,70.0,10x5-fold,
233 +-0.647858812398134,17.0,B2 K only,rep0_fold4,70.0,10x5-fold,
234 +-0.6288038612470842,18.0,B2 K only,rep1_fold0,69.0,10x5-fold,
235 +-0.5975185326794321,18.0,B2 K only,rep1_fold1,69.0,10x5-fold,
236 +-0.5785935586562205,17.0,B2 K only,rep1_fold2,70.0,10x5-fold,
237 +-0.6265308235739577,17.0,B2 K only,rep1_fold3,70.0,10x5-fold,
238 +-0.6049837734565248,17.0,B2 K only,rep1_fold4,70.0,10x5-fold,
239 +-0.622723644715846,18.0,B2 K only,rep2_fold0,69.0,10x5-fold,
240 +-0.5479976710611313,18.0,B2 K only,rep2_fold1,69.0,10x5-fold,
241 +-0.691017174609867,17.0,B2 K only,rep2_fold2,70.0,10x5-fold,
242 +-0.6297025936236185,17.0,B2 K only,rep2_fold3,70.0,10x5-fold,
243 +-0.5489775346820496,17.0,B2 K only,rep2_fold4,70.0,10x5-fold,
244 +-0.5569141957997442,18.0,B2 K only,rep3_fold0,69.0,10x5-fold,
245 +-0.6438185192695789,18.0,B2 K only,rep3_fold1,69.0,10x5-fold,
246 +-0.6381378863600627,17.0,B2 K only,rep3_fold2,70.0,10x5-fold,
247 +-0.6142228160425109,17.0,B2 K only,rep3_fold3,70.0,10x5-fold,
248 +-0.5830679679528096,17.0,B2 K only,rep3_fold4,70.0,10x5-fold,
249 +-0.6272397542059387,18.0,B2 K only,rep4_fold0,69.0,10x5-fold,
250 +-0.7005034673848259,18.0,B2 K only,rep4_fold1,69.0,10x5-fold,
251 +-0.594376135777104,17.0,B2 K only,rep4_fold2,70.0,10x5-fold,
252 +-0.5882661065530312,17.0,B2 K only,rep4_fold3,70.0,10x5-fold,
253 +-0.5552266659875161,17.0,B2 K only,rep4_fold4,70.0,10x5-fold,
254 +-0.5833162558472252,18.0,B2 K only,rep5_fold0,69.0,10x5-fold,
255 +-0.6458843675834318,18.0,B2 K only,rep5_fold1,69.0,10x5-fold,
256 +-0.6341119232147508,17.0,B2 K only,rep5_fold2,70.0,10x5-fold,
257 +-0.5801197123671539,17.0,B2 K only,rep5_fold3,70.0,10x5-fold,
258 +-0.5917407814937196,17.0,B2 K only,rep5_fold4,70.0,10x5-fold,
259 +-0.6478841088759187,18.0,B2 K only,rep6_fold0,69.0,10x5-fold,
260 +-0.5562699230921433,18.0,B2 K only,rep6_fold1,69.0,10x5-fold,
261 +-0.5642110792414579,17.0,B2 K only,rep6_fold2,70.0,10x5-fold,
262 +-0.6339541022109576,17.0,B2 K only,rep6_fold3,70.0,10x5-fold,
263 +-0.631241916779392,17.0,B2 K only,rep6_fold4,70.0,10x5-fold,
264 +-0.6457897459223011,18.0,B2 K only,rep7_fold0,69.0,10x5-fold,
265 +-0.6241780267664523,18.0,B2 K only,rep7_fold1,69.0,10x5-fold,
266 +-0.577715100514324,17.0,B2 K only,rep7_fold2,70.0,10x5-fold,
267 +-0.6570781933037084,17.0,B2 K only,rep7_fold3,70.0,10x5-fold,
268 +-0.5521118033697582,17.0,B2 K only,rep7_fold4,70.0,10x5-fold,
269 +-0.5828381767659178,18.0,B2 K only,rep8_fold0,69.0,10x5-fold,
270 +-0.6144580157235265,18.0,B2 K only,rep8_fold1,69.0,10x5-fold,
271 +-0.616659994437666,17.0,B2 K only,rep8_fold2,70.0,10x5-fold,
272 +-0.624088792321915,17.0,B2 K only,rep8_fold3,70.0,10x5-fold,
273 +-0.5844439826069375,17.0,B2 K only,rep8_fold4,70.0,10x5-fold,
274 +-0.6663920964067712,18.0,B2 K only,rep9_fold0,69.0,10x5-fold,
275 +,,B2 K only,rep9_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
276 +that was "
277 +-0.61663352215543,17.0,B2 K only,rep9_fold2,70.0,10x5-fold,
278 +-0.5989841600894605,17.0,B2 K only,rep9_fold3,70.0,10x5-fold,
279 +-0.5687535233371137,17.0,B2 K only,rep9_fold4,70.0,10x5-fold,
280 +-0.6224232632942309,18.0,B3 complexity,rep0_fold0,69.0,10x5-fold,
281 +,,B3 complexity,rep0_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
282 +that was "
283 +-0.548021220605251,17.0,B3 complexity,rep0_fold2,70.0,10x5-fold,
284 +-0.6185799277109469,17.0,B3 complexity,rep0_fold3,70.0,10x5-fold,
285 +-0.6551767260281819,17.0,B3 complexity,rep0_fold4,70.0,10x5-fold,
286 +-0.6280157326305398,18.0,B3 complexity,rep1_fold0,69.0,10x5-fold,
287 +-0.5974127318195985,18.0,B3 complexity,rep1_fold1,69.0,10x5-fold,
288 +-0.5779100101966184,17.0,B3 complexity,rep1_fold2,70.0,10x5-fold,
289 +-0.6265719380201763,17.0,B3 complexity,rep1_fold3,70.0,10x5-fold,
290 +-0.5998911050375249,17.0,B3 complexity,rep1_fold4,70.0,10x5-fold,
291 +-0.6229682345999569,18.0,B3 complexity,rep2_fold0,69.0,10x5-fold,
292 +-0.5527991529682255,18.0,B3 complexity,rep2_fold1,69.0,10x5-fold,
293 +-0.6918027497298345,17.0,B3 complexity,rep2_fold2,70.0,10x5-fold,
294 +-0.6243495498300767,17.0,B3 complexity,rep2_fold3,70.0,10x5-fold,
295 +-0.5486012589225445,17.0,B3 complexity,rep2_fold4,70.0,10x5-fold,
296 +-0.554348329200956,18.0,B3 complexity,rep3_fold0,69.0,10x5-fold,
297 +-0.643857038455794,18.0,B3 complexity,rep3_fold1,69.0,10x5-fold,
298 +-0.640216594325675,17.0,B3 complexity,rep3_fold2,70.0,10x5-fold,
299 +-0.6139446870181516,17.0,B3 complexity,rep3_fold3,70.0,10x5-fold,
300 +-0.5838240226168955,17.0,B3 complexity,rep3_fold4,70.0,10x5-fold,
301 +-0.6276158169789166,18.0,B3 complexity,rep4_fold0,69.0,10x5-fold,
302 +-0.7025064012583728,18.0,B3 complexity,rep4_fold1,69.0,10x5-fold,
303 +-0.5968080743238756,17.0,B3 complexity,rep4_fold2,70.0,10x5-fold,
304 +-0.5878815702260025,17.0,B3 complexity,rep4_fold3,70.0,10x5-fold,
305 +-0.555541049733102,17.0,B3 complexity,rep4_fold4,70.0,10x5-fold,
306 +-0.5825960687526403,18.0,B3 complexity,rep5_fold0,69.0,10x5-fold,
307 +-0.6458675603618614,18.0,B3 complexity,rep5_fold1,69.0,10x5-fold,
308 +-0.6318087921744449,17.0,B3 complexity,rep5_fold2,70.0,10x5-fold,
309 +-0.5805765904798559,17.0,B3 complexity,rep5_fold3,70.0,10x5-fold,
310 +-0.5898164549103526,17.0,B3 complexity,rep5_fold4,70.0,10x5-fold,
311 +-0.6488127534634986,18.0,B3 complexity,rep6_fold0,69.0,10x5-fold,
312 +-0.5598498827806732,18.0,B3 complexity,rep6_fold1,69.0,10x5-fold,
313 +-0.5631650509389547,17.0,B3 complexity,rep6_fold2,70.0,10x5-fold,
314 +-0.6340273844377895,17.0,B3 complexity,rep6_fold3,70.0,10x5-fold,
315 +-0.6344343111184253,17.0,B3 complexity,rep6_fold4,70.0,10x5-fold,
316 +-0.6495896866751387,18.0,B3 complexity,rep7_fold0,69.0,10x5-fold,
317 +-0.6201545780087081,18.0,B3 complexity,rep7_fold1,69.0,10x5-fold,
318 +-0.5766895733818591,17.0,B3 complexity,rep7_fold2,70.0,10x5-fold,
319 +-0.6526483507711919,17.0,B3 complexity,rep7_fold3,70.0,10x5-fold,
320 +-0.5520706492340092,17.0,B3 complexity,rep7_fold4,70.0,10x5-fold,
321 +-0.5837108392288399,18.0,B3 complexity,rep8_fold0,69.0,10x5-fold,
322 +-0.6148287565836799,18.0,B3 complexity,rep8_fold1,69.0,10x5-fold,
323 +-0.6173938320749792,17.0,B3 complexity,rep8_fold2,70.0,10x5-fold,
324 +-0.6243828632704121,17.0,B3 complexity,rep8_fold3,70.0,10x5-fold,
325 +-0.58370651697469,17.0,B3 complexity,rep8_fold4,70.0,10x5-fold,
326 +-0.6658135394934944,18.0,B3 complexity,rep9_fold0,69.0,10x5-fold,
327 +,,B3 complexity,rep9_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
328 +that was "
329 +-0.6160048014502761,17.0,B3 complexity,rep9_fold2,70.0,10x5-fold,
330 +-0.5994598035926632,17.0,B3 complexity,rep9_fold3,70.0,10x5-fold,
331 +-0.568713984582936,17.0,B3 complexity,rep9_fold4,70.0,10x5-fold,
332 +-0.6177748794828175,18.0,B4 persistence,rep0_fold0,69.0,10x5-fold,
333 +,,B4 persistence,rep0_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
334 +that was "
335 +-0.541350208035929,17.0,B4 persistence,rep0_fold2,70.0,10x5-fold,
336 +-0.6150391065571179,17.0,B4 persistence,rep0_fold3,70.0,10x5-fold,
337 +-0.6399410433722716,17.0,B4 persistence,rep0_fold4,70.0,10x5-fold,
338 +-0.6295697257883499,18.0,B4 persistence,rep1_fold0,69.0,10x5-fold,
339 +-0.5880278784748856,18.0,B4 persistence,rep1_fold1,69.0,10x5-fold,
340 +-0.5731604710799205,17.0,B4 persistence,rep1_fold2,70.0,10x5-fold,
341 +-0.6375013456439419,17.0,B4 persistence,rep1_fold3,70.0,10x5-fold,
342 +-0.5958581411636649,17.0,B4 persistence,rep1_fold4,70.0,10x5-fold,
343 +-0.6190718851371307,18.0,B4 persistence,rep2_fold0,69.0,10x5-fold,
344 +-0.5482486031623248,18.0,B4 persistence,rep2_fold1,69.0,10x5-fold,
345 +-0.6889472659786482,17.0,B4 persistence,rep2_fold2,70.0,10x5-fold,
346 +-0.611941560462283,17.0,B4 persistence,rep2_fold3,70.0,10x5-fold,
347 +-0.5472265352846163,17.0,B4 persistence,rep2_fold4,70.0,10x5-fold,
348 +-0.5573419404454799,18.0,B4 persistence,rep3_fold0,69.0,10x5-fold,
349 +-0.6380646732677969,18.0,B4 persistence,rep3_fold1,69.0,10x5-fold,
350 +-0.6307203306424725,17.0,B4 persistence,rep3_fold2,70.0,10x5-fold,
351 +-0.6097671103332879,17.0,B4 persistence,rep3_fold3,70.0,10x5-fold,
352 +-0.58655920179526,17.0,B4 persistence,rep3_fold4,70.0,10x5-fold,
353 +-0.6211534067439222,18.0,B4 persistence,rep4_fold0,69.0,10x5-fold,
354 +-0.6961452495181134,18.0,B4 persistence,rep4_fold1,69.0,10x5-fold,
355 +-0.5881216246876273,17.0,B4 persistence,rep4_fold2,70.0,10x5-fold,
356 +-0.5876368465571769,17.0,B4 persistence,rep4_fold3,70.0,10x5-fold,
357 +-0.5550327501500281,17.0,B4 persistence,rep4_fold4,70.0,10x5-fold,
358 +-0.5826526469530944,18.0,B4 persistence,rep5_fold0,69.0,10x5-fold,
359 +-0.6371101593952542,18.0,B4 persistence,rep5_fold1,69.0,10x5-fold,
360 +-0.6300000134772511,17.0,B4 persistence,rep5_fold2,70.0,10x5-fold,
361 +-0.5762926736158204,17.0,B4 persistence,rep5_fold3,70.0,10x5-fold,
362 +-0.5985421162868496,17.0,B4 persistence,rep5_fold4,70.0,10x5-fold,
363 +-0.652928695414056,18.0,B4 persistence,rep6_fold0,69.0,10x5-fold,
364 +-0.5551680870281747,18.0,B4 persistence,rep6_fold1,69.0,10x5-fold,
365 +-0.5643743883025886,17.0,B4 persistence,rep6_fold2,70.0,10x5-fold,
366 +-0.6273228665735541,17.0,B4 persistence,rep6_fold3,70.0,10x5-fold,
367 +-0.6269801961378364,17.0,B4 persistence,rep6_fold4,70.0,10x5-fold,
368 +-0.6397452196954947,18.0,B4 persistence,rep7_fold0,69.0,10x5-fold,
369 +-0.6162470649154671,18.0,B4 persistence,rep7_fold1,69.0,10x5-fold,
370 +-0.5647336910797054,17.0,B4 persistence,rep7_fold2,70.0,10x5-fold,
371 +-0.6445988346816625,17.0,B4 persistence,rep7_fold3,70.0,10x5-fold,
372 +-0.5518545474497174,17.0,B4 persistence,rep7_fold4,70.0,10x5-fold,
373 +-0.5816639710614425,18.0,B4 persistence,rep8_fold0,69.0,10x5-fold,
374 +-0.6104026408192657,18.0,B4 persistence,rep8_fold1,69.0,10x5-fold,
375 +-0.6230006737451382,17.0,B4 persistence,rep8_fold2,70.0,10x5-fold,
376 +-0.6211060770037978,17.0,B4 persistence,rep8_fold3,70.0,10x5-fold,
377 +-0.5788777122446616,17.0,B4 persistence,rep8_fold4,70.0,10x5-fold,
378 +-0.6798072722309922,18.0,B4 persistence,rep9_fold0,69.0,10x5-fold,
379 +,,B4 persistence,rep9_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
380 +that was "
381 +-0.6161884466742826,17.0,B4 persistence,rep9_fold2,70.0,10x5-fold,
382 +-0.5979456758715648,17.0,B4 persistence,rep9_fold3,70.0,10x5-fold,
383 +-0.5649801809335007,17.0,B4 persistence,rep9_fold4,70.0,10x5-fold,
384 +-0.6071201113987283,18.0,B5 D+K,rep0_fold0,69.0,10x5-fold,
385 +,,B5 D+K,rep0_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
386 +that was "
387 +-0.5448226199275119,17.0,B5 D+K,rep0_fold2,70.0,10x5-fold,
388 +-0.6078459568722003,17.0,B5 D+K,rep0_fold3,70.0,10x5-fold,
389 +-0.6342417651615544,17.0,B5 D+K,rep0_fold4,70.0,10x5-fold,
390 +-0.6216611883548933,18.0,B5 D+K,rep1_fold0,69.0,10x5-fold,
391 +-0.5933436332383474,18.0,B5 D+K,rep1_fold1,69.0,10x5-fold,
392 +-0.5799203552322584,17.0,B5 D+K,rep1_fold2,70.0,10x5-fold,
393 +-0.6237774969169441,17.0,B5 D+K,rep1_fold3,70.0,10x5-fold,
394 +-0.5962314074144938,17.0,B5 D+K,rep1_fold4,70.0,10x5-fold,
395 +-0.6164285456981456,18.0,B5 D+K,rep2_fold0,69.0,10x5-fold,
396 +-0.5550719506380004,18.0,B5 D+K,rep2_fold1,69.0,10x5-fold,
397 +-0.6823529488772692,17.0,B5 D+K,rep2_fold2,70.0,10x5-fold,
398 +-0.6349211354758763,17.0,B5 D+K,rep2_fold3,70.0,10x5-fold,
399 +-0.5459307682665984,17.0,B5 D+K,rep2_fold4,70.0,10x5-fold,
400 +-0.5642082627660487,18.0,B5 D+K,rep3_fold0,69.0,10x5-fold,
401 +-0.6413358094439828,18.0,B5 D+K,rep3_fold1,69.0,10x5-fold,
402 +-0.6273715788317731,17.0,B5 D+K,rep3_fold2,70.0,10x5-fold,
403 +-0.606168563492821,17.0,B5 D+K,rep3_fold3,70.0,10x5-fold,
404 +-0.5873488241907752,17.0,B5 D+K,rep3_fold4,70.0,10x5-fold,
405 +-0.6167635409415378,18.0,B5 D+K,rep4_fold0,69.0,10x5-fold,
406 +-0.6902898041346739,18.0,B5 D+K,rep4_fold1,69.0,10x5-fold,
407 +-0.590063802353847,17.0,B5 D+K,rep4_fold2,70.0,10x5-fold,
408 +-0.60149969130101,17.0,B5 D+K,rep4_fold3,70.0,10x5-fold,
409 +-0.5610610105956596,17.0,B5 D+K,rep4_fold4,70.0,10x5-fold,
410 +-0.5763076114426743,18.0,B5 D+K,rep5_fold0,69.0,10x5-fold,
411 +-0.6367410766013497,18.0,B5 D+K,rep5_fold1,69.0,10x5-fold,
412 +-0.6283237081659587,17.0,B5 D+K,rep5_fold2,70.0,10x5-fold,
413 +-0.5723113512237697,17.0,B5 D+K,rep5_fold3,70.0,10x5-fold,
414 +-0.5974104639599264,17.0,B5 D+K,rep5_fold4,70.0,10x5-fold,
415 +-0.650233537823597,18.0,B5 D+K,rep6_fold0,69.0,10x5-fold,
416 +-0.5530376972999185,18.0,B5 D+K,rep6_fold1,69.0,10x5-fold,
417 +-0.5745115580682859,17.0,B5 D+K,rep6_fold2,70.0,10x5-fold,
418 +-0.6266934184819944,17.0,B5 D+K,rep6_fold3,70.0,10x5-fold,
419 +-0.6216739607716862,17.0,B5 D+K,rep6_fold4,70.0,10x5-fold,
420 +-0.6517790474103996,18.0,B5 D+K,rep7_fold0,69.0,10x5-fold,
421 +-0.6169432515040979,18.0,B5 D+K,rep7_fold1,69.0,10x5-fold,
422 +-0.5671613279484712,17.0,B5 D+K,rep7_fold2,70.0,10x5-fold,
423 +-0.6516063601653364,17.0,B5 D+K,rep7_fold3,70.0,10x5-fold,
424 +-0.5669222689586157,17.0,B5 D+K,rep7_fold4,70.0,10x5-fold,
425 +-0.5826281169172589,18.0,B5 D+K,rep8_fold0,69.0,10x5-fold,
426 +-0.6043655684533858,18.0,B5 D+K,rep8_fold1,69.0,10x5-fold,
427 +-0.610361676935831,17.0,B5 D+K,rep8_fold2,70.0,10x5-fold,
428 +-0.6213289274365054,17.0,B5 D+K,rep8_fold3,70.0,10x5-fold,
429 +-0.580382971518139,17.0,B5 D+K,rep8_fold4,70.0,10x5-fold,
430 +-0.6811250689340757,18.0,B5 D+K,rep9_fold0,69.0,10x5-fold,
431 +,,B5 D+K,rep9_fold1,,10x5-fold,"predict requires that you use a DataFrame when predicting from a model
432 +that was "
433 +-0.6095615301133424,17.0,B5 D+K,rep9_fold2,70.0,10x5-fold,
434 +-0.5925029199463963,17.0,B5 D+K,rep9_fold3,70.0,10x5-fold,
435 +-0.5588775589829003,17.0,B5 D+K,rep9_fold4,70.0,10x5-fold,
added results/empirical/h2_seshat_cv_folds_binary.csv +358 −0
@@ -0,0 +1,358 @@
1 +oos_loglik,brier,n,events,auc,calibration_slope,calibration_intercept,model,fold,n_train,error
2 +-1.6147278603128579,0.3477243093646753,18.0,16.0,0.4375,0.038878271738374166,2.026196590725106,A2 P,rep0_fold0,68.0,
3 +-0.42441452306857363,0.1520988690137464,17.0,13.0,0.8461538461538461,1.2521074991479944,-1.0679246732517913,A2 P,rep0_fold1,69.0,
4 +-1.8840638143338655,0.36524821538527935,17.0,9.0,0.6875,0.08418244377459007,-0.0633491943728489,A2 P,rep0_fold2,69.0,
5 +-0.20419397407706072,0.06244502228713764,17.0,15.0,0.9666666666666667,1.9906576661035766,0.9108619774489326,A2 P,rep0_fold3,69.0,
6 +-4.430780053520126,0.5793041005247747,17.0,12.0,0.3,-0.0801749860789851,1.2633970374179302,A2 P,rep0_fold4,69.0,
7 +-3.235938791775332,0.27368142086203257,18.0,15.0,0.16666666666666666,-2.0831738621865363,29.290934027674087,A2 P,rep1_fold0,68.0,
8 +-1.315746596440423,0.21037165069507135,17.0,13.0,0.8076923076923077,0.10689476645030033,0.6291870257465465,A2 P,rep1_fold1,69.0,
9 +-1.0161714346005353,0.3533902929376095,17.0,10.0,0.6,0.16558749332123757,-0.08836352642102288,A2 P,rep1_fold2,69.0,
10 +-0.5729346434798638,0.20695281812362554,17.0,15.0,0.6,0.22382184725319815,1.7829883147126673,A2 P,rep1_fold3,69.0,
11 +-0.6656800955333683,0.20903195900594115,17.0,12.0,0.6833333333333333,0.23594597549413338,0.3407316118726492,A2 P,rep1_fold4,69.0,
12 +-0.6535914620065003,0.22121331070289185,18.0,15.0,0.5333333333333333,0.12986220355059042,1.1574914704584087,A2 P,rep2_fold0,68.0,
13 +-1.1724788710482998,0.1792770540530261,17.0,13.0,0.8173076923076924,0.12363940891887464,1.2000716589774805,A2 P,rep2_fold1,69.0,
14 +-1.3198524981977313,0.25193041506948205,17.0,11.0,0.6439393939393939,0.10438219359958759,0.559412467879823,A2 P,rep2_fold2,69.0,
15 +,,,,,,,A2 P,rep2_fold3,,"predict requires that you use a DataFrame when predicting from a model
16 +that was "
17 +-0.6272651629454997,0.20899752686733333,17.0,12.0,0.7833333333333332,0.298914459138422,-0.13492340946207249,A2 P,rep2_fold4,69.0,
18 +-0.3354806229051316,0.11812201104759944,18.0,16.0,0.8125,0.7154223125334125,1.2794408523026972,A2 P,rep3_fold0,68.0,
19 +-0.4437086073143465,0.160879307140492,17.0,15.0,0.7666666666666666,0.5450830291381796,1.5103888106744947,A2 P,rep3_fold1,69.0,
20 +-0.7134263555561973,0.24495887830512034,17.0,13.0,0.5384615384615385,0.13512967061778933,0.8857142154721119,A2 P,rep3_fold2,69.0,
21 +-2.0924764941334812,0.35081623589589617,17.0,10.0,0.8214285714285715,0.11904897495158784,-0.289893176797397,A2 P,rep3_fold3,69.0,
22 +-1.6048130374074236,0.3419129525794218,17.0,11.0,0.4621212121212121,0.06189947947451136,0.603530205162833,A2 P,rep3_fold4,69.0,
23 +-2.672704537604353,0.3041410501715993,18.0,14.0,0.6160714285714286,0.04459856659665558,1.1363092241200814,A2 P,rep4_fold0,68.0,
24 +-1.9549021624544816,0.40223376727601223,17.0,14.0,0.35714285714285715,-0.07318111305960068,1.8285145290206528,A2 P,rep4_fold1,69.0,
25 +-0.5440219786887894,0.19883486902209552,17.0,13.0,0.6730769230769231,0.28649325884862875,0.720737069296145,A2 P,rep4_fold2,69.0,
26 +-2.0611047237129547,0.2617154562801296,17.0,12.0,0.3833333333333333,-0.15207265561858585,1.45686686235328,A2 P,rep4_fold3,69.0,
27 +-3.617187084826787,0.367433817812498,17.0,12.0,0.375,-0.06339638671810253,1.3132950385700353,A2 P,rep4_fold4,69.0,
28 +-1.347115755852717,0.25984022788109135,18.0,15.0,0.4222222222222222,0.04560670174591099,1.4733608398602684,A2 P,rep5_fold0,68.0,
29 +-0.7696945620658717,0.24666384795650267,17.0,12.0,0.6,0.17544137642115198,0.4640834563468401,A2 P,rep5_fold1,69.0,
30 +-1.3861042312985463,0.25144965725559737,17.0,11.0,0.6893939393939394,0.09814499986819727,0.48777175438359144,A2 P,rep5_fold2,69.0,
31 +-0.44570193638545413,0.1641037606752546,17.0,14.0,0.8333333333333333,0.5974521114968139,1.1283588379145597,A2 P,rep5_fold3,69.0,
32 +-0.4576601351382101,0.15041187066866465,17.0,13.0,0.7884615384615384,0.41423006218913255,0.07965869520526861,A2 P,rep5_fold4,69.0,
33 +-0.3761035107600513,0.12616329919383432,18.0,14.0,0.875,1.6557634948473352,-0.6282133990609461,A2 P,rep6_fold0,68.0,
34 +-1.6619671875957103,0.31046049125739683,17.0,12.0,0.65,0.04799852314072253,0.7246092884768622,A2 P,rep6_fold1,69.0,
35 +-0.6989838295231457,0.273826726652936,17.0,12.0,0.6,0.2062419047641306,0.3593777094575474,A2 P,rep6_fold2,69.0,
36 +-0.909007990973212,0.20792283984435148,17.0,13.0,0.7692307692307693,0.17193427774360018,0.47918513299684873,A2 P,rep6_fold3,69.0,
37 +-2.81850711760906,0.3183467535469455,17.0,14.0,0.33333333333333337,-0.09203509113702232,2.1804501564329093,A2 P,rep6_fold4,69.0,
38 +-1.1872378880317631,0.2017689499925686,18.0,15.0,0.7555555555555555,0.0750270298174241,1.4922532517495117,A2 P,rep7_fold0,68.0,
39 +-0.5001909207980899,0.1545253171731453,17.0,13.0,0.826923076923077,0.7119143333563948,-0.8535969344746249,A2 P,rep7_fold1,69.0,
40 +-2.0273237786095715,0.2707148942961337,17.0,13.0,0.6923076923076923,0.06241584821793688,0.9378910575705046,A2 P,rep7_fold2,69.0,
41 +-3.6691485905464516,0.5514625409581766,17.0,12.0,0.35,-0.05894373166747355,1.1409993633794187,A2 P,rep7_fold3,69.0,
42 +-1.3119964121545127,0.24491785812605305,17.0,12.0,0.7416666666666667,0.10530709285135498,0.7782489366139902,A2 P,rep7_fold4,69.0,
43 +-2.36247250070995,0.32007659227406504,18.0,13.0,0.35384615384615387,-0.08318557297293905,1.4319403256005532,A2 P,rep8_fold0,68.0,
44 +-2.0012338376218044,0.25668164542454436,17.0,13.0,0.6538461538461539,0.050668229272140895,1.04851909641943,A2 P,rep8_fold1,69.0,
45 +-0.33300355683927324,0.11039155848439539,17.0,15.0,0.8333333333333333,0.704471267770291,0.9815171783683103,A2 P,rep8_fold2,69.0,
46 +-0.6091075823803311,0.22883072737220334,17.0,13.0,0.5961538461538461,0.20891920721755253,0.6266289295895827,A2 P,rep8_fold3,69.0,
47 +-1.0048419044628136,0.3267922786384308,17.0,11.0,0.5757575757575758,0.16739435335518407,0.03197093921211378,A2 P,rep8_fold4,69.0,
48 +-0.8948152920274626,0.3053150193792902,18.0,16.0,0.4375,0.07177519092991,1.9194295886590058,A2 P,rep9_fold0,68.0,
49 +-0.4628150248187353,0.17197175642834753,17.0,14.0,0.7857142857142857,0.29137560725846207,0.5228233250402071,A2 P,rep9_fold1,69.0,
50 +-1.828081464793649,0.37517440578977823,17.0,10.0,0.6714285714285715,0.06718331847372185,0.12452704484749566,A2 P,rep9_fold2,69.0,
51 +-1.4092359068059312,0.2667741807927447,17.0,12.0,0.7250000000000001,0.1020813983843958,0.6896344573276423,A2 P,rep9_fold3,69.0,
52 +-0.49362602461400906,0.18006104353710953,17.0,13.0,0.7884615384615384,0.42489374443176425,0.5310737542417381,A2 P,rep9_fold4,69.0,
53 +-1.6026807909925862,0.3346420941916078,18.0,16.0,0.453125,0.03548353862135764,2.0246799887665627,B0 FE only,rep0_fold0,68.0,
54 +-0.42166499842004707,0.15083099265515607,17.0,13.0,0.8461538461538461,1.2627571600195981,-1.0645564460917991,B0 FE only,rep0_fold1,69.0,
55 +-1.8847642233389454,0.36721686954510047,17.0,9.0,0.6875,0.08378536457789025,-0.06161431753009383,B0 FE only,rep0_fold2,69.0,
56 +-0.20360669129158154,0.062194646244978787,17.0,15.0,0.9666666666666667,2.0412826847348073,0.9773620520535192,B0 FE only,rep0_fold3,69.0,
57 +-4.155410811444089,0.5216355020583806,17.0,12.0,0.3,-0.06783537993444409,1.1851074469981253,B0 FE only,rep0_fold4,69.0,
58 +-3.235953600345602,0.27368235159932924,18.0,15.0,0.16666666666666666,-2.09274480736517,29.423161512265107,B0 FE only,rep1_fold0,68.0,
59 +-1.280740605149126,0.20945368215516635,17.0,13.0,0.8076923076923077,0.1093191568802817,0.6229670649876213,B0 FE only,rep1_fold1,69.0,
60 +-1.0166645443366125,0.35375847398286225,17.0,10.0,0.6142857142857143,0.16495850525775874,-0.08555539297181841,B0 FE only,rep1_fold2,69.0,
61 +-0.543415991356492,0.19095865995016953,17.0,15.0,0.7333333333333334,0.4132406618766648,1.7356813881884818,B0 FE only,rep1_fold3,69.0,
62 +-0.666217632332288,0.20997192518554564,17.0,12.0,0.6666666666666667,0.23623658710147247,0.34673558274257765,B0 FE only,rep1_fold4,69.0,
63 +-0.6520936763153728,0.22236581594175187,18.0,15.0,0.5333333333333333,0.1321899862294045,1.1523359573654801,B0 FE only,rep2_fold0,68.0,
64 +-1.1724501074465778,0.17924152577864572,17.0,13.0,0.8173076923076924,0.12364768640975514,1.200272146595202,B0 FE only,rep2_fold1,69.0,
65 +-1.3220106098042008,0.2528857660234193,17.0,11.0,0.6439393939393939,0.10415536028472372,0.5593609732605493,B0 FE only,rep2_fold2,69.0,
66 +,,,,,,,B0 FE only,rep2_fold3,,"predict requires that you use a DataFrame when predicting from a model
67 +that was "
68 +-0.6111407977843727,0.20577262887837874,17.0,12.0,0.7666666666666666,0.3156153254380037,-0.1624428016802421,B0 FE only,rep2_fold4,69.0,
69 +-0.32987068390445967,0.11530792543444202,18.0,16.0,0.8125,0.7771298975596408,1.2828039606894506,B0 FE only,rep3_fold0,68.0,
70 +-0.4167716942380925,0.14881871215362125,17.0,15.0,0.7666666666666666,0.6649291944656456,1.4906463903119584,B0 FE only,rep3_fold1,69.0,
71 +-0.7110118819334841,0.24457185260038686,17.0,13.0,0.5384615384615385,0.13750009931365298,0.8822512927806718,B0 FE only,rep3_fold2,69.0,
72 +-2.112263060288217,0.35599318529638485,17.0,10.0,0.7857142857142857,0.11683788869698188,-0.2760119406954518,B0 FE only,rep3_fold3,69.0,
73 +-1.5255939055870558,0.31772193234213875,17.0,11.0,0.5075757575757576,0.06808902759361703,0.6029067188091551,B0 FE only,rep3_fold4,69.0,
74 +-2.6945932163224606,0.31171796494099535,18.0,14.0,0.6160714285714286,0.04376652895861787,1.1394894129977593,B0 FE only,rep4_fold0,68.0,
75 +-1.9572360664896251,0.40227581272958385,17.0,14.0,0.35714285714285715,-0.07313976910298584,1.828376362848262,B0 FE only,rep4_fold1,69.0,
76 +-0.5406156760604889,0.19718347338781572,17.0,13.0,0.6730769230769231,0.2964284947755155,0.7234467017334798,B0 FE only,rep4_fold2,69.0,
77 +-2.058657842032101,0.2606620079577208,17.0,12.0,0.31666666666666665,-0.1552296114471597,1.4819585709327898,B0 FE only,rep4_fold3,69.0,
78 +-3.628402342242634,0.3683301221980204,17.0,12.0,0.3666666666666667,-0.0624528524915107,1.3064309696942449,B0 FE only,rep4_fold4,69.0,
79 +-1.344878512637085,0.2596593488939808,18.0,15.0,0.4444444444444444,0.04622129444388659,1.4729222737396432,B0 FE only,rep5_fold0,68.0,
80 +-0.745915176679459,0.23435224323398882,17.0,12.0,0.6,0.19922945861435562,0.4060956970485787,B0 FE only,rep5_fold1,69.0,
81 +-1.4044035349592963,0.25579013684461477,17.0,11.0,0.7045454545454546,0.09748830312682347,0.4789483856550508,B0 FE only,rep5_fold2,69.0,
82 +-0.44226956285284796,0.1626339965519944,17.0,14.0,0.8333333333333333,0.5845110693223606,1.0963065613213725,B0 FE only,rep5_fold3,69.0,
83 +-0.4480519425774294,0.14874603904811232,17.0,13.0,0.7884615384615384,0.43666818993313505,0.07359497375484515,B0 FE only,rep5_fold4,69.0,
84 +-0.3548223907511674,0.11704244717611287,18.0,14.0,0.8928571428571428,2.0407980970114306,-0.7875499390972025,B0 FE only,rep6_fold0,68.0,
85 +-1.659930067242544,0.31037826384225886,17.0,12.0,0.65,0.049050877882928265,0.72208252814552,B0 FE only,rep6_fold1,69.0,
86 +-0.6902896518354182,0.2700308974113425,17.0,12.0,0.6,0.20921434931207603,0.35360773042774857,B0 FE only,rep6_fold2,69.0,
87 +-0.6242568136801717,0.1880715501310951,17.0,13.0,0.7692307692307693,0.24821088079002757,0.16397011339087533,B0 FE only,rep6_fold3,69.0,
88 +-2.7932388320505885,0.30627573874624886,17.0,14.0,0.3571428571428572,-0.08901604946519137,2.156136999010226,B0 FE only,rep6_fold4,69.0,
89 +-1.1870695197824008,0.20159579637636987,18.0,15.0,0.7333333333333333,0.07518375651056003,1.4929272996793097,B0 FE only,rep7_fold0,68.0,
90 +-0.48941863906217054,0.15172249459629755,17.0,13.0,0.8173076923076923,0.6840777271578351,-0.7260014216935312,B0 FE only,rep7_fold1,69.0,
91 +-2.0290205037399605,0.2675909309457203,17.0,13.0,0.7115384615384616,0.06249587164310489,0.9381841745071903,B0 FE only,rep7_fold2,69.0,
92 +-1.44711798113927,0.3963231431613551,17.0,12.0,0.4666666666666667,0.04231951369515013,0.72711375216709,B0 FE only,rep7_fold3,69.0,
93 +-1.3306059323043782,0.2532548724751301,17.0,12.0,0.7250000000000001,0.10389753800311123,0.7683305016421459,B0 FE only,rep7_fold4,69.0,
94 +-2.1772161915701407,0.31323496536994894,18.0,13.0,0.3384615384615385,-0.07776170021754956,1.3777305839165257,B0 FE only,rep8_fold0,68.0,
95 +-1.9932368171605863,0.2525200823383278,17.0,13.0,0.6923076923076923,0.05196143921355266,1.050951322707007,B0 FE only,rep8_fold1,69.0,
96 +-0.32817989243166945,0.10768459337927172,17.0,15.0,0.8333333333333333,0.8413451716699052,0.903289333555771,B0 FE only,rep8_fold2,69.0,
97 +-0.5579115294250706,0.20670927809879663,17.0,13.0,0.6346153846153846,0.24489572223482411,0.6011246591088047,B0 FE only,rep8_fold3,69.0,
98 +-1.002647705470675,0.3274587221729175,17.0,11.0,0.5606060606060606,0.16833446430630392,0.033042154605333725,B0 FE only,rep8_fold4,69.0,
99 +-0.8927826139153131,0.30645242240070814,18.0,16.0,0.4375,0.07435712383593462,1.9176813755509314,B0 FE only,rep9_fold0,68.0,
100 +-0.43606047088703614,0.16114451252587766,17.0,14.0,0.8095238095238095,0.31425824898374727,0.5104334800521553,B0 FE only,rep9_fold1,69.0,
101 +-1.7278639207992679,0.34731723760764277,17.0,10.0,0.6857142857142857,0.07279373564979091,0.11995003961147409,B0 FE only,rep9_fold2,69.0,
102 +-1.372790259144952,0.251103300589292,17.0,12.0,0.7166666666666666,0.10555449714620235,0.6880725547674722,B0 FE only,rep9_fold3,69.0,
103 +-0.3768952073786865,0.1268559298703138,17.0,13.0,0.8653846153846154,2.217285608525232,-0.2540118806681447,B0 FE only,rep9_fold4,69.0,
104 +-1.6096891859777729,0.3444881607381769,18.0,16.0,0.4375,0.030333020654281187,2.0294410371864005,B1 D only,rep0_fold0,68.0,
105 +-0.4276015985962247,0.1526013817601827,17.0,13.0,0.8269230769230769,1.141013139059531,-0.8914818347953825,B1 D only,rep0_fold1,69.0,
106 +-1.8918074812322336,0.3629808479916706,17.0,9.0,0.6875,0.08428135684725958,-0.0627007295740768,B1 D only,rep0_fold2,69.0,
107 +-0.21161581924247566,0.06567960642767169,17.0,15.0,0.9333333333333333,1.71050389099564,0.7430473975531947,B1 D only,rep0_fold3,69.0,
108 +-4.333896761072428,0.5478677684744071,17.0,12.0,0.3,-0.07570011560466357,1.2369136616550647,B1 D only,rep0_fold4,69.0,
109 +-3.2561949494799185,0.2831179560842563,18.0,15.0,0.16666666666666666,-2.155525980652888,30.29051541190939,B1 D only,rep1_fold0,68.0,
110 +-1.2829771729965602,0.20514863482932857,17.0,13.0,0.8269230769230769,0.1096443975280688,0.6226814083457782,B1 D only,rep1_fold1,69.0,
111 +-1.0422212667322979,0.35695100885877784,17.0,10.0,0.6285714285714286,0.1614294640849755,-0.07768169502832997,B1 D only,rep1_fold2,69.0,
112 +-0.5431457935504378,0.19096450929931347,17.0,15.0,0.7333333333333334,0.40694991560763794,1.734987916697429,B1 D only,rep1_fold3,69.0,
113 +-0.686296368187095,0.21491579982941014,17.0,12.0,0.6666666666666667,0.2212497744889512,0.3292482977604029,B1 D only,rep1_fold4,69.0,
114 +-0.6555053118346805,0.22538528194667704,18.0,15.0,0.5333333333333333,0.13294855073287984,1.1511320951667836,B1 D only,rep2_fold0,68.0,
115 +-1.1801905248706566,0.18268360120013197,17.0,13.0,0.8173076923076924,0.12237338755740647,1.2012884559827004,B1 D only,rep2_fold1,69.0,
116 +-1.3149694676297055,0.24965637563528867,17.0,11.0,0.6439393939393939,0.10496653970207931,0.557860249104251,B1 D only,rep2_fold2,69.0,
117 +,,,,,,,B1 D only,rep2_fold3,,"predict requires that you use a DataFrame when predicting from a model
118 +that was "
119 +-0.6142838534889478,0.20659422765181112,17.0,12.0,0.7833333333333332,0.3120269538835173,-0.15687384375594204,B1 D only,rep2_fold4,69.0,
120 +-0.3538877743929435,0.12584221101368037,18.0,16.0,0.8125,0.6155730326741549,1.3119816840289316,B1 D only,rep3_fold0,68.0,
121 +-0.4544024818598032,0.16432703694219325,17.0,15.0,0.8,0.549088204387999,1.5509521675328624,B1 D only,rep3_fold1,69.0,
122 +-0.7137818452860202,0.24608634433346174,17.0,13.0,0.5576923076923077,0.14161272531328004,0.8781030037632047,B1 D only,rep3_fold2,69.0,
123 +-2.170465866133669,0.36296059325074576,17.0,10.0,0.8071428571428573,0.11713112270230312,-0.2979769611721869,B1 D only,rep3_fold3,69.0,
124 +-1.5713410429648076,0.330082234567258,17.0,11.0,0.5075757575757576,0.06494295446852028,0.6054227658657284,B1 D only,rep3_fold4,69.0,
125 +-2.6850969074299007,0.3086109107148974,18.0,14.0,0.6160714285714286,0.04426913358845757,1.1367568031957755,B1 D only,rep4_fold0,68.0,
126 +-1.949409299272699,0.4106546465593798,17.0,14.0,0.35714285714285715,-0.08543615943450941,1.899441896215269,B1 D only,rep4_fold1,69.0,
127 +-0.5407463668923709,0.1970546215593801,17.0,13.0,0.6730769230769231,0.297875268271316,0.7250201737471363,B1 D only,rep4_fold2,69.0,
128 +-2.052245396362949,0.25760714699902354,17.0,12.0,0.36666666666666664,-0.15308469325211121,1.47432862638495,B1 D only,rep4_fold3,69.0,
129 +-3.6331795135818616,0.3697278145385803,17.0,12.0,0.35833333333333334,-0.062364891327749236,1.305929802117519,B1 D only,rep4_fold4,69.0,
130 +-1.3444742413422481,0.2597410465284632,18.0,15.0,0.4222222222222222,0.046108020104176375,1.4729122172955813,B1 D only,rep5_fold0,68.0,
131 +-0.7678967141892458,0.2400875473594469,17.0,12.0,0.6166666666666666,0.1909330428944416,0.41456620254163196,B1 D only,rep5_fold1,69.0,
132 +-1.4826468179394932,0.26582610064369316,17.0,11.0,0.6893939393939394,0.09317106323761523,0.46619820992416,B1 D only,rep5_fold2,69.0,
133 +-0.45667700008899026,0.1702311139034813,17.0,14.0,0.8095238095238095,0.5736859122512323,1.157406642343978,B1 D only,rep5_fold3,69.0,
134 +-0.4517454031203605,0.14919400762849738,17.0,13.0,0.7884615384615384,0.43050749680826833,0.06848078442217784,B1 D only,rep5_fold4,69.0,
135 +-0.3916530932663536,0.1332460169265755,18.0,14.0,0.8571428571428571,1.5375114703234523,-0.5849151057706868,B1 D only,rep6_fold0,68.0,
136 +-1.6700178465755509,0.3147305959336139,17.0,12.0,0.65,0.04921322367152849,0.7213920418821271,B1 D only,rep6_fold1,69.0,
137 +-0.7213788242724943,0.2829978713848642,17.0,12.0,0.5833333333333333,0.2007976105602687,0.37195922283389615,B1 D only,rep6_fold2,69.0,
138 +-0.8353351398691091,0.20321208562438742,17.0,13.0,0.8076923076923077,0.18810751720257288,0.3893572598756617,B1 D only,rep6_fold3,69.0,
139 +-2.7959629811376967,0.3082697462974714,17.0,14.0,0.33333333333333337,-0.09351691916789893,2.2015571390925657,B1 D only,rep6_fold4,69.0,
140 +-1.187778517180306,0.2019652809685968,18.0,15.0,0.7333333333333333,0.07463535560666269,1.4942708895618895,B1 D only,rep7_fold0,68.0,
141 +-0.4890861936561741,0.15170370314388312,17.0,13.0,0.8076923076923077,0.6816465774009883,-0.7167398709866981,B1 D only,rep7_fold1,69.0,
142 +-2.042232320026171,0.27637846325744914,17.0,13.0,0.673076923076923,0.06144728210834849,0.9392367620894022,B1 D only,rep7_fold2,69.0,
143 +-3.1727720727608966,0.5081821680773623,17.0,12.0,0.36666666666666664,-0.04655522521525051,1.0820544253611788,B1 D only,rep7_fold3,69.0,
144 +-1.3572459497619709,0.26255374596483033,17.0,12.0,0.6583333333333333,0.10124717625218292,0.780139173968533,B1 D only,rep7_fold4,69.0,
145 +-2.2156467862162437,0.3067747230452772,18.0,13.0,0.3384615384615385,-0.07916841186363209,1.3938067286541755,B1 D only,rep8_fold0,68.0,
146 +-1.9917385697529297,0.2521074877954606,17.0,13.0,0.673076923076923,0.05198761728564087,1.0501494377111356,B1 D only,rep8_fold1,69.0,
147 +-0.3274228428776208,0.10736273214442037,17.0,15.0,0.8333333333333333,0.8607810579616503,0.8924112370678038,B1 D only,rep8_fold2,69.0,
148 +-0.6097317582728577,0.22885651097167029,17.0,13.0,0.6153846153846154,0.2073515293635476,0.6382598223460462,B1 D only,rep8_fold3,69.0,
149 +-1.0060159625076595,0.3272259048154521,17.0,11.0,0.5454545454545454,0.1669757177286934,0.0332023147087971,B1 D only,rep8_fold4,69.0,
150 +-0.9050730886050931,0.3108757804259483,18.0,16.0,0.4375,0.07636171256884304,1.9181986703872527,B1 D only,rep9_fold0,68.0,
151 +-0.4724127198630997,0.1750337939426475,17.0,14.0,0.7857142857142857,0.28373984556203635,0.5411861172538079,B1 D only,rep9_fold1,69.0,
152 +-1.9394182246086,0.387025755124138,17.0,10.0,0.6714285714285715,0.06342959624899164,0.12056749706063227,B1 D only,rep9_fold2,69.0,
153 +-1.3742195814269544,0.2518246706412165,17.0,12.0,0.7083333333333334,0.1054115895582119,0.6881467552088498,B1 D only,rep9_fold3,69.0,
154 +-0.4242756767549232,0.15048398843721567,17.0,13.0,0.8076923076923077,0.7781716591659432,0.3622207483000847,B1 D only,rep9_fold4,69.0,
155 +-1.5934825153456282,0.3226837354958242,18.0,16.0,0.5625,0.04434671731205827,2.0224651198876247,B2 K only,rep0_fold0,68.0,
156 +-0.4639078678617403,0.16587798628724412,17.0,13.0,0.7884615384615385,0.8100099389454961,-0.5060399372764922,B2 K only,rep0_fold1,69.0,
157 +-1.907460638626227,0.37158790752085596,17.0,9.0,0.6597222222222223,0.0826538605464319,-0.05467285296482677,B2 K only,rep0_fold2,69.0,
158 +-0.21215757932108464,0.06583584647692366,17.0,15.0,0.9666666666666667,1.7789873592358534,0.9028744093459021,B2 K only,rep0_fold3,69.0,
159 +-4.15193170866549,0.5180310970245148,17.0,12.0,0.3,-0.06762497157670473,1.1842574155053744,B2 K only,rep0_fold4,69.0,
160 +-3.2719760228180563,0.2916027762667932,18.0,15.0,0.16666666666666666,1616732877.7940006,-22335988525.307163,B2 K only,rep1_fold0,68.0,
161 +-1.314224158245434,0.22036779614057744,17.0,13.0,0.7884615384615385,0.10595872416600809,0.6308826575638489,B2 K only,rep1_fold1,69.0,
162 +-1.086554554385631,0.36700313870985224,17.0,10.0,0.6285714285714286,0.15202918809766408,-0.04641822555228065,B2 K only,rep1_fold2,69.0,
163 +-0.6047503163804862,0.21805033364599277,17.0,15.0,0.6000000000000001,0.24131543304267583,1.8006683719659662,B2 K only,rep1_fold3,69.0,
164 +-0.7349202316405614,0.2388458309846166,17.0,12.0,0.6333333333333333,0.2032168408001996,0.4000295247710865,B2 K only,rep1_fold4,69.0,
165 +-0.6759843564554707,0.23206670594065137,18.0,15.0,0.5333333333333333,0.12561891100177364,1.169597317090377,B2 K only,rep2_fold0,68.0,
166 +-1.1959197778800394,0.19045565178438076,17.0,13.0,0.8173076923076924,0.11991871058171044,1.1947692181102212,B2 K only,rep2_fold1,69.0,
167 +-1.4193623068234804,0.28876491168088064,17.0,11.0,0.6136363636363635,0.09565086804020259,0.5527343774993612,B2 K only,rep2_fold2,69.0,
168 +,,,,,,,B2 K only,rep2_fold3,,"predict requires that you use a DataFrame when predicting from a model
169 +that was "
170 +-0.6142069944456687,0.20487097999982895,17.0,12.0,0.7833333333333332,0.3123978462762003,-0.15615403848732573,B2 K only,rep2_fold4,69.0,
171 +-0.3420847219033382,0.11980941509164514,18.0,16.0,0.8125,0.7339970750427701,1.3214958973178086,B2 K only,rep3_fold0,68.0,
172 +-0.41969773392983156,0.14897100618229964,17.0,15.0,0.8,0.6632588837726556,1.51559071721576,B2 K only,rep3_fold1,69.0,
173 +-0.7308444696945573,0.24828908655633455,17.0,13.0,0.5384615384615385,0.13021421114139367,0.8971685499833371,B2 K only,rep3_fold2,69.0,
174 +-2.17129911744673,0.36678374749885895,17.0,10.0,0.7785714285714286,0.11449484837472991,-0.2731750050767141,B2 K only,rep3_fold3,69.0,
175 +-1.5519630813555767,0.32865127755375023,17.0,11.0,0.4621212121212121,0.06533982580838972,0.5995153790328602,B2 K only,rep3_fold4,69.0,
176 +-2.7038610380841024,0.31468081038828455,18.0,14.0,0.6160714285714286,0.0434821938981575,1.1401537750090067,B2 K only,rep4_fold0,68.0,
177 +-1.9763844704511802,0.41267284927263775,17.0,14.0,0.30952380952380953,-0.08621928152419898,1.9051388482619278,B2 K only,rep4_fold1,69.0,
178 +-0.553020247145827,0.20132021615624107,17.0,13.0,0.6538461538461539,0.27602033325035485,0.7259850844448359,B2 K only,rep4_fold2,69.0,
179 +-2.0656465100498136,0.26410818367085176,17.0,12.0,0.3,-0.15493046224864873,1.4721322544773674,B2 K only,rep4_fold3,69.0,
180 +-3.7720247713652477,0.36217700487120486,17.0,12.0,0.375,-0.060169381004793174,1.298590767533205,B2 K only,rep4_fold4,69.0,
181 +-1.346969842300557,0.2596729753441177,18.0,15.0,0.4222222222222222,0.045894670166386084,1.4732389923659868,B2 K only,rep5_fold0,68.0,
182 +-1.1172053649141314,0.325944968947553,17.0,12.0,0.5166666666666666,0.07463727876723746,0.686587630249223,B2 K only,rep5_fold1,69.0,
183 +-1.6085912734771146,0.2870230345802498,17.0,11.0,0.6439393939393939,0.08628652926836171,0.4900206040604975,B2 K only,rep5_fold2,69.0,
184 +-0.4447788535132161,0.16599342664158584,17.0,14.0,0.8095238095238095,0.5213666486070395,1.036861185970761,B2 K only,rep5_fold3,69.0,
185 +-0.45488768109664407,0.15107995202264513,17.0,13.0,0.8076923076923077,0.4122644942807417,0.1056554963878182,B2 K only,rep5_fold4,69.0,
186 +-0.3586093515118774,0.1189477388296404,18.0,14.0,0.8928571428571428,2.1262591580808907,-0.8530262820821654,B2 K only,rep6_fold0,68.0,
187 +-1.7533840458388232,0.3401735421897731,17.0,12.0,0.6666666666666666,0.04203002698728607,0.7372773011463023,B2 K only,rep6_fold1,69.0,
188 +-0.6997184493416847,0.2737753293999566,17.0,12.0,0.5833333333333333,0.20722472388423305,0.3590173089068168,B2 K only,rep6_fold2,69.0,
189 +-0.6312554975950571,0.1919686603004976,17.0,13.0,0.75,0.24465939995119385,0.18236328603471177,B2 K only,rep6_fold3,69.0,
190 +-2.7896703268909064,0.3054364835904974,17.0,14.0,0.3571428571428572,-0.08957177379749144,2.1635138901673274,B2 K only,rep6_fold4,69.0,
191 +-1.1919985053202906,0.2048210556433626,18.0,15.0,0.7333333333333333,0.07177122474179905,1.4922173029246817,B2 K only,rep7_fold0,68.0,
192 +-0.5103358379383645,0.16065808137675444,17.0,13.0,0.8076923076923077,0.6261398003128629,-0.6163795487743071,B2 K only,rep7_fold1,69.0,
193 +-2.0305399558063044,0.2680739410313455,17.0,13.0,0.7115384615384616,0.062386488364781854,0.9383318303682981,B2 K only,rep7_fold2,69.0,
194 +-1.5692143725758811,0.40420583375197433,17.0,12.0,0.4666666666666667,0.03217336758185773,0.7662882274474042,B2 K only,rep7_fold3,69.0,
195 +-1.424876314683051,0.28066069072950817,17.0,12.0,0.6583333333333334,0.09605138797177172,0.755561912574186,B2 K only,rep7_fold4,69.0,
196 +-2.237131941317357,0.3336747682967327,18.0,13.0,0.35384615384615387,-0.07938063682372651,1.388531788353829,B2 K only,rep8_fold0,68.0,
197 +-2.013276876563426,0.25978716384895373,17.0,13.0,0.6923076923076923,0.05009687686441055,1.0495717753161944,B2 K only,rep8_fold1,69.0,
198 +-0.3344606037801157,0.11149048553629907,17.0,15.0,0.8333333333333334,0.6275687212597278,1.01510404604287,B2 K only,rep8_fold2,69.0,
199 +-0.5592593610008724,0.20726750222521126,17.0,13.0,0.6346153846153846,0.2440950686551038,0.6003572521109353,B2 K only,rep8_fold3,69.0,
200 +-1.0017486550723653,0.3271124254924831,17.0,11.0,0.5757575757575758,0.16868990378768775,0.03226969813344554,B2 K only,rep8_fold4,69.0,
201 +-0.9911388095693773,0.3221700440708026,18.0,16.0,0.4375,0.06313704213857917,1.9372783233114657,B2 K only,rep9_fold0,68.0,
202 +-0.4370049303110398,0.1613787390534649,17.0,14.0,0.8095238095238095,0.31309650926588345,0.5143010309377695,B2 K only,rep9_fold1,69.0,
203 +-1.7244469082354708,0.33913973349740384,17.0,10.0,0.7142857142857142,0.07435608923039923,0.11323059521157534,B2 K only,rep9_fold2,69.0,
204 +-1.4299021570236565,0.27156617659999793,17.0,12.0,0.675,0.10012159674756925,0.6904420215256678,B2 K only,rep9_fold3,69.0,
205 +-0.39780692580126065,0.13849469606515852,17.0,13.0,0.8269230769230769,1.2756523315979917,0.0664100927201049,B2 K only,rep9_fold4,69.0,
206 +-1.6623863531360115,0.3522731080926239,18.0,16.0,0.4375,0.021940359221632788,2.038791580657012,B3 complexity,rep0_fold0,68.0,
207 +-0.42198953236922543,0.15095343312997833,17.0,13.0,0.8461538461538461,1.2654867259690037,-1.067506947956652,B3 complexity,rep0_fold1,69.0,
208 +-1.8896928183637802,0.36767668317962654,17.0,9.0,0.6875,0.08378514254312108,-0.05953345367326189,B3 complexity,rep0_fold2,69.0,
209 +-0.20615936482737607,0.06344068908732974,17.0,15.0,0.9666666666666667,1.8021970252865134,0.877492548308532,B3 complexity,rep0_fold3,69.0,
210 +-4.17901413231566,0.5392389986291803,17.0,12.0,0.3,-0.06840593349121644,1.1855992080828421,B3 complexity,rep0_fold4,69.0,
211 +-3.266929699290471,0.287784041249131,18.0,15.0,0.16666666666666666,-2.4208112009156144,33.95556590797302,B3 complexity,rep1_fold0,68.0,
212 +-1.2906830584867575,0.21317086335410607,17.0,13.0,0.8076923076923077,0.10832086712332949,0.6248021799863134,B3 complexity,rep1_fold1,69.0,
213 +-1.069044920315147,0.36298080306736463,17.0,10.0,0.6142857142857143,0.15586963925992575,-0.06184561351985014,B3 complexity,rep1_fold2,69.0,
214 +-0.585643465657826,0.20896094187597244,17.0,15.0,0.6333333333333333,0.25757483583285434,1.7796770077265271,B3 complexity,rep1_fold3,69.0,
215 +-0.7373972344580513,0.237903256205883,17.0,12.0,0.6666666666666667,0.20561282178090545,0.40747565196926055,B3 complexity,rep1_fold4,69.0,
216 +-0.6508670366687029,0.22165334003527487,18.0,15.0,0.5333333333333333,0.13222576410054113,1.152810507673719,B3 complexity,rep2_fold0,68.0,
217 +-1.2434596524360828,0.20830048039791468,17.0,13.0,0.701923076923077,0.11333504582237769,1.1903422775474586,B3 complexity,rep2_fold1,69.0,
218 +-1.519850403877876,0.3219700864051424,17.0,11.0,0.5833333333333333,0.0865660215857349,0.5373970128860566,B3 complexity,rep2_fold2,69.0,
219 +,,,,,,,B3 complexity,rep2_fold3,,"predict requires that you use a DataFrame when predicting from a model
220 +that was "
221 +-0.6100514064777508,0.2058870719780637,17.0,12.0,0.7666666666666666,0.3172906333299963,-0.16847313359042732,B3 complexity,rep2_fold4,69.0,
222 +-0.3500091967433139,0.12233535360165886,18.0,16.0,0.8125,0.724644386358059,1.3666419827860352,B3 complexity,rep3_fold0,68.0,
223 +-0.4183303591544481,0.14943210419745573,17.0,15.0,0.7666666666666666,0.6673588897679142,1.4994421087602658,B3 complexity,rep3_fold1,69.0,
224 +-0.7109539858860738,0.24456051201918516,17.0,13.0,0.5384615384615385,0.13751617049589768,0.8821746871359508,B3 complexity,rep3_fold2,69.0,
225 +-2.1738588074604803,0.3704615603740117,17.0,10.0,0.7785714285714286,0.11450039232940686,-0.27392900966293654,B3 complexity,rep3_fold3,69.0,
226 +-1.5257417437121263,0.31851437377741626,17.0,11.0,0.4924242424242424,0.06785011653332386,0.6020470560865747,B3 complexity,rep3_fold4,69.0,
227 +-2.7228008166383217,0.31749959472003114,18.0,14.0,0.6160714285714286,0.043150730046661694,1.140746316052659,B3 complexity,rep4_fold0,68.0,
228 +-1.9671115415933054,0.4045371314559333,17.0,14.0,0.35714285714285715,-0.07635720496410063,1.8470244531191875,B3 complexity,rep4_fold1,69.0,
229 +-0.5414754717104303,0.19749807926221222,17.0,13.0,0.6730769230769231,0.2954804209261823,0.724740388728852,B3 complexity,rep4_fold2,69.0,
230 +-2.0550358596469804,0.2591733768160422,17.0,12.0,0.36666666666666664,-0.15485723006292204,1.4838236598382475,B3 complexity,rep4_fold3,69.0,
231 +-3.6706695088665686,0.3682175652039673,17.0,12.0,0.4083333333333333,-0.058567264579567624,1.281391742325441,B3 complexity,rep4_fold4,69.0,
232 +-1.344172765092404,0.2590664382030699,18.0,15.0,0.4444444444444444,0.04624383695110885,1.4726728499449642,B3 complexity,rep5_fold0,68.0,
233 +-1.093488011798261,0.34020666508357716,17.0,12.0,0.5333333333333333,0.07958854796561603,0.6776636230381883,B3 complexity,rep5_fold1,69.0,
234 +-1.5814985071599803,0.2720680013988147,17.0,11.0,0.6590909090909091,0.0883764148489301,0.4766002229426724,B3 complexity,rep5_fold2,69.0,
235 +-0.4450242055152936,0.16424073593833685,17.0,14.0,0.8333333333333333,0.5626278292968147,1.08016422487659,B3 complexity,rep5_fold3,69.0,
236 +-0.4464891268801923,0.14771969000969196,17.0,13.0,0.826923076923077,0.4460128728716926,0.05719587725368683,B3 complexity,rep5_fold4,69.0,
237 +-0.35431733396107606,0.11681235231930247,18.0,14.0,0.8928571428571428,2.034640330898736,-0.777307542844579,B3 complexity,rep6_fold0,68.0,
238 +-1.7023497147277356,0.32871324971082533,17.0,12.0,0.6666666666666666,0.043663410272501126,0.7354477449178413,B3 complexity,rep6_fold1,69.0,
239 +-0.7249805005990636,0.2838101932261862,17.0,12.0,0.6166666666666667,0.20200284166290908,0.357630014863664,B3 complexity,rep6_fold2,69.0,
240 +-0.6341444468872258,0.19467924963933375,17.0,13.0,0.75,0.24443677392034852,0.1876062168261502,B3 complexity,rep6_fold3,69.0,
241 +-2.7879548829170595,0.30484805395946446,17.0,14.0,0.3571428571428572,-0.0910908186632036,2.184438916603783,B3 complexity,rep6_fold4,69.0,
242 +-1.194680391282755,0.2052352526716089,18.0,15.0,0.7333333333333333,0.07240690291822693,1.4944054279148282,B3 complexity,rep7_fold0,68.0,
243 +-0.5047641331436848,0.15918304668814406,17.0,13.0,0.8076923076923077,0.6536566726082946,-0.6802052814211619,B3 complexity,rep7_fold1,69.0,
244 +-2.0243397640616263,0.26550154626169686,17.0,13.0,0.7115384615384616,0.06262599938208606,0.9368974021087303,B3 complexity,rep7_fold2,69.0,
245 +-1.4775518892035593,0.3973541422375039,17.0,12.0,0.4666666666666667,0.04051143749161833,0.7352350381835829,B3 complexity,rep7_fold3,69.0,
246 +-1.6902122026210993,0.32264374438523646,17.0,12.0,0.575,0.07738194577965096,0.7534930550797098,B3 complexity,rep7_fold4,69.0,
247 +-2.2894104461648257,0.35479492443186617,18.0,13.0,0.3230769230769231,-0.08131298074907586,1.397442025001191,B3 complexity,rep8_fold0,68.0,
248 +-2.031076139325679,0.26657469053678934,17.0,13.0,0.653846153846154,0.04927528920076973,1.0515734350994792,B3 complexity,rep8_fold1,69.0,
249 +-0.3399549192385036,0.11317660370530899,17.0,15.0,0.8,0.615401996914667,1.0570635856283874,B3 complexity,rep8_fold2,69.0,
250 +-0.5776323588031679,0.21162442252636313,17.0,13.0,0.6346153846153847,0.23375411540553556,0.6015026660892575,B3 complexity,rep8_fold3,69.0,
251 +-1.0136059839985123,0.32954649925377544,17.0,11.0,0.5757575757575757,0.1662040598193038,0.03273684857773984,B3 complexity,rep8_fold4,69.0,
252 +-0.9954404502830219,0.3259182490321211,18.0,16.0,0.4375,0.06754402182755086,1.9366956836292493,B3 complexity,rep9_fold0,68.0,
253 +-0.4561341884365174,0.16757866993952678,17.0,14.0,0.7857142857142858,0.2958320782178414,0.5544858240574173,B3 complexity,rep9_fold1,69.0,
254 +-1.7401908142231886,0.3470325674338248,17.0,10.0,0.7,0.07250743438220877,0.11883160839843362,B3 complexity,rep9_fold2,69.0,
255 +-1.413575610470239,0.26321851419175996,17.0,12.0,0.7083333333333334,0.10192530099350047,0.6858515172470834,B3 complexity,rep9_fold3,69.0,
256 +-0.42447914768610545,0.15118650429476616,17.0,13.0,0.8076923076923077,0.8578662124865621,0.20159834871843324,B3 complexity,rep9_fold4,69.0,
257 +-1.6331629471306073,0.34401795883076186,18.0,16.0,0.453125,0.030965850222504313,2.0298225581604736,B4 persistence,rep0_fold0,68.0,
258 +-0.42560641071013483,0.15213981841948132,17.0,13.0,0.8461538461538461,1.1481704674427302,-0.8424352781618364,B4 persistence,rep0_fold1,69.0,
259 +-1.8327753591733653,0.3528140033244082,17.0,9.0,0.6875,0.08510500696070941,-0.0692845986277328,B4 persistence,rep0_fold2,69.0,
260 +-0.20275062868214125,0.06195095041279391,17.0,15.0,0.9666666666666667,2.0695317947790786,0.9897450189957241,B4 persistence,rep0_fold3,69.0,
261 +-4.155910380196626,0.5210891652970988,17.0,12.0,0.3,-0.06760123878724088,1.1832140731778744,B4 persistence,rep0_fold4,69.0,
262 +-3.251902768368581,0.2821617486566257,18.0,15.0,0.16666666666666666,-2.5845678432203005,36.21794736234458,B4 persistence,rep1_fold0,68.0,
263 +-1.3002645931673988,0.21130099141712338,17.0,13.0,0.8076923076923077,0.10764568275828108,0.6264520429941112,B4 persistence,rep1_fold1,69.0,
264 +-1.0295504711214936,0.3586313166792267,17.0,10.0,0.6285714285714286,0.16539694426896392,-0.09414556080552884,B4 persistence,rep1_fold2,69.0,
265 +-0.5827640122746469,0.2034393943446655,17.0,15.0,0.7666666666666666,0.4185789627654633,1.8001204454880537,B4 persistence,rep1_fold3,69.0,
266 +-0.6708278934974728,0.21292622675907863,17.0,12.0,0.6666666666666666,0.23307838003153458,0.34194591909019034,B4 persistence,rep1_fold4,69.0,
267 +-0.6500464122477321,0.22146558188508816,18.0,15.0,0.5333333333333333,0.13353527267290685,1.1496198555056387,B4 persistence,rep2_fold0,68.0,
268 +-1.2456607015396488,0.21053896990909532,17.0,13.0,0.7596153846153847,0.11349555452858165,1.1952075285259116,B4 persistence,rep2_fold1,69.0,
269 +-1.671165181215381,0.3473966842641013,17.0,11.0,0.6136363636363636,0.08046218634438244,0.5220932733809773,B4 persistence,rep2_fold2,69.0,
270 +,,,,,,,B4 persistence,rep2_fold3,,"predict requires that you use a DataFrame when predicting from a model
271 +that was "
272 +-0.6091818816901347,0.20423870224156349,17.0,12.0,0.7666666666666666,0.3221928631597292,-0.18411565404625715,B4 persistence,rep2_fold4,69.0,
273 +-0.3285805863882706,0.1146486551654658,18.0,16.0,0.8125,0.7839466420955237,1.283525339804927,B4 persistence,rep3_fold0,68.0,
274 +-0.4578331419411633,0.16706285522859346,17.0,15.0,0.7666666666666666,0.4347777404445083,1.4834683796613632,B4 persistence,rep3_fold1,69.0,
275 +-0.8095243115549169,0.2566659662568611,17.0,13.0,0.5576923076923077,0.11094330795655567,0.9165132778142879,B4 persistence,rep3_fold2,69.0,
276 +-2.55732315128427,0.39526113421090925,17.0,10.0,0.7571428571428571,0.09430827258770977,-0.19259755646557408,B4 persistence,rep3_fold3,69.0,
277 +-1.733640311921123,0.39736598821756397,17.0,11.0,0.4469696969696969,0.0533793256996274,0.6062337628311731,B4 persistence,rep3_fold4,69.0,
278 +-2.799459735781272,0.33941559525663856,18.0,14.0,0.5803571428571428,0.04060222617628451,1.149239572191806,B4 persistence,rep4_fold0,68.0,
279 +-2.555097728330663,0.45432303281567543,17.0,14.0,0.2857142857142857,-0.10601669608203995,1.996341044195196,B4 persistence,rep4_fold1,69.0,
280 +-0.5401131777779791,0.1968273870968119,17.0,13.0,0.6730769230769231,0.2976656793945857,0.7233346703667732,B4 persistence,rep4_fold2,69.0,
281 +-2.0763662720187828,0.26802064938340775,17.0,12.0,0.3,-0.15746091226487308,1.486816511420635,B4 persistence,rep4_fold3,69.0,
282 +-3.628502389667755,0.36865696689246996,17.0,12.0,0.3666666666666667,-0.06198962039529773,1.303063775802675,B4 persistence,rep4_fold4,69.0,
283 +-1.407605209751093,0.2740347409648593,18.0,15.0,0.4666666666666667,0.04117368352559595,1.4849793105965086,B4 persistence,rep5_fold0,68.0,
284 +-0.8533737684397269,0.2698509728858546,17.0,12.0,0.5333333333333333,0.12373997628832818,0.6091324170951249,B4 persistence,rep5_fold1,69.0,
285 +-1.4183439778724694,0.2626450592751908,17.0,11.0,0.7045454545454546,0.09678327257181046,0.4784049852806724,B4 persistence,rep5_fold2,69.0,
286 +-0.5128776142792139,0.1855543270125779,17.0,14.0,0.7857142857142858,0.37114697210789777,1.0314234110589908,B4 persistence,rep5_fold3,69.0,
287 +-0.48377424222671955,0.1542981595386225,17.0,13.0,0.7884615384615384,0.3613762967963269,0.12799651649205132,B4 persistence,rep5_fold4,69.0,
288 +-0.40500176550397404,0.1387414673451678,18.0,14.0,0.8035714285714286,1.2276720572249458,-0.13009110897027332,B4 persistence,rep6_fold0,68.0,
289 +-1.6664343202894938,0.31076785165843857,17.0,12.0,0.65,0.048479390173132464,0.7210105384704978,B4 persistence,rep6_fold1,69.0,
290 +-0.6879947331088132,0.26857112809356776,17.0,12.0,0.5833333333333334,0.21000455154835707,0.35975771457053984,B4 persistence,rep6_fold2,69.0,
291 +-0.6849344698290353,0.20819537419520243,17.0,13.0,0.7307692307692307,0.22420766615217877,0.19567597099247216,B4 persistence,rep6_fold3,69.0,
292 +-2.80002345043707,0.30863917039680033,17.0,14.0,0.3571428571428572,-0.08927539397124332,2.159681643848748,B4 persistence,rep6_fold4,69.0,
293 +-1.1887202546941866,0.2016856710870988,18.0,15.0,0.7777777777777777,0.07490182610120051,1.494466997961942,B4 persistence,rep7_fold0,68.0,
294 +-0.547026338177217,0.1657113666591666,17.0,13.0,0.8173076923076923,0.5979481807282748,-0.7354716951230742,B4 persistence,rep7_fold1,69.0,
295 +-2.1716128731939284,0.3177838855953426,17.0,13.0,0.6730769230769231,0.05739345308327703,0.9598057239332483,B4 persistence,rep7_fold2,69.0,
296 +-1.473215921824765,0.40098305534921197,17.0,12.0,0.4666666666666667,0.04047039899198291,0.736025038148334,B4 persistence,rep7_fold3,69.0,
297 +-1.6229276290024282,0.31048918043570756,17.0,12.0,0.5416666666666666,0.07793991193489945,0.7596930595609053,B4 persistence,rep7_fold4,69.0,
298 +-2.268752278500593,0.3222738228664363,18.0,13.0,0.26153846153846155,-0.09643401151803249,1.5154710519257273,B4 persistence,rep8_fold0,68.0,
299 +-1.995794605890843,0.2538155934114468,17.0,13.0,0.6923076923076923,0.05172867195969866,1.0509285394922194,B4 persistence,rep8_fold1,69.0,
300 +-0.3292988203093156,0.10827467803948089,17.0,15.0,0.8333333333333333,0.8130562288692472,0.9234027761126652,B4 persistence,rep8_fold2,69.0,
301 +-0.5922850467723116,0.22394396996025978,17.0,13.0,0.5769230769230769,0.22299689827258687,0.6446239014002785,B4 persistence,rep8_fold3,69.0,
302 +-1.0010292950420931,0.32625780661507675,17.0,11.0,0.5606060606060606,0.16909317507425561,0.02923892108338656,B4 persistence,rep8_fold4,69.0,
303 +-0.9058943747151409,0.3111074050927656,18.0,16.0,0.4375,0.06557488042620463,1.932446589583515,B4 persistence,rep9_fold0,68.0,
304 +-0.44469808788459925,0.1686196552826681,17.0,14.0,0.7857142857142857,0.30702183935037974,0.5650591104525425,B4 persistence,rep9_fold1,69.0,
305 +-1.7507099082550919,0.35063178532349676,17.0,10.0,0.6714285714285714,0.07125362833490514,0.12495652192032426,B4 persistence,rep9_fold2,69.0,
306 +-1.39383179740849,0.25610904471106466,17.0,12.0,0.7166666666666666,0.10454587731879708,0.6832781134228807,B4 persistence,rep9_fold3,69.0,
307 +-0.37712358438361265,0.12704780439733807,17.0,13.0,0.8653846153846154,2.1442012861363025,-0.2336167987828705,B4 persistence,rep9_fold4,69.0,
308 +-1.6086475951036077,0.3430046548428886,18.0,16.0,0.4375,0.04155291331122825,2.025425408671445,B5 D+K,rep0_fold0,68.0,
309 +-0.46505798562119305,0.16600393986092998,17.0,13.0,0.75,0.7755716288318392,-0.45053891505453963,B5 D+K,rep0_fold1,69.0,
310 +-1.910553102230546,0.3671487587462715,17.0,9.0,0.6875,0.08317941702956319,-0.05635396067479679,B5 D+K,rep0_fold2,69.0,
311 +-0.21797860333426577,0.06832696701304698,17.0,15.0,0.9333333333333333,1.5679899193996998,0.746484295584295,B5 D+K,rep0_fold3,69.0,
312 +-4.442881208907123,0.5753831880733453,17.0,12.0,0.3,-0.08067698409893759,1.2684449637499269,B5 D+K,rep0_fold4,69.0,
313 +-3.2886763760559834,0.2985208333628376,18.0,15.0,0.16666666666666666,-2.445914648038962,34.30238282164917,B5 D+K,rep1_fold0,68.0,
314 +-1.3249884918622181,0.21583735206029014,17.0,13.0,0.7692307692307694,0.10556693357103088,0.6327825914404908,B5 D+K,rep1_fold1,69.0,
315 +-1.085035479425277,0.3653493727736542,17.0,10.0,0.6285714285714286,0.15289502745995553,-0.05011381800735956,B5 D+K,rep1_fold2,69.0,
316 +-0.6181320364009891,0.22635548780650397,17.0,15.0,0.5333333333333333,0.18307092950710027,1.8180907445606822,B5 D+K,rep1_fold3,69.0,
317 +-0.7487335959626618,0.242511005914777,17.0,12.0,0.6333333333333333,0.19350845066855457,0.38889543334670296,B5 D+K,rep1_fold4,69.0,
318 +-0.677051064635283,0.23292001311999203,18.0,15.0,0.5333333333333333,0.1259525671975601,1.168976867735629,B5 D+K,rep2_fold0,68.0,
319 +-1.1990902771961511,0.1916692206107921,17.0,13.0,0.7980769230769231,0.11947433146155152,1.196140302867005,B5 D+K,rep2_fold1,69.0,
320 +-1.4083373496478084,0.2846194215061303,17.0,11.0,0.6136363636363635,0.09684084145137371,0.552671333796619,B5 D+K,rep2_fold2,69.0,
321 +,,,,,,,B5 D+K,rep2_fold3,,"predict requires that you use a DataFrame when predicting from a model
322 +that was "
323 +-0.6273754728368014,0.20785533865271316,17.0,12.0,0.7833333333333332,0.29895846921363933,-0.1339394199429445,B5 D+K,rep2_fold4,69.0,
324 +-0.35864946673036374,0.12718648987373163,18.0,16.0,0.8125,0.6132308599390598,1.3326286084165668,B5 D+K,rep3_fold0,68.0,
325 +-0.45406387187424124,0.16363844983876527,17.0,15.0,0.8,0.558459245940016,1.559835301606045,B5 D+K,rep3_fold1,69.0,
326 +-0.7294005421086576,0.2483846181535665,17.0,13.0,0.5384615384615385,0.1324976087963955,0.8940469165129482,B5 D+K,rep3_fold2,69.0,
327 +-2.18913976133198,0.36627006718680266,17.0,10.0,0.8071428571428573,0.11620363525746709,-0.29537465541758173,B5 D+K,rep3_fold3,69.0,
328 +-1.603694240281597,0.34315487131637895,17.0,11.0,0.4621212121212121,0.061612619597799685,0.6019101491872662,B5 D+K,rep3_fold4,69.0,
329 +-2.68643763682533,0.30902926077725623,18.0,14.0,0.6160714285714286,0.044226227142430005,1.1368766901013199,B5 D+K,rep4_fold0,68.0,
330 +-1.967522043578091,0.4162693927750346,17.0,14.0,0.30952380952380953,-0.09450035353060156,1.956076972751605,B5 D+K,rep4_fold1,69.0,
331 +-0.5533698018190921,0.20156381198776688,17.0,13.0,0.6538461538461539,0.2748627039530372,0.7253815213287793,B5 D+K,rep4_fold2,69.0,
332 +-2.0618545972221476,0.2620806791526402,17.0,12.0,0.3833333333333333,-0.1521422961463733,1.4561793294051173,B5 D+K,rep4_fold3,69.0,
333 +-3.8022987629250857,0.3662949557152728,17.0,12.0,0.39166666666666666,-0.062311561595841454,1.3133456630553226,B5 D+K,rep4_fold4,69.0,
334 +-1.347748772235445,0.259839641636982,18.0,15.0,0.4222222222222222,0.045528261811878225,1.4734559983412945,B5 D+K,rep5_fold0,68.0,
335 +-1.117165261029644,0.3261248943137409,17.0,12.0,0.5166666666666666,0.07483138312422152,0.6858851214477804,B5 D+K,rep5_fold1,69.0,
336 +-1.623786577294298,0.2884735546505205,17.0,11.0,0.6439393939393939,0.08561257999011314,0.4866087840005091,B5 D+K,rep5_fold2,69.0,
337 +-0.45838993252287863,0.17226212863349566,17.0,14.0,0.8095238095238095,0.5118303640153168,1.089158293034656,B5 D+K,rep5_fold3,69.0,
338 +-0.4585206212824873,0.15103757964895823,17.0,13.0,0.8076923076923077,0.4073219473812901,0.0964510945060321,B5 D+K,rep5_fold4,69.0,
339 +-0.3911808795118769,0.1331023322389171,18.0,14.0,0.8571428571428571,1.5684468373949076,-0.6055531300897906,B5 D+K,rep6_fold0,68.0,
340 +-1.760548434946782,0.3424541506752111,17.0,12.0,0.6666666666666666,0.04222931127036659,0.7365394662891035,B5 D+K,rep6_fold1,69.0,
341 +-0.7293865873785292,0.28568327915850517,17.0,12.0,0.5833333333333333,0.19928065655720664,0.3758629725612771,B5 D+K,rep6_fold2,69.0,
342 +-0.9208605902486354,0.20757295527959582,17.0,13.0,0.8076923076923077,0.17104131748154877,0.47782292906224644,B5 D+K,rep6_fold3,69.0,
343 +-2.806566300888324,0.3132612059966252,17.0,14.0,0.33333333333333337,-0.09327847228422559,2.196526141634779,B5 D+K,rep6_fold4,69.0,
344 +-1.1920072729172748,0.20477921896261944,18.0,15.0,0.7333333333333333,0.07164730776908775,1.4929350423504666,B5 D+K,rep7_fold0,68.0,
345 +-0.5138423200764016,0.16128568918965838,17.0,13.0,0.8076923076923077,0.6407385326557591,-0.6748888731030043,B5 D+K,rep7_fold1,69.0,
346 +-2.0385185734021327,0.27535858863264523,17.0,13.0,0.673076923076923,0.06168247667862428,0.9388420906226793,B5 D+K,rep7_fold2,69.0,
347 +-3.864619229097563,0.5496259409353056,17.0,12.0,0.3666666666666667,-0.06288951828009778,1.160549622890945,B5 D+K,rep7_fold3,69.0,
348 +-1.412012186014146,0.2785833265940752,17.0,12.0,0.6583333333333334,0.09673316828871309,0.7686155184059031,B5 D+K,rep7_fold4,69.0,
349 +-2.4086979568951974,0.3274649368367347,18.0,13.0,0.35384615384615387,-0.08437392424133028,1.4409418365259739,B5 D+K,rep8_fold0,68.0,
350 +-2.0122534376007857,0.2605845912499715,17.0,13.0,0.6538461538461539,0.0497731527014191,1.0484128095764136,B5 D+K,rep8_fold1,69.0,
351 +-0.3383047825295994,0.11358163232195785,17.0,15.0,0.8333333333333334,0.5735601083454099,1.0552396305747767,B5 D+K,rep8_fold2,69.0,
352 +-0.6142144509590765,0.231223753138173,17.0,13.0,0.5961538461538461,0.20517776891198947,0.6367456431704256,B5 D+K,rep8_fold3,69.0,
353 +-1.0048767992431018,0.32679636217954533,17.0,11.0,0.5757575757575758,0.16738131263396505,0.03198360555919391,B5 D+K,rep8_fold4,69.0,
354 +-0.9995139796531419,0.3242365478545742,18.0,16.0,0.4375,0.06410300045327784,1.9375996700379396,B5 D+K,rep9_fold0,68.0,
355 +-0.4727606768137651,0.1752990612440601,17.0,14.0,0.7857142857142857,0.2836485799854604,0.538920906521827,B5 D+K,rep9_fold1,69.0,
356 +-1.9332028028939552,0.3853947821619841,17.0,10.0,0.6857142857142857,0.06379175357910985,0.11989649374202335,B5 D+K,rep9_fold2,69.0,
357 +-1.439083006037761,0.27624603622328614,17.0,12.0,0.6916666666666667,0.09931383997259025,0.6909196551509177,B5 D+K,rep9_fold3,69.0,
358 +-0.49933422588539145,0.18170512165320227,17.0,13.0,0.7884615384615384,0.40807877936941567,0.5358499695614622,B5 D+K,rep9_fold4,69.0,
added results/empirical/h2_seshat_cv_wins.csv +13 −0
@@ -0,0 +1,13 @@
1 +model,baseline,folds,win_share,mean_diff,scheme
2 +A2 P,B0 FE only,10,0.8,0.010385438647938056,loro
3 +A2 P,B1 D only,10,0.3,-0.002709648303256007,loro
4 +A2 P,B2 K only,10,0.7,0.010421867396540784,loro
5 +A2 P,B3 complexity,10,0.8,0.010873068216126835,loro
6 +A2 P,B4 persistence,10,0.7,0.003042951969894492,loro
7 +A2 P,B5 D+K,10,0.2,-0.002836753438540579,loro
8 +A2 P,B0 FE only,48,0.7916666666666666,0.003561326926182278,kfold
9 +A2 P,B1 D only,48,0.75,0.0017770375262608888,kfold
10 +A2 P,B2 K only,48,0.8125,0.004959698215361119,kfold
11 +A2 P,B3 complexity,48,0.8541666666666666,0.005066075397629062,kfold
12 +A2 P,B4 persistence,48,0.6875,0.0019314050868669112,kfold
13 +A2 P,B5 D+K,48,0.75,0.0018448658208799925,kfold
added results/empirical/h2_seshat_primary.csv +15 −0
@@ -0,0 +1,15 @@
1 +model,term,coef,se,ci_lo,ci_hi,p,n,llf
2 +A1 primary: Y1 ~ P + FE,P_main_z,0.19598811961955986,0.05619238684720763,0.08585104139903292,0.3061251978400868,0.00048700208821658047,127,-53.2195116601875
3 +A2: Y1 ~ P + X + FE,P_main_z,0.20351158077892248,0.08482725386785257,0.03725016319793145,0.3697729983599135,0.01643409427092258,87,-34.71070763520765
4 +A3: Y1 ~ P + D + K + X + FE (P given components),P_main_z,0.2040721242253018,0.08343475533923725,0.04054000376039679,0.3676042446902068,0.014449560406630625,87,-34.70040393910057
5 +B1 baseline D only,D_pc1_z,0.2572372400381392,0.13838255154582166,-0.013992560991671232,0.5284670410679496,0.0630434502191715,94,-37.62951724969353
6 +B2 baseline K only,K_mean_z,-0.034191937803021266,0.19460423313308214,-0.4156162347438623,0.34723235913781975,0.8605297401049103,93,-37.569292952983
7 +B3 baseline complexity PC1,complexity_pc1_z,-0.010208261563331822,0.24040204287255076,-0.4813962655935313,0.4609797424668677,0.966129376006756,100,-40.486805909379015
8 +B4 baseline persistence,prior_crisis_nga,0.34454935642811907,0.24206393422328265,-0.12989595464951492,0.8189946675057531,0.15462555579388437,100,-40.3885673876723
9 +B5 D and K separately,D_pc1_z,0.340812724850877,0.16389523775530399,0.019578058850481195,0.6620473908512727,0.03757557599189618,87,-34.7076776779044
10 +B5 D and K separately,K_mean_z,-0.2130581957177733,0.1933961939788663,-0.5921147359163512,0.16599834448080464,0.2706064890854937,87,-34.7076776779044
11 +Placebo: P built with production infrastructure instead of K,P_placebo,0.2572372400381404,0.13838255154582466,-0.013992560991675895,0.5284670410679567,0.06304345021917601,94,-37.62951724969353
12 +"A1b: Y1b ~ P + region FE (logit, HC1; era FE dropped: separation)",P_main_z,-0.178305671270385,0.20339587470021095,-0.5769615856827984,0.22035024314202845,0.3806803045766206,123,-56.77239170158137
13 +"A2b: Y1b ~ P + X + region FE (logit, HC1)",P_main_z,0.1836712384747268,0.3238227440171184,-0.4510213397988253,0.8183638167482788,0.5705804519018927,86,-35.98874009410509
14 +"A3b: Y1b ~ P (logit, HC1, no FE)",P_main_z,-0.06838433580959115,0.17958182211249252,-0.42036470715007646,0.2835960355308942,0.7033534032954329,123,-65.92796981251857
15 +Exploratory: reform consequences ~ P + X + FE,P_main_z,-0.014797532092286084,0.18124585589368128,-0.37003940964390136,0.3404443454593292,0.9349302699171845,86,-12.808984824042609
added results/empirical/h2_seshat_robustness.csv +12 −0
@@ -0,0 +1,12 @@
1 +model,term,coef,se,ci_lo,ci_hi,p,n,llf
2 +R: K = IRT latent,_P,0.14592383683085786,0.0881205816941691,-0.026792503289713582,0.3186401769514293,0.0977306587410117,94,-37.654357924079186
3 +R: D = log population only,_P,0.26525556383786786,0.10468338503735995,0.06007612916464236,0.4704349985110934,0.011280603854963715,70,-27.82537097868165
4 +R: K = PC1 of blocks,_P,0.20625811785396292,0.08352201113301791,0.042554976033247816,0.369961259674678,0.01352997032752842,87,-34.70320925730064
5 +R: quasi-polities dropped,P_main_z,0.1529724190865244,0.10735424024088927,-0.057441891785618565,0.3633867299586674,0.1541770555079993,83,-33.6187062223242
6 +R: crises starting ≥25 years after polity start,P_main_z,0.25023816036590246,0.0906487023810333,0.0725667036990772,0.42790961703272773,0.005770824628688491,76,-30.631620415895608
7 +R: ≥12 of 14 items coded,P_main_z,0.1844104165442818,0.09097203094850494,0.00610523588521214,0.36271559720335145,0.04265104878181526,84,-33.545926963362994
8 +R: no era FE,P_main_z,0.25180620527649183,0.10548616040095524,0.04505333089061958,0.4585590796623641,0.016981787384069243,87,-35.055112402924486
9 +R: no region FE,P_main_z,0.232119825730709,0.08351611793574859,0.06842823457664177,0.3958114168847762,0.0054469201636038285,87,-35.0070205531534
10 +R: no FE,P_main_z,0.23998778925605788,0.09665426184846038,0.05054543603307554,0.4294301424790402,0.01302990355907613,87,-35.26034874356635
11 +R: SE clustered by NGA,P_main_z,0.20351158077892248,0.08471819678626769,0.037463915077837806,0.36955924648000715,0.0162959918773406,87,-34.71070763520765
12 +R: SE clustered by polity,P_main_z,0.20351158077892248,0.09551838785174915,0.016295540589494145,0.3907276209683508,0.033122020124625715,87,-34.71070763520765
added results/empirical/h2_seshat_y2_y3.csv +8 −0
@@ -0,0 +1,8 @@
1 +model,term,coef,se,ci_lo,ci_hi,p,n,events,hr,schoenfeld_p_P,llf
2 +Y2-1 Cox: P + strata(macro-region),P_z,0.031310416250117296,0.05974024289819664,-0.08577830825802286,0.14839914075825744,0.6002025278928143,317,302,1.0318057434499002,,
3 +Y2-2 Cox: P + X + midpoint + strata,P_z,0.0004380719784831337,0.06848719317473087,-0.13379436004622677,0.13467050400319305,0.9948964402173345,208,201,1.0004381679460252,0.9833941910291977,
4 +Y2-3 Cox: D + K + X + midpoint + strata,D_pc1_z,0.12781060414697887,0.13285461319788708,-0.13257965290087953,0.38820086119483727,0.33603271734868106,208,201,1.1363377646548505,,
5 +Y2-3 Cox: D + K + X + midpoint + strata,K_mean_z,0.5593188677196502,0.20034053668803614,0.16665863116767404,0.9519791042716264,0.005240914807357369,208,201,1.7494804667561765,,
6 +Y2-4 Cox: complexity PC1 + X + strata,complexity_pc1_z,0.39878281944897614,0.2909649639051191,-0.17149803056805407,0.9690636694660064,0.17051443371265806,208,201,1.4900099822759345,,
7 +Y3-1 logit: discontinuous succession ~ P + FE,P_z,0.01763842883851116,0.39254199204592066,-0.7517438755714932,0.7870207332485156,0.9641600238079073,145,24,,,-54.389786225011605
8 +Y3-2 logit: + X,P_z,0.23932566841618358,0.32473562350083773,-0.39715615364545837,0.8758074904778255,0.46113075042447405,117,18,,,-42.244120984695265
added results/empirical/h4_modern_folds.csv +16 −0
@@ -0,0 +1,16 @@
1 +fold,ll_linear,ll_hinge,ll_spline,knot
2 +0_0,-0.38072740150458145,-0.3832807423994349,-0.3799727011101197,-0.26216142759898337
3 +0_1,-0.3619579215407791,-0.36653335685093474,-0.36572721851361895,-0.2105946410843117
4 +0_2,-0.4235349593442857,-0.41993401929731544,-0.4183821499971644,0.28931771578983945
5 +0_3,-0.4365642787142172,-0.43327717327272885,-0.4309105727683838,0.7590880522564252
6 +0_4,-0.4490397442310791,-0.4411443442457377,-0.4394823643911699,-0.11392961120316815
7 +1_0,-0.37260640166068876,-0.37171031730793164,-0.3670082322815938,-0.8103616314912497
8 +1_1,-0.46533740371771243,-0.4600162792532017,-0.45896405575712224,0.023566838661939607
9 +1_2,-0.39086411055109366,-0.3900363471228906,-0.38941600229241935,0.1388426693592834
10 +1_3,-0.4329252646131489,-0.44811398957413373,-0.4423192350131433,0.46450315490570027
11 +1_4,-0.3607990870742064,-0.35813129140906885,-0.3543313502917593,-0.5047122556977675
12 +2_0,-0.38549180793761095,-0.3844138721878144,-0.3820770149747079,-0.08085854020686861
13 +2_1,-0.3052212719727017,-0.30304516814956023,-0.3016512921449975,0.11454948772058167
14 +2_2,-0.4415373149751551,-0.44121277469892334,-0.4388071017380588,-0.31478062143706037
15 +2_3,-0.4823135020710999,-0.4766631526244819,-0.4752436730506729,-0.22153279805808734
16 +2_4,-0.4557569936641007,-0.45244708745140655,-0.4513340897893185,0.015787115188381145
added results/empirical/h4_modern_summary.json +9 −0
@@ -0,0 +1,9 @@
1 +{
2 + "folds": 15,
3 + "hinge_beats_linear_share": 0.8,
4 + "spline_beats_linear_share": 0.8666666666666667,
5 + "mean_ll_linear": -0.409645164238164,
6 + "mean_ll_hinge": -0.4086639943897043,
7 + "mean_ll_spline": -0.40637513694095,
8 + "median_knot": -0.08085854020686861
9 +}
\ No newline at end of file
added results/empirical/h4_seshat_folds.csv +53 −0
@@ -0,0 +1,53 @@
1 +fold,ll_linear,ll_hinge,ll_spline,knot,error
2 +0_0,-0.6073319277431232,-0.6131838242549503,-0.6071190336909165,0.36513210692942416,
3 +0_1,,,,,"predict requires that you use a DataFrame when predicting from a model
4 +that was "
5 +0_2,-0.5430608999692377,-0.5499358087258317,-0.5484332564072465,0.9788949443858063,
6 +0_3,-0.6066033552073161,-0.6073041342704331,-0.6067879720990288,0.3893968360107544,
7 +0_4,-0.6305116194410425,-0.6326288905966302,-0.6327655334698337,-0.011972201587621632,
8 +1_0,-0.6195177999366908,-0.62181175905971,-0.6195350049423968,0.5332544929068211,
9 +1_1,-0.5928356372674103,-0.5923288291601098,-0.5928893306169941,0.8935173898723662,
10 +1_2,-0.5755512951369498,-0.5761642944303119,-0.5757065883469027,0.02936483564554008,
11 +1_3,-0.622916299479458,-0.6357573583395639,-0.6270825202621582,0.7030557333124431,
12 +1_4,-0.5852119207254092,-0.591875290218668,-0.5885172247138127,0.35628507173225793,
13 +2_0,-0.616472621816557,-0.6409823398687424,-0.6284849555643202,-0.0010509353418476,
14 +2_1,-0.5482053008327218,-0.5494991873238384,-0.5483354064190485,0.36513210692942416,
15 +2_2,-0.6821407631459,-0.6853928925005789,-0.6850380959633364,0.059337315306033415,
16 +2_3,-0.6293622469961574,-0.634329851545063,-0.6314843535725201,-0.7433090268718517,
17 +2_4,-0.545310589513379,-0.549200703714863,-0.5481990236192322,-0.7974094314459952,
18 +3_0,-0.5540445983633765,-0.5645217755182262,-0.556476931681974,-0.8154428996373765,
19 +3_1,-0.6415004544963518,-0.6418640463285981,-0.6418113371197941,-0.016879253114445398,
20 +3_2,-0.6258069537622215,-0.6283716062286911,-0.6259175825846708,0.8175394884463547,
21 +3_3,-0.6058292956883152,-0.612228091457024,-0.6103867902075194,-0.011972676787848116,
22 +3_4,-0.5859419890086269,-0.5868179082364648,-0.5861455482707877,0.8649355575843569,
23 +4_0,-0.6170286166705549,-0.6211316100607501,-0.6173855125712173,0.9898030470310585,
24 +4_1,-0.6898464795595827,-0.6953961685290634,-0.6923247661620011,0.40891374390239404,
25 +4_2,-0.5876564900362858,-0.5872309555051255,-0.5874937968797023,-0.023706079651711606,
26 +4_3,-0.599407944209624,-0.6096017182312378,-0.602529050417318,0.07117289129873504,
27 +4_4,-0.5554073836595318,-0.559642654994082,-0.5575500239389983,-0.8579182678023413,
28 +5_0,-0.5754837141305577,-0.5814410604011224,-0.5838196225946528,0.9898030470310585,
29 +5_1,-0.6366553669723513,-0.6361934330260075,-0.6366158669498424,-0.06319747661825138,
30 +5_2,-0.626181965497974,-0.6381105227118837,-0.630748282406736,0.059337315306033415,
31 +5_3,-0.5724568522125653,-0.5745999961845251,-0.5738075087950898,-0.8530306571124697,
32 +5_4,-0.5958887681386783,-0.6090281305723076,-0.6012838397359873,0.3619724515018648,
33 +6_0,-0.6467235094755063,-0.6509659401630754,-0.6474115344382013,0.06682725906244508,
34 +6_1,-0.5530973471164247,-0.5563448949136309,-0.5539055626770129,-0.016879253114445398,
35 +6_2,-0.5729226848601316,-0.5818259184227895,-0.5768249904145749,0.3235321876914416,
36 +6_3,-0.6268760451697202,-0.6284210391856198,-0.6269621361307361,0.3245728761591106,
37 +6_4,-0.6215745903739501,-0.6299813069730887,-0.6264126375427497,0.07117289129873504,
38 +7_0,-0.6460179014798269,-0.6479662862539344,-0.646073707522539,0.8819840342447194,
39 +7_1,-0.615112194855756,-0.6163708504181238,-0.6151633606350659,0.42605674119918846,
40 +7_2,-0.5649084327318514,-0.5758525763758451,-0.5747679428944116,-0.014922148544023224,
41 +7_3,-0.646666369436335,-0.6480217750049363,-0.6474363736954776,-0.8685306970795583,
42 +7_4,-0.5661568215832,-0.5684781355461117,-0.5664295187411669,0.09091412478135999,
43 +8_0,-0.5822039715456159,-0.5814605237780883,-0.5822552357230313,-0.020770422796078346,
44 +8_1,-0.6049258779799229,-0.6099012768891511,-0.6050816961161509,0.36513210692942416,
45 +8_2,-0.6104916839226251,-0.6203893727327301,-0.6111209066438887,0.8555647061368938,
46 +8_3,-0.620428349688623,-0.6211120059109925,-0.6209734422349814,1.0236873529437132,
47 +8_4,-0.5804883865855972,-0.5814434190465739,-0.580620527327425,-0.8530306571124697,
48 +9_0,-0.6800275101477173,-0.687514406861422,-0.685949801096284,0.36513210692942416,
49 +9_1,,,,,"predict requires that you use a DataFrame when predicting from a model
50 +that was "
51 +9_2,-0.6098519300366266,-0.608971015453138,-0.6096314417059784,0.021307327107412496,
52 +9_3,-0.5925777083749647,-0.596248757747395,-0.5948496905802194,0.059337315306033415,
53 +9_4,-0.5587977262042823,-0.602389425752546,-0.5636814319690221,0.9265806565026173,
added results/empirical/h4_seshat_summary.json +12 −0
@@ -0,0 +1,12 @@
1 +{
2 + "folds": 48,
3 + "hinge_beats_linear_share": 0.10416666666666667,
4 + "spline_beats_linear_share": 0.08333333333333333,
5 + "mean_ll_linear": -0.6036253789830548,
6 + "mean_ll_hinge": -0.6091715368629916,
7 + "mean_ll_spline": -0.60583805621027,
8 + "median_knot": 0.08104350804004751,
9 + "insample_knot": 0.9186514745086101,
10 + "insample_hinge_coef": -0.3374682573990433,
11 + "insample_P_coef": 0.2670438154031941
12 +}
\ No newline at end of file
added results/empirical/h5_modern_blocks.csv +11 −0
@@ -0,0 +1,11 @@
1 +model,term,coef,se,ci_lo,ci_hi,p,n,llf,within_block_coef,within_block_se,within_block_n,within_block_events
2 +H5 leave-region-out: 1.0,P_modern_z,0.2934595045288704,0.09362115486969619,0.10996204098426585,0.4769569680734749,0.001721222205862824,13252,-5344.849628149383,1.0667363453334888,0.4315175343100045,1385,131
3 +H5 leave-region-out: 2.0,P_modern_z,0.32839169786350464,0.09899119399634705,0.13436895763066442,0.5224144380963449,0.0009086498400836919,12017,-4279.59797027817,0.542019287761248,0.29203183762582197,2620,773
4 +H5 leave-region-out: 3.0,P_modern_z,0.30259807281640266,0.09685131345583817,0.11276949844295986,0.49242664718984547,0.0017819415256266043,13175,-5045.818633583093,0.44875514382722154,0.35024594633340544,1462,281
5 +H5 leave-region-out: 4.0,P_modern_z,0.3122909808640708,0.1172783121558377,0.08242548903862892,0.5421564726895127,0.007748895907150537,11363,-4117.771450336368,0.3909917466737983,0.16736215744982263,3274,747
6 +H5 leave-region-out: 5.0,P_modern_z,0.2944295644568827,0.096981539591355,0.10434574685782688,0.48451338205593847,0.002397917566488579,10717,-4849.915015269096,0.7808050613948634,0.28471969885156295,3920,350
7 +H5 leave-region-out: 6.0,P_modern_z,0.4699043430360989,0.09343697508522182,0.28676787186906416,0.6530408142031336,4.92774934321103e-07,12661,-4830.72668160546,0.2344469424651936,0.20575581085450534,1976,410
8 +H5 leave-period-out: 1900-1945,P_modern_z,0.41509039109077045,0.09907598554909457,0.22090145941454511,0.6092793227669958,2.7942620509638244e-05,12616,-4640.906505104742,0.298190061570195,0.18693134042787674,2021,554
9 +H5 leave-period-out: 1946-1989,P_modern_z,0.3614935755750333,0.1131577434269858,0.13970439845814114,0.5832827526919255,0.0014002541509288856,8927,-3055.2555325813128,0.43543790099812424,0.12202001089038361,5710,1295
10 +H5 leave-period-out: 1990+,P_modern_z,0.4173530750764519,0.10624640481187518,0.20911012164517656,0.6255960285077273,8.559759609628999e-05,9285,-4036.4384324701446,0.3476491217304899,0.16089032312791085,5352,626
11 +H5 leave-period-out: pre-1900,P_modern_z,0.3940733263264095,0.09183407311667917,0.21407854301771834,0.5740681096351007,1.777541709685051e-05,13083,-5223.594464430906,0.6652900500332333,0.27695705329806547,1554,217
added results/empirical/h5_seshat_blocks.csv +17 −0
@@ -0,0 +1,17 @@
1 +model,term,coef,se,ci_lo,ci_hi,p,n,llf,held_out_n,cov,within_block_coef,within_block_se,within_block_note
2 +H5 leave-region-out: Central_Asia,P_main_z,0.22461753717462926,0.08568439617091256,0.056676120679640646,0.3925589536696179,0.008755607460022404,84,-33.98018010262266,13,cluster,,,
3 +H5 leave-region-out: East_Asia,P_main_z,0.22949092621939032,0.10741782975894221,0.01895197989186359,0.44002987254691706,0.032644189769015154,64,-25.290043505196856,30,cluster,0.1894787513854881,0.18026279023912647,
4 +H5 leave-region-out: Europe,P_main_z,0.3268895933604762,0.12409157207287243,0.08367011209764622,0.5701090746233062,0.008432063416857781,72,-29.26015669527454,39,cluster,0.1955639812755721,0.16079169028537635,
5 +H5 leave-region-out: North_Africa,P_main_z,0.22974877100833047,0.08248305650223646,0.06808198026394702,0.3914155617527139,0.005346079695852263,78,-31.17296980353798,12,cluster,,,
6 +H5 leave-region-out: North_America,P_main_z,0.20972841272512133,0.08982747923234624,0.03366655342972269,0.38579027202051996,0.019554328408799768,85,-34.073542444671,13,cluster,,,
7 +H5 leave-region-out: South_America,P_main_z,0.2612911504595587,0.08857096462904869,0.08769205978662326,0.43489024113249414,0.003176949178068867,84,-33.834765978355286,6,cluster,,,
8 +H5 leave-region-out: South_Asia,P_main_z,0.2247397891044831,0.08388398544018442,0.06032717764172163,0.3891524005672446,0.0073804040514512895,82,-33.10471855215352,5,cluster,,,
9 +H5 leave-region-out: Southeast_Asia_Oceania,P_main_z,0.2138165550159248,0.0928771353592739,0.031777369711747966,0.3958557403201016,0.021327043621541645,81,-32.767722020452744,13,cluster,,,
10 +H5 leave-region-out: Southwest_Asia,P_main_z,0.2350168697854773,0.09035439279804337,0.057922259901312306,0.41211147966964234,0.009293717891667684,70,-27.784628452091624,29,cluster,0.4370423994599299,0.23408049224027258,"P only, HC1"
11 +H5 leave-region-out: Sub_Saharan_Africa,P_main_z,0.17661347291140242,0.06091719007720705,0.0572157803600766,0.2960111654627282,0.00374070034062224,83,-33.34228761918488,6,cluster,,,
12 +H5 leave-era-out: 1-1000,P_main_z,0.3190887539974902,0.13675894464751404,0.05104122248836268,0.5871362855066178,0.019636582812069914,66,-26.29352354427494,40,cluster,0.1269142179101019,0.17708762663627417,
13 +H5 leave-era-out: 1000BCE-0,P_main_z,0.2039775097457945,0.17425442481819425,-0.1375611628978662,0.5455161823894552,0.24177049020818997,69,-28.155236215435547,28,cluster,0.3403822063965426,0.08094658852142315,"P only, HC1"
14 +H5 leave-era-out: 1001-1500,P_main_z,0.26270215046394874,0.09973205586069862,0.06722732097697945,0.458176979950918,0.008436576503777686,65,-26.382990028716325,43,cluster,0.20461342489165785,0.09056084442259384,
15 +H5 leave-era-out: 1501-1800,P_main_z,0.22427320273746681,0.07269809954168585,0.08178492763576256,0.36676147783917107,0.002035562421909049,73,-28.58113736077386,31,cluster,0.29956643047710674,0.5237628215863569,
16 +H5 leave-era-out: post-1800,P_main_z,0.22446987921417064,0.10815421498099562,0.01248761785141922,0.43645214057692205,0.03794380919902884,81,-32.59740907232731,16,cluster,0.27884962464927154,0.15671393674391607,"P only, HC1"
17 +H5 leave-era-out: pre-1000BCE,P_main_z,0.24236614160145775,0.107295830322746,0.03206631416887559,0.4526659690340399,0.023892163096172866,81,-32.648685699000914,8,cluster,,,
modified results/logs/execution_log.md +5 −0
@@ -20,3 +20,8 @@
20 20 | 2026-11-01 04:40 | 3 | Formal framework drafted (fork agent) and reviewed: Theorems 1–5 with proofs, Conjectures C1–C3, mapping to tests; Lindley 1952 / Loynes 1962 verified by Crossref and added | `research/framework.md` |
21 21 | 2026-11-01 04:50 | 3 | `python -m wp35.measurement.build_indices` (2 runs; IRT regularized with MAP priors after boundary estimates) | `data/processed/seshat_indices.parquet`, `seshat_crisis_indices.parquet`, `modern_indices.parquet`; `results/empirical/measurement_*`, `power_h2a_*.csv`; figures `fig_measurement_DK.pdf`, `fig_irt_invariance.pdf` |
22 22 | 2026-11-01 05:00 | 3 | Measurement report: corr(D,K)=0.84, P keeps 16.6% of variance; MDE Y1b≈0.6 (underpowered), Y1≈0.15 | `research/measurement.md` |
23 +| 2026-11-01 05:30 | 4 | `python -m wp35.econometrics.h1` (Seshat OLS/mixed, EA Conley + ordered logit, modern within/differences) | `results/empirical/h1_*.csv` |
24 +| 2026-11-01 05:45 | 4 | `python -m wp35.econometrics.h2_seshat` — FIRST predictor–outcome estimation (4 runs: binary spec switched to region-FE/HC1 after quasi-separation; H5 fallbacks for singular held-out designs) | `results/empirical/h2_seshat_*.csv`, `h4_seshat_summary.json`, `h5_seshat_blocks.csv`, `h2_seshat_y2_y3.csv`; log `results/logs/h2_seshat_run.log` |
25 +| 2026-11-01 06:00 | 4 | `python -m wp35.econometrics.h2_modern` run 1 (placebo collinear with polyarchy control; negative control separated by duration terms → specs fixed, run 2 launched) | `results/empirical/h2_modern_*.csv`, `h4_modern_*`, `h5_modern_blocks.csv` |
26 +| 2026-11-01 06:10 | 4 | `research/identification.md` written | — |
27 +| 2026-11-01 06:20 | 5 | Simulation model + factorial runner written; smoke test showed message count bug (scalar) and root saturation → fixed, admin capacity made a factor; `python -m wp35.simulations.run_experiments` | `results/simulated/runs_main.parquet` (6,048 runs), `runs_ablation.parquet` (488 runs) |
added results/logs/h2_modern_run.log +4 −0
@@ -0,0 +1,4 @@
1 +/Users/simon-pierreboucher/Desktop/UQO/Recherche/Recherche-UQO/economie/social-compression-hypothesis/.venv/lib/python3.12/site-packages/statsmodels/discrete/conditional_models.py:80: UserWarning: Dropped 37 groups and 2823 observations for having no within-group variance
2 + warnings.warn(msg)
3 +/Users/simon-pierreboucher/Desktop/UQO/Recherche/Recherche-UQO/economie/social-compression-hypothesis/.venv/lib/python3.12/site-packages/statsmodels/base/model.py:607: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
4 + warnings.warn("Maximum Likelihood optimization failed to "
added results/logs/h2_seshat_run.log +115 −0
@@ -0,0 +1,115 @@
1 +/Users/simon-pierreboucher/Desktop/UQO/Recherche/Recherche-UQO/economie/social-compression-hypothesis/.venv/lib/python3.12/site-packages/statsmodels/base/model.py:607: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
2 + warnings.warn("Maximum Likelihood optimization failed to "
3 +/Users/simon-pierreboucher/Desktop/UQO/Recherche/Recherche-UQO/economie/social-compression-hypothesis/.venv/lib/python3.12/site-packages/statsmodels/base/model.py:607: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
4 + warnings.warn("Maximum Likelihood optimization failed to "
5 +/Users/simon-pierreboucher/Desktop/UQO/Recherche/Recherche-UQO/economie/social-compression-hypothesis/.venv/lib/python3.12/site-packages/statsmodels/base/model.py:607: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
6 + warnings.warn("Maximum Likelihood optimization failed to "
7 +/Users/simon-pierreboucher/Desktop/UQO/Recherche/Recherche-UQO/economie/social-compression-hypothesis/.venv/lib/python3.12/site-packages/statsmodels/discrete/discrete_model.py:2385: RuntimeWarning: overflow encountered in exp
8 + return 1/(1+np.exp(-X))
9 +/Users/simon-pierreboucher/Desktop/UQO/Recherche/Recherche-UQO/economie/social-compression-hypothesis/.venv/lib/python3.12/site-packages/statsmodels/discrete/discrete_model.py:2443: RuntimeWarning: divide by zero encountered in log
10 + return np.sum(np.log(self.cdf(q * linpred)))
11 +/Users/simon-pierreboucher/Desktop/UQO/Recherche/Recherche-UQO/economie/social-compression-hypothesis/.venv/lib/python3.12/site-packages/statsmodels/base/model.py:607: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
12 + warnings.warn("Maximum Likelihood optimization failed to "
13 +/Users/simon-pierreboucher/Desktop/UQO/Recherche/Recherche-UQO/economie/social-compression-hypothesis/.venv/lib/python3.12/site-packages/statsmodels/base/model.py:607: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
14 + warnings.warn("Maximum Likelihood optimization failed to "
15 +/Users/simon-pierreboucher/Desktop/UQO/Recherche/Recherche-UQO/economie/social-compression-hypothesis/.venv/lib/python3.12/site-packages/statsmodels/base/model.py:607: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
16 + warnings.warn("Maximum Likelihood optimization failed to "
17 +/Users/simon-pierreboucher/Desktop/UQO/Recherche/Recherche-UQO/economie/social-compression-hypothesis/.venv/lib/python3.12/site-packages/statsmodels/base/model.py:607: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
18 + warnings.warn("Maximum Likelihood optimization failed to "
19 +=== PRIMARY (Y1 fractional logit, cluster region) ===
20 + model term coef se p n
21 + A1 primary: Y1 ~ P + FE P_main_z 0.196 0.056 0.000 127
22 + A2: Y1 ~ P + X + FE P_main_z 0.204 0.085 0.016 87
23 + A3: Y1 ~ P + D + K + X + FE (P given components) P_main_z 0.204 0.083 0.014 87
24 + B1 baseline D only D_pc1_z 0.257 0.138 0.063 94
25 + B2 baseline K only K_mean_z -0.034 0.195 0.861 93
26 + B3 baseline complexity PC1 complexity_pc1_z -0.010 0.240 0.966 100
27 + B4 baseline persistence prior_crisis_nga 0.345 0.242 0.155 100
28 + B5 D and K separately D_pc1_z 0.341 0.164 0.038 87
29 + B5 D and K separately K_mean_z -0.213 0.193 0.271 87
30 + Placebo: P built with production infrastructure instead of K P_placebo 0.257 0.138 0.063 94
31 +A1b: Y1b ~ P + region FE (logit, HC1; era FE dropped: separation) P_main_z -0.178 0.203 0.381 123
32 + A2b: Y1b ~ P + X + region FE (logit, HC1) P_main_z 0.184 0.324 0.571 86
33 + A3b: Y1b ~ P (logit, HC1, no FE) P_main_z -0.068 0.180 0.703 123
34 + Exploratory: reform consequences ~ P + X + FE P_main_z -0.015 0.181 0.935 86
35 +
36 +=== ROBUSTNESS ===
37 + model term coef se p n
38 + R: K = IRT latent _P 0.146 0.088 0.098 94
39 + R: D = log population only _P 0.265 0.105 0.011 70
40 + R: K = PC1 of blocks _P 0.206 0.084 0.014 87
41 + R: quasi-polities dropped P_main_z 0.153 0.107 0.154 83
42 +R: crises starting ≥25 years after polity start P_main_z 0.250 0.091 0.006 76
43 + R: ≥12 of 14 items coded P_main_z 0.184 0.091 0.043 84
44 + R: no era FE P_main_z 0.252 0.105 0.017 87
45 + R: no region FE P_main_z 0.232 0.084 0.005 87
46 + R: no FE P_main_z 0.240 0.097 0.013 87
47 + R: SE clustered by NGA P_main_z 0.204 0.085 0.016 87
48 + R: SE clustered by polity P_main_z 0.204 0.096 0.033 87
49 +
50 +=== OOS wins of A2 over baselines ===
51 + model baseline folds win_share mean_diff scheme
52 + A2 P B0 FE only 10 0.800 0.010 loro
53 + A2 P B1 D only 10 0.300 -0.003 loro
54 + A2 P B2 K only 10 0.700 0.010 loro
55 + A2 P B3 complexity 10 0.800 0.011 loro
56 + A2 P B4 persistence 10 0.700 0.003 loro
57 + A2 P B5 D+K 10 0.200 -0.003 loro
58 + A2 P B0 FE only 48 0.792 0.004 kfold
59 + A2 P B1 D only 48 0.750 0.002 kfold
60 + A2 P B2 K only 48 0.812 0.005 kfold
61 + A2 P B3 complexity 48 0.854 0.005 kfold
62 + A2 P B4 persistence 48 0.688 0.002 kfold
63 + A2 P B5 D+K 48 0.750 0.002 kfold
64 +
65 +=== Y1b OOS summary ===
66 + model oos_loglik auc brier
67 + A2 P -1.350 0.633 0.258
68 + B0 FE only -1.278 0.641 0.249
69 + B1 D only -1.339 0.634 0.257
70 + B2 K only -1.318 0.630 0.259
71 + B3 complexity -1.322 0.629 0.261
72 +B4 persistence -1.341 0.624 0.263
73 + B5 D+K -1.396 0.621 0.268
74 +
75 +=== H4 === {
76 + "folds": 48,
77 + "hinge_beats_linear_share": 0.10416666666666667,
78 + "spline_beats_linear_share": 0.08333333333333333,
79 + "mean_ll_linear": -0.6036253789830548,
80 + "mean_ll_hinge": -0.6091715368629916,
81 + "mean_ll_spline": -0.60583805621027,
82 + "median_knot": 0.08104350804004751,
83 + "insample_knot": 0.9186514745086101,
84 + "insample_hinge_coef": -0.3374682573990433,
85 + "insample_P_coef": 0.2670438154031941
86 +}
87 +
88 +=== H5 ===
89 + model coef se p n held_out_n within_block_coef within_block_se
90 + H5 leave-region-out: Central_Asia 0.225 0.086 0.009 84 13 NaN NaN
91 + H5 leave-region-out: East_Asia 0.229 0.107 0.033 64 30 0.189 0.180
92 + H5 leave-region-out: Europe 0.327 0.124 0.008 72 39 0.196 0.161
93 + H5 leave-region-out: North_Africa 0.230 0.082 0.005 78 12 NaN NaN
94 + H5 leave-region-out: North_America 0.210 0.090 0.020 85 13 NaN NaN
95 + H5 leave-region-out: South_America 0.261 0.089 0.003 84 6 NaN NaN
96 + H5 leave-region-out: South_Asia 0.225 0.084 0.007 82 5 NaN NaN
97 +H5 leave-region-out: Southeast_Asia_Oceania 0.214 0.093 0.021 81 13 NaN NaN
98 + H5 leave-region-out: Southwest_Asia 0.235 0.090 0.009 70 29 0.437 0.234
99 + H5 leave-region-out: Sub_Saharan_Africa 0.177 0.061 0.004 83 6 NaN NaN
100 + H5 leave-era-out: 1-1000 0.319 0.137 0.020 66 40 0.127 0.177
101 + H5 leave-era-out: 1000BCE-0 0.204 0.174 0.242 69 28 0.340 0.081
102 + H5 leave-era-out: 1001-1500 0.263 0.100 0.008 65 43 0.205 0.091
103 + H5 leave-era-out: 1501-1800 0.224 0.073 0.002 73 31 0.300 0.524
104 + H5 leave-era-out: post-1800 0.224 0.108 0.038 81 16 0.279 0.157
105 + H5 leave-era-out: pre-1000BCE 0.242 0.107 0.024 81 8 NaN NaN
106 +
107 +=== Y2 Cox / Y3 ===
108 + model term coef se p n events hr schoenfeld_p_P
109 + Y2-1 Cox: P + strata(macro-region) P_z 0.031 0.060 0.600 317 302 1.032 NaN
110 + Y2-2 Cox: P + X + midpoint + strata P_z 0.000 0.068 0.995 208 201 1.000 0.983
111 + Y2-3 Cox: D + K + X + midpoint + strata D_pc1_z 0.128 0.133 0.336 208 201 1.136 NaN
112 + Y2-3 Cox: D + K + X + midpoint + strata K_mean_z 0.559 0.200 0.005 208 201 1.749 NaN
113 + Y2-4 Cox: complexity PC1 + X + strata complexity_pc1_z 0.399 0.291 0.171 208 201 1.490 NaN
114 +Y3-1 logit: discontinuous succession ~ P + FE P_z 0.018 0.393 0.964 145 24 NaN NaN
115 + Y3-2 logit: + X P_z 0.239 0.325 0.461 117 18 NaN NaN
added results/simulated/runs_ablation.parquet +0 −0

Binary file not shown.

added results/simulated/runs_main.parquet +0 −0

Binary file not shown.

added src/wp35/econometrics/common.py +146 −0
@@ -0,0 +1,146 @@
1 +"""Shared estimation utilities for Phase 4 (statsmodels-based, deterministic)."""
2 +from __future__ import annotations
3 +import numpy as np
4 +import pandas as pd
5 +import statsmodels.api as sm
6 +import statsmodels.formula.api as smf
7 +from sklearn.metrics import roc_auc_score
8 +
9 +SEED = 20261101
10 +
11 +
12 +def fit_formula(formula: str, data: pd.DataFrame, family, groups: str | None = None):
13 + """GLM (or OLS if family is None) with cluster-robust SE by `groups`. Returns the fitted result."""
14 + d = data.dropna(subset=_vars(formula, data) + ([groups] if groups else []))
15 + if family is None:
16 + mod = smf.ols(formula, d)
17 + else:
18 + mod = smf.glm(formula, d, family=family)
19 + if groups:
20 + g = pd.factorize(d[groups])[0]
21 + res = mod.fit(cov_type="cluster", cov_kwds={"groups": g})
22 + else:
23 + res = mod.fit(cov_type="HC1")
24 + res._n_used = len(d); res._data_used = d
25 + return res
26 +
27 +
28 +def _vars(formula: str, data: pd.DataFrame) -> list[str]:
29 + import re
30 + toks = set(re.findall(r"[A-Za-z_][A-Za-z0-9_]*", formula))
31 + return [t for t in toks if t in data.columns]
32 +
33 +
34 +def coef_row(res, name: str, label: str, extra: dict | None = None) -> dict:
35 + b = res.params.get(name, np.nan); se = res.bse.get(name, np.nan); p = res.pvalues.get(name, np.nan)
36 + row = {"model": label, "term": name, "coef": b, "se": se, "ci_lo": b - 1.96 * se, "ci_hi": b + 1.96 * se, "p": p,
37 + "n": getattr(res, "_n_used", np.nan), "llf": getattr(res, "llf", np.nan)}
38 + if extra:
39 + row.update(extra)
40 + return row
41 +
42 +
43 +def oos_loglik_binomial(y, p, trials=None):
44 + """Out-of-sample log-likelihood for binary or fractional outcomes (per observation mean)."""
45 + p = np.clip(np.asarray(p, float), 1e-6, 1 - 1e-6); y = np.asarray(y, float)
46 + ll = y * np.log(p) + (1 - y) * np.log(1 - p)
47 + return float(np.mean(ll))
48 +
49 +
50 +def binary_metrics(y, p) -> dict:
51 + y = np.asarray(y, float); p = np.clip(np.asarray(p, float), 1e-6, 1 - 1e-6)
52 + out = {"oos_loglik": oos_loglik_binomial(y, p), "brier": float(np.mean((y - p) ** 2)), "n": int(len(y)), "events": int(y.sum())}
53 + if 0 < y.sum() < len(y):
54 + out["auc"] = float(roc_auc_score(y, p))
55 + # calibration slope: logit(y) on logit(p)
56 + lp = np.log(p / (1 - p))
57 + try:
58 + cal = sm.Logit(y, sm.add_constant(lp)).fit(disp=0)
59 + out["calibration_slope"] = float(cal.params[1]); out["calibration_intercept"] = float(cal.params[0])
60 + except Exception:
61 + out["calibration_slope"] = np.nan
62 + else:
63 + out["auc"] = np.nan; out["calibration_slope"] = np.nan
64 + return out
65 +
66 +
67 +def cv_compare(data: pd.DataFrame, formulas: dict[str, str], y: str, family, fold_col: str | None = None,
68 + n_repeats: int = 10, k: int = 5, groups: str | None = None, fractional: bool = False) -> pd.DataFrame:
69 + """Out-of-sample comparison. If fold_col is given → leave-one-group-out on that column; else repeated k-fold.
70 + Returns one row per (model, fold) with OOS log-likelihood and, for binary y, AUC/Brier."""
71 + rows = []
72 + allvars = sorted(set(sum([_vars(f, data) for f in formulas.values()], [])) | {y} | ({groups} if groups else set()))
73 + d = data.dropna(subset=allvars).reset_index(drop=True)
74 + if fold_col:
75 + folds = [(f"loo_{g}", d[fold_col] != g, d[fold_col] == g) for g in sorted(d[fold_col].unique())]
76 + else:
77 + rng = np.random.default_rng(SEED); folds = []
78 + for r in range(n_repeats):
79 + perm = rng.permutation(len(d)); parts = np.array_split(perm, k)
80 + for i, te in enumerate(parts):
81 + mask = np.zeros(len(d), bool); mask[te] = True
82 + folds.append((f"rep{r}_fold{i}", ~mask, mask))
83 + for name, formula in formulas.items():
84 + for fid, tr, te in folds:
85 + dtr, dte = d[tr], d[te]
86 + if dte[y].notna().sum() == 0 or len(dtr) < 20:
87 + continue
88 + try:
89 + mod = smf.glm(formula, dtr, family=family).fit()
90 + # drop test rows with factor levels unseen in training (predict would fail)
91 + p = mod.predict(dte)
92 + ok = np.isfinite(p)
93 + m = binary_metrics(dte[y][ok], p[ok]) if not fractional else {"oos_loglik": oos_loglik_binomial(dte[y][ok], p[ok]), "n": int(ok.sum())}
94 + m.update({"model": name, "fold": fid, "n_train": int(len(dtr))}); rows.append(m)
95 + except Exception as e:
96 + rows.append({"model": name, "fold": fid, "error": str(e)[:80]})
97 + return pd.DataFrame(rows)
98 +
99 +
100 +def fold_win_share(cv: pd.DataFrame, model: str, baseline: str, metric: str = "oos_loglik") -> dict:
101 + a = cv[cv.model == model].set_index("fold")[metric]; b = cv[cv.model == baseline].set_index("fold")[metric]
102 + j = a.to_frame("m").join(b.to_frame("b"), how="inner").dropna()
103 + if len(j) == 0:
104 + return {"model": model, "baseline": baseline, "folds": 0, "win_share": np.nan, "mean_diff": np.nan}
105 + return {"model": model, "baseline": baseline, "folds": int(len(j)), "win_share": float((j.m > j.b).mean()), "mean_diff": float((j.m - j.b).mean())}
106 +
107 +
108 +def holm(pvals: dict[str, float]) -> dict[str, float]:
109 + items = sorted(pvals.items(), key=lambda kv: kv[1]); m = len(items); out = {}; running = 0
110 + for i, (k, p) in enumerate(items):
111 + adj = min(1.0, (m - i) * p); running = max(running, adj); out[k] = running
112 + return out
113 +
114 +
115 +def conley_ols(formula: str, data: pd.DataFrame, lat: str, lon: str, cutoff_km: float):
116 + """OLS with Conley (1999) spatial HAC standard errors, Bartlett kernel with distance cutoff."""
117 + d = data.dropna(subset=_vars(formula, data) + [lat, lon]).reset_index(drop=True)
118 + mod = smf.ols(formula, d); res = mod.fit()
119 + X = mod.exog; u = res.resid.values; n, kx = X.shape
120 + la, lo = np.radians(d[lat].values), np.radians(d[lon].values)
121 + dlat = la[:, None] - la[None, :]; dlon = lo[:, None] - lo[None, :]
122 + h = np.sin(dlat / 2) ** 2 + np.cos(la)[:, None] * np.cos(la)[None, :] * np.sin(dlon / 2) ** 2
123 + dist = 2 * 6371.0 * np.arcsin(np.sqrt(np.clip(h, 0, 1)))
124 + w = np.clip(1 - dist / cutoff_km, 0, None)
125 + Xu = X * u[:, None]
126 + meat = Xu.T @ w @ Xu
127 + bread = np.linalg.inv(X.T @ X)
128 + V = bread @ meat @ bread
129 + se = np.sqrt(np.diag(V))
130 + return res, pd.Series(se, index=res.params.index), len(d)
131 +
132 +
133 +def hinge_fit(data: pd.DataFrame, y: str, base_formula: str, pvar: str, family, grid=None):
134 + """Profile-likelihood hinge: y ~ base + P + max(P-c,0), c chosen on the given data (call on the TRAINING fold)."""
135 + d = data.dropna(subset=_vars(base_formula, data) + [y, pvar]).copy()
136 + grid = np.quantile(d[pvar], np.linspace(0.15, 0.85, 15)) if grid is None else grid
137 + best = None
138 + for c in grid:
139 + d["_hinge"] = np.clip(d[pvar] - c, 0, None)
140 + try:
141 + m = smf.glm(f"{base_formula} + _hinge", d, family=family).fit()
142 + if best is None or m.llf > best[0]:
143 + best = (m.llf, c, m)
144 + except Exception:
145 + continue
146 + return best
added src/wp35/econometrics/h1.py +118 −0
@@ -0,0 +1,118 @@
1 +"""H1 — association between coordination capacity and social scale (no direction claimed).
2 +Seshat (polity), Ethnographic Atlas (society), modern panel (country-year). Usage: python -m wp35.econometrics.h1
3 +"""
4 +from __future__ import annotations
5 +import json
6 +from pathlib import Path
7 +import numpy as np
8 +import pandas as pd
9 +import statsmodels.api as sm
10 +import statsmodels.formula.api as smf
11 +from statsmodels.miscmodels.ordinal_model import OrderedModel
12 +from scipy.stats import norm
13 +from wp35.econometrics.common import fit_formula, coef_row, conley_ols
14 +
15 +ROOT = Path(__file__).resolve().parents[3]
16 +PROC = ROOT / "data" / "processed"; RES = ROOT / "results" / "empirical"
17 +RES.mkdir(parents=True, exist_ok=True)
18 +
19 +
20 +def seshat():
21 + d = pd.read_parquet(PROC / "seshat_indices.parquet")
22 + d["quasi"] = d.centralization.eq("quasi-polity")
23 + rows = []
24 + base = "C(macro_region) + C(era)"
25 + specs = {
26 + "H1-S1 primary: D_pc1 ~ K_mean + FE": ("D_pc1 ~ K_mean + " + base, "K_mean"),
27 + "H1-S2: D_pc1 ~ K_mean + X + FE": ("D_pc1 ~ K_mean + X_warfare + X_prod_infra + X_military + " + base, "K_mean"),
28 + "H1-S3: log_pop ~ K_mean + X + FE": ("log_pop ~ K_mean + X_warfare + X_prod_infra + X_military + " + base, "K_mean"),
29 + "H1-S4: log_terr ~ K_mean + X + FE": ("log_terr ~ K_mean + X_warfare + X_prod_infra + X_military + " + base, "K_mean"),
30 + "H1-S5: D_pc1 ~ K_irt + X + FE": ("D_pc1 ~ K_irt + X_warfare + X_prod_infra + X_military + " + base, "K_irt"),
31 + "H1-S6: D_pc1 ~ K blocks + X + FE": ("D_pc1 ~ K_admin + K_rules_money + K_comm_infra + K_records + X_warfare + X_prod_infra + X_military + " + base, "K_admin"),
32 + "H1-S7: D_pc1 ~ K_mean + X + FE, no quasi-polities": ("D_pc1 ~ K_mean + X_warfare + X_prod_infra + X_military + " + base, "K_mean"),
33 + }
34 + for label, (f, term) in specs.items():
35 + dd = d[~d.quasi] if "no quasi" in label else d
36 + r = fit_formula(f, dd, None, groups="seshat_region")
37 + rows.append(coef_row(r, term, label, {"r2": r.rsquared}))
38 + if "K blocks" in label:
39 + for t in ["K_rules_money", "K_comm_infra", "K_records"]:
40 + rows.append(coef_row(r, t, label, {"r2": r.rsquared}))
41 + # region random effects (MixedLM) on the primary spec
42 + dd = d.dropna(subset=["D_pc1", "K_mean", "macro_region", "era", "seshat_region"])
43 + try:
44 + mm = smf.mixedlm("D_pc1 ~ K_mean + C(era)", dd, groups=dd["seshat_region"]).fit(reml=True)
45 + rows.append({"model": "H1-S8: D_pc1 ~ K_mean + era, region random intercept", "term": "K_mean", "coef": mm.params["K_mean"], "se": mm.bse["K_mean"],
46 + "ci_lo": mm.params["K_mean"] - 1.96 * mm.bse["K_mean"], "ci_hi": mm.params["K_mean"] + 1.96 * mm.bse["K_mean"], "p": mm.pvalues["K_mean"], "n": len(dd), "llf": mm.llf})
47 + except Exception as e:
48 + rows.append({"model": "H1-S8 mixedlm", "error": str(e)[:100]})
49 + # standardized effect: K_mean has range 0-1; report SD-scaled coefficient
50 + out = pd.DataFrame(rows); out["coef_per_sd_K"] = out.coef * d.K_mean.std()
51 + out.to_csv(RES / "h1_seshat.csv", index=False)
52 + return out
53 +
54 +
55 +def ea():
56 + d = pd.read_parquet(PROC / "dplace_ea_societies.parquet")
57 + d["hier"] = d.jurisdictional_hierarchy_beyond; d["cls"] = d.EA066; d["agri"] = d.EA005; d["intens"] = d.EA028; d["subs"] = d.EA042
58 + rows = []
59 + # (a) OLS of log community size on hierarchy levels with Conley SE and family-cluster SE
60 + f = "log_community_size ~ hier + C(subs) + intens + cls + C(region)"
61 + for cut in [500, 1000]:
62 + res, se, n = conley_ols(f, d, "Latitude", "Longitude", cut)
63 + rows.append({"model": f"H1-E1 OLS log community size ~ hierarchy + X + region, Conley {cut} km", "term": "hier", "coef": res.params["hier"], "se": se["hier"],
64 + "ci_lo": res.params["hier"] - 1.96 * se["hier"], "ci_hi": res.params["hier"] + 1.96 * se["hier"], "p": 2 * (1 - norm.cdf(abs(res.params["hier"] / se["hier"]))), "n": n, "r2": res.rsquared})
65 + r = fit_formula(f, d, None, groups="Family_ID"); rows.append(coef_row(r, "hier", "H1-E2 same, SE clustered by language family", {"r2": r.rsquared}))
66 + f2 = "log_population ~ hier + C(subs) + intens + cls + C(region)"
67 + r = fit_formula(f2, d, None, groups="Family_ID"); rows.append(coef_row(r, "hier", "H1-E3 log population (EA202) ~ hierarchy + X + region, family-clustered", {"r2": r.rsquared}))
68 + # (b) ordered logit of hierarchy on log community size
69 + dd = d.dropna(subset=["hier", "log_community_size", "intens", "cls", "region", "Family_ID"]).copy()
70 + X = pd.get_dummies(dd[["log_community_size", "intens", "cls", "region"]], columns=["region"], drop_first=True, dtype=float)
71 + try:
72 + om = OrderedModel(dd.hier.astype(int), X, distr="logit").fit(method="bfgs", disp=0, maxiter=500)
73 + # cluster-robust SE by family via sandwich on scores
74 + groups = pd.factorize(dd.Family_ID)[0]
75 + from statsmodels.stats.sandwich_covariance import cov_cluster
76 + try:
77 + V = cov_cluster(om, groups); se = float(np.sqrt(V[0, 0]))
78 + except Exception:
79 + se = float(om.bse.iloc[0])
80 + b = float(om.params.iloc[0])
81 + rows.append({"model": "H1-E4 ordered logit hierarchy ~ log community size + X + region (family-clustered)", "term": "log_community_size", "coef": b, "se": se, "ci_lo": b - 1.96 * se, "ci_hi": b + 1.96 * se,
82 + "p": 2 * (1 - norm.cdf(abs(b / se))), "n": len(dd), "llf": om.llf})
83 + except Exception as e:
84 + rows.append({"model": "H1-E4 ordered logit", "error": str(e)[:120]})
85 + out = pd.DataFrame(rows); out.to_csv(RES / "h1_ea.csv", index=False)
86 + return out
87 +
88 +
89 +def modern():
90 + p = pd.read_parquet(PROC / "modern_indices.parquet")
91 + d = p.dropna(subset=["log_pop", "K_modern", "log_gdppc", "v2x_polyarchy"]).copy()
92 + # within-country (demeaned) regression with year FE
93 + for c in ["log_pop", "K_modern", "log_gdppc", "v2x_polyarchy"]:
94 + d[c + "_dm"] = d[c] - d.groupby("country_text_id")[c].transform("mean")
95 + rows = []
96 + r = fit_formula("log_pop_dm ~ K_modern_dm + log_gdppc_dm + v2x_polyarchy_dm + C(year)", d, None, groups="country_text_id")
97 + rows.append(coef_row(r, "K_modern_dm", "H1-M1 within-country: log pop ~ K + log gdppc + polyarchy + year FE", {"r2": r.rsquared}))
98 + r = fit_formula("log_pop ~ K_modern + log_gdppc + v2x_polyarchy + C(year) + C(e_regionpol_6C)", d, None, groups="country_text_id")
99 + rows.append(coef_row(r, "K_modern", "H1-M2 pooled: log pop ~ K + log gdppc + polyarchy + year FE + region FE", {"r2": r.rsquared}))
100 + # long differences 50 years
101 + d50 = d.merge(d[["country_text_id", "year", "log_pop", "K_modern", "log_gdppc", "v2x_polyarchy"]].assign(year=lambda x: x.year + 50), on=["country_text_id", "year"], suffixes=("", "_lag50"))
102 + for c in ["log_pop", "K_modern", "log_gdppc", "v2x_polyarchy"]:
103 + d50["d" + c] = d50[c] - d50[c + "_lag50"]
104 + r = fit_formula("dlog_pop ~ dK_modern + dlog_gdppc + dv2x_polyarchy + C(year)", d50, None, groups="country_text_id")
105 + rows.append(coef_row(r, "dK_modern", "H1-M3 50-year differences: Δlog pop ~ ΔK + Δlog gdppc + Δpolyarchy + year FE", {"r2": r.rsquared}))
106 + out = pd.DataFrame(rows); out.to_csv(RES / "h1_modern.csv", index=False)
107 + return out
108 +
109 +
110 +def main():
111 + a = seshat(); b = ea(); c = modern()
112 + pd.set_option("display.width", 250); pd.set_option("display.max_colwidth", 90)
113 + for name, t in [("SESHAT", a), ("EA", b), ("MODERN", c)]:
114 + print(f"\n=== H1 {name} ===\n", t[[c for c in t.columns if c in ("model", "term", "coef", "se", "p", "n", "r2", "coef_per_sd_K", "error")]].round(4).to_string(index=False))
115 +
116 +
117 +if __name__ == "__main__":
118 + main()
added src/wp35/econometrics/h2_modern.py +236 −0
@@ -0,0 +1,236 @@
1 +"""H2 (and H4/H5) on the modern panel (V-Dem v16 + Maddison 2023), pre-registration §5.4.
2 +Primary outcome Y456 = any instability event in (t, t+5]; pooled logit with region and year FE, country-clustered SE.
3 +Usage: python -m wp35.econometrics.h2_modern
4 +"""
5 +from __future__ import annotations
6 +import json
7 +from pathlib import Path
8 +import numpy as np
9 +import pandas as pd
10 +import statsmodels.api as sm
11 +import statsmodels.formula.api as smf
12 +from wp35.econometrics.common import fit_formula, coef_row, binary_metrics, oos_loglik_binomial, hinge_fit, fold_win_share
13 +
14 +ROOT = Path(__file__).resolve().parents[3]
15 +PROC = ROOT / "data" / "processed"; RES = ROOT / "results" / "empirical"
16 +BIN = sm.families.Binomial()
17 +FE = "C(e_regionpol_6C) + C(year)"
18 +XS = "log_gdppc + v2x_polyarchy + t_since + t_since2 + t_since3"
19 +
20 +
21 +def window_outcome(df: pd.DataFrame, col: str, h: int, forward: bool = True) -> pd.Series:
22 + """any(event in (t, t+h]) (forward) or any(event in [t-h, t-1]) (backward); NaN if no coded year in the window."""
23 + out = pd.Series(np.nan, index=df.index)
24 + for cid, g in df.groupby("country_text_id"):
25 + s = g.set_index("year")[col]
26 + yrs = g.year.values
27 + vals = []
28 + for t in yrs:
29 + rng = range(t + 1, t + h + 1) if forward else range(t - h, t)
30 + w = s.reindex(rng)
31 + vals.append(np.nan if w.notna().sum() == 0 else float((w == 1).any()))
32 + out.loc[g.index] = vals
33 + return out
34 +
35 +
36 +def build_sample(h: int = 5):
37 + p = pd.read_parquet(PROC / "modern_indices.parquet").sort_values(["country_text_id", "year"]).reset_index(drop=True)
38 + p["any_event"] = p[["y4_civilwar_onset", "y5_coup", "y6_irregular_regime_end"]].max(axis=1, skipna=True)
39 + p.loc[p[["y4_civilwar_onset", "y5_coup", "y6_irregular_regime_end"]].isna().all(axis=1), "any_event"] = np.nan
40 + for col, name in [("any_event", "y456"), ("y4_civilwar_onset", "y4"), ("y5_coup", "y5"), ("y6_irregular_regime_end", "y6")]:
41 + p[f"{name}_f{h}"] = window_outcome(p, col, h, forward=True)
42 + p["y456_b5"] = window_outcome(p, "any_event", 5, forward=False) # persistence / negative control
43 + # time since last event (years), cubic polynomial (Carter & Signorino 2010)
44 + p["t_since"] = np.nan
45 + for cid, g in p.groupby("country_text_id"):
46 + last = None; vals = []
47 + for y, e in zip(g.year, g.any_event):
48 + vals.append(np.nan if last is None else y - last)
49 + if e == 1:
50 + last = y
51 + p.loc[g.index, "t_since"] = vals
52 + p["t_since"] = p.t_since.fillna(p.t_since.max()) / 100.0 # no prior event observed → treated as long spell (max observed), flagged in the paper
53 + p["t_since2"] = p.t_since ** 2; p["t_since3"] = p.t_since ** 3
54 + for c in ["P_modern", "D_modern", "K_modern", "P_modern_pc1", "P_modern_within_year", "P_modern_area"]:
55 + p[c + "_z"] = (p[c] - p[c].mean()) / p[c].std()
56 + p["P_placebo_z"] = ((p.D_modern - p.D_modern.mean()) / p.D_modern.std() - (p.v2x_polyarchy - p.v2x_polyarchy.mean()) / p.v2x_polyarchy.std())
57 + p["period"] = pd.cut(p.year, [1700, 1899, 1945, 1989, 2100], labels=["pre-1900", "1900-1945", "1946-1989", "1990+"])
58 + return p
59 +
60 +
61 +def primary(d: pd.DataFrame, y: str = "y456_f5"):
62 + rows = []
63 + specs = {
64 + "C1 primary: Y456 ~ P + X + region FE + year FE": (f"{y} ~ P_modern_z + {XS} + {FE}", "P_modern_z"),
65 + "C2: Y456 ~ P + FE only": (f"{y} ~ P_modern_z + {FE}", "P_modern_z"),
66 + "C3: Y456 ~ P + K + X + FE (P given K)": (f"{y} ~ P_modern_z + K_modern_z + {XS} + {FE}", "P_modern_z"),
67 + "B1 baseline population only": (f"{y} ~ D_modern_z + {XS} + {FE}", "D_modern_z"),
68 + "B2 baseline capacity only": (f"{y} ~ K_modern_z + {XS} + {FE}", "K_modern_z"),
69 + "B3 baseline development (gdppc) only": (f"{y} ~ log_gdppc + v2x_polyarchy + t_since + t_since2 + t_since3 + {FE}", "log_gdppc"),
70 + "B4 baseline persistence": (f"{y} ~ y456_b5 + {XS} + {FE}", "y456_b5"),
71 + "B5 D and K separately": (f"{y} ~ D_modern_z + K_modern_z + {XS} + {FE}", "D_modern_z"),
72 + "Placebo: P with polyarchy in place of K (polyarchy not separately controlled)": (f"{y} ~ P_placebo_z + log_gdppc + t_since + t_since2 + t_since3 + {FE}", "P_placebo_z"),
73 + "Placebo comparison: P_main with the same controls as the placebo": (f"{y} ~ P_modern_z + log_gdppc + t_since + t_since2 + t_since3 + {FE}", "P_modern_z"),
74 + "Negative control: past events (t-5..t-1) ~ P_t + gdppc + polyarchy + FE (no duration terms)": (f"y456_b5 ~ P_modern_z + log_gdppc + v2x_polyarchy + {FE}", "P_modern_z"),
75 + "Forward comparison for the negative control: future events ~ P_t + gdppc + polyarchy + FE": (f"{y} ~ P_modern_z + log_gdppc + v2x_polyarchy + {FE}", "P_modern_z"),
76 + }
77 + for label, (f, term) in specs.items():
78 + try:
79 + r = fit_formula(f, d, BIN, groups="country_text_id"); rows.append(coef_row(r, term, label, {"events": int(r._data_used[f.split(" ~")[0]].sum())}))
80 + if "B5" in label:
81 + rows.append(coef_row(r, "K_modern_z", label))
82 + except Exception as e:
83 + rows.append({"model": label, "error": str(e)[:100]})
84 + # country fixed effects: conditional logit via statsmodels (drops never-event countries)
85 + try:
86 + from statsmodels.discrete.conditional_models import ConditionalLogit
87 + dd = d.dropna(subset=[y, "P_modern_z", "log_gdppc", "v2x_polyarchy", "t_since"]).copy()
88 + dd["decade"] = (dd.year // 10) * 10
89 + X = pd.concat([dd[["P_modern_z", "log_gdppc", "v2x_polyarchy", "t_since", "t_since2", "t_since3"]], pd.get_dummies(dd.decade, prefix="dec", drop_first=True, dtype=float)], axis=1)
90 + cl = ConditionalLogit(dd[y].values, X.values, groups=pd.factorize(dd.country_text_id)[0]).fit(disp=0, maxiter=200)
91 + b, se = cl.params[0], cl.bse[0]
92 + rows.append({"model": "C4: conditional logit, country FE + decade FE", "term": "P_modern_z", "coef": b, "se": se, "ci_lo": b - 1.96 * se, "ci_hi": b + 1.96 * se, "p": cl.pvalues[0], "n": len(dd), "events": int(dd[y].sum())})
93 + except Exception as e:
94 + rows.append({"model": "C4 conditional logit", "error": str(e)[:120]})
95 + # LPM two-way FE
96 + try:
97 + dd = d.dropna(subset=[y, "P_modern_z", "log_gdppc", "v2x_polyarchy", "t_since"]).copy()
98 + for c in [y, "P_modern_z", "log_gdppc", "v2x_polyarchy", "t_since", "t_since2", "t_since3"]:
99 + dd[c + "_dm"] = dd[c] - dd.groupby("country_text_id")[c].transform("mean")
100 + r = fit_formula(f"{y}_dm ~ P_modern_z_dm + log_gdppc_dm + v2x_polyarchy_dm + t_since_dm + t_since2_dm + t_since3_dm + C(year)", dd, None, groups="country_text_id")
101 + rows.append(coef_row(r, "P_modern_z_dm", "C5: linear probability, country + year FE", {"events": int(dd[y].sum())}))
102 + except Exception as e:
103 + rows.append({"model": "C5 LPM", "error": str(e)[:100]})
104 + return pd.DataFrame(rows)
105 +
106 +
107 +def oos(d: pd.DataFrame, y: str = "y456_f5"):
108 + formulas = {"C1 P": f"{y} ~ P_modern_z + {XS} + {FE}", "B0 FE+X": f"{y} ~ {XS} + {FE}", "B1 D": f"{y} ~ D_modern_z + {XS} + {FE}", "B2 K": f"{y} ~ K_modern_z + {XS} + {FE}",
109 + "B4 persistence": f"{y} ~ y456_b5 + {XS} + {FE}", "B5 D+K": f"{y} ~ D_modern_z + K_modern_z + {XS} + {FE}"}
110 + rows = []
111 + need = [y, "P_modern_z", "D_modern_z", "K_modern_z", "y456_b5", "log_gdppc", "v2x_polyarchy", "t_since", "e_regionpol_6C", "year"]
112 + dd = d.dropna(subset=need).copy()
113 + # forward chaining (year FE replaced by decade FE so that test years have a fitted level: pre-registered deviation logged as A-001)
114 + fc = {k: v.replace("C(year)", "C(decade)") for k, v in formulas.items()}
115 + dd["decade"] = (dd.year // 10) * 10
116 + splits = [("train<=1945,test1946-1975", dd.year <= 1945, dd.year.between(1946, 1975)), ("train<=1975,test1976-2005", dd.year <= 1975, dd.year.between(1976, 2005)), ("train<=2005,test>=2006", dd.year <= 2005, dd.year >= 2006)]
117 + for name, f in fc.items():
118 + for sname, tr, te in splits:
119 + try:
120 + m = smf.glm(f, dd[tr], family=BIN).fit()
121 + te_d = dd[te].copy(); te_d["decade"] = np.minimum(te_d.decade, dd[tr].decade.max()) # unseen decades mapped to the last training decade
122 + p = m.predict(te_d); r = binary_metrics(te_d[y], p); r.update({"model": name, "fold": sname, "scheme": "forward"}); rows.append(r)
123 + except Exception as e:
124 + rows.append({"model": name, "fold": sname, "scheme": "forward", "error": str(e)[:80]})
125 + # leave-one-region-out (region FE removed)
126 + lr = {k: v.replace("C(e_regionpol_6C) + ", "") for k, v in formulas.items()}
127 + for name, f in lr.items():
128 + for reg in sorted(dd.e_regionpol_6C.unique()):
129 + try:
130 + m = smf.glm(f, dd[dd.e_regionpol_6C != reg], family=BIN).fit(); te_d = dd[dd.e_regionpol_6C == reg]
131 + p = m.predict(te_d); r = binary_metrics(te_d[y], p); r.update({"model": name, "fold": f"loro_{int(reg)}", "scheme": "loro"}); rows.append(r)
132 + except Exception as e:
133 + rows.append({"model": name, "fold": f"loro_{int(reg)}", "scheme": "loro", "error": str(e)[:80]})
134 + cv = pd.DataFrame(rows); cv.to_csv(RES / "h2_modern_cv_folds.csv", index=False)
135 + wins = []
136 + for scheme in ["forward", "loro"]:
137 + c = cv[cv.scheme == scheme]
138 + for b in ["B0 FE+X", "B1 D", "B2 K", "B4 persistence", "B5 D+K"]:
139 + for metric in ["oos_loglik", "auc"]:
140 + w = fold_win_share(c, "C1 P", b, metric); w.update({"scheme": scheme, "metric": metric}); wins.append(w)
141 + wins = pd.DataFrame(wins); wins.to_csv(RES / "h2_modern_cv_wins.csv", index=False)
142 + summ = cv.groupby(["scheme", "model"])[["oos_loglik", "auc", "brier", "calibration_slope"]].mean().reset_index(); summ.to_csv(RES / "h2_modern_cv_summary.csv", index=False)
143 + return wins, summ
144 +
145 +
146 +def h4(d: pd.DataFrame, y: str = "y456_f5"):
147 + base = f"{y} ~ P_modern_z + {XS} + C(e_regionpol_6C) + C(decade)"
148 + dd = d.dropna(subset=[y, "P_modern_z", "log_gdppc", "v2x_polyarchy", "t_since", "e_regionpol_6C"]).copy(); dd["decade"] = (dd.year // 10) * 10
149 + rng = np.random.default_rng(20261101); rows = []
150 + countries = dd.country_text_id.unique()
151 + for rep in range(3):
152 + perm = rng.permutation(countries); parts = np.array_split(perm, 5) # country-blocked folds
153 + for i, te_c in enumerate(parts):
154 + te = dd.country_text_id.isin(te_c); tr, ts = dd[~te], dd[te].copy()
155 + try:
156 + lin = smf.glm(base, tr, family=BIN).fit(); ll_lin = oos_loglik_binomial(ts[y], lin.predict(ts))
157 + h = hinge_fit(tr, y, base, "P_modern_z", BIN, grid=np.quantile(tr.P_modern_z, np.linspace(0.2, 0.8, 7)))
158 + ts["_hinge"] = np.clip(ts.P_modern_z - h[1], 0, None); ll_h = oos_loglik_binomial(ts[y], h[2].predict(ts))
159 + sp = smf.glm(base.replace("P_modern_z", "cr(P_modern_z, df=3)"), tr, family=BIN).fit(); ll_s = oos_loglik_binomial(ts[y], sp.predict(ts))
160 + rows.append({"fold": f"{rep}_{i}", "ll_linear": ll_lin, "ll_hinge": ll_h, "ll_spline": ll_s, "knot": h[1]})
161 + except Exception as e:
162 + rows.append({"fold": f"{rep}_{i}", "error": str(e)[:80]})
163 + r = pd.DataFrame(rows); r.to_csv(RES / "h4_modern_folds.csv", index=False); ok = r.dropna(subset=["ll_linear"])
164 + # in-sample shape (for the figure): predicted probability vs P at covariate means, linear vs spline
165 + sp = smf.glm(base.replace("P_modern_z", "cr(P_modern_z, df=3)"), dd, family=BIN).fit(); lin = smf.glm(base, dd, family=BIN).fit()
166 + grid = np.linspace(dd.P_modern_z.quantile(0.02), dd.P_modern_z.quantile(0.98), 40)
167 + ref = dd.iloc[[0]].copy()
168 + for c in ["log_gdppc", "v2x_polyarchy", "t_since", "t_since2", "t_since3"]:
169 + ref[c] = dd[c].mean()
170 + ref["e_regionpol_6C"] = dd.e_regionpol_6C.mode()[0]; ref["decade"] = 1970
171 + g = pd.concat([ref] * len(grid), ignore_index=True); g["P_modern_z"] = grid
172 + pd.DataFrame({"P_z": grid, "p_linear": lin.predict(g), "p_spline": sp.predict(g)}).to_csv(RES / "h4_modern_curve.csv", index=False)
173 + return {"folds": int(len(ok)), "hinge_beats_linear_share": float((ok.ll_hinge > ok.ll_linear).mean()), "spline_beats_linear_share": float((ok.ll_spline > ok.ll_linear).mean()),
174 + "mean_ll_linear": float(ok.ll_linear.mean()), "mean_ll_hinge": float(ok.ll_hinge.mean()), "mean_ll_spline": float(ok.ll_spline.mean()), "median_knot": float(ok.knot.median())}
175 +
176 +
177 +def h5(d: pd.DataFrame, y: str = "y456_f5"):
178 + rows = []
179 + for col, name in [("e_regionpol_6C", "region"), ("period", "period")]:
180 + for g in sorted(d[col].dropna().unique()):
181 + held = d[d[col] != g]; inb = d[d[col] == g]
182 + fe = "C(year)" if col == "e_regionpol_6C" else "C(e_regionpol_6C) + C(year)"
183 + try:
184 + r = fit_formula(f"{y} ~ P_modern_z + {XS} + {fe}", held, BIN, groups="country_text_id"); row = coef_row(r, "P_modern_z", f"H5 leave-{name}-out: {g}")
185 + rb = fit_formula(f"{y} ~ P_modern_z + {XS} + " + ("C(year)" if col == "e_regionpol_6C" else "C(e_regionpol_6C)"), inb, BIN, groups="country_text_id")
186 + row.update({"within_block_coef": rb.params["P_modern_z"], "within_block_se": rb.bse["P_modern_z"], "within_block_n": rb._n_used, "within_block_events": int(rb._data_used[y].sum())})
187 + rows.append(row)
188 + except Exception as e:
189 + rows.append({"model": f"H5 {name} {g}", "error": str(e)[:80]})
190 + out = pd.DataFrame(rows); out.to_csv(RES / "h5_modern_blocks.csv", index=False); return out
191 +
192 +
193 +def robustness(d: pd.DataFrame):
194 + rows = []
195 + for h in [1, 3, 10]:
196 + dh = build_sample(h) if h != 5 else d
197 + r = fit_formula(f"y456_f{h} ~ P_modern_z + {XS} + {FE}", dh, BIN, groups="country_text_id"); rows.append(coef_row(r, "P_modern_z", f"R: horizon h={h}", {"events": int(r._data_used[f"y456_f{h}"].sum())}))
198 + for comp in ["y4_f5", "y5_f5", "y6_f5"]:
199 + r = fit_formula(f"{comp} ~ P_modern_z + {XS} + {FE}", d, BIN, groups="country_text_id"); rows.append(coef_row(r, "P_modern_z", f"R: component {comp}", {"events": int(r._data_used[comp].sum())}))
200 + for v, lab in [("P_modern_pc1_z", "K = PC1"), ("P_modern_within_year_z", "standardized within year"), ("P_modern_area_z", "D = (log pop + log area)/2")]:
201 + r = fit_formula(f"y456_f5 ~ {v} + {XS} + {FE}", d, BIN, groups="country_text_id"); rows.append(coef_row(r, v, f"R: {lab}", {"events": int(r._data_used.y456_f5.sum())}))
202 + r = fit_formula(f"y456_f5 ~ P_modern_z + {XS} + {FE}", d[d.year >= 1900], BIN, groups="country_text_id"); rows.append(coef_row(r, "P_modern_z", "R: years ≥ 1900", {"events": int(r._data_used.y456_f5.sum())}))
203 + r = fit_formula(f"y456_f5 ~ P_modern_z + log_gdppc + t_since + t_since2 + t_since3 + {FE}", d, BIN, groups="country_text_id"); rows.append(coef_row(r, "P_modern_z", "R: polyarchy not controlled", {"events": int(r._data_used.y456_f5.sum())}))
204 + r = fit_formula(f"y456_f5 ~ P_modern_z + {XS} + y456_b5 + {FE}", d, BIN, groups="country_text_id"); rows.append(coef_row(r, "P_modern_z", "R: + persistence control", {"events": int(r._data_used.y456_f5.sum())}))
205 + # Oster / Cinelli-Hazlett style sensitivity on the LPM version of the primary
206 + try:
207 + dd = d.dropna(subset=["y456_f5", "P_modern_z", "log_gdppc", "v2x_polyarchy", "t_since", "e_regionpol_6C"]).copy()
208 + full = smf.ols(f"y456_f5 ~ P_modern_z + {XS} + {FE}", dd).fit(); short = smf.ols(f"y456_f5 ~ P_modern_z + {FE}", dd).fit()
209 + restricted = smf.ols(f"y456_f5 ~ {XS} + {FE}", dd).fit()
210 + r2_full, r2_short = full.rsquared, short.rsquared; b_full, b_short = full.params["P_modern_z"], short.params["P_modern_z"]
211 + rmax = min(1.0, 1.3 * r2_full); delta1 = b_full - (b_short - b_full) * (rmax - r2_full) / max(r2_full - r2_short, 1e-9)
212 + t = full.tvalues["P_modern_z"]; dfres = full.df_resid; r2_yd = t ** 2 / (t ** 2 + dfres)
213 + rv = 0.5 * (np.sqrt(r2_yd ** 2 + 4 * r2_yd) - r2_yd)
214 + rows.append({"model": "Sensitivity (LPM): Oster bias-adjusted β at Rmax=1.3·R² (δ=1); Cinelli–Hazlett RV", "term": "P_modern_z", "coef": delta1, "oster_beta_full": b_full, "oster_beta_short": b_short, "r2_full": r2_full, "r2_short": r2_short, "partial_r2_P": r2_yd, "robustness_value": rv, "n": len(dd)})
215 + except Exception as e:
216 + rows.append({"model": "Sensitivity", "error": str(e)[:100]})
217 + out = pd.DataFrame(rows); out.to_csv(RES / "h2_modern_robustness.csv", index=False); return out
218 +
219 +
220 +def main():
221 + d = build_sample(5); d.to_parquet(PROC / "modern_h2_sample.parquet", index=False)
222 + prim = primary(d); prim.to_csv(RES / "h2_modern_primary.csv", index=False)
223 + wins, summ = oos(d)
224 + h4s = h4(d); (RES / "h4_modern_summary.json").write_text(json.dumps(h4s, indent=2))
225 + h5s = h5(d); rob = robustness(d)
226 + pd.set_option("display.width", 250); pd.set_option("display.max_colwidth", 70)
227 + cols = ["model", "term", "coef", "se", "p", "n", "events", "error"]
228 + print("=== PRIMARY ===\n", prim[[c for c in cols if c in prim.columns]].round(3).to_string(index=False))
229 + print("\n=== OOS wins ===\n", wins.round(3).to_string(index=False)); print("\n=== OOS summary ===\n", summ.round(3).to_string(index=False))
230 + print("\n=== H4 ===", json.dumps(h4s, indent=1))
231 + print("\n=== H5 ===\n", h5s[[c for c in h5s.columns if c in ("model", "coef", "se", "p", "n", "within_block_coef", "within_block_se", "within_block_n", "within_block_events", "error")]].round(3).to_string(index=False))
232 + print("\n=== ROBUSTNESS ===\n", rob[[c for c in rob.columns if c in cols + ["robustness_value", "partial_r2_P", "oster_beta_full", "oster_beta_short"]]].round(4).to_string(index=False))
233 +
234 +
235 +if __name__ == "__main__":
236 + main()
added src/wp35/econometrics/h2_seshat.py +226 −0
@@ -0,0 +1,226 @@
1 +"""H2 (and H4/H5) on Seshat: Y1 crisis severity (primary), Y1b severe binary, Y2 polity duration (Cox), Y3 succession.
2 +This is the first module that reads outcomes together with P. Usage: python -m wp35.econometrics.h2_seshat
3 +Everything follows research/preregistration.md §5.2–5.3, §5.5–5.7, §6.
4 +"""
5 +from __future__ import annotations
6 +import json
7 +from pathlib import Path
8 +import numpy as np
9 +import pandas as pd
10 +import statsmodels.api as sm
11 +import statsmodels.formula.api as smf
12 +from lifelines import CoxPHFitter
13 +from lifelines.statistics import proportional_hazard_test
14 +from wp35.econometrics.common import fit_formula, coef_row, cv_compare, fold_win_share, hinge_fit, binary_metrics, oos_loglik_binomial
15 +
16 +ROOT = Path(__file__).resolve().parents[3]
17 +PROC = ROOT / "data" / "processed"; RES = ROOT / "results" / "empirical"
18 +RES.mkdir(parents=True, exist_ok=True)
19 +BIN = sm.families.Binomial()
20 +FE = "C(macro_region) + C(era)"
21 +XS = "X_warfare + X_prod_infra + epidemic_v"
22 +
23 +
24 +def load_crisis():
25 + cr = pd.read_parquet(PROC / "seshat_crisis_indices.parquet")
26 + y = pd.read_parquet(PROC / "seshat_crisis.parquet")[["crisis_id", "y1_severity", "y1b_severe", "y_reform", "epidemic_v", "y1_n_coded"]]
27 + d = cr.merge(y, on="crisis_id")
28 + meta = pd.read_parquet(PROC / "seshat_polity_meta.parquet")[["polity_id", "centralization", "homeNGA"]]
29 + d = d.merge(meta, on="polity_id", how="left", suffixes=("", "_m"))
30 + d["homeNGA"] = d["homeNGA"].fillna(d.get("homeNGA_m"))
31 + # persistence baseline: an earlier crisis record in the same NGA
32 + d = d.sort_values("crisis_start")
33 + d["prior_crisis_nga"] = 0.0
34 + for i, r in d.iterrows():
35 + d.loc[i, "prior_crisis_nga"] = float(((d.homeNGA == r.homeNGA) & (d.crisis_start < r.crisis_start)).any())
36 + d["quasi"] = d.centralization.eq("quasi-polity")
37 + d["P_placebo"] = (d.D_pc1 - d.D_pc1.mean()) / d.D_pc1.std() - (d.X_prod_infra - d.X_prod_infra.mean()) / d.X_prod_infra.std()
38 + for c in ["P_main", "D_pc1", "K_mean", "K_irt", "complexity_pc1", "log_pop"]:
39 + d[c + "_z"] = (d[c] - d[c].mean()) / d[c].std()
40 + return d
41 +
42 +
43 +def primary_models(d: pd.DataFrame):
44 + rows = []
45 + specs = {
46 + "A1 primary: Y1 ~ P + FE": (f"y1_severity ~ P_main_z + {FE}", "P_main_z"),
47 + "A2: Y1 ~ P + X + FE": (f"y1_severity ~ P_main_z + {XS} + {FE}", "P_main_z"),
48 + "A3: Y1 ~ P + D + K + X + FE (P given components)": (f"y1_severity ~ P_main_z + complexity_pc1_z + {XS} + {FE}", "P_main_z"),
49 + "B1 baseline D only": (f"y1_severity ~ D_pc1_z + {XS} + {FE}", "D_pc1_z"),
50 + "B2 baseline K only": (f"y1_severity ~ K_mean_z + {XS} + {FE}", "K_mean_z"),
51 + "B3 baseline complexity PC1": (f"y1_severity ~ complexity_pc1_z + {XS} + {FE}", "complexity_pc1_z"),
52 + "B4 baseline persistence": (f"y1_severity ~ prior_crisis_nga + {XS} + {FE}", "prior_crisis_nga"),
53 + "B5 D and K separately": (f"y1_severity ~ D_pc1_z + K_mean_z + {XS} + {FE}", "D_pc1_z"),
54 + "Placebo: P built with production infrastructure instead of K": (f"y1_severity ~ P_placebo + {XS} + {FE}", "P_placebo"),
55 + }
56 + for label, (f, term) in specs.items():
57 + r = fit_formula(f, d, BIN, groups="seshat_region"); rows.append(coef_row(r, term, label))
58 + if "B5" in label:
59 + rows.append(coef_row(r, "K_mean_z", label))
60 + # binary secondary
61 + # binary secondary outcome: several region/era cells are all-severe (quasi-separation) -> region FE only, HC1 SE
62 + for label, f in {"A1b: Y1b ~ P + region FE (logit, HC1; era FE dropped: separation)": "y1b_severe ~ P_main_z + C(macro_region)",
63 + "A2b: Y1b ~ P + X + region FE (logit, HC1)": f"y1b_severe ~ P_main_z + {XS} + C(macro_region)",
64 + "A3b: Y1b ~ P (logit, HC1, no FE)": "y1b_severe ~ P_main_z"}.items():
65 + r = fit_formula(f, d, BIN, groups=None); rows.append(coef_row(r, "P_main_z", label))
66 + # exploratory: reforms
67 + r = fit_formula(f"y_reform ~ P_main_z + {XS} + {FE}", d, BIN, groups="seshat_region"); rows.append(coef_row(r, "P_main_z", "Exploratory: reform consequences ~ P + X + FE"))
68 + return pd.DataFrame(rows)
69 +
70 +
71 +def robustness(d: pd.DataFrame):
72 + rows = []
73 + variants = {"P_D_pc1_K_irt": "K = IRT latent", "P_log_pop_K_mean": "D = log population only", "P_D_pc1_K_pc1": "K = PC1 of blocks",
74 + "P_main_lo": "D at lower bounds", "P_main_hi": "D at upper bounds", "P_main_noinf": "inferred codes dropped",
75 + "P_within_era": "standardized within era", "P_within_region": "standardized within macro-region", "P_rank": "rank-based P"}
76 + for v, lab in variants.items():
77 + if v not in d.columns:
78 + # crisis-level file lacks some polity-level variants → merge from polity file
79 + continue
80 + dd = d.copy(); dd["_P"] = (dd[v] - dd[v].mean()) / dd[v].std()
81 + r = fit_formula(f"y1_severity ~ _P + {XS} + {FE}", dd, BIN, groups="seshat_region"); rows.append(coef_row(r, "_P", f"R: {lab}"))
82 + dd = d[~d.quasi]; r = fit_formula(f"y1_severity ~ P_main_z + {XS} + {FE}", dd, BIN, groups="seshat_region"); rows.append(coef_row(r, "P_main_z", "R: quasi-polities dropped"))
83 + dd = d[d.years_since_start >= 25]; r = fit_formula(f"y1_severity ~ P_main_z + {XS} + {FE}", dd, BIN, groups="seshat_region"); rows.append(coef_row(r, "P_main_z", "R: crises starting ≥25 years after polity start"))
84 + dd = d[d.y1_n_coded >= 12]; r = fit_formula(f"y1_severity ~ P_main_z + {XS} + {FE}", dd, BIN, groups="seshat_region"); rows.append(coef_row(r, "P_main_z", "R: ≥12 of 14 items coded"))
85 + r = fit_formula(f"y1_severity ~ P_main_z + {XS} + C(macro_region)", d, BIN, groups="seshat_region"); rows.append(coef_row(r, "P_main_z", "R: no era FE"))
86 + r = fit_formula(f"y1_severity ~ P_main_z + {XS} + C(era)", d, BIN, groups="seshat_region"); rows.append(coef_row(r, "P_main_z", "R: no region FE"))
87 + r = fit_formula(f"y1_severity ~ P_main_z + {XS}", d, BIN, groups="seshat_region"); rows.append(coef_row(r, "P_main_z", "R: no FE"))
88 + r = fit_formula(f"y1_severity ~ P_main_z + {XS} + {FE}", d, BIN, groups="homeNGA"); rows.append(coef_row(r, "P_main_z", "R: SE clustered by NGA"))
89 + r = fit_formula(f"y1_severity ~ P_main_z + {XS} + {FE}", d, BIN, groups="polity_id"); rows.append(coef_row(r, "P_main_z", "R: SE clustered by polity"))
90 + return pd.DataFrame(rows)
91 +
92 +
93 +def out_of_sample(d: pd.DataFrame):
94 + formulas = {"A2 P": f"y1_severity ~ P_main_z + {XS} + {FE}", "B0 FE only": f"y1_severity ~ {XS} + {FE}", "B1 D only": f"y1_severity ~ D_pc1_z + {XS} + {FE}",
95 + "B2 K only": f"y1_severity ~ K_mean_z + {XS} + {FE}", "B3 complexity": f"y1_severity ~ complexity_pc1_z + {XS} + {FE}", "B4 persistence": f"y1_severity ~ prior_crisis_nga + {XS} + {FE}",
96 + "B5 D+K": f"y1_severity ~ D_pc1_z + K_mean_z + {XS} + {FE}"}
97 + # era FE with leave-one-region-out can leave unseen levels; macro-region FE cannot be used when the region is held out
98 + f_loro = {k: v.replace("C(macro_region) + ", "") for k, v in formulas.items()}
99 + loro = cv_compare(d, f_loro, "y1_severity", BIN, fold_col="macro_region", fractional=True)
100 + kf = cv_compare(d, formulas, "y1_severity", BIN, n_repeats=10, k=5, fractional=True)
101 + loro["scheme"] = "leave-one-macro-region-out"; kf["scheme"] = "10x5-fold"
102 + cv = pd.concat([loro, kf]); cv.to_csv(RES / "h2_seshat_cv_folds.csv", index=False)
103 + wins = []
104 + for scheme, c in [("loro", loro), ("kfold", kf)]:
105 + for b in ["B0 FE only", "B1 D only", "B2 K only", "B3 complexity", "B4 persistence", "B5 D+K"]:
106 + w = fold_win_share(c, "A2 P", b); w["scheme"] = scheme; wins.append(w)
107 + wins = pd.DataFrame(wins); wins.to_csv(RES / "h2_seshat_cv_wins.csv", index=False)
108 + # binary Y1b out-of-sample metrics
109 + fb = {k: v.replace("y1_severity", "y1b_severe") for k, v in formulas.items()}
110 + kfb = cv_compare(d, fb, "y1b_severe", BIN, n_repeats=10, k=5)
111 + kfb.to_csv(RES / "h2_seshat_cv_folds_binary.csv", index=False)
112 + summ = kfb.groupby("model")[["oos_loglik", "auc", "brier"]].mean().reset_index(); summ.to_csv(RES / "h2_seshat_cv_binary_summary.csv", index=False)
113 + return wins, summ
114 +
115 +
116 +def h4_nonlinear(d: pd.DataFrame):
117 + """Linear vs hinge vs spline, out of sample (10x5-fold); hinge knot chosen on the training fold only."""
118 + rng = np.random.default_rng(20261101)
119 + base = f"y1_severity ~ P_main_z + {XS} + {FE}"
120 + dd = d.dropna(subset=["y1_severity", "P_main_z", "X_warfare", "X_prod_infra", "epidemic_v", "macro_region", "era"]).reset_index(drop=True)
121 + rows = []
122 + for rep in range(10):
123 + perm = rng.permutation(len(dd)); parts = np.array_split(perm, 5)
124 + for i, te in enumerate(parts):
125 + m = np.zeros(len(dd), bool); m[te] = True; tr, ts = dd[~m], dd[m].copy()
126 + try:
127 + lin = smf.glm(base, tr, family=BIN).fit(); ll_lin = oos_loglik_binomial(ts.y1_severity, lin.predict(ts))
128 + h = hinge_fit(tr, "y1_severity", base, "P_main_z", BIN)
129 + ts["_hinge"] = np.clip(ts.P_main_z - h[1], 0, None); ll_h = oos_loglik_binomial(ts.y1_severity, h[2].predict(ts))
130 + sp = smf.glm(f"y1_severity ~ cr(P_main_z, df=3) + {XS} + {FE}", tr, family=BIN).fit(); ll_s = oos_loglik_binomial(ts.y1_severity, sp.predict(ts))
131 + rows.append({"fold": f"{rep}_{i}", "ll_linear": ll_lin, "ll_hinge": ll_h, "ll_spline": ll_s, "knot": h[1]})
132 + except Exception as e:
133 + rows.append({"fold": f"{rep}_{i}", "error": str(e)[:80]})
134 + r = pd.DataFrame(rows); r.to_csv(RES / "h4_seshat_folds.csv", index=False)
135 + ok = r.dropna(subset=["ll_linear"])
136 + summ = {"folds": int(len(ok)), "hinge_beats_linear_share": float((ok.ll_hinge > ok.ll_linear).mean()), "spline_beats_linear_share": float((ok.ll_spline > ok.ll_linear).mean()),
137 + "mean_ll_linear": float(ok.ll_linear.mean()), "mean_ll_hinge": float(ok.ll_hinge.mean()), "mean_ll_spline": float(ok.ll_spline.mean()), "median_knot": float(ok.knot.median())}
138 + # in-sample hinge for description
139 + h = hinge_fit(dd, "y1_severity", base, "P_main_z", BIN); summ["insample_knot"] = float(h[1]); summ["insample_hinge_coef"] = float(h[2].params["_hinge"]); summ["insample_P_coef"] = float(h[2].params["P_main_z"])
140 + return summ
141 +
142 +
143 +def h5_blocks(d: pd.DataFrame):
144 + rows = []
145 + for col, name in [("macro_region", "region"), ("era", "era")]:
146 + for g in sorted(d[col].dropna().unique()):
147 + held = d[d[col] != g]; inb = d[d[col] == g]
148 + other = "C(era)" if col == "macro_region" else "C(macro_region)"
149 + try:
150 + try:
151 + r = fit_formula(f"y1_severity ~ P_main_z + {XS} + {other}", held, BIN, groups="seshat_region"); cov = "cluster"
152 + except Exception:
153 + try:
154 + r = fit_formula(f"y1_severity ~ P_main_z + {XS} + {other}", held, BIN, groups=None); cov = "HC1 (cluster cov singular)"
155 + except Exception:
156 + r = fit_formula(f"y1_severity ~ P_main_z + {XS}", held, BIN, groups="seshat_region"); cov = "cluster, FE dropped (design singular)"
157 + row = coef_row(r, "P_main_z", f"H5 leave-{name}-out: {g}"); row["held_out_n"] = int(inb.y1_severity.notna().sum()); row["cov"] = cov
158 + if inb.P_main_z.notna().sum() >= 12:
159 + try:
160 + rb = fit_formula(f"y1_severity ~ P_main_z + {XS}", inb, BIN, groups="seshat_region"); row["within_block_coef"] = rb.params["P_main_z"]; row["within_block_se"] = rb.bse["P_main_z"]
161 + except Exception:
162 + try:
163 + rb = fit_formula("y1_severity ~ P_main_z", inb, BIN, groups=None); row["within_block_coef"] = rb.params["P_main_z"]; row["within_block_se"] = rb.bse["P_main_z"]; row["within_block_note"] = "P only, HC1"
164 + except Exception as e2:
165 + row["within_block_note"] = str(e2)[:60]
166 + rows.append(row)
167 + except Exception as e:
168 + rows.append({"model": f"H5 {name} {g}", "error": str(e)[:80]})
169 + out = pd.DataFrame(rows); out.to_csv(RES / "h5_seshat_blocks.csv", index=False)
170 + return out
171 +
172 +
173 +def y2_cox_and_y3(dp: pd.DataFrame):
174 + rows = []
175 + d = dp.dropna(subset=["P_main", "duration", "macro_region"]).copy()
176 + d["event"] = (~d.censored).astype(int); d["P_z"] = (d.P_main - d.P_main.mean()) / d.P_main.std()
177 + for c in ["X_warfare", "X_prod_infra", "X_military", "D_pc1", "K_mean", "complexity_pc1"]:
178 + d[c + "_z"] = (d[c] - d[c].mean()) / d[c].std()
179 + d["era_num"] = d.midpoint
180 + specs = {"Y2-1 Cox: P + strata(macro-region)": ["P_z"], "Y2-2 Cox: P + X + midpoint + strata": ["P_z", "X_warfare_z", "X_prod_infra_z", "midpoint"],
181 + "Y2-3 Cox: D + K + X + midpoint + strata": ["D_pc1_z", "K_mean_z", "X_warfare_z", "X_prod_infra_z", "midpoint"], "Y2-4 Cox: complexity PC1 + X + strata": ["complexity_pc1_z", "X_warfare_z", "X_prod_infra_z", "midpoint"]}
182 + for label, cols in specs.items():
183 + dd = d.dropna(subset=cols + ["seshat_region"])[cols + ["duration", "event", "macro_region", "seshat_region"]].copy()
184 + try:
185 + cph = CoxPHFitter(); cph.fit(dd, duration_col="duration", event_col="event", strata=["macro_region"], cluster_col="seshat_region", robust=True)
186 + for t in cols[:2] if "Y2-3" in label else cols[:1]:
187 + s = cph.summary.loc[t]
188 + rows.append({"model": label, "term": t, "coef": s["coef"], "se": s["se(coef)"], "ci_lo": s["coef lower 95%"], "ci_hi": s["coef upper 95%"], "p": s["p"], "n": len(dd), "events": int(dd.event.sum()), "hr": np.exp(s["coef"])})
189 + if "Y2-2" in label:
190 + ph = proportional_hazard_test(cph, dd, time_transform="rank"); rows[-1]["schoenfeld_p_P"] = float(ph.summary.loc["P_z", "p"])
191 + except Exception as e:
192 + rows.append({"model": label, "error": str(e)[:100]})
193 + # Y3 discontinuous succession
194 + meta = pd.read_parquet(PROC / "seshat_polity_meta.parquet")[["polity_id", "y3_discontinuous"]]
195 + d3 = dp.merge(meta, on="polity_id").dropna(subset=["y3_discontinuous", "P_main"]).copy(); d3["P_z"] = (d3.P_main - d3.P_main.mean()) / d3.P_main.std()
196 + for label, f in {"Y3-1 logit: discontinuous succession ~ P + FE": "y3_discontinuous ~ P_z + C(macro_region) + C(era)", "Y3-2 logit: + X": "y3_discontinuous ~ P_z + X_warfare + X_prod_infra + C(macro_region) + C(era)"}.items():
197 + try:
198 + r = fit_formula(f, d3, BIN, groups="seshat_region"); rows.append(coef_row(r, "P_z", label, {"events": int(r._data_used.y3_discontinuous.sum())}))
199 + except Exception as e:
200 + rows.append({"model": label, "error": str(e)[:100]})
201 + out = pd.DataFrame(rows); out.to_csv(RES / "h2_seshat_y2_y3.csv", index=False)
202 + return out
203 +
204 +
205 +def main():
206 + d = load_crisis(); dp = pd.read_parquet(PROC / "seshat_indices.parquet")
207 + d.to_parquet(PROC / "seshat_h2_sample.parquet", index=False)
208 + prim = primary_models(d); prim.to_csv(RES / "h2_seshat_primary.csv", index=False)
209 + rob = robustness(d); rob.to_csv(RES / "h2_seshat_robustness.csv", index=False)
210 + wins, summ = out_of_sample(d)
211 + h4 = h4_nonlinear(d); (RES / "h4_seshat_summary.json").write_text(json.dumps(h4, indent=2))
212 + h5 = h5_blocks(d)
213 + y23 = y2_cox_and_y3(dp)
214 + pd.set_option("display.width", 250); pd.set_option("display.max_colwidth", 70)
215 + cols = ["model", "term", "coef", "se", "p", "n"]
216 + print("=== PRIMARY (Y1 fractional logit, cluster region) ===\n", prim[cols].round(3).to_string(index=False))
217 + print("\n=== ROBUSTNESS ===\n", rob[cols].round(3).to_string(index=False))
218 + print("\n=== OOS wins of A2 over baselines ===\n", wins.round(3).to_string(index=False))
219 + print("\n=== Y1b OOS summary ===\n", summ.round(3).to_string(index=False))
220 + print("\n=== H4 ===", json.dumps(h4, indent=1))
221 + print("\n=== H5 ===\n", h5[[c for c in h5.columns if c in ("model", "coef", "se", "p", "n", "held_out_n", "within_block_coef", "within_block_se")]].round(3).to_string(index=False))
222 + print("\n=== Y2 Cox / Y3 ===\n", y23[[c for c in y23.columns if c in ("model", "term", "coef", "se", "p", "n", "events", "hr", "schoenfeld_p_P", "error")]].round(3).to_string(index=False))
223 +
224 +
225 +if __name__ == "__main__":
226 + main()
added src/wp35/simulations/model.py +252 −0
@@ -0,0 +1,252 @@
1 +"""SIMULATED — agent-based coordination model for H3 (pre-registration §1, framework Theorems 1–5).
2 +
3 +Agents live on a spatial interaction network. Each period, tasks arrive; a task needs k participants to hold the same
4 +plan x in S (|S| = s), x drawn from a Zipf-like distribution p. The initiator must communicate x to the k-1 others.
5 +Communication is counted in MESSAGES and BITS; each agent (and each administrator) can process at most `bandwidth`
6 +messages per period (limited attention) — excess messages queue (FIFO), producing latency; a task whose last message
7 +is served more than `tau_max` periods after arrival FAILS (coordination failure). Without a shared code, decoding a
8 +message across agents of different "dialects" fails with probability eps * |dialect_i - dialect_j| (heterogeneous
9 +information / trust); with a shared code the error is eps_code; with records it is ~0 (verification against the record).
10 +
11 +Five institutional regimes are IMPOSED by the experimenter (nothing emerges):
12 + none : direct messages, log2(s) bits per recipient, dialect errors, one acknowledgement round (2 msgs/recipient)
13 + norms : shared prefix code optimal for p (bits = codeword length), lower error; learning cost per agent; after a
14 + distribution shock the stale code costs KL(q||p) extra bits until re-learned (adapt_delay periods)
15 + records : norms + a written record per task (admin overhead bits) that recipients verify (error -> 0, 1 msg each)
16 + central : hierarchy (b-ary tree of administrators); messages relayed via the lowest common ancestor; admin nodes
17 + have their own bandwidth; per-task admin overhead; administrators are agents withdrawn from production
18 + federated : hierarchy with local modules: tasks whose participants share a module are settled by the module admin,
19 + cross-module tasks go to the root; same overhead as central
20 +All quantities below are measured, not assumed. Shannon quantities (H(p), code lengths, KL) are computed only because
21 +p and the code are explicitly defined in the simulation.
22 +"""
23 +from __future__ import annotations
24 +from dataclasses import dataclass, asdict
25 +import math
26 +import numpy as np
27 +
28 +
29 +@dataclass
30 +class Params:
31 + N: int = 200
32 + k: int = 3 # participants per task
33 + lam: float = 0.5 # tasks per agent per period
34 + T: int = 40 # periods
35 + s: int = 64 # plan set size
36 + zipf: float = 1.0 # 0 -> uniform plans (H = log2 s); larger -> concentrated
37 + network: str = "lattice" # lattice | smallworld | random
38 + rewire: float = 0.1
39 + degree: int = 6
40 + bandwidth: int = 8 # messages an agent can process per period
41 + admin_bandwidth: int = 60 # messages an administrator can process per period (used when admin_capacity_ratio <= 0)
42 + admin_capacity_ratio: float = 0.0 # if > 0: admin_bandwidth = ratio * expected relayed messages per period (2*lam*N*(k-1))
43 + verify_records: bool = True # ablation: records without verification (overhead only)
44 + tau_max: int = 3 # periods allowed before a task fails
45 + eps: float = 0.25 # per-unit-dialect-distance decoding error (no code)
46 + eps_code: float = 0.02 # decoding error with a shared code
47 + learn_bits: float = 200.0 # bits each agent spends to learn a code (fixed cost, once)
48 + admin_bits: float = 4.0 # per-task administrative overhead bits (records/central/federated)
49 + branching: int = 8 # tree branching factor for central/federated
50 + shock_period: int = -1 # period at which a shock occurs (-1: none)
51 + shock_type: str = "none" # none | distribution | network
52 + shock_kl_target: float = 1.0 # for distribution shocks: how far q is from p (approx bits)
53 + shock_link_removal: float = 0.3
54 + adapt_delay: int = 10 # periods before a code is re-optimized after a distribution shock
55 + cost_per_bit: float = 0.002
56 + value_per_task: float = 1.0
57 + seed: int = 0
58 + regime: str = "none"
59 +
60 +
61 +def zipf_dist(s: int, a: float) -> np.ndarray:
62 + w = 1.0 / np.arange(1, s + 1) ** a if a > 0 else np.ones(s)
63 + return w / w.sum()
64 +
65 +
66 +def entropy_bits(p: np.ndarray) -> float:
67 + p = p[p > 0]; return float(-(p * np.log2(p)).sum())
68 +
69 +
70 +def huffman_lengths(p: np.ndarray) -> np.ndarray:
71 + """Optimal prefix-code lengths for distribution p (Huffman)."""
72 + import heapq
73 + n = len(p); heap = [(float(p[i]), i, [i]) for i in range(n)]; heapq.heapify(heap); L = np.zeros(n)
74 + cnt = n
75 + while len(heap) > 1:
76 + a = heapq.heappop(heap); b = heapq.heappop(heap)
77 + for i in a[2] + b[2]:
78 + L[i] += 1
79 + heapq.heappush(heap, (a[0] + b[0], cnt, a[2] + b[2])); cnt += 1
80 + return L
81 +
82 +
83 +def build_network(P: Params, rng: np.random.Generator):
84 + pos = rng.random((P.N, 2))
85 + d = np.linalg.norm(pos[:, None, :] - pos[None, :, :], axis=2); np.fill_diagonal(d, np.inf)
86 + nbr = np.argsort(d, axis=1)[:, :P.degree]
87 + A = np.zeros((P.N, P.N), bool)
88 + for i in range(P.N):
89 + A[i, nbr[i]] = True; A[nbr[i], i] = True
90 + if P.network == "smallworld":
91 + for i in range(P.N):
92 + for j in np.where(A[i])[0]:
93 + if j > i and rng.random() < P.rewire:
94 + A[i, j] = A[j, i] = False; m = rng.integers(P.N)
95 + if m != i:
96 + A[i, m] = A[m, i] = True
97 + elif P.network == "random":
98 + A[:] = False; m = P.N * P.degree // 2
99 + ii = rng.integers(P.N, size=m); jj = rng.integers(P.N, size=m); ok = ii != jj
100 + A[ii[ok], jj[ok]] = True; A[jj[ok], ii[ok]] = True
101 + return pos, A
102 +
103 +
104 +def tree_structure(P: Params, pos: np.ndarray):
105 + """Assign agents to leaves of a b-ary tree by spatial sorting (modules are spatially contiguous)."""
106 + b = P.branching
107 + depth = max(1, math.ceil(math.log(P.N, b)))
108 + order = np.lexsort((pos[:, 1], np.floor(pos[:, 0] * b))) # column strips then y
109 + leaf = np.empty(P.N, int); leaf[order] = np.arange(P.N)
110 + # path of each agent: digits of its leaf index in base b, depth levels
111 + paths = np.array([[(l // b ** (depth - 1 - lvl)) % b for lvl in range(depth)] for l in leaf])
112 + return depth, paths
113 +
114 +
115 +def lca_depth(paths: np.ndarray, i: np.ndarray, j: np.ndarray) -> np.ndarray:
116 + """Level of the lowest common ancestor (0 = root). Vectorized over task pairs."""
117 + eq = paths[i] == paths[j]
118 + first_diff = np.where(eq.all(axis=1), eq.shape[1], np.argmin(eq, axis=1))
119 + return first_diff
120 +
121 +
122 +def simulate(P: Params) -> dict:
123 + rng = np.random.default_rng(P.seed)
124 + pos, A = build_network(P, rng)
125 + dialect = rng.random(P.N) # heterogeneous information: cultural distance
126 + p = zipf_dist(P.s, P.zipf); H = entropy_bits(p)
127 + code_len = huffman_lengths(p); L_code = float((p * code_len).sum()); L_raw = math.ceil(math.log2(P.s))
128 + q = p.copy()
129 + if P.shock_type == "distribution" and P.shock_period >= 0:
130 + # q = p permuted so that D_KL(q||p) is close to the target (search over cyclic shifts)
131 + best = None
132 + for sh in range(1, P.s):
133 + qq = np.roll(p, sh); kl = float((qq * np.log2(qq / p)).sum())
134 + if best is None or abs(kl - P.shock_kl_target) < abs(best[0] - P.shock_kl_target):
135 + best = (kl, qq)
136 + q = best[1]
137 + regime = P.regime
138 + if P.admin_capacity_ratio > 0:
139 + P.admin_bandwidth = max(1, int(round(P.admin_capacity_ratio * 2 * P.lam * P.N * (P.k - 1))))
140 + use_code = regime in ("norms", "records", "central", "federated")
141 + use_records = regime in ("records", "central", "federated")
142 + hier = regime in ("central", "federated")
143 + depth, paths = tree_structure(P, pos) if hier else (0, None)
144 + n_admin = 0
145 + if hier:
146 + n_admin = sum(P.branching ** lvl for lvl in range(depth)) # one administrator per internal node
147 + producers = np.ones(P.N, bool)
148 + if hier: # administrators are withdrawn from production (overhead): the first n_admin agents by index
149 + producers[: min(n_admin, P.N // 4)] = False
150 + # per-agent FIFO queues: cumulative message count served at `bandwidth` per period
151 + agent_backlog = np.zeros(P.N); admin_backlog = {} # admin id -> backlog
152 + stats = dict(tasks=0, success=0, fail_latency=0, fail_decode=0, messages=0, bits=0.0, admin_bits=0.0, latency_sum=0.0,
153 + tasks_pre=0, success_pre=0, tasks_post=0, success_post=0, bits_pre=0.0, bits_post=0.0, root_load=0.0)
154 + benefit = np.zeros(P.N)
155 + learn_cost = P.N * P.learn_bits if use_code else 0.0
156 + cur_code_len = code_len.copy(); shock_time = None
157 + for t in range(P.T):
158 + if P.shock_period == t and P.shock_type == "network":
159 + drop = rng.random(A.shape) < P.shock_link_removal; A &= ~drop; A &= A.T
160 + if P.shock_period == t and P.shock_type == "distribution":
161 + shock_time = t
162 + dist_now = q if (shock_time is not None and t >= shock_time) else p
163 + if use_code and shock_time is not None and t >= shock_time + P.adapt_delay:
164 + cur_code_len = huffman_lengths(q) # institution re-learns the code after adapt_delay
165 + # drain queues by one period of service
166 + agent_backlog = np.maximum(0, agent_backlog - P.bandwidth)
167 + for a_ in admin_backlog:
168 + admin_backlog[a_] = max(0.0, admin_backlog[a_] - P.admin_bandwidth)
169 + M = rng.poisson(P.lam * producers.sum())
170 + if M == 0:
171 + continue
172 + init = rng.choice(np.where(producers)[0], size=M)
173 + plans = rng.choice(P.s, size=M, p=dist_now)
174 + # participants: k-1 network neighbours of the initiator (random if none)
175 + parts = np.empty((M, P.k - 1), int)
176 + for m in range(M):
177 + nb = np.where(A[init[m]] & producers)[0]
178 + parts[m] = rng.choice(nb, size=P.k - 1, replace=len(nb) < P.k - 1) if len(nb) > 0 else rng.choice(np.where(producers)[0], size=P.k - 1)
179 + # bits per recipient
180 + if use_code:
181 + bits_r = cur_code_len[plans]
182 + else:
183 + bits_r = np.full(M, float(L_raw))
184 + # decoding errors
185 + if use_records and P.verify_records:
186 + err = np.zeros((M, P.k - 1), bool)
187 + elif use_code:
188 + err = rng.random((M, P.k - 1)) < P.eps_code
189 + else:
190 + dd = np.abs(dialect[init][:, None] - dialect[parts]); err = rng.random((M, P.k - 1)) < P.eps * dd
191 + task_fail_decode = err.any(axis=1)
192 + # messages and routing
193 + msgs_per_recip = 1 if use_records else 2 # ack round without records
194 + if not hier:
195 + n_msgs = msgs_per_recip * (P.k - 1)
196 + # load: each message is processed by its recipient; the ack by the initiator
197 + np.add.at(agent_backlog, parts.ravel(), 1.0)
198 + if msgs_per_recip == 2:
199 + np.add.at(agent_backlog, init, float(P.k - 1))
200 + wait = np.maximum(np.ceil(agent_backlog[parts] / P.bandwidth).max(axis=1), np.ceil(agent_backlog[init] / P.bandwidth) if msgs_per_recip == 2 else 0)
201 + root_load_t = 0.0
202 + else:
203 + # relay through the LCA of initiator and each participant
204 + lvl = np.stack([lca_depth(paths, init, parts[:, c]) for c in range(P.k - 1)], axis=1) # 0 = root
205 + hops = 2 * (depth - lvl) # messages up and down
206 + n_msgs = hops.sum(axis=1)
207 + if regime == "federated":
208 + pass # locality is captured by the LCA level: same-module tasks never reach the root
209 + else:
210 + lvl[:] = 0 # central: everything is relayed through the root
211 + hops = np.full_like(hops, 2 * depth); n_msgs = hops.sum(axis=1)
212 + # admin load: the LCA administrator processes 2 messages per recipient
213 + keys = []
214 + for c in range(P.k - 1):
215 + for m in range(M):
216 + key = (int(lvl[m, c]), tuple(paths[init[m]][: lvl[m, c]])); keys.append(key)
217 + admin_backlog[key] = admin_backlog.get(key, 0.0) + 2.0
218 + wait = np.zeros(M)
219 + idx = 0
220 + for c in range(P.k - 1):
221 + for m in range(M):
222 + wait[m] = max(wait[m], math.ceil(admin_backlog[keys[idx]] / P.admin_bandwidth)); idx += 1
223 + np.add.at(agent_backlog, parts.ravel(), 1.0)
224 + wait = np.maximum(wait, np.ceil(agent_backlog[parts] / P.bandwidth).max(axis=1))
225 + root_load_t = float(admin_backlog.get((0, ()), 0.0))
226 + task_fail_latency = wait > P.tau_max
227 + success = ~task_fail_decode & ~task_fail_latency
228 + # bits per task = codeword/raw bits to each recipient + 1-bit acknowledgements (if any) + record overhead
229 + bits = bits_r * (P.k - 1) + (1.0 * (P.k - 1) if msgs_per_recip == 2 else 0.0) + (P.admin_bits if use_records else 0.0)
230 + stats["tasks"] += M; stats["success"] += int(success.sum()); stats["fail_decode"] += int(task_fail_decode.sum()); stats["fail_latency"] += int((task_fail_latency & ~task_fail_decode).sum())
231 + stats["messages"] += int(np.sum(n_msgs) if np.ndim(n_msgs) else M * n_msgs); stats["bits"] += float(bits.sum()); stats["admin_bits"] += float(M * P.admin_bits if use_records else 0.0)
232 + stats["latency_sum"] += float(wait[success].sum()); stats["root_load"] += root_load_t
233 + if shock_time is None or t < shock_time:
234 + stats["tasks_pre"] += M; stats["success_pre"] += int(success.sum()); stats["bits_pre"] += float(bits.sum())
235 + else:
236 + stats["tasks_post"] += M; stats["success_post"] += int(success.sum()); stats["bits_post"] += float(bits.sum())
237 + np.add.at(benefit, init[success], P.value_per_task); np.add.at(benefit, parts[success].ravel(), P.value_per_task)
238 + tot_bits = stats["bits"] + learn_cost
239 + succ = max(stats["success"], 1)
240 + b = benefit[producers] if producers.any() else benefit
241 + g = float(np.abs(b[:, None] - b[None, :]).mean() / (2 * b.mean())) if b.mean() > 0 else float("nan")
242 + out = {**asdict(P), "H_p_bits": H, "L_code_bits": L_code, "L_raw_bits": float(L_raw), "n_admin": int((~producers).sum()), "depth": depth,
243 + "success_rate": stats["success"] / max(stats["tasks"], 1), "msgs_per_task": stats["messages"] / max(stats["tasks"], 1),
244 + "bits_per_task": stats["bits"] / max(stats["tasks"], 1), "bits_per_success_incl_setup": tot_bits / succ, "bits_per_success": stats["bits"] / succ,
245 + "tasks_per_kbit": succ / (tot_bits / 1000.0), "latency_mean": stats["latency_sum"] / succ, "fail_latency_share": stats["fail_latency"] / max(stats["tasks"], 1),
246 + "fail_decode_share": stats["fail_decode"] / max(stats["tasks"], 1), "admin_overhead_share": (stats["admin_bits"] + learn_cost) / max(tot_bits, 1e-9),
247 + "welfare": float(benefit.sum() - P.cost_per_bit * tot_bits), "welfare_per_agent": float((benefit.sum() - P.cost_per_bit * tot_bits) / P.N),
248 + "gini_benefit": g, "root_load_mean": stats["root_load"] / P.T,
249 + "success_pre": stats["success_pre"] / max(stats["tasks_pre"], 1), "success_post": stats["success_post"] / max(stats["tasks_post"], 1),
250 + "bits_per_task_pre": stats["bits_pre"] / max(stats["tasks_pre"], 1), "bits_per_task_post": stats["bits_post"] / max(stats["tasks_post"], 1),
251 + "kl_q_p_bits": float((q * np.log2(q / p)).sum()) if P.shock_type == "distribution" else 0.0, "tasks": stats["tasks"]}
252 + return out
added src/wp35/simulations/run_experiments.py +87 −0
@@ -0,0 +1,87 @@
1 +"""SIMULATED — factorial experiments + ablations for H3. Usage: python -m wp35.simulations.run_experiments [--quick]
2 +Design (pre-declared here before running): N x network x bandwidth x plan-entropy x shock x regime x seeds, plus an
3 +admin-capacity factor for the two hierarchical regimes. Outputs results/simulated/runs_main.parquet, runs_ablation.parquet.
4 +"""
5 +from __future__ import annotations
6 +import itertools, sys, time
7 +from multiprocessing import Pool
8 +from pathlib import Path
9 +import pandas as pd
10 +from wp35.simulations.model import Params, simulate
11 +
12 +ROOT = Path(__file__).resolve().parents[3]; OUT = ROOT / "results" / "simulated"; OUT.mkdir(parents=True, exist_ok=True)
13 +SEEDS = list(range(8))
14 +REGIMES = ["none", "norms", "records", "central", "federated"]
15 +
16 +
17 +def main_design(quick=False):
18 + Ns = [50, 200, 800] if not quick else [50, 200]
19 + cells = []
20 + for N, net, bw, zipf, shock, reg, seed in itertools.product(Ns, ["lattice", "smallworld", "random"], [2, 8], [0.0, 1.0], ["none", "distribution", "network"], REGIMES, SEEDS if not quick else SEEDS[:2]):
21 + base = dict(N=N, network=net, bandwidth=bw, zipf=zipf, shock_type=shock, shock_period=20 if shock != "none" else -1, regime=reg, seed=seed, T=40)
22 + if reg in ("central", "federated"):
23 + for ratio in [0.5, 2.0]:
24 + cells.append(Params(**base, admin_capacity_ratio=ratio))
25 + else:
26 + cells.append(Params(**base, admin_capacity_ratio=2.0))
27 + return cells
28 +
29 +
30 +def ablation_design(quick=False):
31 + cells = []
32 + seeds = SEEDS if not quick else SEEDS[:2]
33 + base = dict(N=200, network="lattice", bandwidth=8, zipf=1.0, T=40)
34 + for seed in seeds:
35 + for reg in REGIMES:
36 + r = 2.0
37 + cells.append(Params(**base, regime=reg, seed=seed, admin_capacity_ratio=r, shock_type="none", shock_period=-1)) # reference
38 + # records without verification
39 + cells.append(Params(**base, regime="records", seed=seed, verify_records=False, admin_capacity_ratio=2.0))
40 + # code adaptation speed after a distribution shock
41 + for ad in [0, 10, 1000]:
42 + cells.append(Params(**base, regime="norms", seed=seed, shock_type="distribution", shock_period=20, adapt_delay=ad, shock_kl_target=2.0, admin_capacity_ratio=2.0))
43 + # horizon (break-even, Theorem 2) and learning cost
44 + for T in [10, 40, 160]:
45 + for lb in [0.0, 200.0, 1000.0]:
46 + for reg in ["none", "norms"]:
47 + cells.append(Params(**{**base, "T": T}, regime=reg, seed=seed, learn_bits=lb, admin_capacity_ratio=2.0))
48 + # heterogeneity of information (eps) for none vs norms
49 + for eps in [0.05, 0.25, 0.6]:
50 + for reg in ["none", "norms"]:
51 + cells.append(Params(**base, regime=reg, seed=seed, eps=eps, admin_capacity_ratio=2.0))
52 + # admin capacity sweep (phase diagram, Theorem 5) and branching
53 + for ratio in [0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 4.0]:
54 + for reg in ["central", "federated"]:
55 + cells.append(Params(**base, regime=reg, seed=seed, admin_capacity_ratio=ratio))
56 + for b in [4, 16]:
57 + cells.append(Params(**base, regime="federated", seed=seed, branching=b, admin_capacity_ratio=1.0))
58 + # plan-set size / entropy sweep (coding gain, Theorem 1)
59 + for s_, z in [(16, 0.0), (64, 0.0), (256, 0.0), (64, 0.5), (64, 1.5), (64, 2.5)]:
60 + for reg in ["none", "norms"]:
61 + cells.append(Params(**{**base, "zipf": z}, regime=reg, seed=seed, s=s_, admin_capacity_ratio=2.0))
62 + return cells
63 +
64 +
65 +def _run(P):
66 + return simulate(P)
67 +
68 +
69 +def run(cells, path, n_jobs=12):
70 + t0 = time.time()
71 + with Pool(n_jobs) as pool:
72 + rows = pool.map(_run, cells, chunksize=16)
73 + df = pd.DataFrame(rows); df.to_parquet(path, index=False)
74 + print(f"{path.name}: {len(df)} runs in {time.time() - t0:.1f}s")
75 + return df
76 +
77 +
78 +def main():
79 + quick = "--quick" in sys.argv
80 + main_cells = main_design(quick); abl = ablation_design(quick)
81 + print("main design cells:", len(main_cells), "| ablation cells:", len(abl))
82 + run(main_cells, OUT / ("runs_main_quick.parquet" if quick else "runs_main.parquet"))
83 + run(abl, OUT / ("runs_ablation_quick.parquet" if quick else "runs_ablation.parquet"))
84 +
85 +
86 +if __name__ == "__main__":
87 + main()
88
Menu

Theme