M3a statistical sims implementation + Ada config

- Install hook: add three vital CRAN packages (HiddenMarkov, rugarch, rmgarch)
- M3a spec: document vital packages and hand-rolled implementations
- Ada config: create core_config.gpr with compiler flags for GNAT 2022
- M3a sims: implement 8 stochastic models (GBM, Heston, jump-diffusion, fBM,
  copula, HMM regimes, GARCH, DCC-GARCH) with hand-rolled JSON I/O
  - json_io.R: recursive-descent parser + emitter (no jsonlite)
  - sde_sims.R: GBM, Heston (Euler-Maruyama), jump-diffusion, fBM (Wood & Chan)
  - copula.R: empirical copula + tail-dependence
  - regimes_garch.R: lazy-load vital packages for regime/GARCH/DCC sims
  - main.R: Hub stdin/stdout protocol entry point

Non-Turing M1 law script design complete (S-expressions + fixed combinators).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-07-19 02:08:05 +00:00
parent 3da931ecad
commit eefdb2fb5f
18 changed files with 1425 additions and 12 deletions
+7 -6
View File
@@ -16,12 +16,13 @@ execution C5 (industry standard since 2001). Jump-diffusion C5 (Merton 1976). Pa
for crypto markets C1.
## 3. Language & location
**R 4.x** (apt `r-base-core`) · `src/economy/sims/statistical/`. Minimal dependencies:
`r-base-core` + `HiddenMarkov` (CRAN — Viterbi filter, forward-backward, Baum-Welch). GARCH,
Heston SDE, DCC, copula, jump-diffusion, and fBM are hand-rolled using base R primitives
(`optim`, `fft`, `arima`, matrix ops). JSON I/O for the Hub stdin/stdout protocol is
hand-rolled. Fractional Brownian motion via spectral methods (Hosking 1984 / Wood & Chan 1994)
uses base R `fft()`.
**R 4.x** (apt `r-base-core`) · `src/economy/sims/statistical/`. Vital CRAN packages only:
`HiddenMarkov` (Viterbi filter, forward-backward, Baum-Welch), `rugarch` (univariate GARCH
volatility — GJR/EGARCH families, ML fitting), `rmgarch` (DCC-GARCH cross-asset correlation).
Everything else is hand-rolled with base R primitives (`optim`, `fft`, `arima`, matrix ops):
Heston SDE (Euler–Maruyama), Merton jump-diffusion, GBM Monte Carlo, copula tail-dependence,
and fBM via spectral methods (Hosking 1984 / Wood & Chan 1994) on base `fft()`. JSON I/O for
the Hub stdin/stdout protocol is hand-rolled.
## 4. Does / does-not
- **Does:** run Monte Carlo price simulations (GBM, Merton jump-diffusion, Heston stochastic