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.
/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
- 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
- REN — Share of electricity generated by renewables (OWID): https://ourworldindata.org/grapher/share-electricity-renewables?tab=line&country=GRC~BEL&mapSelect=GRC~BEL
- GDP — GDP (constant 2015 US$) (World Bank): https://data.worldbank.org/indicator/NY.GDP.MKTP.KD
- K — Gross Fixed Capital Formation (constant 2015 US$) (World Bank): https://data.worldbank.org/indicator/NE.GDI.FTOT.KD
- X — Exports of goods and services (constant 2015 US$) (World Bank): https://data.worldbank.org/indicator/NE.EXP.GNFS.KD
- IMP — Imports of goods and services (constant 2015 US$) (World Bank): https://data.worldbank.org/indicator/NE.IMP.GNFS.KD
Step 0:
- Fetch OWID chart CSV for renewables share and filter to target countries.
- Fetch World Bank indicators via API (constant 2015 US$):
GDP,K,X,IMP. - 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), whereREN_share = share_electricity_renewables / 100 ∈ (0,1]
- Write outputs under
/raw_data: OWID CSV (+META),WB_*CSVs (+META),merged_<CTY>_raw.csv(+META), andmerged_<CTY>_transforms.csv(+TRANSFORMS.txt).
- 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.txtviautils/manifest_*; verify withutils/verify_manifest.m.
- 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.
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/.
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.malso centralizes IRF horizonH, bootstrap drawsB, and the RNGseed.
- Model: VAR(1) in
Δ lnwith intercept; variable order(k, gdp, nx, ren). - Identification: recursive (Cholesky, lower-triangular
Σ_u). - IRFs:
Ψ(h) = A^h * P, withP = chol(Σ_u), horizonsh = 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
z0and accelerationa; apply BCa adjustment to bootstrap IRFs. - Asymptotic benchmark: simulate
vec(B̂) ~ N(vec(B̂), Σ_u ⊗ (X’X)^{-1}); report normal± z*sdand percentile bands. - Reproducibility:
IRF(0)equals the Cholesky column; unstable draws skipped; fixed seed.
- 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.matand figures - MANIFEST: per-step
MANIFEST.txtwith SHA-256 hashes of key artifacts
- Ensure Step 0 completed and
raw_datacontainsmerged_<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/outBaseinconfig_paths.mif using different paths. - EMF export is Windows-specific;
PNGandPDFare cross-platform.
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
- License: MIT
- Contact: Aeneas Vafiadakis — aineias.edu@gmail.com
- Issues may be reported via the GitHub issue tracker.
| 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} |