# IR-SBL-St: Implicit-Reparameterization Sparse Bayesian Learning with Student-t Emissions
Reproduction package for the manuscript *"IR-SBL-St: A Variational Sparse
Bayesian Learning Framework with Student-t Emissions for Volatility Regime
Identification on the Johannesburg Stock Exchange"* (submitted to
*FinTech*, MDPI).
This deposit contains the complete code, data, results, figures, and
manuscript source needed to reproduce every table, figure, theorem-adjacent
diagnostic, and numeric claim in the paper directly from the raw JSE
return series.
## Repository structure
```
code/ All model code and experiment-runner scripts
data/ Preprocessed JSE ALSI AR(1) residual series
results/ Pickled/zipped output of the diagnostic experiments
figures/ The five figures used in the manuscript, as submitted
manuscript/ manuscript.tex, ref.bib, and the compiled manuscript.pdf
```
### `code/`
- `models.py` -- all six model implementations compared in Table 1
(Gaussian-HMM, GMM-ARD, MS-GARCH, BB-StM, HMM-St, and the proposed
IR-SBL-St), including the `nu_mode`/`estimator` ablation switches used
for Table 2.
- `models_ext.py` -- extends `models.py` with the `kl_mode` (closed-form
vs. Monte Carlo KL) and `precondition_mode` (Fisher/`Nk` vs. literal
`Nk/2` vs. none) switches used for the Equations 16-17 empirical
validation.
- `simulation.py` -- the Monte Carlo simulation study (known-truth
Student-t mixture: parameter recovery, runtime scaling, and the
duplicate-component merging logic reused by the power-curve analysis).
- `run_all.py` -- driver script reproducing Tables 1-3 and Figures 2-4
end to end from the raw returns file.
- `eq_validation.py` -- reproduces the Fisher-preconditioning and
closed-form-KL empirical validation (Section 6.7 / Table 6).
- `stability_power.py`, `run_bootstrap_resumable.py`,
`run_power_resumable.py` -- the bootstrap stability analysis and Monte
Carlo power/null-specificity diagnostics (Section 6.8 / Table 8).
- `IR_SBL_St_sensitivity.py` -- the hyperparameter sensitivity sweep over
`K_max`, ARD concentration `alpha0`, and learning rate (Section 6.9 /
Table 12, Figure 5).
- `requirements.txt` -- Python package dependencies (CPU-only; no GPU
required for any experiment in this paper).
### `data/`
- `resid_data.csv` -- the preprocessed AR(1)-residual JSE ALSI return
series (2015-01-05 to 2026-04-29), Eskom load-shedding stage, and
train/test split markers used throughout the paper.
### `results/`
Pickled raw output from the diagnostic experiments reported in the
paper, so the reported numbers can be inspected directly without
re-running the (CPU-hours-scale) full experiment suite:
- `eq_validation_results.pkl` -- Fisher-preconditioning / closed-form KL
validation (Table 6).
- `bootstrap_stability_final.pkl` -- 12-resample bootstrap stability
analysis of the real JSE fit (Table 9).
- `power_specificity_final.pkl` -- Monte Carlo power curve and
null-specificity check (Table 8).
- `sensitivity_results.zip` -- the full 70-fit hyperparameter sensitivity
sweep (Table 12, Figure 5): `sensitivity_results.csv` (raw, per-fit),
`sensitivity_summary.csv` (aggregated), `fig_sensitivity.pdf`.
### `figures/`
The five figures as they appear in the manuscript: `1.png` (model
architecture), `2.png` (inferred regime probabilities), `3.png` (latent
scale vs. squared residual), `4.png` (optimization trajectories), `5.pdf`
(hyperparameter sensitivity).
### `manuscript/`
`manuscript.tex` and `ref.bib` (MDPI FinTech class), plus the compiled
`manuscript.pdf` as submitted.
## Setup
```bash
cd code/
pip install -r requirements.txt
```
No GPU is required; every experiment in this paper runs on CPU.
## Reproducing the main results
```bash
python run_all.py
```
Runtime: roughly 4-6 minutes on a standard laptop CPU for Tables 1-3 and
Figures 2-4.
For the additional diagnostics reported in Sections 6.7-6.9:
```bash
python eq_validation.py # Table 6 (~10 min)
python run_bootstrap_resumable.py # Table 9, run repeatedly to completion (~30-40 min total)
python run_power_resumable.py # Table 8, run repeatedly to completion (~10 min total)
python IR_SBL_St_sensitivity.py # Table 12 / Figure 5 (~35-40 min)
```
(`run_bootstrap_resumable.py` and `run_power_resumable.py` are
checkpointed: each invocation makes partial progress and can be re-run
to continue.)
## Reproducibility notes
- Unless noted otherwise, all results use `seed=0` as the default; the
diagnostic experiments in `results/` were run across multiple seeds
per setting as described in the corresponding section of the paper.
Small differences in the last reported decimal can arise from
BLAS/threading nondeterminism in PyTorch across machines; the
qualitative conclusions (regime counts, model ranking, gradient-variance
ratios) are stable across runs.
- All reported theorems, propositions, and the lemma in Section 5.4 are
proved analytically in the manuscript and are not themselves
"reproduced" by code, but every empirical claim used to illustrate or
validate them (e.g., the measured 4.0x gradient-variance ratio matching
the theoretical prediction of Proposition 3) is reproducible from the
scripts above.
## License
Code: MIT License. Data: derived from public JSE market data and South
Africa's public Eskom load-shedding schedule; redistributed here for
research reproducibility.
## Citation
If you use this code or data, please cite the manuscript (full citation
to be added once published; see `manuscript/manuscript.pdf` for the
current version) and this Zenodo deposit:
```
[Author name], (2026). IR-SBL-St reproduction package [Data set/Code].
Zenodo.
doi.org to be assigned on publication]
```
## Contact
Prof. Ntebogang Dinah Moroke, North-West University, Mafikeng Campus,
Faculty of Economic and Management Sciences, South Africa.
ORCID: 0000-0001-8545-1860