Input: reanalysis/serie_auditada.csv  (n = 35, 1991-2025; cohort total incl. baseline = 768; K grid lower limit = 557)

======================================================================================
1. Reproduction of the manuscript's Table 4 (authors' Gaussian set-up, constant-free AICc)
======================================================================================
  single_mean  RMSE 21.74 (ms 21.74)  AICc 219.926 (ms 219.93)  full-Gaussian AICc 319.25  
  two_means    RMSE 10.44 (ms 10.44)  AICc 170.982 (ms 170.98)  full-Gaussian AICc 270.31  
  unbounded    RMSE 12.46 (ms 12.46)  AICc 185.916 (ms 185.92)  full-Gaussian AICc 285.24  a=12.9 g=0.166 w2020=1
  bounded      RMSE 10.20 (ms 10.20)  AICc 174.638 (ms 174.64)  full-Gaussian AICc 273.96  a=13.59 g=0.4019 w2020=0.75 K=719 K_dAICc2_lo=640 K_dAICc2_hi=878

======================================================================================
2. Recommended model set: NB2 full log-likelihoods, n = 35 (1991-2025)
======================================================================================
      model  k   logLik    AICc  dAICc  akaike_weight     BIC   RMSE  alpha  acf1_pearson  LjungBox_p_lag2  LR_NB_vs_Poisson
trend_shift  4 -111.279 231.892  0.000          0.550 236.780  8.171  0.062         0.097            0.031            15.888
      trend  3 -113.634 234.042  2.151          0.188 237.934  9.534  0.095         0.192            0.112            31.162
  segmented  5 -111.140 234.349  2.457          0.161 240.057  7.856  0.060         0.099            0.032            14.445
stock_shift  4 -112.965 235.262  3.371          0.102 240.151  9.248  0.077         0.058            0.021            22.890
  two_means  3 -130.793 268.359 36.468          0.000 272.251 10.442  0.409         0.587            0.000           105.766
  unbounded  4 -131.111 271.555 39.664          0.000 276.443 13.033  0.420         0.623            0.000           127.655
    bounded  5 -131.805 275.679 43.787          0.000 281.387 12.152  0.441         0.631            0.000           127.781
single_mean  2 -143.199 290.774 58.882          0.000 293.509 21.743  0.900         0.853            0.000           518.883

  Full-likelihood AICc by family (comparable across columns):
      model  AICc_Poisson  AICc_NB2  AICc_Gaussian_full
single_mean        807.40    290.77              319.25
  two_means        371.73    268.36              270.31
      trend        262.81    234.04              262.78
trend_shift        245.22    231.89              254.08
  segmented        246.06    234.35              255.23
stock_shift        255.59    235.26              259.07
  unbounded        396.65    271.56              285.24
    bounded        400.72    275.68              273.96

  corr(year, log A(t-1)): pre-2020 0.9923 (VIF 65.0); all years 0.9944

======================================================================================
3. Key NB2 parameters: profile-likelihood, Wald and parametric-bootstrap 95% CIs
======================================================================================
      model                      quantity scale  estimate  profile_lo  profile_hi   wald_lo  wald_hi  boot_lo  boot_hi                           note
  two_means           post/pre rate ratio ratio     4.924       2.784       9.357     2.756    8.796      NaN      NaN                               
      trend                   growth %/yr   pct     9.592       7.994       11.22     8.032    11.17      NaN      NaN                               
trend_shift          pre-2020 growth %/yr   pct     7.908       5.979       10.01     5.964    9.889    6.107    9.949                               
trend_shift         2020 shift rate ratio ratio      1.57        1.05       2.315     1.081    2.281    1.079    2.222                               
  segmented          pre-2020 growth %/yr   pct     7.972       6.033       10.08     6.023    9.957    6.049    9.972                               
  segmented          2020 jump rate ratio ratio      1.71       1.015       2.903     1.051    2.784    1.075     2.68                               
  segmented slope change after 2020, %/yr   pct    -3.705      -17.34       12.14    -16.22    10.68   -15.37    9.559                               
stock_shift          elasticity on A(t-1)   raw    0.6896      0.5137       0.874    0.5138   0.8655      NaN      NaN                               
stock_shift         2020 shift rate ratio ratio     1.688       1.119       2.543     1.143    2.492      NaN      NaN                               
  segmented         post-2020 growth %/yr   pct     3.971         NaN         NaN       NaN      NaN   -8.587    18.11                               
trend_shift                     NB2 alpha   raw   0.06156     0.01784      0.1634 -0.003859    0.127      NaN      NaN                               
  unbounded                             a   raw      12.9         NaN         NaN       NaN      NaN      NaN      NaN                               
  unbounded                             g   raw     0.191         NaN         NaN       NaN      NaN      NaN      NaN                               
  unbounded                         w2020   raw         1         NaN         NaN       NaN      NaN      NaN      NaN                    at boundary
  unbounded                     NB2 alpha   raw    0.4204         NaN         NaN       NaN      NaN      NaN      NaN                               
    bounded                             a   raw     13.48         NaN         NaN       NaN      NaN      NaN      NaN                               
    bounded                             g   raw    0.2208         NaN         NaN       NaN      NaN      NaN      NaN                               
    bounded                         w2020   raw         1         NaN         NaN       NaN      NaN      NaN      NaN                    at boundary
    bounded                             K   raw      2500         NaN         NaN       NaN      NaN      NaN      NaN at the upper grid limit (2500)
    bounded                     NB2 alpha   raw    0.4411         NaN         NaN       NaN      NaN      NaN      NaN                               

======================================================================================
4. Claim 1: were first entries 1991-2019 'low and approximately constant'?
======================================================================================
                                           model  n  k   logLik    AICc  alpha            estimate  dAICc
                                        constant 29  2 -102.154 208.769  0.526          mean=12.90 29.259
                                log-linear trend 29  3  -86.275 179.510  0.080     growth=8.02%/yr  0.000
                               stock: log A(t-1) 29  3  -87.258 181.475  0.091    elasticity=0.710  1.966
      one mean shift, date estimated (best 2004) 29  4  -85.518 180.703  0.078 means 4.92 -> 19.38  1.194
authors' bounded pre-2020 term a(1-A/K), K<=2500 29  3 -102.834 212.628  0.556     a=13.49, K=2500 33.119
                            same, K unrestricted 29  3 -102.154 211.267  0.526      a=12.90, K=inf 31.758
                                        test  statistic  p_asymptotic  p_bootstrap    B  estimate  ci_lo  ci_hi                           note
NB2 log-linear trend vs constant (1991-2019)      31.76     1.746e-08       0.0005 1999     8.016  5.917  10.32    growth %/yr, profile 95% CI
              Mann-Kendall trend (1991-2019)      4.981     6.331e-07          NaN    0    0.8571 0.6429  1.105 Z; Sen slope entries/yr; S=266
         Spearman rho, year vs Y (1991-2019)     0.8471      6.87e-09          NaN    0    0.8471    NaN    NaN                               
       NB2 log-linear trend within 2004-2019      7.605       0.00582          NaN    0     4.542  1.493  7.697    growth %/yr, profile 95% CI
                            mean Y 1991-1999        NaN           NaN          NaN    0     4.889    NaN    NaN                            n=9
                            mean Y 2000-2009        NaN           NaN          NaN    0      11.6    NaN    NaN                           n=10
                            mean Y 2010-2019        NaN           NaN          NaN    0      21.4    NaN    NaN                           n=10
                            mean Y 1991-2003        NaN           NaN          NaN    0     4.923    NaN    NaN                           n=13
                            mean Y 2004-2019        NaN           NaN          NaN    0     19.38    NaN    NaN                           n=16
                            mean Y 2017-2019        NaN           NaN          NaN    0     27.67    NaN    NaN                            n=3
                            mean Y 1991-2019        NaN           NaN          NaN    0      12.9    NaN    NaN                           n=29
                            mean Y 2020-2025        NaN           NaN          NaN    0      63.5    NaN    NaN                            n=6
  NB2 trend fitted mean, first pre-2020 year        NaN           NaN          NaN    0     3.611    NaN    NaN                           1991
   NB2 trend fitted mean, last pre-2020 year        NaN           NaN          NaN    0     31.28    NaN    NaN                           2019

======================================================================================
5. Claim 2: the 2020 regime change (break dates estimated vs fixed)
======================================================================================
                                                                                             test       value                                                                                                                     detail      p
                                                     Two means: best single break date (NB2 scan)        2005 RR 6.04; AICc (date counted) 262.27 vs 268.36 with 2020 fixed; dAICc<=2 dates [2004, 2005, 2008]; -2dlogLik at 2020 = 8.64    NaN
                                                      Two mean shifts, both dates estimated (NB2) 2004 & 2020                                                              means 4.92 / 19.38 / 63.50; logLik -110.53; AICc (k=6) 236.07    NaN
                                                        Trend + shift: best shift date (NB2 scan)        2020                RR 1.57; AICc (date counted, k=5) 234.63 vs 231.89 with 2020 fixed; dAICc<=2 dates [2019, 2020, 2021, 2022]    NaN
sup-LR: one level shift on a common trend, date estimated (parametric bootstrap under trend only)        4.71                                                                          B=1999; 95% critical value 10.20; dates 1994-2023 0.4545
                                      Fixed 2020 shift on a common trend: LR trend+shift vs trend        4.71                                                                                          chi2_1 p=0.0300; bootstrap B=1999 0.0460

  Pre-2020 NB trend projected forward:
 year  observed  expected_pre2020_trend  O_over_E expected_total_CI95 O_over_E_total_CI95 prediction_interval_total_95  P_pred_total_ge_observed
 2020    49.000                  33.785     1.450                                                                                            NaN
 2021    49.000                  36.493     1.343                                                                                            NaN
 2022    75.000                  39.418     1.903                                                                                            NaN
 2023    93.000                  42.578     2.184                                                                                            NaN
 2024    63.000                  45.991     1.370                                                                                            NaN
 2025    52.000                  49.677     1.047                                                                                            NaN
total   381.000                 247.943     1.537         177.2-342.1           1.11-2.15                      163-367                     0.018

======================================================================================
6. Claim 3: saturation (K profile, saturation vs plateau, post-2020 shape)
======================================================================================
                               specification   K_hat  logLik_max  logLik_K_inf  LR95_lo  LR95_hi  dAICc_le2_lo  dAICc_le2_hi  LR_K719  LR_K727  LR_K_inf  p_K719_chi2  largest_K_evaluated
                       authors' bounded, NB2     inf    -131.111      -131.111  969.000      inf      1765.000           inf    5.474    5.396     0.000        0.019          1000000.000
authors' bounded, Gaussian (authors' family) 719.000    -130.947      -137.954  618.000 1005.000       640.000       878.000    0.000    0.013    14.014        1.000          1000000.000
  pre-2020 trend + bounded (both terms), NB2 687.000    -109.364      -112.887  586.000 1321.000       606.000       935.000    0.114    0.168     7.046        0.735          1000000.000
  NB2 authors' bounded logLik at K=719: -133.848; K=2500: -131.805; K=1e6: -131.113; unbounded: -131.111
  Trend model, finite K vs K=inf: LR=7.05; bootstrap p=0.0100 (B=499); chi-bar-square p=0.0040; null draws with LR*=0: 0.483
                                                         model  k   logLik    AICc                                                           details                                                                     note  dAICc
             Log-linear trend + 2020 level shift (recommended)  4 -111.279 231.892                     b0=3.5079; b_trend=0.0761; b_shift2020=0.4512                                                             main NB2 set  0.926
                                    Log-linear trend, no shift  3 -113.634 234.042                                         b0=3.7630; b_trend=0.0916                                                             main NB2 set  3.077
                         Two means, pre-2020 / 2020+ (authors)  3 -130.793 268.359                                     b0=2.5570; b_shift2020=1.5941                                                             main NB2 set 37.394
                                            Authors' unbounded  4 -131.111 271.555                                   a=12.897; g=0.1910; w2020=1.000                                                             main NB2 set 40.590
                           Authors' bounded (K in [557, 2500])  5 -131.805 275.679                         a=13.483; g=0.2208; w2020=1.000; K=2500.0                                                             main NB2 set 44.714
 pre-2020 trend + post-2020 term proportional to A (unbounded)  5 -112.887 237.843          b=0.0772 (8.03%/yr); g=0.1897; w2020=1.000; alpha=0.0858                                                                           6.877
pre-2020 trend + flat post-2020 level (plateau, no saturation)  5 -110.813 233.694           b=0.0766 (7.96%/yr); m=66.40; w2020=0.470; alpha=0.0548                                    no saturation: flat post-2020 level m  2.729
                 pre-2020 trend + bounded (both terms), K free  6 -109.364 233.728 b=0.0891 (9.32%/yr); g=0.4224; w2020=0.548; K=687.0; alpha=0.0378                                                   k counts K (and w2020)  2.763
          pre-2020 trend + bounded (both terms), K = 727 fixed  5 -109.448 230.965 b=0.0883 (9.23%/yr); g=0.3909; w2020=0.603; K=727.0; alpha=0.0387 K set to D_2025 after K~719 was seen: post hoc, not independent evidence  0.000
                                                        test  statistic  p_parametric  p_permutation                                                                                         note
                   Gaussian quadratic vs constant, 2020-2025      2.754        0.2094         0.1778 F; exact permutation over 720 orderings; quadratic coef -4.98, one-sided permutation p 0.033
         Gaussian kink (rise then fall), kink year estimated      11.12           NaN         0.1167                                                               sup-F over interior kink years
                               NB2 log-quadratic vs constant      7.222       0.02703          0.134                                       p_permutation column = parametric bootstrap p (B=1999)
Segmented model (full series): slope change after 2020, %/yr     -3.705           NaN            NaN                                                               profile 95% CI -17.34 to 12.14

======================================================================================
7. Claim 4: the bounded model's pre-2020 term, and the entry rate on the nominal gap G = D - A
======================================================================================
                                                                              quantity   value     year
                    authors' bounded fit (Table 4): pre-2020 term a(1-A/K), first year  13.340 1991.000
            authors' bounded fit (Table 4): pre-2020 term a(1-A/K), last pre-2020 year   9.731 2019.000
                                                change of that term over 1991-2019 (%) -27.054      NaN
                                                    NB2 pre-2020 trend fit, first year   3.611 1991.000
                                            NB2 pre-2020 trend fit, last pre-2020 year  31.278 2019.000
                                                  observed mean first 5 pre-2020 years   4.000      NaN
                                                   observed mean last 5 pre-2020 years  22.800      NaN
                                             1991-2019 NB2 AICc: constant (mean=12.90) 208.769      NaN
1991-2019 NB2 AICc: authors' bounded pre-2020 term a(1-A/K), K<=2500 (a=13.49, K=2500) 212.628      NaN
                             1991-2019 NB2 AICc: same, K unrestricted (a=12.90, K=inf) 211.267      NaN
 year      Y  D_prev  A_prev  G_prev  rate  rate_lo95_poisson  rate_hi95_poisson  cumulative_cohort_prev  D_minus_cohort_prev
 2019 32.000 603.000 204.000 399.000 0.080              0.055              0.113                 355.000              248.000
 2020 49.000 590.000 226.000 364.000 0.135              0.100              0.178                 387.000              203.000
 2021 49.000 674.000 264.000 410.000 0.120              0.088              0.158                 436.000              238.000
 2022 75.000 683.000 296.000 387.000 0.194              0.152              0.243                 485.000              198.000
 2023 93.000 701.000 366.000 335.000 0.278              0.224              0.340                 560.000              141.000
 2024 63.000 715.000 459.000 256.000 0.246              0.189              0.315                 653.000               62.000
 2025 52.000 721.000 516.000 205.000 0.254              0.189              0.333                 716.000                5.000
   window                                                                test  annual_rate_ratio  ci_lo  ci_hi  statistic  df         p                                                                                                                     note
2021-2025                                   Poisson: log-linear trend in rate              1.186  1.098  1.282      18.37   1 1.817e-05                                                                                                      constant rate 0.208
2021-2025 NB2 (alpha fixed at trend+shift estimate): log-linear trend in rate              1.187  0.999  1.411      3.365   1   0.06658                                                                                                      constant rate 0.208
2021-2025                      Poisson: constant rate vs saturated (deviance)                NaN    NaN    NaN       29.3   4 6.795e-06 multinomial Monte Carlo p=5e-06 (200000 draws); expected [85.4, 80.7, 69.8, 53.4, 42.7] vs observed [49, 75, 93, 63, 52]
2023-2025                                   Poisson: log-linear trend in rate             0.9491 0.8011  1.124     0.3662   1    0.5451                                                                                                      constant rate 0.261
2023-2025 NB2 (alpha fixed at trend+shift estimate): log-linear trend in rate             0.9546 0.6501  1.402    0.05742   1    0.8106                                                                                                      constant rate 0.261
2023-2025                      Poisson: constant rate vs saturated (deviance)                NaN    NaN    NaN     0.6116   2    0.7365                    multinomial Monte Carlo p=0.7336 (200000 draws); expected [87.5, 66.9, 53.6] vs observed [93, 63, 52]
    ratio                                                  Y_last_over_Y_peak                NaN    NaN    NaN     0.5591 NaN       NaN                                                                                                                peak=2023
    ratio                                        G_prev_last_over_G_prev_peak                NaN    NaN    NaN     0.6119 NaN       NaN                                                                                                                peak=2023
    ratio                                            Y_peak_over_Y_first_full                NaN    NaN    NaN      1.898 NaN       NaN                                                                                                                peak=2023
    ratio                                  G_prev_peak_over_G_prev_first_full                NaN    NaN    NaN     0.8171 NaN       NaN                                                                                                                peak=2023

======================================================================================
8. Out-of-sample checks: rolling-origin one-step-ahead forecasts and leave-one-out (NB2 plug-in)
======================================================================================
            block       model  n_targets  sum_log_score    MAE   RMSE  MAE_LSfit  RMSE_LSfit
rolling 2010-2019 single_mean         10        -43.297 11.061 12.244     11.061      12.244
rolling 2010-2019   two_means         10        -43.297 11.061 12.244     11.061      12.244
rolling 2010-2019       trend         10        -33.660  5.055  6.725      5.852       6.734
rolling 2010-2019 trend_shift         10        -33.660  5.055  6.725      5.852       6.734
rolling 2010-2019   segmented         10        -33.660  5.055  6.725      5.852       6.734
rolling 2010-2019 stock_shift         10        -33.366  4.966  5.646      5.727       6.432
rolling 2010-2019   unbounded         10        -43.297 11.061 12.244     11.061      12.244
rolling 2010-2019     bounded         10        -43.849 11.399 12.563     11.578      12.735
rolling 2010-2019  naive_last         10        -39.813  6.000  7.362      6.000       7.362
rolling 2021-2025 single_mean          5        -35.574 49.102 51.837     49.102      51.837
rolling 2021-2025   two_means          5        -24.330 15.727 20.626     15.727      20.626
rolling 2021-2025       trend          5        -23.988 19.992 24.343     25.972      27.330
rolling 2021-2025 trend_shift          5        -22.294 19.342 21.355     20.077      22.015
rolling 2021-2025   segmented          5        -25.780 25.860 32.239     24.423      31.928
rolling 2021-2025 stock_shift          5        -23.013 22.922 25.722     23.936      27.128
rolling 2021-2025   unbounded          5        -24.603 27.086 33.045     26.302      31.806
rolling 2021-2025     bounded          5        -24.573 24.431 28.380     20.332      22.958
rolling 2021-2025  naive_last          5        -23.876 17.000 20.105     17.000      20.105
    LOO 1991-2025 single_mean         35       -145.372 16.420 22.383     16.420      22.383
    LOO 1991-2025   two_means         35       -133.395  9.401 11.545      9.401      11.545
    LOO 1991-2025       trend         35       -117.293  6.478 10.428      6.894      11.321
    LOO 1991-2025 trend_shift         35       -115.952  6.035  9.574      6.300       9.714
    LOO 1991-2025   segmented         35       -118.025  6.906 11.431      6.749      10.826
    LOO 1991-2025 stock_shift         35       -117.599  6.781 10.987      7.155      10.717
    LOO 1991-2025   unbounded         35       -134.180 11.127 15.278     11.303      15.276
    LOO 1991-2025     bounded         35       -134.812 10.956 14.131     10.446      12.566

  Paired bootstrap (target years resampled, 5000 draws), sum of log-score differences vs two means:
            block       model  dLogScore_vs_two_means   ci_lo  ci_hi  years_better  n
rolling 2010-2019 single_mean                   0.000   0.000  0.000             0 10
rolling 2010-2019       trend                   9.637   3.881 14.406             9 10
rolling 2010-2019 trend_shift                   9.637   4.146 14.422             9 10
rolling 2010-2019   segmented                   9.637   4.101 14.279             9 10
rolling 2010-2019 stock_shift                   9.931   6.202 13.297             9 10
rolling 2010-2019   unbounded                  -0.000  -0.000  0.000             3 10
rolling 2010-2019     bounded                  -0.552  -0.662 -0.455             0 10
rolling 2010-2019  naive_last                   3.484   1.312  5.914             8 10
rolling 2021-2025 single_mean                 -11.245 -15.486 -7.004             0  5
rolling 2021-2025       trend                   0.342  -2.292  2.873             3  5
rolling 2021-2025 trend_shift                   2.035  -0.027  3.610             4  5
rolling 2021-2025   segmented                  -1.450  -7.147  4.246             2  5
rolling 2021-2025 stock_shift                   1.317  -1.982  3.858             4  5
rolling 2021-2025   unbounded                  -0.273  -1.367  0.812             2  5
rolling 2021-2025     bounded                  -0.244  -1.108  0.621             2  5
rolling 2021-2025  naive_last                   0.453  -0.032  1.079             4  5
    LOO 1991-2025 single_mean                 -11.977 -20.607 -3.738             9 35
    LOO 1991-2025       trend                  16.102   4.849 26.344            28 35
    LOO 1991-2025 trend_shift                  17.443   5.761 27.823            27 35
    LOO 1991-2025   segmented                  15.370   3.155 26.234            27 35
    LOO 1991-2025 stock_shift                  15.796   4.356 25.484            29 35
    LOO 1991-2025   unbounded                  -0.785  -2.214  0.360            13 35
    LOO 1991-2025     bounded                  -1.417  -2.678 -0.371             7 35

  Rolling fits of the authors' bounded model (training through t-1):
 year    y  mu_nb  mu_ls   K_nb   K_ls
 2021 49.0   56.3   56.3 2500.0 2500.0
 2022 75.0   58.2   57.6 2500.0 2500.0
 2023 93.0   77.3   78.6 2500.0 2500.0
 2024 63.0   99.0  101.9 2500.0 2500.0
 2025 52.0   98.3   75.7 2500.0  918.3

======================================================================================
9. Revised Figure 3
======================================================================================
  saved build/reanalysis/figura3_revisada.png

Done in 334 s. Outputs in build/reanalysis
