Skip to content

AineiasGV/Replication_Package-Energy_Compet_Growth-Vafiadakis-Stravelakis-2025

Repository files navigation

Replication Package

This repository reproduces all empirical results for the paper. We estimate country-specific VAR(1) models in first-differenced natural logs for k, gdp, nx, ren with an intercept. Identification is recursive (Cholesky) with the ordering k → gdp → nx → ren. Inference uses a fixed-design residual bootstrap (B = 2000) for coefficients and IRFs; confidence bands are reported as percentile and BCa (bias-corrected and accelerated). For comparison, asymptotic (delta-method) IRF bands are also provided.


1) Repository structure

/Strave_MATLAB/

  • raw_data/ # Step 0 outputs (automated EPL pipeline & transformed)
  • utils/ # manifest_* helpers, sha256_file, verify_manifest
  • GR_MATLAB_code/ # Greece scripts
  • BEL_MATLAB_code/ # Belgium scripts
  • GR_MATLAB_output/ # Greece outputs
  • BEL_MATLAB_output/ # Belgium outputs
  • config_paths.m # central paths & run constants
  • step0_source_data.m # Step 0: fetch OWID/WB & build transforms

Scripts ("CTY" ∈ {Belgium, Greece}):

  • step0_source_data.m
  • step1_load__data.m
  • step2_estimate_var_.m
  • step2b_estimate_var_Diagnostics_.m
  • step2c_var_Cointegration_.m
  • step3_orthogonalized_irf_.m
  • step4_bootstrap_coeff_SE_IRF_CI_.m
  • step4b_IRF_asymptotic_CIS_.m
  • step5_Biased_Corr_bootstrap_coeff_IRF_CI_.m

2) Data (retrieved: Aug 2025)

Step 0:

  1. Fetch OWID chart CSV for renewables share and filter to target countries.
  2. Fetch World Bank indicators via API (constant 2015 US$): GDP, K, X, IMP.
  3. Build analysis-ready transforms per country:
    • gdp = Δ ln(GDP_2015USD)
    • k = Δ ln(K_2015USD)
    • nx = Δ ln(X_2015USD) − Δ ln(IMP_2015USD)
    • ren = Δ ln(REN_share), where REN_share = share_electricity_renewables / 100 ∈ (0,1]
  4. Write outputs under /raw_data: OWID CSV (+META), WB_* CSVs (+META), merged_<CTY>_raw.csv (+META), and merged_<CTY>_transforms.csv (+TRANSFORMS.txt).

3) Software & reproducibility

  • MATLAB: R2024a (or R2020a+). No extra toolboxes required (Econometrics Toolbox optional).
  • EViews: v9 used for stationarity tests.
  • Random seed: 12345 (set in all bootstrap routines).
  • OS: Developed on Windows.
  • Provenance: Each step appends SHA-256 hashes to MANIFEST.txt via utils/manifest_*; verify with utils/verify_manifest.m.

4) Data details

  • Primary inputs are created by Step 0 and stored in /Strave_MATLAB/raw_data.
  • Core file used in Step 1 (Greece example): merged_GRC_transforms.csv.
  • Column order (required after Step 1 load): year, k, gdp, nx, ren.
  • Units: first-differenced natural logs (Δ ln) by construction (see Step 0).
  • Frequency: annual, analysis window 1990–2023.
  • Missing values: rows with missing entries are dropped before differencing.
  • Sources & license: OWID (renewables chart CSV) and World Bank WDI (constant 2015 US$); CC BY / CC BY 4.0.

5) How to run (example: Greece)

a) Source data & transforms (automated)
Run step0_source_data.m
Outputs (under raw_data): OWID & WB CSVs (+META), merged_GRC_raw.csv (+META), merged_GRC_transforms.csv (+TRANSFORMS.txt)

b) Load prepared Δln data
Run step1_load_GREECE_data.m
Output: GR_prepared.mat

c) Estimate VAR(1)
Run step2_estimate_var_GREECE.m
Output: GR_VAR_estimates.mat

d) Diagnostics
Run step2b_estimate_var_Diagnostics_GREECE.m
Outputs: GR_VAR_diagnostics.mat, GR_DIAGNOSTICS.txt

e) Orthogonalized IRFs (point)
Run step3_orthogonalized_irf_GREECE.m
Outputs: GR_IRFs_point.mat, GR_IRFs_point_tidy.csv, GR_IRFs_point_H10.(png|pdf|emf)

f) Bootstrap (coefficients & IRFs)
Run step4_bootstrap_coeff_SE_IRF_CI_GREECE.m
Outputs: GR_bootstrap_results.mat, GR_coefficients_bootstrap_(csv|xlsx), GR_IRFs_Bands_95.(png|pdf|emf)

g) Asymptotic benchmark (delta method)
Run step4b_IRF_asymptotic_CIS_GREECE.m
Outputs: GR_asymptotic_results.mat, GR_IRFs_Asymptotic_(Normal|Percentile)_95.(png|pdf|emf)

h) BCa IRF bands
Run step5_Biased_Corr_bootstrap_coeff_IRF_CI_GREECE.m
Outputs: GR_BCa_IRF_bands.mat, GR_IRF_BCa_tidy_95.csv, GR_IRFs_BCa_95.(png|pdf|emf)

For Belgium, run the corresponding BEL scripts. Outputs are saved in BEL_MATLAB_output/.


6) Paths & configuration

Default paths (configurable in config_paths.m):

  • Base (repo): ...\OneDrive\Υπολογιστής\Strave\Strave_MATLAB
  • Data (Step 0 output): ...\Strave_MATLAB\raw_data
  • Output (Greece): ...\Strave_MATLAB\GR_MATLAB_output
  • Output (Belgium): ...\Strave_MATLAB\BEL_MATLAB_output
  • config_paths.m also centralizes IRF horizon H, bootstrap draws B, and the RNG seed.

7) Methods summary

  • Model: VAR(1) in Δ ln with intercept; variable order (k, gdp, nx, ren).
  • Identification: recursive (Cholesky, lower-triangular Σ_u).
  • IRFs: Ψ(h) = A^h * P, with P = chol(Σ_u), horizons h = 0…10.
  • Diagnostics: LM tests (lags 1–2), White heteroskedasticity (cross-terms), Jarque–Bera per equation and joint, stability via companion eigenvalues.
  • Cointegration (reference): system-wide Johansen trace/max-eig (focus on r = 0) for no-const and unrestricted-const cases; reported for context only.
  • Bootstrap: fixed-design residual bootstrap; resample centered residuals, simulate with observed initial condition, re-estimate, recompute IRFs; report percentile CIs.
  • BCa: jackknife to compute z0 and acceleration a; apply BCa adjustment to bootstrap IRFs.
  • Asymptotic benchmark: simulate vec(B̂) ~ N(vec(B̂), Σ_u ⊗ (X’X)^{-1}); report normal ± z*sd and percentile bands.
  • Reproducibility: IRF(0) equals the Cholesky column; unstable draws skipped; fixed seed.

8) Expected outputs

  • Prepared data: *_prepared.mat
  • VAR estimates: *_VAR_estimates.mat
  • Diagnostics: *_VAR_diagnostics.mat, *_DIAGNOSTICS.txt
  • IRFs: *_IRFs_point.mat, *_IRFs_point_tidy.csv, figures (PNG/PDF/EMF)
  • Bootstrap results: *_bootstrap_results.mat, coefficients tables (CSV/XLSX)
  • IRF bands: percentile and BCa (MAT, CSV, PNG, PDF, EMF)
  • Asymptotic results: *_asymptotic_results.mat and figures
  • MANIFEST: per-step MANIFEST.txt with SHA-256 hashes of key artifacts

9) Troubleshooting

  • Ensure Step 0 completed and raw_data contains merged_<CTY>_transforms.csv.
  • Ensure column order after Step 1 is (year, k, gdp, nx, ren).
  • Cholesky errors: covariance is stabilized with a ridge; persistent issues may indicate outliers.
  • Update baseDir/rawDir/outBase in config_paths.m if using different paths.
  • EMF export is Windows-specific; PNG and PDF are cross-platform.

10) Citation & references

If using this package, please cite the paper.

References

  • Efron & Tibshirani (1993) — An Introduction to the Bootstrap
  • Efron & Hastie (2016) — Computer Age Statistical Inference
  • Kilian (1998) — Small-sample confidence intervals for IRFs
  • Lütkepohl (2005) — New Introduction to Multiple Time Series Analysis
  • Lütkepohl & Kilian (2017) — Structural Vector Autoregressive Analysis
  • Runkle (1987) — Vector Autoregressions and Reality

11) License & contact

  • License: MIT
  • Contact: Aeneas Vafiadakis — aineias.edu@gmail.com
  • Issues may be reported via the GitHub issue tracker.

Aggregate process (table)

Paper artifact Script (section) Inputs Output filenames (canonical)
Step 0: EPL & transforms step0_source_data.m OWID CSV, WB API merged_<CTY>_raw.csv (+META); merged_<CTY>_transforms.csv (+TRANSFORMS.txt); OWID/WB CSVs (+META)
Step 1: load Δln data step1_load_<CTY>_data.m merged_<CTY>_transforms.csv <CTY>_prepared.mat; <CTY>_TRANSFORMS.txt; <CTY>_tidy.csv
VAR estimates step2_estimate_var_<CTY>.m <CTY>_prepared.mat <CTY>_VAR_estimates.mat
Diagnostics TXT & MAT step2b_estimate_var_Diagnostics_<CTY>.m prepared + estimates <CTY>_VAR_diagnostics.mat; <CTY>_DIAGNOSTICS.txt; GR_regression_diagnostics*.{csv,xlsx}
Johansen summary step2c_var_Cointegration_<CTY>.m prepared <CTY>_JOHANSEN_SYSTEM.txt; <CTY>_Johansen_system.mat
Point IRFs (grid) step3_orthogonalized_irf_<CTY>.m estimates <CTY>_IRFs_point.mat; <CTY>_IRFs_point_tidy.csv; <CTY>_IRFs_point_H10.{pdf,png,emf}
Percentile IRFs step4_bootstrap_coeff_SE_IRF_CI_<CTY>.m prepared + estimates <CTY>_bootstrap_results.mat; <CTY>_IRFs_Bands_95.{pdf,png,emf}; <CTY>_coefficients_bootstrap*.{csv,xlsx}
Asymptotic benchmarks step4b_IRF_asymptotic_CIS_<CTY>.m prepared + estimates GR_IRFs_Asymptotic_Normal_95.*; GR_IRFs_Asymptotic_Percentile_95.*
BCa IRFs (main) step5_Biased_Corr_bootstrap_coeff_IRF_CI_<CTY>.m prepared + boot draws <CTY>_BCa_IRF_bands.mat; <CTY>_IRF_BCa_tidy_95.csv; <CTY>_IRFs_BCa_95.{pdf,png,emf}

About

Replication Package for the working paper 'Energy Transition, Competitiveness and Growth: RVAR Evidence from Greece & Belgium' (Vafiadakis & Stravelakis, 2025).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages