============================================================
METAFRONTIER REPLICATION —  2026-08-31 10:02:50 
Package version: 0.3.1 
R version: R version 4.5.1 (2025-06-13 ucrt) 
============================================================

=== TARGET 1: Code examples (§4.1–4.5) ===

--- §4.1: simulate_metafrontier ---
  [PASS] sim nrow = 600
  [PASS] sim ncol includes log_y,log_x1,log_x2,group,true_te,true_tgr
  [PASS] row1 log_y
  [PASS] row1 true_te
  [PASS] row1 true_tgr = 1 (G1)

--- §4.2: Deterministic metafrontier ---
  [PASS] G1 intercept
  [PASS] G1 log_x1
  [PASS] G1 log_x2
  [PASS] meta intercept
  [PASS] meta log_x1
  [PASS] meta log_x2
  [PASS] G1 Mean_TE
  [PASS] G1 Mean_TGR
  [PASS] G2 Mean_TE
  [PASS] G2 Mean_TGR
  [PASS] G3 Mean_TE_star
  [PASS] G2 TGR mean
  [PASS] G3 TGR mean

--- §4.3: Stochastic metafrontier ---
  [PASS] stoch intercept
  [PASS] stoch log_x1
  [PASS] stoch log_x2
  [PASS] stoch CI intercept lower
  [PASS] stoch CI intercept upper

--- §4.4: DEA metafrontier ---
  [PASS] DEA G1 TGR mean
  [PASS] DEA G2 TGR mean
  [PASS] DEA G3 TGR mean

--- §4.5: Identity check and poolability ---
  [PASS] TE* = TE x TGR identity
  [PASS] poolability LR stat
  [PASS] poolability p-value < 0.001

Target 1 summary: 29/29 checks passed

=== TARGET 2: Real-data example (§4.6) ===

  [PASS] utility Regulated N
  [PASS] utility Retail access N
  [PASS] utility Regulated TGR mean
  [PASS] utility Retail access TGR mean

Target 2 summary: 4 new checks passed

=== TARGET 3: Monte Carlo — Table 5 (§6.1–6.3) ===
Running 500 replications (this takes ~5 minutes)...

  rep 50/500
  rep 100/500
  rep 150/500
  rep 200/500
  rep 250/500
  rep 300/500
  rep 350/500
  rep 400/500
  rep 450/500
  rep 500/500

MC completed in 58.9 seconds
Converged: 500 / 500

--- Table 5 replication ---
                  Det bias    Sto bias    Det SD      Sto SD
beta_1 (0.5):     -0.0001      +0.0009      0.0131        0.0146
beta_2 (0.3):     -0.0003      -0.0002      0.0133        0.0145
Intercept (1.0):  -0.0204      -0.1710      0.0897        0.1136
  [PASS] MC beta1 det bias
  [PASS] MC beta1 sto bias
  [PASS] MC beta2 det bias
  [PASS] MC beta2 sto bias
  [PASS] MC intercept det bias
  [PASS] MC intercept sto bias
  [PASS] MC beta1 det SD
  [PASS] MC beta1 sto SD

TGR rank correlation: det=0.882, sto=0.866
  [PASS] MC TGR rank corr det
  [PASS] MC TGR rank corr sto
  [PASS] MC convergence rate = 100%

=== TARGET 4: Small-sample MC (§6.4) ===
Running 500 replications with n=30/group...

  rep 100/500
  rep 200/500
  rep 300/500
  rep 400/500
  rep 500/500

Small-sample MC completed in 27.4 seconds
Converged: 500 / 500
Slope biases: beta1=-0.0033, beta2=-0.0022
TGR rank correlation: 0.873
  [PASS] small-sample TGR rank corr
  [PASS] small-sample slope bias beta1 < 0.01
  [PASS] small-sample slope bias beta2 < 0.01

=== TARGET 5: Murphy–Topel SEs (Table 4) ===

Uncorrected SEs: 0.1222 0.0057 0.0056 
Murphy-Topel SEs: 0.1328 0.0095 0.0099 
Ratios: 1.0862 1.6759 1.7703 
  [PASS] MT ratio intercept
  [PASS] MT ratio log_x1
  [PASS] MT ratio log_x2
  [PASS] MT SEs uniformly larger

=== TARGET 6: Bootstrap CIs (Table 3) ===

  [PASS] boot class
  [PASS] boot R_effective > 0
  [PASS] boot CI matrix dimensions
  [PASS] boot G1 mean TGR
  [PASS] boot G2 mean TGR
  [PASS] boot G3 mean TGR
  [PASS] boot G2 CIs non-degenerate

=== TARGET 7: Scenario A efficiency recovery ===
Running 500 replications x 3 estimators (this takes several minutes)...

  rep 50/500
  rep 100/500
  rep 150/500
  rep 200/500
  rep 250/500
  rep 300/500
  rep 350/500
  rep 400/500
  rep 450/500
  rep 500/500

Scenario A efficiency recovery completed in 124.0 seconds
Successful replications (all 3 estimators): 500 / 500

--- Scenario A efficiency recovery (means over replications) ---
Deterministic SFA  TE true=0.829 est=0.850 rho=0.575 | TE* true=0.697 est=0.717 rho=0.897 | TGR true=0.835 est=0.840 rho=0.883
Stochastic SFA     TE true=0.829 est=0.850 rho=0.575 | TE* true=0.697 est=0.828 rho=0.880 | TGR true=0.835 est=0.969 rho=0.866
DEA (VRS)          TE true=0.829 est=0.891 rho=0.502 | TE* true=0.697 est=0.830 rho=0.730 | TGR true=0.835 est=0.929 rho=0.833
  [PASS] ScenA n successful
  [PASS] ScenA det TGR est mean
  [PASS] ScenA det TGR rank corr
  [PASS] ScenA det TE* rank corr
  [PASS] ScenA DEA TGR est mean
  [PASS] ScenA DEA TGR rank corr

=== TARGET 8: Scenario B efficiency recovery ===
Running 500 replications x 3 estimators (this takes several minutes)...

  rep 50/500
  rep 100/500
  rep 150/500
  rep 200/500
  rep 250/500
  rep 300/500
  rep 350/500
  rep 400/500
  rep 450/500
  rep 500/500

Scenario B efficiency recovery completed in 124.7 seconds
Successful replications (all 3 estimators): 500 / 500 (0 failed)

--- Scenario B efficiency recovery (means over successful replications) ---
Deterministic SFA  TE true=0.828 est=0.845 rho=0.547 | TE* true=0.766 est=0.513 rho=0.644 | TGR true=0.925 est=0.608 rho=0.761
Stochastic SFA     TE true=0.828 est=0.845 rho=0.547 | TE* true=0.766 est=0.852 rho=0.661 | TGR true=0.925 est=1.010 rho=0.794
DEA (VRS)          TE true=0.828 est=0.898 rho=0.502 | TE* true=0.766 est=0.810 rho=0.566 | TGR true=0.925 est=0.902 rho=0.731
  [PASS] ScenB det TGR est mean
  [PASS] ScenB true TGR mean
  [PASS] ScenB det TGR rank corr
  [PASS] ScenB DEA TGR est mean
  [PASS] ScenB DEA TGR rank corr

=== TARGET 9: LP vs QP TGR difference ===

Max abs LP vs QP TGR difference over 50 designs: 2.5473e-12
  [PASS] LP vs QP max TGR diff < 1e-9

=== TARGET 10: Unbalanced groups (200 vs 20 firms) ===
Running 500 replications...

  rep 100/500
  rep 200/500
  rep 300/500
  rep 400/500
  rep 500/500

Unbalanced MC completed in 16.9 seconds
Replications completed without error: 500 / 500
Replications with convergence code zero at every stage: 500
Slope biases: beta1=-0.0002, beta2=-0.0010
Overall TGR rank correlation: 0.598
Mean TGR bias in the 20-firm group: -0.0188
  [PASS] Unbalanced n complete
  [PASS] Unbalanced slope bias beta1
  [PASS] Unbalanced slope bias beta2
  [PASS] Unbalanced TGR rank corr
  [PASS] Unbalanced small-group TGR bias

============================================================
REPLICATION COMPLETE
============================================================
Total time: 6.5 minutes
Checks passed: 75 / 75
Checks failed: 0 / 75

*** ALL CHECKS PASSED — FULL REPLICATION SUCCESSFUL ***

Results saved to: replication-log.txt
============================================================

--- sessionInfo() ---
R version 4.5.1 (2025-06-13 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 11 x64 (build 26200)

Matrix products: default
  LAPACK version 3.12.1

locale:
[1] LC_COLLATE=Norwegian Bokmål_Norway.utf8 
[2] LC_CTYPE=Norwegian Bokmål_Norway.utf8   
[3] LC_MONETARY=Norwegian Bokmål_Norway.utf8
[4] LC_NUMERIC=C                            
[5] LC_TIME=Norwegian Bokmål_Norway.utf8    

time zone: Europe/Oslo
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] sfaR_1.0.1         metafrontier_0.3.1

loaded via a namespace (and not attached):
 [1] sandwich_3.1-1           generics_0.1.4           lattice_0.22-9          
 [4] marqLevAlg_2.0.8         cubature_2.1.4-1         digest_0.6.39           
 [7] magrittr_2.0.5           lpSolveAPI_5.5.2.0-17.15 grid_4.5.1              
[10] RColorBrewer_1.1-3       nleqslv_3.3.5            iterators_1.0.14        
[13] mnorm_1.2.2              Matrix_1.7-4             foreach_1.5.2           
[16] doParallel_1.0.17        rngWELL_0.10-10          fastGHQuad_1.0.1        
[19] Formula_1.2-5            plm_2.6-7                httr_1.4.8              
[22] scales_1.4.0             trustOptim_0.8.7.4       randtoolbox_2.0.5       
[25] codetools_0.2-20         numDeriv_2016.8-1.1      Rdpack_2.6.6            
[28] cli_3.6.6                rlang_1.2.0              rbibutils_2.4.1         
[31] miscTools_0.6-30         texreg_1.39.5            ucminf_1.2.2            
[34] tools_4.5.1              parallel_4.5.1           bdsmatrix_1.3-7         
[37] dplyr_1.2.0              hpa_1.3.4                ggplot2_4.0.2           
[40] qrng_0.0-11              maxLik_1.5-2.2           vctrs_0.7.3             
[43] R6_2.6.1                 zoo_1.8-15               lifecycle_1.0.5         
[46] MASS_7.3-65              pkgconfig_2.0.3          RcppParallel_5.1.11-2   
[49] pillar_1.11.1            gtable_0.3.6             glue_1.8.0              
[52] Rcpp_1.1.1               collapse_2.1.6           tibble_3.3.1            
[55] lmtest_0.9-40            tidyselect_1.2.1         farver_2.1.2            
[58] nlme_3.1-168             compiler_4.5.1           quadprog_1.5-8          
[61] S7_0.2.1                
