SPB Git

spb/wp40_uqo

Public MIT

WP40 RAID: Phase 4 — HAR family (fit/rolling/batched), block bootstrap, R references (highfrequency, rugarch), statsmodels HAR refs, Monte Carlo tests, calendar one-offs, Python/CLI HAR+bootstrap

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Simon-Pierre Boucher committed (Nov 2, 2026) parent 3905e5b Browse files

22 changed files +2,956 −35

modified RESEARCH_STATUS.md +6 −6
@@ -1,6 +1,6 @@
1 # RESEARCH_STATUS.md — RAID (UQO WP 40) 1 # RESEARCH_STATUS.md — RAID (UQO WP 40)
2 2
3−Last update: 2026-11-02 (Phase 3 passed). Legend: ✅ verified by tests/artifacts · 🧪 implemented, validation pending · 3+Last update: 2026-11-02 (Phase 4 passed). Legend: ✅ verified by tests/artifacts · 🧪 implemented, validation pending ·
4 🧭 experimental · ⛔ blocked · ⏳ planned · ✖ not implemented (deliberately). 4 🧭 experimental · ⛔ blocked · ⏳ planned · ✖ not implemented (deliberately).
5 5
6 ## Phases 6 ## Phases
@@ -10,7 +10,7 @@ Last update: 2026-11-02 (Phase 3 passed). Legend: ✅ verified by tests/artifact
10 | 1 Foundation | clean build + tests + docs | ✅ passed 2026-11-02 | `ctest` 26/26 (314 assertions), `pytest` 7/7, `docs/PROGRESS.md` Phase 1 | 10 | 1 Foundation | clean build + tests + docs | ✅ passed 2026-11-02 | `ctest` 26/26 (314 assertions), `pytest` 7/7, `docs/PROGRESS.md` Phase 1 |
11 | 2 Data | offline synthetic tests + opt-in live tests | ✅ passed 2026-11-02 | offline `[findata]` 4/4, live `[live]` 2/2 (60 assertions), `docs/operations/findata.md` | 11 | 2 Data | offline synthetic tests + opt-in live tests | ✅ passed 2026-11-02 | offline `[findata]` 4/4, live `[live]` 2/2 (60 assertions), `docs/operations/findata.md` |
12 | 3 Numerical primitives | accuracy + measured break-even | ✅ passed 2026-11-02 | `[metal]` 6 cases / 6 411 assertions; `experiments/results/bench_primitives_summary.json` (Metal wins: fused realized ≥ 39 k elements up to 3.4×, GARCH NLL P=64 up to 7.9×; CPU wins: rolling sums, GARCH P=1, small panels) | 12 | 3 Numerical primitives | accuracy + measured break-even | ✅ passed 2026-11-02 | `[metal]` 6 cases / 6 411 assertions; `experiments/results/bench_primitives_summary.json` (Metal wins: fused realized ≥ 39 k elements up to 3.4×, GARCH NLL P=64 up to 7.9×; CPU wins: rolling sums, GARCH P=1, small panels) |
13−| 4 Econometrics (Tier A) | references + Monte Carlo | ⏳ | — | 13+| 4 Econometrics (Tier A) | references + Monte Carlo | ✅ passed 2026-11-02 | R (highfrequency/rugarch) + statsmodels/arch references, `tests/simulation` Monte Carlo, `docs/methods/registry.md` |
14 | 5 Extensions (Tier B) | per-feature specs + tests | ⏳ | — | 14 | 5 Extensions (Tier B) | per-feature specs + tests | ⏳ | — |
15 | 6 Benchmarking E1–E7 | every claim traceable | ⏳ | — | 15 | 6 Benchmarking E1–E7 | every claim traceable | ⏳ | — |
16 | 7 Manuscript | reproducible build, no placeholders | ⏳ | — | 16 | 7 Manuscript | reproducible build, no placeholders | ⏳ | — |
@@ -22,9 +22,9 @@ Last update: 2026-11-02 (Phase 3 passed). Legend: ✅ verified by tests/artifact
22 | returns (log/arith), lag/lead, rolling windows, calendar-aware aggregation | A | ✅ | ⏳ (Phase 3) | numpy; exchange_calendars (calendar exact 2000–2026) | ✅ CPU | 22 | returns (log/arith), lag/lead, rolling windows, calendar-aware aggregation | A | ✅ | ⏳ (Phase 3) | numpy; exchange_calendars (calendar exact 2000–2026) | ✅ CPU |
23 | RV, BPV, RSV±, RQ, jump proxy, TriPV, rCov/rCorr | A | ✅ (numpy truth 1e−12) | ✅ fused kernel 1e−6 vs FP64 | highfrequency 1.0.3 (R comparison Phase 4) | ✅ CPU | 23 | RV, BPV, RSV±, RQ, jump proxy, TriPV, rCov/rCorr | A | ✅ (numpy truth 1e−12) | ✅ fused kernel 1e−6 vs FP64 | highfrequency 1.0.3 (R comparison Phase 4) | ✅ CPU |
24 | OLS/WLS/ridge, HC0–3, HAC, cluster, rolling OLS | A | ✅ (statsmodels 1e−9) | ✅ sufficient statistics 1e−6 (k ≤ 8) | statsmodels 0.15, scipy 1.18 | ✅ CPU | 24 | OLS/WLS/ridge, HC0–3, HAC, cluster, rolling OLS | A | ✅ (statsmodels 1e−9) | ✅ sufficient statistics 1e−6 (k ≤ 8) | statsmodels 0.15, scipy 1.18 | ✅ CPU |
25−| HAR-RV, log-HAR, HAR-X, HARQ | A | ⏳ | ⏳ | highfrequency `HARmodel`, statsmodels | ⏳ | 25+| HAR-RV, log-HAR, HAR-X, HARQ, rolling, batched | A | ✅ (highfrequency 1e−8, statsmodels 1e−9) | ✅ batched sufficient statistics | highfrequency 1.0.3, statsmodels 0.15 | ✅ |
26 | GARCH(1,1), GJR, EGARCH (N, t), QMLE/Hessian/OPG SE, forecasts | A | ✅ (arch 8.0: loglik 5e−4, params 5 %) | ✅ batched NLL 2e−5 (grids) | arch 8.0 ✅, rugarch 1.5.6 (Phase 4) | ✅ CPU | 26 | GARCH(1,1), GJR, EGARCH (N, t), QMLE/Hessian/OPG SE, forecasts | A | ✅ (arch 8.0: loglik 5e−4, params 5 %) | ✅ batched NLL 2e−5 (grids) | arch 8.0 ✅, rugarch 1.5.6 (Phase 4) | ✅ CPU |
27−| Bootstrap (stationary / circular block), Monte Carlo | A | ⏳ | ⏳ | arch.bootstrap | ⏳ | 27+| Bootstrap (stationary / circular / iid), Monte Carlo harness | A | ✅ (theory + MC coverage) | ⏳ GPU replicas (E5) | theory (Politis–Romano) | ✅ |
28 | VAR, GFEVD, Diebold–Yilmaz | B | ⏳ | ⏳ | statsmodels VAR | ⏳ | 28 | VAR, GFEVD, Diebold–Yilmaz | B | ⏳ | ⏳ | statsmodels VAR | ⏳ |
29 | Realized GARCH, HEAVY, DCC, PCA/shrinkage, Kalman | B | ✖ until Tier A passes | | | ⏳ | 29 | Realized GARCH, HEAVY, DCC, PCA/shrinkage, Kalman | B | ✖ until Tier A passes | | | ⏳ |
30 | Pre-averaging, realized kernels, MSRV, BNS test | C | ✖ (1-min bars) | | highfrequency | 🧭 only if validated | 30 | Pre-averaging, realized kernels, MSRV, BNS test | C | ✖ (1-min bars) | | highfrequency | 🧭 only if validated |
@@ -35,5 +35,5 @@ Last update: 2026-11-02 (Phase 3 passed). Legend: ✅ verified by tests/artifact
35 not tested unless they come back. 35 not tested unless they come back.
36 36
37 ## Next safe action 37 ## Next safe action
38−Phase 4: HAR family (fit, rolling, batched via GPU sufficient statistics), block bootstrap, R references 38+Phase 5 (Tier B, selected for research value): VAR(p) + generalized FEVD + Diebold–Yilmaz connectedness (rolling, batched
39−(highfrequency / rugarch), Monte Carlo (bias/RMSE/coverage), gradient checks, registry completion. 39+realized-covariance inputs) for E4; shrinkage covariance; then Phase 6 experiments E1–E7.
modified bindings/python/raid_py.cpp +29 −0
@@ -12,6 +12,9 @@
12 #include "raid/estimators/ols.hpp" 12 #include "raid/estimators/ols.hpp"
13 #include "raid/estimators/realized.hpp" 13 #include "raid/estimators/realized.hpp"
14 #include "raid/models/garch.hpp" 14 #include "raid/models/garch.hpp"
15+#include "raid/estimators/har.hpp"
16+#include "raid/statistics/bootstrap.hpp"
17+#include "raid/statistics/reductions.hpp"
15 #include "raid/data/bar_series.hpp" 18 #include "raid/data/bar_series.hpp"
16 #include "raid/data/calendar.hpp" 19 #include "raid/data/calendar.hpp"
17 #include "raid/data/returns.hpp" 20 #include "raid/data/returns.hpp"
@@ -94,6 +97,32 @@ NB_MODULE(_core, m) {
94 97
95 m.def("calendar_sessions", [](const std::string& a, const std::string& b) { MarketCalendar cal; std::vector<std::string> out; for (auto d : cal.sessions(date_from_iso(a), date_from_iso(b))) out.push_back(d.iso()); return out; }); 98 m.def("calendar_sessions", [](const std::string& a, const std::string& b) { MarketCalendar cal; std::vector<std::string> out; for (auto d : cal.sessions(date_from_iso(a), date_from_iso(b))) out.push_back(d.iso()); return out; });
96 99
100+ // ---- HAR family ----
101+ m.def("har_fit", [](F64 rv, std::vector<usize> lags, int horizon, bool log_model, bool harq, std::optional<F64> rq, const std::string& cov, int hac_lags, const std::string& target) {
102+ est::HarSpec s; s.lags = lags; s.horizon = horizon; s.log = log_model; s.harq = harq; s.cov.type = stats::covtype_from_string(cov); s.cov.hac_lags = hac_lags; s.target = target == "single" ? est::HarTarget::single : est::HarTarget::average;
103+ std::span<const f64> rvs(rv.data(), rv.shape(0)); std::span<const f64> rqs; if (rq) rqs = std::span<const f64>(rq->data(), rq->shape(0));
104+ json out; { nb::gil_scoped_release rel; auto e = est::har_fit(rvs, s, rqs); out = e.to_json(); out["forecast_next"] = est::har_forecast(e, rvs, s, rqs); }
105+ return json_to_py(out);
106+ }, nb::arg("rv"), nb::arg("lags") = std::vector<usize>{1, 5, 22}, nb::arg("horizon") = 1, nb::arg("log") = false, nb::arg("harq") = false, nb::arg("rq") = nb::none(), nb::arg("cov") = "hac", nb::arg("hac_lags") = -1, nb::arg("target") = "average");
107+ m.def("har_rolling", [](F64 rv, std::vector<usize> lags, int horizon, bool log_model, usize window, usize step, bool harq, std::optional<F64> rq) {
108+ est::HarSpec s; s.lags = lags; s.horizon = horizon; s.log = log_model; s.harq = harq; std::span<const f64> rvs(rv.data(), rv.shape(0)); std::span<const f64> rqs; if (rq) rqs = std::span<const f64>(rq->data(), rq->shape(0));
109+ est::HarRolling r; { nb::gil_scoped_release rel; r = est::har_rolling(rvs, s, window, step, rqs); }
110+ nb::dict d; std::vector<int64_t> o(r.origin.begin(), r.origin.end()); d["origin"] = to_np_i64(std::move(o)); d["forecast"] = to_np(r.forecast); d["actual"] = to_np(r.actual); d["n_fits"] = r.n_fits; d["seconds"] = r.seconds;
111+ auto l = est::forecast_loss(r.actual, r.forecast); d["mse"] = l.mse; d["qlike"] = l.qlike; d["n_loss"] = l.n; return d;
112+ }, nb::arg("rv"), nb::arg("lags") = std::vector<usize>{1, 5, 22}, nb::arg("horizon") = 1, nb::arg("log") = false, nb::arg("window") = 1000, nb::arg("step") = 1, nb::arg("harq") = false, nb::arg("rq") = nb::none());
113+ m.def("har_batch", [](F64 rv, I64 off, std::vector<usize> lags, int horizon, bool log_model, const std::string& backend_s) {
114+ est::HarSpec s; s.lags = lags; s.horizon = horizon; s.log = log_model; ExecutionPlan p; p.backend = backend_from_string(backend_s);
115+ est::HarBatchResult r; { nb::gil_scoped_release rel; r = est::har_batch(std::span<const f64>(rv.data(), rv.shape(0)), std::span<const i64>(off.data(), off.shape(0)), s, p); }
116+ nb::list fits; for (auto& e : r.fits) fits.append(json_to_py(e.to_json())); nb::dict d; d["fits"] = fits; d["backend"] = std::string(to_string(r.stats.backend)); d["precision"] = std::string(to_string(r.stats.precision)); d["wall_seconds"] = r.stats.wall_seconds; d["device_seconds"] = r.stats.device_seconds; return d;
117+ }, nb::arg("rv"), nb::arg("offsets"), nb::arg("lags") = std::vector<usize>{1, 5, 22}, nb::arg("horizon") = 1, nb::arg("log") = false, nb::arg("backend") = "auto");
118+ // ---- bootstrap ----
119+ m.def("bootstrap", [](F64 x, const std::string& stat, const std::string& scheme, double mean_block, usize replicas, uint64_t seed, double level) {
120+ stats::BootstrapOptions o; o.scheme = scheme == "circular" ? stats::BootstrapScheme::circular_block : (scheme == "iid" ? stats::BootstrapScheme::iid : stats::BootstrapScheme::stationary); o.mean_block = mean_block; o.replicas = replicas; o.seed = seed; o.ci_level = level;
121+ std::function<f64(std::span<const f64>)> f; if (stat == "mean") f = [](std::span<const f64> v) { return stats::mean<f64>(v); }; else if (stat == "rv" || stat == "sum_squares") f = [](std::span<const f64> v) { return stats::sum_squares<f64>(v); }; else if (stat == "variance") f = [](std::span<const f64> v) { return stats::variance<f64>(v); }; else throw RaidError(ErrorCode::invalid_argument, "stat must be mean|rv|variance");
122+ stats::BootstrapResult r; { nb::gil_scoped_release rel; r = stats::bootstrap(std::span<const f64>(x.data(), x.shape(0)), f, o); }
123+ nb::dict d; d["point"] = r.point; d["se"] = r.se; d["ci_lo"] = r.ci_lo; d["ci_hi"] = r.ci_hi; d["bias"] = r.bias; d["failures"] = r.failures; d["block_length"] = r.block_length; d["statistics"] = to_np(r.statistics); d["seconds"] = r.seconds; return d;
124+ }, nb::arg("x"), nb::arg("stat") = "mean", nb::arg("scheme") = "stationary", nb::arg("mean_block") = 0.0, nb::arg("replicas") = 999, nb::arg("seed") = 20261102, nb::arg("level") = 0.95);
125+
97 // ---- FinData client (keys from FINDATA_API_KEY / FINDATA_API_KEY_FILE; never passed through Python) ---- 126 // ---- FinData client (keys from FINDATA_API_KEY / FINDATA_API_KEY_FILE; never passed through Python) ----
98 m.def("findata_bars", [](const std::string& symbol, const std::string& interval, const std::string& start, const std::string& end, const std::string& adjustment, const std::string& cache_dir, bool offline) { 127 m.def("findata_bars", [](const std::string& symbol, const std::string& interval, const std::string& start, const std::string& end, const std::string& adjustment, const std::string& cache_dir, bool offline) {
99 findata::Config cfg = findata::Config::from_env(); if (!cache_dir.empty()) cfg.cache_dir = cache_dir; cfg.offline = offline; findata::Client cl(cfg); 128 findata::Config cfg = findata::Config::from_env(); if (!cache_dir.empty()) cfg.cache_dir = cache_dir; cfg.offline = offline; findata::Client cl(cfg);
modified cli/raid.cpp +10 −0
@@ -18,6 +18,7 @@
18 #include "raid/estimators/realized.hpp" 18 #include "raid/estimators/realized.hpp"
19 #include "raid/estimators/ols.hpp" 19 #include "raid/estimators/ols.hpp"
20 #include "raid/models/garch.hpp" 20 #include "raid/models/garch.hpp"
21+#include "raid/estimators/har.hpp"
21 #ifdef RAID_WITH_FINDATA 22 #ifdef RAID_WITH_FINDATA
22 #include "raid/data/findata.hpp" 23 #include "raid/data/findata.hpp"
23 #endif 24 #endif
@@ -34,6 +35,7 @@ void usage() {
34 " raid estimate realized <bars> [--backend auto|cpu|metal] [--bpv-no-fs] per-session realized measures\n" 35 " raid estimate realized <bars> [--backend auto|cpu|metal] [--bpv-no-fs] per-session realized measures\n"
35 " raid estimate garch <bars> [--model garch|gjr|egarch] [--dist gaussian|student_t] [--horizon H] [--returns daily|intraday]\n" 36 " raid estimate garch <bars> [--model garch|gjr|egarch] [--dist gaussian|student_t] [--horizon H] [--returns daily|intraday]\n"
36 " raid estimate ols <csv y,x1,x2...> [--cov classical|hc0..hc3|hac|cluster] [--lags L]\n" 37 " raid estimate ols <csv y,x1,x2...> [--cov classical|hc0..hc3|hac|cluster] [--lags L]\n"
38+ " raid estimate har <bars> [--horizon h] [--log] [--harq] [--window W --step S] daily RV from 1m bars → HAR fit (+ rolling forecasts)\n"
37 " raid data ... FinData access (Phase 2)\n" 39 " raid data ... FinData access (Phase 2)\n"
38 " raid benchmark ... benchmark harness (Phase 3+)\n", RAID_VERSION); 40 " raid benchmark ... benchmark harness (Phase 3+)\n", RAID_VERSION);
39 } 41 }
@@ -89,6 +91,14 @@ int cmd_estimate(const std::vector<std::string>& a) {
89 try { auto e = models::garch_fit(r, go); out[sym] = e.to_json(); } catch (const RaidError& ex) { out[sym] = {{"error", ex.what()}}; } } 91 try { auto e = models::garch_fit(r, go); out[sym] = e.to_json(); } catch (const RaidError& ex) { out[sym] = {{"error", ex.what()}}; } }
90 std::cout << out.dump(1) << "\n"; return 0; 92 std::cout << out.dump(1) << "\n"; return 0;
91 } 93 }
94+ if (what == "har") {
95+ auto bars = load_bars(path); MarketCalendar cal; json out = json::object(); est::HarSpec s; s.horizon = std::stoi(arg(a, "--horizon", "1")); s.log = flag(a, "--log"); s.harq = flag(a, "--harq");
96+ for (auto& [sym, b0] : bars) { auto b = b0; b.normalize(); auto reg = b.filter_session(cal, SessionPolicy::regular); auto ir = data::intraday_returns(reg); est::RealizedOptions ro; ro.plan = plan; auto m = est::realized_measures(ir, ro);
97+ try { auto e = est::har_fit(m.rv, s, m.rq); json j = e.to_json(); j["forecast_next"] = est::har_forecast(e, m.rv, s, m.rq); j["n_sessions"] = m.rv.size();
98+ if (!arg(a, "--window").empty()) { auto r = est::har_rolling(m.rv, s, static_cast<usize>(std::stoul(arg(a, "--window"))), static_cast<usize>(std::stoul(arg(a, "--step", "1"))), m.rq); auto l = est::forecast_loss(r.actual, r.forecast); j["rolling"] = {{"n_fits", r.n_fits}, {"mse", l.mse}, {"qlike", l.qlike}, {"seconds", r.seconds}}; }
99+ out[sym] = j; } catch (const RaidError& ex) { out[sym] = {{"error", ex.what()}}; } }
100+ std::cout << out.dump(1) << "\n"; return 0;
101+ }
92 if (what == "ols") { 102 if (what == "ols") {
93 std::ifstream f(path); RAID_REQUIRE(f.good(), io, "cannot open " + path); std::string line; std::getline(f, line); 103 std::ifstream f(path); RAID_REQUIRE(f.good(), io, "cannot open " + path); std::string line; std::getline(f, line);
94 std::vector<std::string> names; { usize s = 0; for (usize i = 0; i <= line.size(); ++i) if (i == line.size() || line[i] == ',') { names.push_back(line.substr(s, i - s)); s = i + 1; } } 104 std::vector<std::string> names; { usize s = 0; for (usize i = 0; i <= line.size(); ++i) if (i == line.size() || line[i] == ',') { names.push_back(line.substr(s, i - s)); s = i + 1; } }
added datasets/fixtures/har_rv.csv +1501 −0
@@ -0,0 +1,1501 @@
1+rv,rq
2+0.00010000000000000009,1.4405505785837637e-08
3+6.3328360608245278e-05,5.8457908532148236e-09
4+4.735392494116195e-05,2.8915512147545496e-09
5+4.3772372296844666e-05,2.3507104508857125e-09
6+7.6272793543610479e-05,7.7019251835855382e-09
7+5.4619899802699215e-05,2.9980959338279616e-09
8+4.3441504925126849e-05,2.2491120759492536e-09
9+4.7679144275385566e-05,2.5789861759974905e-09
10+0.00010372970093747665,1.6072885476575217e-08
11+7.108118056210782e-05,7.2904823577695472e-09
12+5.9592783040528097e-05,4.8651066372349026e-09
13+7.519981368398477e-05,6.0030901703153299e-09
14+8.6792138369599597e-05,1.0926306707785091e-08
15+0.00010568360711704954,1.501391131310545e-08
16+8.2733987669243058e-05,9.0312559806971966e-09
17+6.0235323379755125e-05,4.1468894089209222e-09
18+4.110481777812044e-05,1.7835179165626757e-09
19+6.1230578704997925e-05,5.2846218810178925e-09
20+6.5286629824018403e-05,6.3686948136536427e-09
21+8.8006494273294573e-05,8.2080908016950806e-09
22+9.3106346145575337e-05,9.0994563454820669e-09
23+0.00016589587353684114,3.6879479922538509e-08
24+0.00017996587973620492,4.0969752915690145e-08
25+0.00016118777696453465,3.254738949660456e-08
26+0.00014215997716062698,2.0668035090489348e-08
27+0.00010430723023348266,1.4361299098377497e-08
28+8.8213197077851438e-05,9.5746552739581861e-09
29+8.0589904909768236e-05,7.4996919664111637e-09
30+0.00015804542838804614,3.5521666383678481e-08
31+0.00012772720025827817,2.2045748448063965e-08
32+9.3486926351336682e-05,1.0384678407101521e-08
33+0.0001050699428118745,1.1895306492747391e-08
34+0.00013819853847982664,2.1672699648560212e-08
35+7.9866894789802403e-05,7.2950093938329374e-09
36+3.3626808595935305e-05,1.26138684204291e-09
37+4.1847147168608125e-05,1.818111902587141e-09
38+8.1887378552536388e-05,7.7354708406924213e-09
39+6.5920643497778886e-05,4.4238782543079141e-09
40+9.6084165973750867e-05,1.2805032726138758e-08
41+0.00011090142110921326,1.2701144728808645e-08
42+0.00014172575968156723,2.9125463878506157e-08
43+9.8848941447141802e-05,1.3775585775363813e-08
44+8.6171620822518203e-05,7.7790296409194131e-09
45+0.00017145269149963462,3.6233338669838028e-08
46+0.00019224972823194756,3.8099973296279259e-08
47+5.80627160164585e-05,3.8999143881771987e-09
48+0.0001130938065422844,1.5868851870496025e-08
49+0.00024371572207406708,6.5218728623863564e-08
50+0.0001676228700116649,4.2069956317544517e-08
51+0.00019917287927743009,4.4639420546664094e-08
52+0.00011520198291787633,1.7810125490647562e-08
53+0.00011270065965677967,1.8099128743512548e-08
54+0.00011250565784489241,1.3278081519704562e-08
55+8.4583913467279045e-05,9.1933015090385829e-09
56+0.00012789057291449956,2.2059307294042244e-08
57+0.00014777973610786415,2.2576041410933114e-08
58+0.00016985974964642094,3.8764945217385767e-08
59+0.00020798870975328052,4.4998895979216774e-08
60+6.9885745403057189e-05,5.4490269604967011e-09
61+8.9430564746528841e-05,8.5973031258527259e-09
62+4.8797836512109514e-05,2.6853342029450698e-09
63+5.1155225143286407e-05,3.1882999621257537e-09
64+6.1532185104798141e-05,4.3534184581962642e-09
65+4.602032388876992e-05,3.1267042771399209e-09
66+6.087383799210071e-05,5.3439374141231573e-09
67+4.1169108295041356e-05,1.7105872704468924e-09
68+4.4639155154950822e-05,2.7771354448123583e-09
69+8.0370281040046342e-05,8.6581083368376567e-09
70+5.7688289587857187e-05,4.6518752862767097e-09
71+7.2707361438514474e-05,6.285346071405861e-09
72+4.3150266969788614e-05,2.1079927373333253e-09
73+6.2182554789271891e-05,4.4559093245388832e-09
74+3.5547298632941716e-05,1.3664048491425626e-09
75+3.2336239668369105e-05,1.1411648433607441e-09
76+2.2892748972472851e-05,5.4005093503578139e-10
77+3.9017075692884282e-05,2.0659736397395156e-09
78+3.4363843603561887e-05,1.4372395842970005e-09
79+3.7768539117161634e-05,1.9555626097253645e-09
80+5.5608315241996902e-05,4.0285106076457656e-09
81+9.495622628915399e-05,9.4975115388102091e-09
82+0.00012075182221443614,1.7742888738007114e-08
83+0.00010366646977946964,1.3871683893877352e-08
84+0.00018309090377095866,4.4730621345731043e-08
85+0.00021574403620057739,5.6873582368402868e-08
86+0.00016033191342021955,3.4222334895165218e-08
87+0.00029524409856851311,9.5208237837946376e-08
88+0.00014538693289917551,2.3865118559053892e-08
89+0.0001230154040645433,2.0821831408332563e-08
90+0.00019426841234193679,4.4874313708930941e-08
91+0.00021248430138282067,6.1390021739364239e-08
92+0.00020622106624640146,5.6950876258613656e-08
93+0.00014577146661019666,2.8924039131400655e-08
94+8.849246516914541e-05,9.2618730139723343e-09
95+7.9484071376788337e-05,7.4930077987263806e-09
96+0.00010543354775035837,1.4042547844029122e-08
97+8.5997587504944999e-05,1.0578253214611148e-08
98+5.203225468468112e-05,2.9746798932897801e-09
99+5.5463102746352212e-05,3.7868615468273752e-09
100+0.00015972300506320904,3.3204135610437961e-08
101+0.00020926140478594565,6.3442702338639946e-08
102+0.00040474323939777699,2.0703460464419671e-07
103+0.0002822073439864779,1.0331078413436207e-07
104+0.00020366797632913357,5.5025071217726528e-08
105+0.00014047847556854579,2.2531434562939176e-08
106+0.0002752401704489624,9.6259763017339006e-08
107+0.00015453092956090034,3.1663123267710143e-08
108+0.00013907244129505243,2.7274751820318475e-08
109+0.00017545217625634658,3.4817822612752479e-08
110+9.022204845835242e-05,1.1353267486925884e-08
111+7.8913671171194436e-05,9.0461925621854703e-09
112+6.4020152694301824e-05,6.1073459648769872e-09
113+7.1961126703031433e-05,7.5593985361473772e-09
114+0.00010363675080400878,1.4689114371355169e-08
115+7.6885902601847491e-05,7.4693414948764468e-09
116+0.00010258456016755281,1.0863457054007705e-08
117+8.0850924925293121e-05,7.0625034056745101e-09
118+8.6328397296555508e-05,1.1158658563286452e-08
119+8.5193439584333488e-05,9.4828229318971873e-09
120+6.7413638591793702e-05,4.6905427836938319e-09
121+4.2758006650950521e-05,2.237707657938565e-09
122+5.0584413774008995e-05,2.7493742070329457e-09
123+5.7056426383593604e-05,3.7534805781988037e-09
124+0.00016126597708017191,2.9509717984389842e-08
125+0.0002442474085627346,6.6657318239851568e-08
126+0.0003233285825672374,1.4113315972023555e-07
127+0.00019436112406991427,4.6342652526323968e-08
128+0.00029417362634421201,1.1619970983016829e-07
129+0.00034441132124924436,1.4413030872153624e-07
130+0.00027989385245351633,7.9103965133578985e-08
131+0.00040074631487730495,2.0242402956580712e-07
132+0.00033092907680000151,1.5687600640076096e-07
133+0.0002983630173988616,1.1945761834194381e-07
134+0.00022665218811186393,7.4437358160846893e-08
135+0.00013601308699839459,2.7262518463304052e-08
136+0.00021614517441976758,6.7025598393992245e-08
137+0.00010866287556651908,1.6903222649380552e-08
138+0.00012748902103248088,2.1637599144235496e-08
139+7.5779522138073806e-05,8.2461998538364272e-09
140+8.9522437419467578e-05,8.9943223148784641e-09
141+6.5145526018845046e-05,6.1283421279398071e-09
142+0.00011013831000918839,1.2570296162344414e-08
143+8.9654650183107744e-05,8.2950687834250852e-09
144+8.1748833672386256e-05,9.9650326165940379e-09
145+6.5267460967209618e-05,5.8730218776908812e-09
146+5.7836121365137354e-05,3.6724855362210332e-09
147+5.2400507364212844e-05,2.8901375403407135e-09
148+0.00011057499854236544,1.4442411235787337e-08
149+0.00011962178896928292,1.8865426464818469e-08
150+7.9325028461078685e-05,7.9338075155837072e-09
151+0.00014781237733230767,2.43633131715108e-08
152+0.00015155113758276095,2.7462976221594666e-08
153+0.00019082442627126978,5.4029454466883508e-08
154+0.00024214401744905879,7.9333845978466118e-08
155+0.00012296175121681964,2.0041005585797199e-08
156+9.2114784751426486e-05,9.0997306702498047e-09
157+0.00010224133096365215,1.0665839519528526e-08
158+0.00020858264392286898,5.0745412286613246e-08
159+0.00026196553324563365,9.3524541644135947e-08
160+0.00010459568930190152,1.1265824210550406e-08
161+5.5389774653539768e-05,3.5040180860417956e-09
162+0.00012161066653792054,1.8921717202016512e-08
163+0.00012496542721575091,2.0090718307831775e-08
164+0.00018237212016546241,4.0252555346655152e-08
165+0.0002533057576813087,7.7427704630914776e-08
166+9.2848800910687939e-05,8.6764399505456429e-09
167+0.00013893402999186333,2.8862379940478855e-08
168+0.00012472244395763814,2.2333047764451103e-08
169+0.00011626811087861832,1.7961932101825275e-08
170+0.00026056566058541768,8.2532996393658417e-08
171+0.00020340749693656979,4.5212745273411704e-08
172+0.0001343899249302987,2.0732413307034011e-08
173+7.1483142300146052e-05,6.9060887154592001e-09
174+0.0001669078794181886,3.3054012066258031e-08
175+0.00019914601063936708,5.7566608065446493e-08
176+0.00010441877881434704,1.2569254534164447e-08
177+0.00011598391704323882,1.3708313185213953e-08
178+0.00013475489230286398,1.9583513128902819e-08
179+5.9835464208879106e-05,4.5680208283605945e-09
180+8.775384595530041e-05,9.1171677982127394e-09
181+7.0581789719200062e-05,5.6608329267661922e-09
182+0.00012691819814470963,2.0239123827621483e-08
183+9.367344259306911e-05,1.2468457200351894e-08
184+9.4515750927348961e-05,1.2693121645029642e-08
185+3.8988624232738166e-05,2.0001574640898515e-09
186+3.5191095101943765e-05,1.5008487242934362e-09
187+3.1345746335553796e-05,1.0653532686350382e-09
188+9.5315725319364118e-05,9.9787500815009172e-09
189+8.6892729745937785e-05,9.4886559776577468e-09
190+9.7563720117789293e-05,1.2683156354666158e-08
191+7.0059035641051892e-05,5.2745526723645076e-09
192+5.9674208247108859e-05,3.7636757894867601e-09
193+7.3961571180690519e-05,6.883604033914095e-09
194+0.00022057438233797423,6.3380586418249858e-08
195+0.00013509595635420308,2.7211992487838203e-08
196+0.00024670260763484317,8.5484518359752931e-08
197+0.00035223486140870678,1.3798011172950215e-07
198+0.00026711092946066125,8.9279473052616109e-08
199+0.00026980280571216466,9.0354892886100141e-08
200+0.00032007147838398824,1.0654096708895757e-07
201+0.00016052122721345465,3.2025773902655691e-08
202+0.00012717680856973539,1.7515351593108141e-08
203+8.8581481702901618e-05,1.1258383712805863e-08
204+8.4467351051480775e-05,7.6595845159092676e-09
205+0.00011788470691246586,1.4455414379246464e-08
206+0.00028021280354358227,1.1506116265944366e-07
207+0.00029426793621382171,1.2249000457673324e-07
208+0.00027391809254792234,1.10944088230275e-07
209+8.547441593165159e-05,8.4096180744741025e-09
210+0.00015579180526731327,2.9659944005817043e-08
211+0.00010754070497267883,1.6880616777254691e-08
212+0.00014706386368373595,2.560112673626659e-08
213+0.00017616149296878657,3.179542542464602e-08
214+0.00027513531779862555,1.044472914513479e-07
215+0.000181893961959533,3.6827092782148085e-08
216+0.00018454172357179908,4.5266509961290522e-08
217+0.00016649940345223762,3.5556002227601616e-08
218+0.00013200745799930459,2.3164312965030525e-08
219+0.0001861482507736353,4.9720839954358491e-08
220+0.0001416244719737273,2.331360918845109e-08
221+0.00012138255733425131,1.8957245458468766e-08
222+0.00015408699420419326,3.3969289361262967e-08
223+0.00022203741372493155,6.1078323592167132e-08
224+5.1746881329414514e-05,3.6312135045968732e-09
225+6.6757827580333321e-05,5.5133625415378266e-09
226+7.3919535479465465e-05,8.1644353336467734e-09
227+0.00026547247767993938,9.9982333670178773e-08
228+4.3092776671361529e-05,2.0097973987302333e-09
229+5.9962968174539861e-05,4.9823993528013972e-09
230+7.9401498064342367e-05,7.6602386160553312e-09
231+7.6074493398083231e-05,7.5015480107249738e-09
232+0.00014464219017977417,3.0106511725158855e-08
233+0.00014131143633457722,2.5638487570810528e-08
234+0.0001302415978355424,1.946694243888579e-08
235+5.0947696269194378e-05,3.0038511824877482e-09
236+7.4580832039912155e-05,7.3560717914570296e-09
237+0.00010282807534332023,1.3364180649756897e-08
238+0.00019813625378728813,4.4024705609206571e-08
239+0.00017604496145242799,3.5502325027114845e-08
240+0.00031589127614944907,1.3835775420618289e-07
241+0.00052100705080737131,3.9504836733697791e-07
242+0.00024375638521213091,8.1135266245579882e-08
243+0.0003102907722107397,1.1513965311630114e-07
244+0.00013740756540091116,2.0169814514937036e-08
245+7.006648161625411e-05,5.1259313583124558e-09
246+0.00011034404985396717,1.7847164634409414e-08
247+0.00013970966594014858,2.2834196950386489e-08
248+0.00012090639852409316,1.8551544132624604e-08
249+7.786493529961827e-05,8.4435218615377187e-09
250+4.9077900242519607e-05,2.5421755243834971e-09
251+6.5999863171346942e-05,6.4907943687971341e-09
252+6.0016101692424829e-05,3.9648160056497845e-09
253+0.0001031314949311694,1.1808148380969765e-08
254+0.00015511115442165186,3.5472676505089405e-08
255+8.4280065072782448e-05,7.9895849984084921e-09
256+7.8467366153467415e-05,7.2647816106345515e-09
257+6.2308422017793053e-05,5.1829210102143666e-09
258+6.9944215562160075e-05,7.2379901565250755e-09
259+6.4284151612812172e-05,4.7504583724670957e-09
260+4.5514863289180117e-05,2.3121555442905651e-09
261+3.5503827824029109e-05,1.5652788121379011e-09
262+3.323739905728216e-05,1.3432695340475259e-09
263+4.0003660591531288e-05,1.9266337530786206e-09
264+2.1023182663427053e-05,5.3637430252717326e-10
265+2.6421632248017649e-05,7.7219126172762805e-10
266+5.8500208475851022e-05,5.1038930224837298e-09
267+7.9945683372462182e-05,6.8072959702889423e-09
268+6.2787386915034917e-05,4.7561379593398483e-09
269+3.4229705830139901e-05,1.7466192286885742e-09
270+0.00010127930449144857,1.4014193868816126e-08
271+0.00013739488911934441,2.0815336859401874e-08
272+0.0001947500097437321,5.3411686296741239e-08
273+0.00015636741970193177,2.6141554975855207e-08
274+0.00013353163757579182,2.5087871640141134e-08
275+7.3596787083557907e-05,6.6983119649872388e-09
276+4.3057568001899588e-05,2.4617439388706652e-09
277+5.1654695418385675e-05,3.9988274852557549e-09
278+7.1262491068964487e-05,6.0041386622211344e-09
279+7.6037823637065631e-05,6.7620599345383405e-09
280+5.6114186162722714e-05,3.5650301489606472e-09
281+4.2835590063910845e-05,2.6566985349401625e-09
282+5.6416501903787042e-05,4.1278447350221711e-09
283+7.9172933875098014e-05,8.1434082636160207e-09
284+7.0273541225218081e-05,5.0472706227937847e-09
285+4.675933183864088e-05,2.3467177628405253e-09
286+8.1221395025965173e-05,8.4954452313440462e-09
287+9.6021977311690581e-05,1.1062586165022277e-08
288+4.610727164128142e-05,2.7910372032348836e-09
289+3.7604716263110476e-05,1.4911603160874196e-09
290+8.1225601075396334e-05,7.2106418345417223e-09
291+7.9056746313299568e-05,8.1400070055765847e-09
292+4.5443923200930361e-05,2.0885306580064658e-09
293+5.5814829111885204e-05,3.96663825385966e-09
294+7.1927250884325241e-05,6.6074404905425196e-09
295+9.2985074942901892e-05,9.1222223089933362e-09
296+7.6041188563993466e-05,8.56297734308239e-09
297+6.5346211227125601e-05,6.3360123538782531e-09
298+6.6548900086707682e-05,4.5232386046331083e-09
299+8.5720868621949812e-05,7.3848003166618433e-09
300+9.0918146780127087e-05,9.3486542862817444e-09
301+0.00015175706629591351,3.0127955445418164e-08
302+5.0215393639423547e-05,2.9194019328612444e-09
303+4.0712293497382606e-05,2.0896300930632257e-09
304+5.2223580065743348e-05,3.4296303300438429e-09
305+6.9244652091233932e-05,5.3852177737829951e-09
306+0.00013947349427466667,2.2068061087868937e-08
307+0.0001403105563064267,2.3105575903065618e-08
308+0.0001098000639054699,1.2086760802806138e-08
309+4.4540774313285586e-05,2.727523880985936e-09
310+5.3661145216022109e-05,3.4041765784192262e-09
311+5.8056011568856185e-05,3.8240224703727609e-09
312+0.00010352822431837142,1.0988507292157066e-08
313+8.9666363171910993e-05,9.0104142352228334e-09
314+8.2594303254089363e-05,7.9702233673596082e-09
315+5.7667736626575074e-05,4.8807584085287391e-09
316+4.6490782533174141e-05,2.8714236783645724e-09
317+6.0964486154807764e-05,4.920123706507387e-09
318+5.9014838830308736e-05,4.8581409551842741e-09
319+4.5403598939382315e-05,3.0651145209261766e-09
320+3.9957870623690603e-05,2.0979151451096439e-09
321+5.0930478519446854e-05,3.3130646295242813e-09
322+5.9375032687345025e-05,4.9115064148746838e-09
323+9.2267138116145639e-05,1.1910529825973387e-08
324+5.3534793114049959e-05,3.8060475503836585e-09
325+7.6744609805345945e-05,6.3807858175409875e-09
326+0.00013246549399797356,2.5944919145247038e-08
327+9.3507676008056686e-05,1.2824587410915348e-08
328+7.4826538262629406e-05,7.5374157520358413e-09
329+0.00012127283627183676,1.6665493850448401e-08
330+3.80467046508397e-05,2.1259929269235615e-09
331+4.5941650851043232e-05,2.2111230722379023e-09
332+4.1098085314484852e-05,2.2265483691767802e-09
333+0.00011839931360137951,1.903882855065874e-08
334+0.00019508505261254687,4.0473143235481516e-08
335+0.00023146076461439617,5.76450241359542e-08
336+0.00024276999832912742,6.1164778655773259e-08
337+0.0002472798520218322,7.2579974220642769e-08
338+0.00030352540167097086,1.2322243594804211e-07
339+0.00026944128316120264,1.0313475059256134e-07
340+0.00025840008333843749,9.382131321739364e-08
341+0.00015106721386107952,2.355142578086102e-08
342+7.4957677105530574e-05,5.6192298940954576e-09
343+4.4722523579748347e-05,2.7307239240306406e-09
344+6.5937481522843506e-05,5.4534888248550399e-09
345+7.9970942956917188e-05,9.4678605221596071e-09
346+0.00011531833984898028,1.8155850663618298e-08
347+5.8293956729095902e-05,3.7202770190140262e-09
348+0.00010471804190475633,1.4140465118691946e-08
349+8.3289928784816724e-05,7.6719794134578919e-09
350+4.914277358908666e-05,3.4880807223993363e-09
351+8.8209534170458607e-05,9.8741791804192507e-09
352+7.8884728086501976e-05,7.5920505473145464e-09
353+5.2124556356989746e-05,3.3587404643417659e-09
354+7.828927203344721e-05,7.1305935498648749e-09
355+0.00010075927611539037,1.1469769129880864e-08
356+8.1048700240100199e-05,8.5621193987587684e-09
357+9.826095486830324e-05,1.0674876246303847e-08
358+0.00015260621920374704,3.0534400261891433e-08
359+0.00011235652790071924,1.2965230572693661e-08
360+0.00015527101519822824,3.1975781727523184e-08
361+0.00011227849151378484,1.4490999515326876e-08
362+6.3932699561176982e-05,5.8945263767605894e-09
363+6.9269031005063578e-05,6.5089244560494246e-09
364+9.6866396274772562e-05,1.0438758574459312e-08
365+0.00010647629138868425,1.1838042630177918e-08
366+9.3321786990478438e-05,9.5578997143661418e-09
367+0.00013362612382497769,2.1217861384188261e-08
368+7.1160496438525057e-05,5.2920300722068026e-09
369+6.3119137121765253e-05,4.7016999377608876e-09
370+7.3455333976728835e-05,6.2929964868663656e-09
371+7.9466822274698826e-05,7.4379615132203714e-09
372+8.8957235580112257e-05,9.820505008714816e-09
373+9.8411624004454299e-05,1.2667481589099864e-08
374+0.00027172967866139511,9.6480510992760821e-08
375+0.00010212125261553596,1.1530935046674526e-08
376+9.9634546017718481e-05,1.4203950627683484e-08
377+0.00024077142938247142,6.9020091748346162e-08
378+0.00017124285421546298,3.7846035961496104e-08
379+0.0001416713206841248,2.5318476034598015e-08
380+0.00017843452447752187,4.1280106189646035e-08
381+0.00014298192646372229,3.0230591152593601e-08
382+0.00016801235770205099,4.0242945106064391e-08
383+0.00011013004643199864,1.3175364586008529e-08
384+0.00010953822258033056,1.3538273937874511e-08
385+0.00014235710018049508,2.8831035289402872e-08
386+0.00017034178339077335,3.1354421924118474e-08
387+0.00016182423897911371,2.6419084573465926e-08
388+0.00011759390111478323,1.4655714483680766e-08
389+0.0001211998515678488,1.8139410796387308e-08
390+4.0293583773631935e-05,2.002080474858696e-09
391+4.0502976035496944e-05,1.8318084754035279e-09
392+4.5551201580974906e-05,2.2987628642868023e-09
393+5.4480329462933044e-05,3.8426175630026503e-09
394+0.00011316366180244386,1.6450105612111515e-08
395+9.7832850585077342e-05,9.6893875925996529e-09
396+0.00010069042983442145,1.3118384123535951e-08
397+0.0002762327346361727,1.1346759836088944e-07
398+0.00028789840598842108,8.3367212386113956e-08
399+0.00019751473709386834,5.4194995754813537e-08
400+0.0001385482219340893,2.3943961839600389e-08
401+9.7315553271584552e-05,1.0905812020984487e-08
402+8.0136738134565494e-05,8.539738514311118e-09
403+9.7536914763503358e-05,1.0344208872908295e-08
404+0.0001569210700273195,3.6404489893017274e-08
405+9.4314879154539592e-05,1.3053356399039483e-08
406+8.685855269693912e-05,1.0797771126809099e-08
407+0.00014696783721759917,2.5263101089394539e-08
408+7.7084854665785785e-05,7.6742669053767026e-09
409+7.1880793177001885e-05,5.7164350815194429e-09
410+0.00011130297940782544,1.5655974153610632e-08
411+7.7220661700113982e-05,8.3813292005058803e-09
412+3.6228590543894594e-05,1.5477681122187829e-09
413+6.2192728594818121e-05,5.6860463189200239e-09
414+6.3138593328491242e-05,5.1179462353111651e-09
415+0.00013965966516290708,2.3755492199851628e-08
416+0.00011769262912516814,1.4463699685234442e-08
417+0.00015478658514780195,2.6207928182576154e-08
418+0.00013625057562466461,2.7670555791745665e-08
419+0.0002149943724977501,4.8432789942786816e-08
420+0.00013020933614248589,2.0300509396021672e-08
421+0.00017820413770208701,3.5100896616877834e-08
422+0.00012576226707833706,2.3157744089250918e-08
423+9.9550154543799518e-05,1.079975001985084e-08
424+0.0001759777911063467,4.291263065148973e-08
425+0.00011638497844115248,1.9685342251994218e-08
426+0.00018476989146659474,4.7038583554351609e-08
427+9.4185432530540091e-05,9.5730432614358436e-09
428+0.00014896045885886378,2.2858916526885419e-08
429+0.00024741469616072396,9.0859990956003376e-08
430+0.00036363937265708934,1.4873714303426696e-07
431+0.00020721788273303073,6.2215087289295649e-08
432+0.0001842125348546082,5.0572808970246539e-08
433+5.7623796742159573e-05,4.1257432782196985e-09
434+0.00011618348448276879,1.9025771775537491e-08
435+5.0037317233831166e-05,2.5571467935057519e-09
436+7.3451952591839108e-05,5.407826477683125e-09
437+8.0355030936959807e-05,7.8496889753725378e-09
438+7.0532520567320121e-05,6.6793743206511794e-09
439+9.6792584666340913e-05,1.2646188116855137e-08
440+5.9905949198847787e-05,3.737289912458922e-09
441+0.00012723097658710029,2.3674764956821106e-08
442+0.0002785127683590357,9.4769208880564963e-08
443+0.00027434380233879244,8.8657872372124309e-08
444+0.00021760251947035847,6.0191757597757443e-08
445+0.00012833919419305177,1.9084267449490405e-08
446+0.00013805760492475262,2.1322387369618561e-08
447+0.00013481624979072985,2.5760657304342827e-08
448+7.7868542716497564e-05,8.6993221919328259e-09
449+0.00011135800030027136,1.3211997078995451e-08
450+8.2275038323222329e-05,9.4467804528734605e-09
451+7.8199094541355689e-05,7.3643141218473056e-09
452+5.4367448694543207e-05,3.336184631741925e-09
453+9.6781860822908744e-05,1.3527446376540739e-08
454+6.2442184959987738e-05,5.539260279665186e-09
455+4.7138568289188041e-05,2.7162622371608079e-09
456+3.512537618836283e-05,1.8311971868061627e-09
457+8.5139147852358909e-05,1.008740055492399e-08
458+8.7848677929570394e-05,9.7103723568816937e-09
459+8.5937530459319862e-05,7.9483479740326213e-09
460+0.00010403176503063411,1.4713414051636133e-08
461+6.9134520509442357e-05,4.9963020466795217e-09
462+0.00012170430648472776,1.5273733332658733e-08
463+0.00011466790022064254,1.8712404877411151e-08
464+4.0558957762481615e-05,2.008904203739543e-09
465+4.7890599504162361e-05,3.1409341952757204e-09
466+4.8791032700319863e-05,2.7365401047533712e-09
467+3.4692912770919211e-05,1.771659527501952e-09
468+8.0605376424514922e-05,9.2915116271043078e-09
469+7.8750715583006427e-05,6.8625022463298477e-09
470+0.00013063284849856898,1.9796745432456599e-08
471+0.00022731412714601431,5.6946818360888348e-08
472+0.00026910296001531313,1.0376399840138849e-07
473+0.00021222006982799096,6.6002059188320094e-08
474+0.00019834778096877338,5.6244654299776243e-08
475+0.00015689581236532482,3.6663797635049236e-08
476+0.00014719739897037294,2.7999659139530103e-08
477+9.2161974057979065e-05,1.1213495271958364e-08
478+0.00012733082593941253,1.7191741520920114e-08
479+6.6642884098088375e-05,6.3141359257446712e-09
480+5.7132692617711185e-05,3.6032169539297367e-09
481+8.7584332482320044e-05,1.028381863093356e-08
482+0.00010268911278582948,1.2957124100837398e-08
483+8.8236835622954228e-05,8.3160292269201141e-09
484+0.00012147891184120068,2.0793421725849222e-08
485+0.00012993041028235477,1.9226388994998291e-08
486+5.8087219975920151e-05,4.2636388786600157e-09
487+0.00010738526016017441,1.2335119983187547e-08
488+8.5568737292767845e-05,1.0941004756789268e-08
489+0.00015649953976465096,2.7388454511234206e-08
490+9.7422533191397897e-05,1.0259505087596437e-08
491+7.9668183070768082e-05,9.3058055368929468e-09
492+4.3093150605787988e-05,2.3908327330601291e-09
493+6.0911646152074507e-05,4.3458814677348375e-09
494+7.0502570455653699e-05,7.2151809753629509e-09
495+3.0874270264403687e-05,1.2072513516869763e-09
496+3.2797852057643548e-05,1.5489110040064531e-09
497+2.0177132094394047e-05,5.625943923461352e-10
498+3.5934298700497495e-05,1.9273769226878448e-09
499+4.6499720632209772e-05,2.4910919878734592e-09
500+6.4858464916721842e-05,5.6033074149810484e-09
501+9.6931370608456478e-05,1.1374238613238514e-08
502+0.00015234880126833788,3.4635851385053881e-08
503+0.00016307361306733208,2.6779837396383047e-08
504+0.00016534491581656868,3.0395082807184535e-08
505+0.00010134757923800346,1.1824709583223465e-08
506+6.9673152253565043e-05,5.2851891355194909e-09
507+8.2736276119760088e-05,7.9689497409908002e-09
508+0.00011362580419750534,1.4072970228938199e-08
509+9.2167982038649307e-05,1.0144912873875229e-08
510+0.00013720301889054578,2.1770851658145502e-08
511+0.00024109908399490914,6.699600090735019e-08
512+0.00024953604768671305,7.9035101390167544e-08
513+0.0002786947305531501,1.0949413655305063e-07
514+0.00031356307872508379,1.0948031090264017e-07
515+0.00036347617748557105,1.4560829507750637e-07
516+0.00028418013691478933,1.1808619733218703e-07
517+0.00019651677351467089,4.0922584691641731e-08
518+0.00015480374373528515,3.147441077859336e-08
519+9.9767488468437311e-05,1.1947487017712083e-08
520+5.3942716794014619e-05,3.0235926423075614e-09
521+6.6798384448663733e-05,5.3433772110564622e-09
522+6.8811120021139527e-05,6.6738962041861856e-09
523+9.5927974065554119e-05,1.3329994352340056e-08
524+4.4957030521991276e-05,2.21467445799757e-09
525+6.3046211284285646e-05,5.5583893966934978e-09
526+6.4807417094471365e-05,5.9371173108810785e-09
527+0.00020393336818934124,5.0444757246864561e-08
528+0.00012777674242685883,1.7927402583077243e-08
529+0.00022434274617913786,7.1038775356578831e-08
530+0.00010761046818596612,1.4217311829263762e-08
531+0.00012074768094130336,2.0303016978008509e-08
532+8.8059720249858241e-05,8.7206987286114816e-09
533+8.8942123799297097e-05,9.0319316572831234e-09
534+5.9074126833432297e-05,3.7168024660702774e-09
535+4.7384445517718311e-05,2.3105654583005383e-09
536+7.4036922643909089e-05,7.6006573904340827e-09
537+0.00012020443888694678,1.5652485722883417e-08
538+0.00015799594436179324,2.7024368536414186e-08
539+0.00014031254416606352,2.7011183180109491e-08
540+0.00018868363074791268,4.2915179934367317e-08
541+0.00019865370491991505,4.8698688722485426e-08
542+0.00010621446436221265,1.4814342358464291e-08
543+0.00017401078849255065,3.4866296100144379e-08
544+0.0001243405219743388,1.6334692085644383e-08
545+0.00012197209145347773,1.9828220485383867e-08
546+0.00013103358365326406,2.1368711976944867e-08
547+0.00013186167186474319,1.9031337003090894e-08
548+0.00015590702616926361,3.3710001785141804e-08
549+0.00012562781133946421,2.2394348999933687e-08
550+8.3921458065598715e-05,9.7667138815061362e-09
551+0.00014064935857427603,2.6362331350680753e-08
552+0.00010761687396842157,1.5297678464135613e-08
553+0.00019741866250421692,4.1854760544242421e-08
554+0.00027378373903523908,8.8001057054266784e-08
555+0.00035134213402086557,1.7986160717098448e-07
556+0.00024433735633000263,8.6561948019660403e-08
557+7.0489411816621354e-05,5.1467303990714623e-09
558+8.179479436383305e-05,7.5627117004459417e-09
559+0.00010018087344497,1.0162314924780352e-08
560+8.0811910679015822e-05,9.3213984115784102e-09
561+0.00013861548657423007,1.9981485296022737e-08
562+0.00016510656985581435,3.4279840039069443e-08
563+0.00010723328823377977,1.5531668608682217e-08
564+0.0002243420498000281,6.1113798968424265e-08
565+0.00011541552093981115,1.8182009711329769e-08
566+0.00022905131373622716,7.1703716694469284e-08
567+9.2920784012394405e-05,8.8331454609278132e-09
568+9.3529897071483888e-05,1.2534239667189936e-08
569+6.0802901026842321e-05,4.0033884931750619e-09
570+7.3501975357161573e-05,7.7501241410965676e-09
571+4.3908848872897749e-05,2.0860434947596473e-09
572+4.6348728325011491e-05,3.1048730277725394e-09
573+5.0959962119908406e-05,2.6062417135632586e-09
574+6.0009972343208277e-05,4.5836767452789083e-09
575+0.00013974620428245456,2.1253527019739667e-08
576+6.3921908419632418e-05,4.3962115708853747e-09
577+5.2776677362464022e-05,2.8474598947019454e-09
578+4.188449103824819e-05,2.0767854989836254e-09
579+0.00012685364840232802,1.9011614662031364e-08
580+0.00011313611959068537,1.529559208162956e-08
581+6.9509344006836663e-05,6.4583829977191499e-09
582+5.2866849229971648e-05,3.9797615705706923e-09
583+7.6985197115817628e-05,6.8270151469678458e-09
584+6.3992759103413232e-05,5.1215079577221659e-09
585+4.9832965467718474e-05,3.4871095135489759e-09
586+6.4751026312580238e-05,5.8758577930821125e-09
587+3.9313415589023394e-05,1.5803981809025436e-09
588+6.0355366332614851e-05,5.3357944477562449e-09
589+6.7370734179695446e-05,4.9462681192028452e-09
590+9.3613560838076351e-05,9.1823319723036678e-09
591+0.0001075541183850564,1.4081787130349336e-08
592+0.00010740759957314411,1.6327529572602247e-08
593+6.9166763930732009e-05,6.8515269874950786e-09
594+5.8249670317693873e-05,4.0990429095676371e-09
595+5.6772373042539206e-05,4.7071511628992743e-09
596+5.2942146384608268e-05,4.0550088444825234e-09
597+3.2088428730645849e-05,1.4674081618821739e-09
598+4.6091585785383406e-05,2.6499525445106362e-09
599+6.4096778977697333e-05,5.303327813381318e-09
600+2.9117210871783992e-05,1.2412882989006059e-09
601+3.2753127594009526e-05,1.3845324891217889e-09
602+5.7003825891264038e-05,3.8663562121451553e-09
603+8.5762975281476777e-05,9.3459130637099969e-09
604+5.7226306878943857e-05,4.4718471615485692e-09
605+7.7422749128040977e-05,7.6598848986927719e-09
606+5.2894304407231957e-05,3.1526520429027896e-09
607+5.0529930439647783e-05,2.6383022790587811e-09
608+0.00010127763528258339,1.343676050901046e-08
609+9.3123627001334624e-05,1.1416611320877186e-08
610+3.9951625338739582e-05,1.679706834716997e-09
611+6.4367162415305965e-05,4.3780528754743123e-09
612+7.480836018524344e-05,7.5558372276486288e-09
613+4.7436793165336759e-05,2.49089223481078e-09
614+6.7950306711857529e-05,6.7925438500525766e-09
615+6.4366867687933995e-05,4.3579162843926468e-09
616+0.00020329904738034774,5.2494870303034169e-08
617+9.6683829886558015e-05,1.2112881336173277e-08
618+8.3407421364036541e-05,9.3637340466882062e-09
619+0.00011006297513947636,1.4896899197606274e-08
620+0.00011287811865459646,1.4544409739973714e-08
621+6.586588079279091e-05,5.4180449788484991e-09
622+0.00017438521336933451,4.1917358572442844e-08
623+0.00013029037245243806,2.05931439258193e-08
624+0.0001486467033989441,2.4662815850196143e-08
625+0.00010844427960212587,1.7320907190745279e-08
626+0.00010453558494252142,1.2561365175103357e-08
627+9.1966402133610137e-05,1.161608949903341e-08
628+8.3280445091604051e-05,9.140957862932406e-09
629+7.9656764828575226e-05,8.8566245695282137e-09
630+0.00011534542450081169,1.5400705739968845e-08
631+0.00010556957351119053,1.1265335008505069e-08
632+7.7876538066542749e-05,9.0187378218232219e-09
633+7.8151204106886168e-05,7.2801934396409849e-09
634+0.00014688182547236613,3.06762511883623e-08
635+4.7145188772921716e-05,3.18177730864936e-09
636+4.189386789970632e-05,2.1351922982128203e-09
637+4.7972857689952041e-05,3.1790719311374809e-09
638+8.974808454007467e-05,9.747249046086316e-09
639+7.7551421859494349e-05,8.1349352238076747e-09
640+4.5678452839826732e-05,2.976061185845508e-09
641+4.080210074885964e-05,2.2456773550553263e-09
642+6.5280377833728685e-05,4.7920230105190225e-09
643+0.00011184346724055216,1.3456839244629886e-08
644+6.7533704896338381e-05,5.469963742994573e-09
645+6.7318717584697915e-05,6.4315565347013229e-09
646+0.00010600841488998275,1.6834342543775204e-08
647+0.00010762790711637929,1.3729216502925666e-08
648+6.558949505552e-05,5.3037321789524411e-09
649+7.2764529173998928e-05,5.727265536608209e-09
650+6.7354672989144521e-05,5.4939612803728076e-09
651+7.779629377942193e-05,8.6490557935875154e-09
652+7.3874198072753719e-05,5.6644088163637459e-09
653+0.00010837768165838098,1.1915804927320723e-08
654+6.0369426734643672e-05,4.2762264117635786e-09
655+0.00013922942487493842,2.2840375859183259e-08
656+0.000167218133714899,3.0125476080726806e-08
657+0.00012350694846637996,2.0851704058597754e-08
658+0.00011885783076159735,1.7025356414490401e-08
659+8.188164693435179e-05,9.4771229821060971e-09
660+0.00012798887890996927,2.3254602786363717e-08
661+9.8725432228865493e-05,1.3680445298787268e-08
662+7.2630244680399071e-05,5.7734085408320903e-09
663+6.9696263872589542e-05,7.2061521125147553e-09
664+8.7147123001352346e-05,9.84885497692351e-09
665+0.00014229160409547312,2.3440377319011293e-08
666+0.00023428688273343599,8.2332547773165068e-08
667+0.00012487617395842257,1.8490819273745602e-08
668+0.00015193606905525493,2.7828076926152459e-08
669+0.00012198736808164072,1.9891843958700136e-08
670+0.00010972661426253134,1.3213976555009245e-08
671+0.00021133200901037402,5.5700309777081451e-08
672+0.0002047558131086883,4.572294162519115e-08
673+0.00019416643114633297,5.4932525240346787e-08
674+0.00014284255196937411,2.092490599139034e-08
675+0.00019024485596636051,4.5935686173681923e-08
676+0.00032796926871454503,1.1160718965883338e-07
677+0.0001997971488700547,4.1434392604462105e-08
678+0.00021174055291874589,5.2367902674420363e-08
679+4.9109801148896457e-05,2.9984709987068386e-09
680+5.1465152763234431e-05,2.8225062898655755e-09
681+5.3064697567818693e-05,3.1330918852909078e-09
682+6.7473267720244475e-05,5.2332255479239441e-09
683+9.057639101218908e-05,1.1918966898180578e-08
684+8.9258945171321599e-05,1.1943977440097293e-08
685+0.00010492887495131604,1.3124315454013998e-08
686+4.9112684642861853e-05,3.1660452373783831e-09
687+4.9709619095021045e-05,3.1105325260162207e-09
688+4.2070773244082569e-05,1.7754379305585799e-09
689+2.944585573684734e-05,9.8591210821882129e-10
690+8.6459931449748393e-05,7.7916112690066837e-09
691+9.4682496179437082e-05,1.2720014228386134e-08
692+8.3257608675326822e-05,8.7760163900061186e-09
693+0.00028476727348376445,1.0645867026358942e-07
694+0.0001956356910702846,5.5222930312829479e-08
695+0.00051550719213189287,3.9289058351642356e-07
696+0.00032458974609241758,1.3759550378288339e-07
697+0.00035988783414105753,1.7590685360296539e-07
698+0.00028034333901279707,1.1197681896127464e-07
699+0.00013764877158545027,1.9185470678682373e-08
700+8.8974189339830495e-05,1.1360784735206e-08
701+0.00010731613949985225,1.5901224198362156e-08
702+0.00018177301346486058,4.1255081144422364e-08
703+0.00010902071081585859,1.7023016703516474e-08
704+0.00012560863758974728,1.7755763359740039e-08
705+4.22845070142196e-05,2.584034221908187e-09
706+4.0522609779431704e-05,1.9612669617602655e-09
707+3.9965730056042557e-05,2.0788109003076401e-09
708+5.4785090035447107e-05,3.9540279735755524e-09
709+8.9590626975038023e-05,9.5483373099363769e-09
710+9.4043651796402517e-05,1.0501749881732725e-08
711+9.9348290001157933e-05,1.046790665108278e-08
712+7.2946728998487487e-05,7.5290552558135835e-09
713+4.4669022944144349e-05,2.1060360013023598e-09
714+5.9073672995945866e-05,5.0247362202530861e-09
715+8.8750265640902954e-05,8.7650914172003014e-09
716+5.2561329600974017e-05,3.1517133717031591e-09
717+0.00012631586478892705,1.8400485758847522e-08
718+0.00015488693964781661,3.0772305548717175e-08
719+9.2870341000557839e-05,8.9615996610400207e-09
720+0.00012126079485712305,2.1673785086735913e-08
721+0.00013229465581686794,1.868247443382914e-08
722+0.00012946053583617165,2.1683445785833162e-08
723+7.4340971793922781e-05,7.9034563240537484e-09
724+6.4476170490014844e-05,6.1468485907652383e-09
725+7.8803793321275789e-05,7.4767731730179989e-09
726+6.9405328285431625e-05,5.2298846443112341e-09
727+0.00012765936073589026,2.2638628313732221e-08
728+8.1658881688113886e-05,8.320180521566376e-09
729+8.8058804690070277e-05,9.3059529467416907e-09
730+0.00012889446492900684,2.0920077538340177e-08
731+0.00013433761123528013,2.2912052800495134e-08
732+0.00013043691817901074,2.1376416877854295e-08
733+0.00014395781940240588,3.103230842394837e-08
734+0.00023471253877285897,8.2603864415545668e-08
735+0.00013986489557499531,1.9698110867492685e-08
736+0.00020978685074560783,5.8213076316632229e-08
737+0.00028089364948381921,8.1611156741356414e-08
738+0.00013823353838375696,2.4726219155770014e-08
739+9.7215384200523714e-05,1.3354547117633167e-08
740+0.00010933478524627177,1.4751743323318446e-08
741+5.0523742927069816e-05,2.8029067163200567e-09
742+6.2655828760133805e-05,4.7457848206422558e-09
743+6.2651570260396949e-05,4.0840903347980675e-09
744+4.6272742381796838e-05,2.5305372467386773e-09
745+5.9929812427344659e-05,4.5928780420282894e-09
746+0.00010267268836937572,1.112306166790116e-08
747+8.9879452545301537e-05,1.0417936989198786e-08
748+8.84547030772318e-05,1.0597726853515574e-08
749+0.00013608775194005234,1.9779364548461035e-08
750+0.00012063291249028287,1.5766116679615238e-08
751+0.0001790644298954457,4.782411351781526e-08
752+0.00021652399921658969,4.7366556092388333e-08
753+0.0002380407813817183,8.2086638009388973e-08
754+0.00020472471773480295,4.5908663456854466e-08
755+0.00040756593671565456,1.7446885165566302e-07
756+0.00022442376201939159,6.3119409582875623e-08
757+0.00022599836049762618,5.3160805848229053e-08
758+7.51511484456728e-05,6.9333440429385705e-09
759+0.00013063963876207049,2.0183571744262572e-08
760+0.00011763737835232221,1.3926322133483797e-08
761+6.9697910992771433e-05,7.1460213628819609e-09
762+5.8334939010806558e-05,4.2330322419537149e-09
763+6.1171207943934818e-05,3.8302539346632766e-09
764+5.8932466909881144e-05,3.7401595883946704e-09
765+7.8581855580221483e-05,7.4685442025181322e-09
766+0.00010436943790576852,1.6312386504151011e-08
767+6.2764891597877381e-05,4.9543571066541839e-09
768+7.1247675584772604e-05,6.8876012084207479e-09
769+5.7156730062230423e-05,4.608963872131909e-09
770+5.4991495369501443e-05,4.0684813594201297e-09
771+5.9169006475528009e-05,5.0614785717624777e-09
772+8.5184232918184132e-05,7.8865964009891824e-09
773+7.7273126242455851e-05,7.4723152880001358e-09
774+0.00016167792815208437,3.4138819062097776e-08
775+7.9437139658325003e-05,8.2814686668465501e-09
776+6.3971898086811164e-05,5.2038625822793551e-09
777+5.2331211998409527e-05,3.2062776829525259e-09
778+5.6922434703218186e-05,4.2382476187946114e-09
779+0.00015158574307398996,2.3301487107508983e-08
780+0.00017737983086449965,4.3129916877915361e-08
781+9.9530231145786828e-05,1.3071365504525317e-08
782+9.2027240056979657e-05,9.1034051318017947e-09
783+0.0001106505948914295,1.2674930967363935e-08
784+0.00010213950235555786,1.52658665395394e-08
785+6.5450126539330994e-05,5.4715449521346635e-09
786+9.1332408928715785e-05,9.1923487965771192e-09
787+4.0038510839869969e-05,2.0628636983988592e-09
788+2.5912051296663018e-05,8.2870919935217508e-10
789+5.5945682442924105e-05,3.1711596947926312e-09
790+7.814814121065829e-05,6.1604251379116902e-09
791+9.4357469204955276e-05,1.0375472777590104e-08
792+0.00011062217815445768,1.7243695186763529e-08
793+3.208149021847016e-05,1.4018542463095864e-09
794+9.6075578511164609e-05,1.1226118358519695e-08
795+0.00013749762105805927,2.5164150406921078e-08
796+0.00012816498321195529,2.3273223831225576e-08
797+0.00013435917838854988,2.1938831900582619e-08
798+9.8450936161015307e-05,1.050999458443188e-08
799+0.00015181526863881816,2.5143570701484535e-08
800+0.00017898737113675617,3.7433098114759458e-08
801+9.6478522928708467e-05,1.2505929017923378e-08
802+8.1500116933645616e-05,7.5623764618309991e-09
803+8.1340541657380072e-05,7.0048213617087877e-09
804+5.3839127515279888e-05,3.4211097458083875e-09
805+3.6698312638878904e-05,1.563976810037949e-09
806+3.4337592127838068e-05,1.2504573772156771e-09
807+5.593305964317953e-05,4.1112565056017484e-09
808+8.3596139011387407e-05,8.5481675454545361e-09
809+6.9779642759670179e-05,6.709316462881509e-09
810+4.948764147268085e-05,3.186914684452465e-09
811+4.5461230866174733e-05,2.2692475692558033e-09
812+7.6945156192110843e-05,8.3545162445703152e-09
813+3.8903634870242752e-05,1.9714299600118728e-09
814+7.7427152562062758e-05,8.4942707837879781e-09
815+7.0601973695023451e-05,5.2419316398590358e-09
816+6.4592323653750889e-05,4.6364907652746512e-09
817+5.3894001960819598e-05,4.2917817266036203e-09
818+7.3933274203238591e-05,6.4353067707095225e-09
819+5.7869298915998078e-05,4.6264680447657043e-09
820+4.3331355767185462e-05,2.6753632766799798e-09
821+7.6105863861759772e-05,7.0100313499902952e-09
822+0.00010701939252275837,1.4766033649867914e-08
823+0.00011660600030753683,2.0238178874017765e-08
824+0.00010919201771716639,1.2528626888362412e-08
825+0.00015619517821142265,2.4602494114982562e-08
826+0.00016171055564375656,3.678275840578081e-08
827+6.5596015256298463e-05,5.9512177202520736e-09
828+7.0161379938845191e-05,5.6814339771026041e-09
829+5.7478481696819138e-05,3.7957732993661417e-09
830+5.349654303568748e-05,4.0174178449941566e-09
831+0.00010243817016959667,1.113024800320703e-08
832+9.1890524585910019e-05,8.8274681658282215e-09
833+6.1566645614510949e-05,4.4370480249996256e-09
834+6.373185542577804e-05,5.7900272202871261e-09
835+8.3530028622196079e-05,8.4328129737028663e-09
836+0.00023378352471906659,6.2025751157612793e-08
837+0.00012807842638926404,2.2823480846603392e-08
838+9.1475678913910226e-05,9.1566350487819377e-09
839+6.8365753826617285e-05,6.8638802865521742e-09
840+5.5394017019118582e-05,4.0605162087405383e-09
841+0.00010554924755506586,1.4709288705857391e-08
842+0.00014240906007841189,2.5643295330162754e-08
843+0.00010476427728591741,1.1393495540633132e-08
844+0.00011950079810167275,1.9438762578685074e-08
845+7.9392598110217225e-05,8.4433367132673563e-09
846+9.5216487393065758e-05,9.9133673234886674e-09
847+9.3758541870851662e-05,9.0463827097914858e-09
848+0.00014872610792636824,2.2744251860036421e-08
849+9.0795455014957421e-05,9.2948552395715479e-09
850+6.3014495406319907e-05,4.9060646228450668e-09
851+6.0205463114518939e-05,4.4214503068290741e-09
852+3.4144198010189954e-05,1.5994055895798168e-09
853+3.0734383083943203e-05,1.1173061917418456e-09
854+6.1026647843014885e-05,4.5597397481400899e-09
855+6.3675592949135676e-05,5.4924411477988588e-09
856+8.9411004614251935e-05,1.0081087144689623e-08
857+5.8509550139471689e-05,4.9976889297275018e-09
858+6.9355396948226258e-05,6.157609127105462e-09
859+4.8268607571987383e-05,2.8887694020096634e-09
860+9.135793211986026e-05,8.8601446024183942e-09
861+0.0001014884356207272,1.2128104163003991e-08
862+5.5118095223454152e-05,3.5853622540198405e-09
863+7.0700718368172237e-05,5.7922398411093852e-09
864+4.5985506975888734e-05,2.8701315412998557e-09
865+9.4551909405429864e-05,9.2792639583282055e-09
866+0.00018058633118228214,3.8268410209824944e-08
867+0.00014252100213898121,2.511678083135466e-08
868+0.00018847933306863257,4.6127605115425945e-08
869+0.00018809755328826522,3.5800275503916683e-08
870+8.9738092746495488e-05,8.7623139128368721e-09
871+0.00020725414756673753,4.3918184004080014e-08
872+0.00014330249847822025,2.0917436489908343e-08
873+7.5469563847714252e-05,5.8527893432181325e-09
874+4.1300622626414667e-05,2.2241346552074184e-09
875+6.9335869849809572e-05,6.1600436687193836e-09
876+5.3660809684360118e-05,2.8836289336732981e-09
877+6.4949853593359452e-05,4.2508706811692686e-09
878+0.00010987230489203239,1.6435439169250427e-08
879+0.0001737572215580409,3.5344857842838037e-08
880+0.00018816667228862958,3.7424666412971031e-08
881+0.00017707026936647559,3.3684056818549264e-08
882+0.00013440872470577172,2.629436221779022e-08
883+0.00010292182283971691,1.5723106268139313e-08
884+0.00011634911684620301,1.6642753435321767e-08
885+0.00010864256699060384,1.7492679778952257e-08
886+0.00015994720255553096,2.5664257518475822e-08
887+5.0098478310771314e-05,2.6933116632887423e-09
888+6.2882712575305062e-05,5.6574898596224651e-09
889+6.9676122378315355e-05,6.6277140155906833e-09
890+6.7973974948481506e-05,5.8119941454488514e-09
891+6.5422297956576673e-05,6.3475354965744523e-09
892+5.6702266413224516e-05,4.5846972148539813e-09
893+3.5946521391886132e-05,1.7545840964670144e-09
894+5.3178308099966998e-05,4.038895495960205e-09
895+4.0794645747696244e-05,1.9919146025992606e-09
896+3.5856819547543589e-05,1.3715330768046927e-09
897+7.2043223989134926e-05,5.7497610103074001e-09
898+6.2862151704774064e-05,5.1989402654605217e-09
899+6.1319068974654629e-05,3.9635315481599015e-09
900+6.6804876305607687e-05,4.6982493203200989e-09
901+0.00011147867905138353,1.2456273892799956e-08
902+0.00019403989727163754,5.1666881080245162e-08
903+7.8618813237992015e-05,8.5627153155504551e-09
904+0.00013054037527588118,2.4642282448873874e-08
905+0.00011310094463929329,1.6576470772083267e-08
906+0.0001414940860541537,2.0699040445590293e-08
907+0.00012141228039800421,2.053453247615675e-08
908+0.00017788306943762166,3.8891747023754513e-08
909+0.00022416057912031219,7.1272342019251472e-08
910+0.00037447406218428232,2.0814166846434899e-07
911+0.00040769604484391453,1.6805719094115745e-07
912+0.00022379382349073683,5.6369691470970117e-08
913+0.00014411977616598736,2.9212667575237519e-08
914+6.6779228144107629e-05,4.7532834874951002e-09
915+6.8408593650866624e-05,4.7593743181601068e-09
916+7.0085639692742208e-05,5.860077166325439e-09
917+5.6182604710727488e-05,4.6887516367843108e-09
918+9.1830744135253288e-05,1.0829165299140302e-08
919+8.5311082526964399e-05,1.0154175017629443e-08
920+6.898050542543285e-05,6.2045789823006127e-09
921+0.00011428976621219035,1.9485678095779299e-08
922+0.00014580601717361331,2.4183465804555712e-08
923+0.00013954314820494376,1.9526957846091433e-08
924+0.00011560195508325569,1.3719150610984509e-08
925+0.00013247714440026961,1.7555770749147664e-08
926+6.350700856508938e-05,5.1566195145144867e-09
927+0.0001030622720420629,1.1510236149572528e-08
928+0.00017621603890582857,4.2746024947870763e-08
929+0.00012401606936941916,1.9113388835879914e-08
930+0.00013379860629319308,2.6539404533778825e-08
931+0.00013049625977191179,2.5133149328485401e-08
932+9.9054561276951041e-05,1.1613254570690651e-08
933+5.9340759790042335e-05,4.8702760510661583e-09
934+5.4699407241457827e-05,3.8605293907963306e-09
935+8.1437816196680392e-05,7.4922697897151987e-09
936+9.9897156209182195e-05,1.4807061524184837e-08
937+5.9448649540556138e-05,5.1304660814396296e-09
938+0.00011904723346125827,2.090932508412002e-08
939+0.00012664789226082769,1.8277586765974991e-08
940+0.0001155325056470165,1.9822194921640277e-08
941+0.00013265559604889258,2.5023258463418324e-08
942+0.00010706385308102803,1.2751577370261368e-08
943+0.00018578510150316999,4.8380480349985942e-08
944+0.00012370284094762553,1.6786560276148029e-08
945+0.00010308319715255286,1.1912925038125454e-08
946+6.0958614527747064e-05,4.2606370457445646e-09
947+0.00010006316346503617,1.0860488545261865e-08
948+6.2022330057852357e-05,4.0767738174579386e-09
949+7.5669397645725412e-05,8.0485231360965357e-09
950+8.1332245772324706e-05,7.2078067997646369e-09
951+5.2714928023244179e-05,3.1138670632464947e-09
952+5.6238696516047122e-05,4.5979927335716787e-09
953+6.783182559753338e-05,5.3786398949302339e-09
954+9.2613329602136101e-05,1.1038772270625786e-08
955+7.1724904686296817e-05,6.7156955331886014e-09
956+8.426846924017318e-05,7.2358910934232303e-09
957+6.3036542685031337e-05,5.1115534428980387e-09
958+6.1990391919919188e-05,5.0118144991286704e-09
959+3.163206807655739e-05,1.0681231722800211e-09
960+4.7520120266802416e-05,2.5260129113414723e-09
961+8.838977593466721e-05,9.0546514078982766e-09
962+0.00012990129826418801,1.861326144939554e-08
963+0.00021129752095539489,6.4646022458344664e-08
964+8.4099358132748008e-05,1.0096567643820443e-08
965+0.00010216219454674392,1.3133452365228043e-08
966+0.0001675140633097825,3.7297933571005301e-08
967+8.1979579279407071e-05,9.9901150965216864e-09
968+4.9042378676771427e-05,3.3332128782519233e-09
969+0.00011414918650631853,1.5817630966962682e-08
970+0.00013663018486233301,1.9860772553203814e-08
971+0.00014816654436249362,2.8242697967214286e-08
972+0.00014935937288961212,2.885422658876883e-08
973+0.00017025210658584738,3.2180813997753029e-08
974+0.00019094849125115895,4.4593840208412011e-08
975+0.00012128694948216941,1.7812042851458398e-08
976+0.00020871203531288199,5.081737851219171e-08
977+0.00012518381758953783,1.7123026159277974e-08
978+0.00012690782556614135,1.7960797218703096e-08
979+0.00010226766339445924,1.5383703910980347e-08
980+8.3512516142863891e-05,9.2479514175498714e-09
981+0.00028475902004809956,1.1498920624037052e-07
982+0.00051811568936597976,3.7943918419910994e-07
983+0.00062932956189699603,3.9878514041362057e-07
984+0.00023428265818120972,7.1284487572938444e-08
985+0.00026435617661171959,7.4147112208748866e-08
986+0.00025194688868302492,6.8897709389380241e-08
987+0.00027186792341996719,8.3979638193806272e-08
988+0.00037969460149866216,2.0970346474762992e-07
989+0.00045280031433559418,2.819187216613044e-07
990+0.00017918139245830231,3.365263649554032e-08
991+0.00016696724012510051,3.6255444817631592e-08
992+0.00014282516717198019,2.4862679535948357e-08
993+0.00011500764926288074,1.8146099646678203e-08
994+6.4941872469764065e-05,5.1867384791198303e-09
995+5.2536783158116679e-05,4.0069479161351669e-09
996+9.400842143251463e-05,1.1217205191577887e-08
997+5.078364613326376e-05,3.6000435878227675e-09
998+6.8615861780206962e-05,4.9085333100369562e-09
999+6.7088529900130779e-05,4.8986606585797381e-09
1000+5.2434253737132732e-05,3.1008520464430083e-09
1001+5.1905309145143951e-05,2.832819988023274e-09
1002+3.4501647188050642e-05,1.592777346158051e-09
1003+2.8784953630346508e-05,9.6450701786443346e-10
1004+2.4690244978775021e-05,8.2165582238315928e-10
1005+2.917040768164806e-05,1.2388913749925172e-09
1006+4.4740906819261705e-05,2.9756132999010031e-09
1007+5.0859242204942119e-05,3.4050028890466764e-09
1008+7.6837012463212018e-05,7.7687067892651751e-09
1009+0.00010799602566360464,1.4580542213608586e-08
1010+8.4656534475625295e-05,8.8049086975256389e-09
1011+0.00014191536253881199,2.5222620543795574e-08
1012+7.8153298404373445e-05,7.8621859347691814e-09
1013+7.9467621615710596e-05,6.579305272699331e-09
1014+9.3918232237945093e-05,1.2049930003791774e-08
1015+5.0416256535254709e-05,2.6362648984280633e-09
1016+5.1760146785652988e-05,2.9335984487273419e-09
1017+8.2279776472837324e-05,9.8920998485336004e-09
1018+9.2193423766364694e-05,1.0146235390480456e-08
1019+0.00021464509456978802,6.2586186487239121e-08
1020+0.00023802575770767717,7.1798793556948207e-08
1021+0.0002341292206515004,6.6403213617863585e-08
1022+0.00048750738459877078,2.4001544154686849e-07
1023+0.00019618426237651395,4.4434448923735556e-08
1024+0.00028798370485833593,9.7807819753245333e-08
1025+0.00042268409496652699,1.9289998374992494e-07
1026+0.00023452279931721051,6.8169414818353457e-08
1027+8.8516692460884657e-05,1.0925770874261479e-08
1028+0.00012987132479302764,1.7607723520215216e-08
1029+0.00014317032063813835,2.4464695659707362e-08
1030+0.00014475879195913674,2.7695950483542879e-08
1031+0.00014435296720933047,2.3659501644967588e-08
1032+0.00016046185972952139,3.335235049947715e-08
1033+0.00018437889745463948,4.4770251602898405e-08
1034+0.00018046115692569342,4.0896506073729421e-08
1035+0.00011595839813744405,1.5367806263503228e-08
1036+9.4343103239260661e-05,1.062020320444891e-08
1037+6.9444562384060919e-05,6.7909048620271719e-09
1038+8.1229524033535618e-05,9.1657864167408077e-09
1039+8.233621242025465e-05,7.7750029716448701e-09
1040+0.00015041383937956391,2.7412275264004558e-08
1041+0.0003195388193698206,1.2936823854516005e-07
1042+0.00018725421308006236,5.1503004451622062e-08
1043+0.00018998446923616943,3.7447741758045412e-08
1044+8.3680340235185442e-05,9.7823808110383978e-09
1045+4.1719037482477982e-05,2.1540057900370591e-09
1046+7.6260988282284464e-05,8.3218341130215683e-09
1047+9.1959898806728024e-05,9.0731523210954666e-09
1048+0.00012809389221298144,1.7967955048211754e-08
1049+0.00022844605547862355,7.1102013206298068e-08
1050+0.00022605588077856186,7.4035380017287747e-08
1051+0.00014619412794233469,2.1764732553340559e-08
1052+5.7643448723010365e-05,3.8587594039059124e-09
1053+2.8536083891169452e-05,9.7495700353796934e-10
1054+5.5979047980746553e-05,3.3364333515240551e-09
1055+4.9665742371831739e-05,3.4343257228636029e-09
1056+4.1416974994554905e-05,2.038667297503592e-09
1057+8.290096043292443e-05,7.0321335715967297e-09
1058+7.7119129188154808e-05,8.455083832510609e-09
1059+0.00011644084874194617,1.4670073148546089e-08
1060+8.0391689890058868e-05,7.2336003764937584e-09
1061+8.9717642905800328e-05,8.9235137532728334e-09
1062+0.00013545398272323133,2.4171544648303377e-08
1063+0.0001215737412124086,1.7619158222664978e-08
1064+8.1072257766632284e-05,8.1005004161456693e-09
1065+4.3734982856393337e-05,2.5565683358821581e-09
1066+6.0792746472968192e-05,4.0431553645590861e-09
1067+3.6684318938912698e-05,1.404102565070011e-09
1068+1.6670899310058047e-05,3.6682632943806152e-10
1069+1.4191213701674122e-05,2.1016031593300626e-10
1070+3.460588892248732e-05,1.754980662608959e-09
1071+5.0761105172019535e-05,3.6115495408944172e-09
1072+6.6769450840061448e-05,4.8584184163906895e-09
1073+8.4074817646507624e-05,9.735546855588178e-09
1074+7.1901126655225982e-05,6.544551021276566e-09
1075+7.6753610600952804e-05,8.7790185010278163e-09
1076+9.2478862322590359e-05,1.0185192771786027e-08
1077+0.00014940095605881935,2.6193792572874679e-08
1078+9.0063991243898467e-05,1.1827455992377898e-08
1079+6.2044549352309361e-05,5.4732619881513288e-09
1080+8.2250424007490611e-05,7.0561759263363515e-09
1081+6.2883635325046384e-05,5.6725002296790734e-09
1082+0.00011799379685289703,2.0414839285847874e-08
1083+5.4942743382434857e-05,3.5629045372988327e-09
1084+0.00012539102740780764,1.6368766630086075e-08
1085+8.001095716868287e-05,6.5609373373066272e-09
1086+7.6134716229943924e-05,7.5450957912144533e-09
1087+0.0001755136889302001,4.3177655417262271e-08
1088+7.6312464317670206e-05,6.567499536713297e-09
1089+7.6256494912413429e-05,7.3238730204915079e-09
1090+6.8442521611726e-05,5.0222863979175403e-09
1091+5.2855595105258489e-05,3.2392585747785441e-09
1092+6.7570162674948224e-05,5.0511529378793605e-09
1093+5.5810499376043951e-05,4.2812309393081467e-09
1094+4.793886290250493e-05,3.3607649203025648e-09
1095+5.6985627088901569e-05,3.5607543686282938e-09
1096+5.4834439896813133e-05,4.4487182550889038e-09
1097+0.00013333587352232565,2.6484594891009033e-08
1098+0.00018742492565826925,4.4487418977639929e-08
1099+0.00016386181909310222,3.6007431273441857e-08
1100+6.0884039046307713e-05,5.4530764753634186e-09
1101+4.9001497586182795e-05,3.3234783699735668e-09
1102+5.0841487684100951e-05,3.750796361905376e-09
1103+0.00016281701781670156,3.6762904926493577e-08
1104+0.0001186425370253467,1.6751846146744885e-08
1105+0.00016725707053599347,4.1164693185221922e-08
1106+5.7779844692681243e-05,3.5689435165828353e-09
1107+5.4896840530851447e-05,4.2189783462997086e-09
1108+5.476417437607313e-05,4.0881960328732175e-09
1109+3.6880813044078087e-05,1.6607294749348357e-09
1110+2.8187372454415853e-05,9.3258945541781031e-10
1111+4.888561108916203e-05,3.4693194584919884e-09
1112+7.3996024320772678e-05,6.4542801939177486e-09
1113+8.4816577279536127e-05,1.0477722204942186e-08
1114+9.5084806004865877e-05,1.2025876962529244e-08
1115+6.5506155409477516e-05,4.3515907064590573e-09
1116+0.00016281190951739178,3.8658423082379156e-08
1117+0.00018801863482480958,4.2908752537610889e-08
1118+0.00013584822729420098,2.6197188690216526e-08
1119+8.5228739748982317e-05,7.2923375909462536e-09
1120+0.0001085170632393473,1.7152739003805373e-08
1121+6.9354298243217517e-05,6.7296517526391358e-09
1122+5.3939294106634656e-05,3.7256645073233074e-09
1123+7.4561359613048032e-05,7.3440343309584839e-09
1124+4.0533583505962874e-05,2.4215083869629281e-09
1125+8.0075940777514669e-05,9.2248134875309669e-09
1126+0.00014716339657063176,3.0619154094947325e-08
1127+8.7954124960298313e-05,1.0258368332532466e-08
1128+5.3250952236036164e-05,4.230821902424733e-09
1129+4.5270045078190006e-05,2.1016119445532423e-09
1130+5.5649263223716514e-05,3.1514328758140163e-09
1131+5.8170225563771756e-05,3.5085016419854162e-09
1132+8.1696198083366033e-05,9.8679015653968408e-09
1133+9.2307997363909338e-05,1.0933480488068846e-08
1134+0.00010796290402952993,1.2996273059086335e-08
1135+0.00012530814992696342,1.8123219893044157e-08
1136+0.00010724723058491519,1.439293225341452e-08
1137+0.00014099365509045967,2.6466882498440065e-08
1138+0.0001115079544378461,1.5148642502134509e-08
1139+0.00011404710041418471,1.8443017219997373e-08
1140+9.109772525104856e-05,9.2907567890026161e-09
1141+0.00010059944138294978,1.4878928832178061e-08
1142+4.3694336907709662e-05,2.7658623838947705e-09
1143+4.9097068639443821e-05,3.3345499083481687e-09
1144+3.5261292341980878e-05,1.7022391044785763e-09
1145+6.4372363117365115e-05,6.03457187383837e-09
1146+5.3582060951447959e-05,2.8751840160041731e-09
1147+5.1231361937140623e-05,2.986534432877412e-09
1148+3.0942015751020886e-05,1.248075978819715e-09
1149+4.7718911190992972e-05,3.1679405303801786e-09
1150+0.00010356344525859076,1.4055830291888439e-08
1151+6.7565709491419616e-05,5.5780290290149677e-09
1152+6.2905646923108082e-05,5.6314847857755358e-09
1153+0.00010070594639619575,1.2900012273914617e-08
1154+0.00010363309213570858,1.5743712819574458e-08
1155+8.1119275767619874e-05,6.948757980236242e-09
1156+0.00015932574697764617,2.712210827169513e-08
1157+9.3675475709850797e-05,1.1351280303769854e-08
1158+6.3702083414022076e-05,6.0209487701366855e-09
1159+5.8127214258053595e-05,4.2113619191191458e-09
1160+8.8491484285845452e-05,9.8200921089148853e-09
1161+9.4065114274214889e-05,1.2561971146037123e-08
1162+8.1427392060114427e-05,9.8282333826983035e-09
1163+8.250536036943988e-05,7.6977403785807458e-09
1164+3.3381719581933425e-05,1.5316716954326944e-09
1165+6.9955931545242925e-05,5.8936575575223629e-09
1166+9.4905836841759951e-05,1.1423568920035787e-08
1167+0.0001436733799820171,2.1015793729533091e-08
1168+5.1333112843422375e-05,3.8056171257621976e-09
1169+5.2350028270462155e-05,3.7242405546412787e-09
1170+9.2831429339106225e-05,9.1176386997445831e-09
1171+0.00017482315304049708,3.439061790985846e-08
1172+0.00029410737077394713,1.2490931273768223e-07
1173+0.00024477612324624523,8.0525430466252528e-08
1174+0.00016153667030001883,3.8125788264607089e-08
1175+7.8011420706902362e-05,6.6127522503603851e-09
1176+4.2913339801374715e-05,2.7179343585064596e-09
1177+0.00010026331943581138,1.0931422705638407e-08
1178+6.1416767464981414e-05,5.2484214495106338e-09
1179+8.3491346248239055e-05,7.6086887886513175e-09
1180+0.00015708141213310539,3.4118707900346417e-08
1181+0.00019149425026252694,5.3480554381972728e-08
1182+0.0001493406234728363,2.5532322168012036e-08
1183+6.6548792056669317e-05,5.3396752730703312e-09
1184+5.0005906710987148e-05,3.2895414628608779e-09
1185+9.3870297838422593e-05,1.1738707368313538e-08
1186+4.2166811858311104e-05,1.9092508248427385e-09
1187+7.1200887154256642e-05,5.2291868418073849e-09
1188+0.00023220089714553175,7.5423940735153403e-08
1189+0.00015683544477975,3.3031034480173406e-08
1190+0.00025506819785717379,9.5609563799069439e-08
1191+0.00023679796175881193,5.963291349558077e-08
1192+0.00013930767072675075,2.9063896919736285e-08
1193+0.00015449081618204441,3.0203443445120765e-08
1194+8.5069294249270696e-05,9.7100702649454917e-09
1195+0.00013261306722713818,2.2980319769678282e-08
1196+0.00010987790123207113,1.3845400956642658e-08
1197+0.00013813398467454245,2.6590257234111083e-08
1198+5.9568380604910398e-05,5.0829977924173462e-09
1199+7.7657874127328008e-05,6.8596059114071317e-09
1200+7.8526166106940756e-05,8.1181837263511463e-09
1201+0.00012492445425400209,1.7819688024243221e-08
1202+0.00012891487480186202,1.77459568153768e-08
1203+0.00018161714884461398,4.4755749347459496e-08
1204+0.00012134247540943834,1.8279751350226821e-08
1205+0.00016116715152966806,3.2161140323645999e-08
1206+0.00012420221317212637,1.8166094295892351e-08
1207+0.00023506284304378728,7.8501041160462463e-08
1208+0.00011075384324553185,1.6387034607359063e-08
1209+7.7615144388815149e-05,8.8212735573009016e-09
1210+7.8174244625415669e-05,6.9032114147956872e-09
1211+9.173629480273095e-05,1.0667123237173323e-08
1212+0.00015863403910199549,3.7195745118938916e-08
1213+0.00015073877980563893,3.188046029504553e-08
1214+8.6436775894088247e-05,9.7160225780728876e-09
1215+6.4838559560970806e-05,5.0934761531259702e-09
1216+4.7271626598458763e-05,2.9636982612213203e-09
1217+9.9452355450648213e-05,1.1884796761643958e-08
1218+8.9574957865188663e-05,1.0901643255366192e-08
1219+9.802459678686596e-05,1.2011348551226583e-08
1220+0.00011001887963996096,1.3729987143112402e-08
1221+0.00010916283151053722,1.2273705526165902e-08
1222+8.7118750435100645e-05,1.0952757731646745e-08
1223+0.00011320790078312923,1.3244455849631464e-08
1224+8.8754473413719059e-05,8.7183347821969952e-09
1225+8.3290089238412975e-05,9.8094307700991384e-09
1226+0.0002425200510635009,8.0728872742848298e-08
1227+0.00013841308274172893,2.0817257258488895e-08
1228+0.00015601501073938233,2.6137188130955514e-08
1229+8.1899699553494935e-05,8.1776628957454054e-09
1230+0.00013963806381775071,2.3909913663339244e-08
1231+0.00018101715238261337,4.1519116097734758e-08
1232+0.00013410402011517351,2.2466833363865232e-08
1233+8.0367515028267956e-05,8.3247845881113922e-09
1234+5.3161134641157633e-05,2.9531864476404345e-09
1235+8.2998842275731712e-05,7.116455881647771e-09
1236+7.8931567853987201e-05,7.5162201301761922e-09
1237+0.00010944876287396953,1.4761081269791578e-08
1238+0.00017569254544703744,3.2179840561627978e-08
1239+0.00012677379092607651,1.8140811635722463e-08
1240+7.727168816594781e-05,6.6208261287555528e-09
1241+3.3544797520242564e-05,1.5340005063545105e-09
1242+5.4480658532918775e-05,3.346811659698878e-09
1243+0.00010144836810890697,1.5079386502713074e-08
1244+0.00015128796988865973,3.0350657688067248e-08
1245+0.00015153559084735558,2.7184276638895885e-08
1246+0.00012786040720039622,2.0179594863083284e-08
1247+0.00015079399386842566,3.0803588831930618e-08
1248+0.00013169011819954372,1.8489701042175117e-08
1249+0.00011459692322974282,1.4741992324867638e-08
1250+0.00021382216306970454,4.7326370079542563e-08
1251+9.2923048128781428e-05,1.1067224712981618e-08
1252+0.00018852195024928026,5.1403813860164094e-08
1253+0.00021171565455027457,6.0964223654988215e-08
1254+0.00031778819430934981,1.4794488587148221e-07
1255+0.00010073715268100199,1.0530817747444775e-08
1256+6.3210417484099767e-05,5.3725396902223596e-09
1257+9.9476750520922273e-05,1.3196258338866061e-08
1258+5.615058794397547e-05,3.6393004470514425e-09
1259+6.8629870157621681e-05,6.4486267999012608e-09
1260+6.1997397127264554e-05,4.9400480973381141e-09
1261+4.8745236652864285e-05,3.1658089406214927e-09
1262+5.9229578858136878e-05,4.3929727852003339e-09
1263+0.00013285837483783386,2.2366442022066127e-08
1264+9.5066882257667138e-05,1.0358716682697154e-08
1265+9.9268102540611756e-05,1.0952308910418747e-08
1266+0.00016117210785560437,3.0445818673090809e-08
1267+8.9375173721693352e-05,9.4134541481123239e-09
1268+9.6698524803358595e-05,1.2333702376697377e-08
1269+7.0854674313928056e-05,7.1431606393512686e-09
1270+8.9398395648191184e-05,1.0779238396812908e-08
1271+5.5194159037133818e-05,3.67321295739665e-09
1272+4.6264660633261132e-05,2.4145568371843648e-09
1273+8.6041004672135303e-05,9.7350084946513528e-09
1274+5.8945184249713325e-05,4.02673889228224e-09
1275+6.4008177820785428e-05,6.0916172390444325e-09
1276+5.6009604551794657e-05,3.2850615164340041e-09
1277+7.4107079636469416e-05,7.1424625787804811e-09
1278+6.0243547735936853e-05,4.0830786034810667e-09
1279+8.5671009316193772e-05,8.2427796293382193e-09
1280+8.1826285008818641e-05,9.1831571995668228e-09
1281+0.00010650442475286441,1.4842280685378102e-08
1282+0.00010327469973126029,1.1696795235790611e-08
1283+6.8710547174517187e-05,4.8358820978390385e-09
1284+0.00018380009348203352,3.9279433225503245e-08
1285+0.00019084656943143947,4.1938297479437754e-08
1286+0.00023736191155719009,6.3436755969960191e-08
1287+0.00021803610327692912,6.4898081512551157e-08
1288+0.00054225844653855093,2.9842839137790761e-07
1289+0.00052323297126153224,3.6643698141314964e-07
1290+0.00085872076932238021,9.7707553723651682e-07
1291+0.00058155535276262183,3.8500893777309818e-07
1292+0.00039130431259762073,2.157293058571465e-07
1293+0.00023572478396587392,7.8254693037584221e-08
1294+0.0002296625258319085,6.025946642637658e-08
1295+0.00010490222757715071,1.6093894735187475e-08
1296+0.00015725402248090875,3.5659385848300488e-08
1297+0.00011345899042451626,1.3839208854269387e-08
1298+0.00010481268239361618,1.3614115374112229e-08
1299+0.00022505051533244975,6.042452589337818e-08
1300+0.00041399872775971447,2.5220262668429875e-07
1301+0.00030571153189081222,1.1650890994273948e-07
1302+0.00054888308375094022,4.0805186031410129e-07
1303+0.00037666266413055127,1.7608245727435878e-07
1304+0.00035714541329651941,1.6710853271763539e-07
1305+0.00022736404395554819,7.147744717903642e-08
1306+0.00015510785202359941,3.6032115648004016e-08
1307+8.7669373525746985e-05,9.2271210442943582e-09
1308+4.529630611922183e-05,2.3114682229340171e-09
1309+6.2030873571325927e-05,4.2246146330873372e-09
1310+8.2718817606614237e-05,8.2166181058315347e-09
1311+9.8263076431361122e-05,1.2154370049342175e-08
1312+8.3706940054991682e-05,7.5064103691802906e-09
1313+9.2084634840128066e-05,1.0084625031194639e-08
1314+6.676622079783995e-05,4.8879866576102059e-09
1315+5.0643350978581718e-05,2.5842861819301101e-09
1316+6.8612122245646629e-05,5.083046988129289e-09
1317+7.1175602695927855e-05,6.0198136497454844e-09
1318+4.1450879031098804e-05,2.0871272511284269e-09
1319+5.2010429935527953e-05,3.4506690983216201e-09
1320+3.8581282565558776e-05,1.6499783749304025e-09
1321+3.8111306893396168e-05,1.8690877936714772e-09
1322+5.9862680784486222e-05,4.590484384551243e-09
1323+6.3594202212083871e-05,4.5134208213585013e-09
1324+5.9641102544162886e-05,5.0039674604065468e-09
1325+9.0897785833957525e-05,1.2045367010738693e-08
1326+7.202418926690529e-05,7.3761978249399715e-09
1327+6.4700254146000144e-05,4.8425165503022151e-09
1328+0.00013042932931146657,1.9824084980760772e-08
1329+6.3055078370424596e-05,5.53770051958064e-09
1330+5.9620529723958886e-05,3.9207870455451824e-09
1331+6.9688242096903981e-05,5.6099970662564608e-09
1332+3.7000643087915234e-05,1.8798699010282972e-09
1333+3.4458647680110276e-05,1.7593892621583465e-09
1334+5.8088190402842862e-05,4.2159798459729007e-09
1335+0.00011372648257504446,1.5339464576935708e-08
1336+0.0001086799057440633,1.6599360919040202e-08
1337+5.6491385153827036e-05,4.5028765327581077e-09
1338+0.00012726515341765358,1.8687429111356363e-08
1339+0.00012122189547090428,1.7061175887449408e-08
1340+0.0001224254692220725,1.8301431783704864e-08
1341+0.00013898904500293075,2.5953364182408106e-08
1342+0.00019293271084349053,3.9612161781296963e-08
1343+0.00019435939329486663,4.6395860528775037e-08
1344+0.0001139171003996761,1.4199783962039034e-08
1345+0.00012376795674587252,2.0178546584440136e-08
1346+0.00018233730750388428,3.6839945697208393e-08
1347+0.00012035182984736028,1.6807560501019601e-08
1348+6.5655042617955694e-05,5.2770398431584803e-09
1349+7.5353743275460272e-05,7.4574242705145976e-09
1350+5.9418948417997992e-05,3.5457424432511183e-09
1351+3.9091830919752751e-05,2.200500295310085e-09
1352+6.7650755860259099e-05,6.3868631730997413e-09
1353+7.8867834950981783e-05,6.638734523673228e-09
1354+7.4567924980692551e-05,7.318355353202451e-09
1355+7.2141330520537235e-05,7.0694348690992041e-09
1356+0.00010682595835670832,1.6784972908619464e-08
1357+8.2816668219535587e-05,9.2308081443956687e-09
1358+0.00013812446586087838,2.250617456686499e-08
1359+0.00010524570266753122,1.6398568681738602e-08
1360+0.00015634652854502098,2.7842956540773815e-08
1361+0.00011639119920432241,1.7073643633593135e-08
1362+7.9464809411301327e-05,8.9718366881271045e-09
1363+0.00025774711825510179,8.3741813790945688e-08
1364+0.00018171568674980976,4.3779953027516739e-08
1365+0.00011307390853352972,1.646031796892681e-08
1366+0.00010602813631022852,1.6085693932210823e-08
1367+0.00025752147893026765,6.8608435489821251e-08
1368+0.00010431585086858201,1.4349888243996349e-08
1369+8.7295103161945739e-05,7.8797065014086745e-09
1370+8.1243921786822227e-05,8.1857486908385121e-09
1371+9.5164726787144233e-05,1.0949791909364347e-08
1372+8.8151181758811374e-05,1.0222856803588085e-08
1373+9.269242127767587e-05,1.2686472372183228e-08
1374+0.00019307022325985249,5.0879032334175977e-08
1375+9.1102919043239443e-05,1.2315854460951411e-08
1376+0.00014054418990395545,2.6452859344155942e-08
1377+7.0387357828642953e-05,6.7122550789654656e-09
1378+8.598482348359236e-05,9.4317256243063746e-09
1379+5.8639878647205922e-05,4.3449872695588612e-09
1380+9.1560499934833817e-05,1.0091201059683156e-08
1381+0.00016625591074385501,4.0269209483987213e-08
1382+0.00014421135831904964,2.4326816495801363e-08
1383+0.00022671792829037177,7.2706248050156277e-08
1384+0.00013598114459467117,2.4570702042526983e-08
1385+0.00019311309108000695,3.9326098185329686e-08
1386+0.00014071507412232224,2.6523894334402581e-08
1387+0.00022900430971035639,5.8853233222180735e-08
1388+0.00029723044044014057,9.984033454361568e-08
1389+0.00025321232164085192,7.1114905545893727e-08
1390+0.00036599170235508644,1.3996084324758252e-07
1391+0.00035967593769390234,1.8733226359726011e-07
1392+0.00030369246735926868,9.7168428524546147e-08
1393+0.00018849759338920207,5.1483929817599929e-08
1394+0.0001142338446835761,1.3831700080312587e-08
1395+0.00013161053357623503,1.7960035917188042e-08
1396+0.00012924094633904657,1.8306712839025876e-08
1397+0.00024137982092080988,8.0966838080683443e-08
1398+0.00017578520901613995,4.1314045879853442e-08
1399+0.00033052803960336081,1.1914450493748651e-07
1400+0.00045892684410426242,3.026844849377476e-07
1401+0.00026039163149486791,9.3715636044971567e-08
1402+0.00029457400800770992,9.3234182490839061e-08
1403+0.00025601807234835631,6.6704148685898502e-08
1404+0.00013417661177785286,2.3320713210878301e-08
1405+8.5448775815804692e-05,9.2553033093185022e-09
1406+0.00012447216077376302,1.8647941164430959e-08
1407+8.0207426306181233e-05,8.739629786131285e-09
1408+7.4255036149863132e-05,8.0397894101370043e-09
1409+6.798245947406886e-05,4.7625047399882148e-09
1410+0.00015934624146866975,3.2351925793369178e-08
1411+0.00020285872832687045,6.1089614192562832e-08
1412+7.3509482312681049e-05,6.3368376682134321e-09
1413+6.0690847635198905e-05,5.1971477150168751e-09
1414+6.732723878915406e-05,5.374909419284875e-09
1415+9.1072340519346632e-05,1.0490168370979244e-08
1416+7.0722640775916788e-05,7.1997388222966834e-09
1417+0.00012406260387621561,1.604214262810344e-08
1418+0.00013471762092073049,2.5377992374124058e-08
1419+0.0001193277520963612,1.9214055723761113e-08
1420+8.349983510239275e-05,8.5702011124926288e-09
1421+0.00012666020813009019,2.3268806835644496e-08
1422+0.00049981701418137347,3.4449349277651353e-07
1423+0.00041683032441624954,2.1721790052777775e-07
1424+0.00029493767176888937,1.1569563498499674e-07
1425+0.00018695621061292635,3.9378854140290624e-08
1426+0.00013466940938003949,2.4737245657471166e-08
1427+0.00019406350312489026,5.3810908588342615e-08
1428+0.0002227881955355263,6.5330772964522371e-08
1429+0.00034920073291562758,1.3682403145126921e-07
1430+0.00028587864693391848,8.997771483284829e-08
1431+0.00012027250457292278,1.9548177762568123e-08
1432+8.1558776696331322e-05,7.5137250783207446e-09
1433+0.00011221459975182487,1.719719440032058e-08
1434+4.7175517647160713e-05,2.5873479313672272e-09
1435+3.7066283057178974e-05,1.5978000946379365e-09
1436+7.9582993690567626e-05,6.9736273115971421e-09
1437+8.6598054628086288e-05,1.0414971774552664e-08
1438+9.0384127953739923e-05,9.4223510723874102e-09
1439+4.6392762879493815e-05,2.7488284462708703e-09
1440+6.8229746703054965e-05,5.8816390633335609e-09
1441+6.1358581780857218e-05,5.0441552434044773e-09
1442+8.9934248455027775e-05,1.1200507277254339e-08
1443+8.6778208997211967e-05,7.9338505289444315e-09
1444+6.8632373343398002e-05,5.1181927489052622e-09
1445+4.190023888589368e-05,2.287228664583311e-09
1446+4.6436437040288671e-05,2.6492177321182641e-09
1447+3.6286785142252975e-05,1.6652913548665417e-09
1448+5.7089624709379402e-05,3.3137681711691165e-09
1449+5.1823796821938958e-05,3.4493959154161126e-09
1450+4.2376815462558687e-05,1.9931260451629225e-09
1451+0.00010927043982035592,1.1970904395071717e-08
1452+0.0001079826888565442,1.2870645820024515e-08
1453+7.3189984665199929e-05,7.5318225669621389e-09
1454+7.9302461878534369e-05,7.5490997013151649e-09
1455+4.7997866383181615e-05,3.2183086885081781e-09
1456+7.4394530254516774e-05,6.9649805364147167e-09
1457+2.645487597018105e-05,9.5194830439494861e-10
1458+3.1377708292414738e-05,1.1153038353754731e-09
1459+5.4924320608220234e-05,3.0568936290043744e-09
1460+6.858033158440785e-05,5.6428900658365252e-09
1461+8.5735271027035767e-05,7.8951583268465187e-09
1462+0.00013737641908517193,2.7048845181227212e-08
1463+0.0001016128424417786,1.2903462572609689e-08
1464+0.00010622632228941985,1.2263337298653804e-08
1465+0.00013890817570129876,2.4131913187359763e-08
1466+0.00011283705735696581,1.4806319216988597e-08
1467+0.00011014672766599298,1.5045745350669767e-08
1468+8.8182644393530361e-05,1.072063372572039e-08
1469+6.6329300357642425e-05,6.0315875771232968e-09
1470+2.4689140265537751e-05,8.2611582788285839e-10
1471+2.9209330197642074e-05,1.1718286663646253e-09
1472+7.3757272527387517e-05,5.572534003632792e-09
1473+7.2644595062198536e-05,5.9748193740331306e-09
1474+0.00014736982493286855,3.2024295149981266e-08
1475+0.00010660503578609766,1.3328646626989131e-08
1476+0.00020415722327670843,4.9158148115929551e-08
1477+0.00039088033350283166,1.890651736311721e-07
1478+0.00018452947511755205,4.862093989109296e-08
1479+0.00013848923034718877,2.2259823128845419e-08
1480+0.00015433609562780305,2.84221177955221e-08
1481+0.00014855964310025457,2.9128773298618666e-08
1482+7.6354919767940611e-05,8.6121416198320755e-09
1483+8.2601515845671914e-05,7.8771104050188014e-09
1484+8.88102610629642e-05,1.1413510889522224e-08
1485+9.8593000130324878e-05,1.4427195488050609e-08
1486+8.2197925950974504e-05,9.9207012954173986e-09
1487+0.00021241562942966275,5.6205431235284499e-08
1488+0.00018316456298726456,4.8674120949846648e-08
1489+0.00015432888051589659,3.2374952895067413e-08
1490+0.00010685583721826502,1.342348665143037e-08
1491+7.0012769853178676e-05,5.8381325205306376e-09
1492+5.0680876730894734e-05,3.708943718621979e-09
1493+3.4939138875537628e-05,1.3211351407303876e-09
1494+3.7864575357529329e-05,2.0631296579016771e-09
1495+6.3466881456829136e-05,4.115010716589453e-09
1496+0.00014054033492135823,2.3387015051987227e-08
1497+0.00017266734567897819,4.3011779643269319e-08
1498+0.00032758973412527753,1.4666989854605829e-07
1499+0.00025451986311191894,9.3283290923344179e-08
1500+0.00021593241346005816,6.6276337249713792e-08
1501+0.0001920853702757736,5.2993615394194996e-08
added datasets/fixtures/reference_r.json +275 −0
@@ -0,0 +1,275 @@
1+{
2+ "versions": {
3+ "R": "R version 4.6.1 (2026-06-24)",
4+ "highfrequency": "1.0.3",
5+ "rugarch": "1.5.6"
6+ },
7+ "realized": [
8+ {
9+ "symbol": "SYN1",
10+ "session": "2024-11-25",
11+ "n_returns": 376,
12+ "rv": 0.00024637973969908694,
13+ "bpv": 0.00025302528836869474,
14+ "rsv": [
15+ 0.00011826488596639238,
16+ 0.00012811485373269454
17+ ],
18+ "rq": 6.1955475593533076e-08,
19+ "bns_jump_stat": -0.63686746412020079
20+ },
21+ {
22+ "symbol": "SYN1",
23+ "session": "2024-11-26",
24+ "n_returns": 380,
25+ "rv": 0.00025120155461075104,
26+ "bpv": 0.00025054486669860156,
27+ "rsv": [
28+ 0.00014267619680554289,
29+ 0.00010852535780520789
30+ ],
31+ "rq": 6.7253679376590466e-08,
32+ "bns_jump_stat": 0.068970742524895531
33+ },
34+ {
35+ "symbol": "SYN1",
36+ "session": "2024-11-27",
37+ "n_returns": 378,
38+ "rv": 0.0002390168957960943,
39+ "bpv": 0.00022840680183704593,
40+ "rsv": [
41+ 0.00013122649739655021,
42+ 0.00010779039839954402
43+ ],
44+ "rq": 5.6950640282455897e-08,
45+ "bns_jump_stat": 1.1638378388270785
46+ },
47+ {
48+ "symbol": "SYN1",
49+ "session": "2024-11-29",
50+ "n_returns": 202,
51+ "rv": 0.00012568246852596236,
52+ "bpv": 0.00012277463617564428,
53+ "rsv": [
54+ 6.122043330139223e-05,
55+ 6.446203522457004e-05
56+ ],
57+ "rq": 1.5743895380525133e-08,
58+ "bns_jump_stat": 0.41268306704483854
59+ },
60+ {
61+ "symbol": "SYN1",
62+ "session": "2024-12-02",
63+ "n_returns": 374,
64+ "rv": 0.00025663107389074444,
65+ "bpv": 0.00026185091449691135,
66+ "rsv": [
67+ 0.00013313693173621296,
68+ 0.00012349414215453134
69+ ],
70+ "rq": 5.8890476779010351e-08,
71+ "bns_jump_stat": -0.52149588902390398
72+ },
73+ {
74+ "symbol": "SYN2",
75+ "session": "2024-11-25",
76+ "n_returns": 379,
77+ "rv": 0.00082192359382040508,
78+ "bpv": 0.00077128792714542993,
79+ "rsv": [
80+ 0.00044988199402507862,
81+ 0.0003720415997953264
82+ ],
83+ "rq": 7.2168645678471738e-07,
84+ "bns_jump_stat": 1.610563286868119
85+ },
86+ {
87+ "symbol": "SYN2",
88+ "session": "2024-11-26",
89+ "n_returns": 372,
90+ "rv": 0.00083538319359307796,
91+ "bpv": 0.00079559175532029731,
92+ "rsv": [
93+ 0.00045959249810148073,
94+ 0.00037579069549159729
95+ ],
96+ "rq": 7.9965430681871144e-07,
97+ "bns_jump_stat": 1.2542860210850504
98+ },
99+ {
100+ "symbol": "SYN2",
101+ "session": "2024-11-27",
102+ "n_returns": 379,
103+ "rv": 0.00094331162341424076,
104+ "bpv": 0.00091513546495405808,
105+ "rsv": [
106+ 0.00048049767491522617,
107+ 0.00046281394849901556
108+ ],
109+ "rq": 8.6472512831618337e-07,
110+ "bns_jump_stat": 0.84552683387723016
111+ },
112+ {
113+ "symbol": "SYN2",
114+ "session": "2024-11-29",
115+ "n_returns": 204,
116+ "rv": 0.00041835614920297191,
117+ "bpv": 0.00041596105295539106,
118+ "rsv": [
119+ 0.00019707105657041914,
120+ 0.00022128509263255283
121+ ],
122+ "rq": 1.7220072106991806e-07,
123+ "bns_jump_stat": 0.10257694520744498
124+ },
125+ {
126+ "symbol": "SYN2",
127+ "session": "2024-12-02",
128+ "n_returns": 376,
129+ "rv": 0.00081343264911332375,
130+ "bpv": 0.00074702008065915127,
131+ "rsv": [
132+ 0.00040838597594895434,
133+ 0.00040504667316436957
134+ ],
135+ "rq": 6.1891158459595883e-07,
136+ "bns_jump_stat": 2.3533450016448088
137+ }
138+ ],
139+ "har_h1": {
140+ "coef": [
141+ 3.5722370546217632e-05,
142+ 0.70518726337650595,
143+ -0.0026533461235811935,
144+ -0.0053820721046231841
145+ ],
146+ "names": ["(Intercept)", "RV1", "RV5", "RV22"],
147+ "n": 1478,
148+ "ssr": 4.9066292970164608e-06
149+ },
150+ "har_h5": {
151+ "coef": [
152+ 7.303627566100136e-05,
153+ 0.4023751739951188,
154+ -0.012151755617208278,
155+ -0.010149362030271216
156+ ],
157+ "n": 1474,
158+ "ssr": 4.5531062852922072e-06
159+ },
160+ "harq_h1": {
161+ "coef": [
162+ 3.0480165047628301e-05,
163+ 0.75934012713345289,
164+ -0.0096384376195148974,
165+ -0.002776592386853348,
166+ -153.55046863809272
167+ ],
168+ "names": ["(Intercept)", "RV1", "RV5", "RV22", "RQ1"],
169+ "n": 1478,
170+ "ssr": 4.8947444550853927e-06
171+ },
172+ "garch": {
173+ "sGARCH.norm": {
174+ "coef": {
175+ "mu": -0.01822814352585278,
176+ "omega": 0.046968370528598521,
177+ "alpha1": 0.045332156957475216,
178+ "beta1": 0.89386846098192896
179+ },
180+ "se": {
181+ "mu": 0.015720112893335601,
182+ "omega": 0.020057089545485348,
183+ "alpha1": 0.012340636889580047,
184+ "beta1": 0.035421075697137025
185+ },
186+ "robust_se": {
187+ "mu": 0.017043974680386417,
188+ "omega": 0.020836549077324372,
189+ "alpha1": 0.014636746334251497,
190+ "beta1": 0.038358083830533872
191+ },
192+ "loglik": -3841.0200748070997,
193+ "converged": true,
194+ "forecast_h5": [0.94763507510028322, 0.93698781864383818, 0.92698790880058568, 0.91759598729646441, 0.90877508881615554]
195+ },
196+ "gjrGARCH.norm": {
197+ "coef": {
198+ "mu": -0.01921714832040566,
199+ "omega": 0.049606222107306731,
200+ "alpha1": 0.041772517207855783,
201+ "beta1": 0.88881536902228075,
202+ "gamma1": 0.010749578214706531
203+ },
204+ "se": {
205+ "mu": 0.015788877242223259,
206+ "omega": 0.020732037955024357,
207+ "alpha1": 0.012738012140778642,
208+ "beta1": 0.036358574231286772,
209+ "gamma1": 0.01681215666556346
210+ },
211+ "robust_se": {
212+ "mu": 0.016963187542588787,
213+ "omega": 0.021997526667836047,
214+ "alpha1": 0.012381109622775522,
215+ "beta1": 0.040044430330484673,
216+ "gamma1": 0.017230012922633861
217+ },
218+ "loglik": -3840.8034370254973,
219+ "converged": true,
220+ "forecast_h5": [0.97755196253582011, 0.96455837224266494, 0.95239685670965857, 0.94101413209524076, 0.93036032671251323]
221+ },
222+ "eGARCH.norm": {
223+ "coef": {
224+ "mu": -0.022966085734094945,
225+ "omega": -0.012779542213507692,
226+ "alpha1": -0.00076829518133545631,
227+ "beta1": 0.9532136736359611,
228+ "gamma1": 0.089834797367789293
229+ },
230+ "se": {
231+ "mu": 0.015731171060962931,
232+ "omega": 0.020613569207631303,
233+ "alpha1": 0.013206355990077282,
234+ "beta1": 0.073113474575883089,
235+ "gamma1": 0.060626191829447999
236+ },
237+ "robust_se": {
238+ "mu": 0.017146433037466612,
239+ "omega": 0.088337872440952633,
240+ "alpha1": 0.040033713535164918,
241+ "beta1": 0.31484565953594218,
242+ "gamma1": 0.25365796252326678
243+ },
244+ "loglik": -3840.6120305950508,
245+ "converged": true,
246+ "forecast_h5": [0.94230544276184092, 0.93293006812265378, 0.92408018148567717, 0.91572251144926264, 0.90782624332712947]
247+ },
248+ "sGARCH.std": {
249+ "coef": {
250+ "mu": -0.018816592659429972,
251+ "omega": 0.046191939728617612,
252+ "alpha1": 0.044962812250873993,
253+ "beta1": 0.89536963039369999,
254+ "shape": 99.999873765090996
255+ },
256+ "se": {
257+ "mu": 0.015733116019376509,
258+ "omega": 0.020181074534464737,
259+ "alpha1": 0.012481787204476544,
260+ "beta1": 0.035670675658710446,
261+ "shape": 68.929603216724544
262+ },
263+ "robust_se": {
264+ "mu": 0.017107427281700522,
265+ "omega": 0.02085183337489558,
266+ "alpha1": 0.014641888146575781,
267+ "beta1": 0.038396705016878786,
268+ "shape": 24.403762618119906
269+ },
270+ "loglik": -3841.7221654386312,
271+ "converged": true,
272+ "forecast_h5": [0.94772578579531741, 0.93736924284277667, 0.92763064951086072, 0.9184731342551381, 0.90986202556616935]
273+ }
274+ }
275+}
modified datasets/fixtures/reference_values.json +676 −9
@@ -1,6 +1,579 @@
1 { 1 {
2 "xnys": { 2 "xnys": {
3− "error": "Parameter `start` receieved as '2000-01-01 00:00:00' although cannot be earlier than the first session of calendar 'XNYS' ('2000-01-03 00:00:00')." 3+ "n_sessions_2000_2026": 6790,
4+ "sessions_2024": [
5+ "2024-01-02",
6+ "2024-01-03",
7+ "2024-01-04",
8+ "2024-01-05",
9+ "2024-01-08",
10+ "2024-01-09",
11+ "2024-01-10",
12+ "2024-01-11",
13+ "2024-01-12",
14+ "2024-01-16",
15+ "2024-01-17",
16+ "2024-01-18",
17+ "2024-01-19",
18+ "2024-01-22",
19+ "2024-01-23",
20+ "2024-01-24",
21+ "2024-01-25",
22+ "2024-01-26",
23+ "2024-01-29",
24+ "2024-01-30",
25+ "2024-01-31",
26+ "2024-02-01",
27+ "2024-02-02",
28+ "2024-02-05",
29+ "2024-02-06",
30+ "2024-02-07",
31+ "2024-02-08",
32+ "2024-02-09",
33+ "2024-02-12",
34+ "2024-02-13",
35+ "2024-02-14",
36+ "2024-02-15",
37+ "2024-02-16",
38+ "2024-02-20",
39+ "2024-02-21",
40+ "2024-02-22",
41+ "2024-02-23",
42+ "2024-02-26",
43+ "2024-02-27",
44+ "2024-02-28",
45+ "2024-02-29",
46+ "2024-03-01",
47+ "2024-03-04",
48+ "2024-03-05",
49+ "2024-03-06",
50+ "2024-03-07",
51+ "2024-03-08",
52+ "2024-03-11",
53+ "2024-03-12",
54+ "2024-03-13",
55+ "2024-03-14",
56+ "2024-03-15",
57+ "2024-03-18",
58+ "2024-03-19",
59+ "2024-03-20",
60+ "2024-03-21",
61+ "2024-03-22",
62+ "2024-03-25",
63+ "2024-03-26",
64+ "2024-03-27",
65+ "2024-03-28",
66+ "2024-04-01",
67+ "2024-04-02",
68+ "2024-04-03",
69+ "2024-04-04",
70+ "2024-04-05",
71+ "2024-04-08",
72+ "2024-04-09",
73+ "2024-04-10",
74+ "2024-04-11",
75+ "2024-04-12",
76+ "2024-04-15",
77+ "2024-04-16",
78+ "2024-04-17",
79+ "2024-04-18",
80+ "2024-04-19",
81+ "2024-04-22",
82+ "2024-04-23",
83+ "2024-04-24",
84+ "2024-04-25",
85+ "2024-04-26",
86+ "2024-04-29",
87+ "2024-04-30",
88+ "2024-05-01",
89+ "2024-05-02",
90+ "2024-05-03",
91+ "2024-05-06",
92+ "2024-05-07",
93+ "2024-05-08",
94+ "2024-05-09",
95+ "2024-05-10",
96+ "2024-05-13",
97+ "2024-05-14",
98+ "2024-05-15",
99+ "2024-05-16",
100+ "2024-05-17",
101+ "2024-05-20",
102+ "2024-05-21",
103+ "2024-05-22",
104+ "2024-05-23",
105+ "2024-05-24",
106+ "2024-05-28",
107+ "2024-05-29",
108+ "2024-05-30",
109+ "2024-05-31",
110+ "2024-06-03",
111+ "2024-06-04",
112+ "2024-06-05",
113+ "2024-06-06",
114+ "2024-06-07",
115+ "2024-06-10",
116+ "2024-06-11",
117+ "2024-06-12",
118+ "2024-06-13",
119+ "2024-06-14",
120+ "2024-06-17",
121+ "2024-06-18",
122+ "2024-06-20",
123+ "2024-06-21",
124+ "2024-06-24",
125+ "2024-06-25",
126+ "2024-06-26",
127+ "2024-06-27",
128+ "2024-06-28",
129+ "2024-07-01",
130+ "2024-07-02",
131+ "2024-07-03",
132+ "2024-07-05",
133+ "2024-07-08",
134+ "2024-07-09",
135+ "2024-07-10",
136+ "2024-07-11",
137+ "2024-07-12",
138+ "2024-07-15",
139+ "2024-07-16",
140+ "2024-07-17",
141+ "2024-07-18",
142+ "2024-07-19",
143+ "2024-07-22",
144+ "2024-07-23",
145+ "2024-07-24",
146+ "2024-07-25",
147+ "2024-07-26",
148+ "2024-07-29",
149+ "2024-07-30",
150+ "2024-07-31",
151+ "2024-08-01",
152+ "2024-08-02",
153+ "2024-08-05",
154+ "2024-08-06",
155+ "2024-08-07",
156+ "2024-08-08",
157+ "2024-08-09",
158+ "2024-08-12",
159+ "2024-08-13",
160+ "2024-08-14",
161+ "2024-08-15",
162+ "2024-08-16",
163+ "2024-08-19",
164+ "2024-08-20",
165+ "2024-08-21",
166+ "2024-08-22",
167+ "2024-08-23",
168+ "2024-08-26",
169+ "2024-08-27",
170+ "2024-08-28",
171+ "2024-08-29",
172+ "2024-08-30",
173+ "2024-09-03",
174+ "2024-09-04",
175+ "2024-09-05",
176+ "2024-09-06",
177+ "2024-09-09",
178+ "2024-09-10",
179+ "2024-09-11",
180+ "2024-09-12",
181+ "2024-09-13",
182+ "2024-09-16",
183+ "2024-09-17",
184+ "2024-09-18",
185+ "2024-09-19",
186+ "2024-09-20",
187+ "2024-09-23",
188+ "2024-09-24",
189+ "2024-09-25",
190+ "2024-09-26",
191+ "2024-09-27",
192+ "2024-09-30",
193+ "2024-10-01",
194+ "2024-10-02",
195+ "2024-10-03",
196+ "2024-10-04",
197+ "2024-10-07",
198+ "2024-10-08",
199+ "2024-10-09",
200+ "2024-10-10",
201+ "2024-10-11",
202+ "2024-10-14",
203+ "2024-10-15",
204+ "2024-10-16",
205+ "2024-10-17",
206+ "2024-10-18",
207+ "2024-10-21",
208+ "2024-10-22",
209+ "2024-10-23",
210+ "2024-10-24",
211+ "2024-10-25",
212+ "2024-10-28",
213+ "2024-10-29",
214+ "2024-10-30",
215+ "2024-10-31",
216+ "2024-11-01",
217+ "2024-11-04",
218+ "2024-11-05",
219+ "2024-11-06",
220+ "2024-11-07",
221+ "2024-11-08",
222+ "2024-11-11",
223+ "2024-11-12",
224+ "2024-11-13",
225+ "2024-11-14",
226+ "2024-11-15",
227+ "2024-11-18",
228+ "2024-11-19",
229+ "2024-11-20",
230+ "2024-11-21",
231+ "2024-11-22",
232+ "2024-11-25",
233+ "2024-11-26",
234+ "2024-11-27",
235+ "2024-11-29",
236+ "2024-12-02",
237+ "2024-12-03",
238+ "2024-12-04",
239+ "2024-12-05",
240+ "2024-12-06",
241+ "2024-12-09",
242+ "2024-12-10",
243+ "2024-12-11",
244+ "2024-12-12",
245+ "2024-12-13",
246+ "2024-12-16",
247+ "2024-12-17",
248+ "2024-12-18",
249+ "2024-12-19",
250+ "2024-12-20",
251+ "2024-12-23",
252+ "2024-12-24",
253+ "2024-12-26",
254+ "2024-12-27",
255+ "2024-12-30",
256+ "2024-12-31"
257+ ],
258+ "early_closes_2000_2026": [
259+ "2000-07-03",
260+ "2000-11-24",
261+ "2001-07-03",
262+ "2001-11-23",
263+ "2001-12-24",
264+ "2002-07-05",
265+ "2002-11-29",
266+ "2002-12-24",
267+ "2003-07-03",
268+ "2003-11-28",
269+ "2003-12-24",
270+ "2003-12-26",
271+ "2004-11-26",
272+ "2005-11-25",
273+ "2006-07-03",
274+ "2006-11-24",
275+ "2007-07-03",
276+ "2007-11-23",
277+ "2007-12-24",
278+ "2008-07-03",
279+ "2008-11-28",
280+ "2008-12-24",
281+ "2009-11-27",
282+ "2009-12-24",
283+ "2010-11-26",
284+ "2011-11-25",
285+ "2012-07-03",
286+ "2012-11-23",
287+ "2012-12-24",
288+ "2013-07-03",
289+ "2013-11-29",
290+ "2013-12-24",
291+ "2014-07-03",
292+ "2014-11-28",
293+ "2014-12-24",
294+ "2015-11-27",
295+ "2015-12-24",
296+ "2016-11-25",
297+ "2017-07-03",
298+ "2017-11-24",
299+ "2018-07-03",
300+ "2018-11-23",
301+ "2018-12-24",
302+ "2019-07-03",
303+ "2019-11-29",
304+ "2019-12-24",
305+ "2020-11-27",
306+ "2020-12-24",
307+ "2021-11-26",
308+ "2022-11-25",
309+ "2023-07-03",
310+ "2023-11-24",
311+ "2024-07-03",
312+ "2024-11-29",
313+ "2024-12-24",
314+ "2025-07-03",
315+ "2025-11-28",
316+ "2025-12-24",
317+ "2026-11-27",
318+ "2026-12-24"
319+ ],
320+ "holidays_2000_2026": [
321+ "2000-01-17",
322+ "2000-02-21",
323+ "2000-04-21",
324+ "2000-05-29",
325+ "2000-07-04",
326+ "2000-09-04",
327+ "2000-11-23",
328+ "2000-12-25",
329+ "2001-01-01",
330+ "2001-01-15",
331+ "2001-02-19",
332+ "2001-04-13",
333+ "2001-05-28",
334+ "2001-07-04",
335+ "2001-09-03",
336+ "2001-09-11",
337+ "2001-09-12",
338+ "2001-09-13",
339+ "2001-09-14",
340+ "2001-11-22",
341+ "2001-12-25",
342+ "2002-01-01",
343+ "2002-01-21",
344+ "2002-02-18",
345+ "2002-03-29",
346+ "2002-05-27",
347+ "2002-07-04",
348+ "2002-09-02",
349+ "2002-11-28",
350+ "2002-12-25",
351+ "2003-01-01",
352+ "2003-01-20",
353+ "2003-02-17",
354+ "2003-04-18",
355+ "2003-05-26",
356+ "2003-07-04",
357+ "2003-09-01",
358+ "2003-11-27",
359+ "2003-12-25",
360+ "2004-01-01",
361+ "2004-01-19",
362+ "2004-02-16",
363+ "2004-04-09",
364+ "2004-05-31",
365+ "2004-06-11",
366+ "2004-07-05",
367+ "2004-09-06",
368+ "2004-11-25",
369+ "2004-12-24",
370+ "2005-01-17",
371+ "2005-02-21",
372+ "2005-03-25",
373+ "2005-05-30",
374+ "2005-07-04",
375+ "2005-09-05",
376+ "2005-11-24",
377+ "2005-12-26",
378+ "2006-01-02",
379+ "2006-01-16",
380+ "2006-02-20",
381+ "2006-04-14",
382+ "2006-05-29",
383+ "2006-07-04",
384+ "2006-09-04",
385+ "2006-11-23",
386+ "2006-12-25",
387+ "2007-01-01",
388+ "2007-01-02",
389+ "2007-01-15",
390+ "2007-02-19",
391+ "2007-04-06",
392+ "2007-05-28",
393+ "2007-07-04",
394+ "2007-09-03",
395+ "2007-11-22",
396+ "2007-12-25",
397+ "2008-01-01",
398+ "2008-01-21",
399+ "2008-02-18",
400+ "2008-03-21",
401+ "2008-05-26",
402+ "2008-07-04",
403+ "2008-09-01",
404+ "2008-11-27",
405+ "2008-12-25",
406+ "2009-01-01",
407+ "2009-01-19",
408+ "2009-02-16",
409+ "2009-04-10",
410+ "2009-05-25",
411+ "2009-07-03",
412+ "2009-09-07",
413+ "2009-11-26",
414+ "2009-12-25",
415+ "2010-01-01",
416+ "2010-01-18",
417+ "2010-02-15",
418+ "2010-04-02",
419+ "2010-05-31",
420+ "2010-07-05",
421+ "2010-09-06",
422+ "2010-11-25",
423+ "2010-12-24",
424+ "2011-01-17",
425+ "2011-02-21",
426+ "2011-04-22",
427+ "2011-05-30",
428+ "2011-07-04",
429+ "2011-09-05",
430+ "2011-11-24",
431+ "2011-12-26",
432+ "2012-01-02",
433+ "2012-01-16",
434+ "2012-02-20",
435+ "2012-04-06",
436+ "2012-05-28",
437+ "2012-07-04",
438+ "2012-09-03",
439+ "2012-10-29",
440+ "2012-10-30",
441+ "2012-11-22",
442+ "2012-12-25",
443+ "2013-01-01",
444+ "2013-01-21",
445+ "2013-02-18",
446+ "2013-03-29",
447+ "2013-05-27",
448+ "2013-07-04",
449+ "2013-09-02",
450+ "2013-11-28",
451+ "2013-12-25",
452+ "2014-01-01",
453+ "2014-01-20",
454+ "2014-02-17",
455+ "2014-04-18",
456+ "2014-05-26",
457+ "2014-07-04",
458+ "2014-09-01",
459+ "2014-11-27",
460+ "2014-12-25",
461+ "2015-01-01",
462+ "2015-01-19",
463+ "2015-02-16",
464+ "2015-04-03",
465+ "2015-05-25",
466+ "2015-07-03",
467+ "2015-09-07",
468+ "2015-11-26",
469+ "2015-12-25",
470+ "2016-01-01",
471+ "2016-01-18",
472+ "2016-02-15",
473+ "2016-03-25",
474+ "2016-05-30",
475+ "2016-07-04",
476+ "2016-09-05",
477+ "2016-11-24",
478+ "2016-12-26",
479+ "2017-01-02",
480+ "2017-01-16",
481+ "2017-02-20",
482+ "2017-04-14",
483+ "2017-05-29",
484+ "2017-07-04",
485+ "2017-09-04",
486+ "2017-11-23",
487+ "2017-12-25",
488+ "2018-01-01",
489+ "2018-01-15",
490+ "2018-02-19",
491+ "2018-03-30",
492+ "2018-05-28",
493+ "2018-07-04",
494+ "2018-09-03",
495+ "2018-11-22",
496+ "2018-12-05",
497+ "2018-12-25",
498+ "2019-01-01",
499+ "2019-01-21",
500+ "2019-02-18",
501+ "2019-04-19",
502+ "2019-05-27",
503+ "2019-07-04",
504+ "2019-09-02",
505+ "2019-11-28",
506+ "2019-12-25",
507+ "2020-01-01",
508+ "2020-01-20",
509+ "2020-02-17",
510+ "2020-04-10",
511+ "2020-05-25",
512+ "2020-07-03",
513+ "2020-09-07",
514+ "2020-11-26",
515+ "2020-12-25",
516+ "2021-01-01",
517+ "2021-01-18",
518+ "2021-02-15",
519+ "2021-04-02",
520+ "2021-05-31",
521+ "2021-07-05",
522+ "2021-09-06",
523+ "2021-11-25",
524+ "2021-12-24",
525+ "2022-01-17",
526+ "2022-02-21",
527+ "2022-04-15",
528+ "2022-05-30",
529+ "2022-06-20",
530+ "2022-07-04",
531+ "2022-09-05",
532+ "2022-11-24",
533+ "2022-12-26",
534+ "2023-01-02",
535+ "2023-01-16",
536+ "2023-02-20",
537+ "2023-04-07",
538+ "2023-05-29",
539+ "2023-06-19",
540+ "2023-07-04",
541+ "2023-09-04",
542+ "2023-11-23",
543+ "2023-12-25",
544+ "2024-01-01",
545+ "2024-01-15",
546+ "2024-02-19",
547+ "2024-03-29",
548+ "2024-05-27",
549+ "2024-06-19",
550+ "2024-07-04",
551+ "2024-09-02",
552+ "2024-11-28",
553+ "2024-12-25",
554+ "2025-01-01",
555+ "2025-01-09",
556+ "2025-01-20",
557+ "2025-02-17",
558+ "2025-04-18",
559+ "2025-05-26",
560+ "2025-06-19",
561+ "2025-07-04",
562+ "2025-09-01",
563+ "2025-11-27",
564+ "2025-12-25",
565+ "2026-01-01",
566+ "2026-01-19",
567+ "2026-02-16",
568+ "2026-04-03",
569+ "2026-05-25",
570+ "2026-06-19",
571+ "2026-07-03",
572+ "2026-09-07",
573+ "2026-11-26",
574+ "2026-12-25"
575+ ],
576+ "exchange_calendars_version": "4.13.2"
4 }, 577 },
5 "ols": { 578 "ols": {
6 "params": [ 579 "params": [
@@ -168,10 +741,10 @@
168 "converged": true, 741 "converged": true,
169 "forecast_h5": [ 742 "forecast_h5": [
170 0.9428008577891447, 743 0.9428008577891447,
171− 0.9349887823049752, 744+ 0.9350967040941869,
172− 0.9276816634654835, 745+ 0.9279209834507949,
173− 0.9206952073863107, 746+ 0.9203740696879242,
174− 0.9139209540830693 747+ 0.9136275610313748
175 ] 748 ]
176 }, 749 },
177 "egarch.t": { 750 "egarch.t": {
@@ -195,11 +768,105 @@
195 "converged": true, 768 "converged": true,
196 "forecast_h5": [ 769 "forecast_h5": [
197 0.9422973309992873, 770 0.9422973309992873,
198− 0.9345334516475253, 771+ 0.9347854822088925,
199− 0.9275624591259901, 772+ 0.9267087660109804,
200− 0.9204890251862488, 773+ 0.9193443167679186,
201− 0.9130849041786623 774+ 0.9129057243623206
202 ] 775 ]
203 } 776 }
777+ },
778+ "har": {
779+ "h1": {
780+ "params": [
781+ 3.572237054621749e-05,
782+ 0.705187263376507,
783+ -0.0026533461235812503,
784+ -0.005382072104623131
785+ ],
786+ "hac_bse": [
787+ 5.025808125371488e-06,
788+ 0.03771149347978252,
789+ 0.04088782859024564,
790+ 0.05679993577399188
791+ ],
792+ "hac_lags": 7,
793+ "n": 1478,
794+ "ssr": 4.9066292970164625e-06,
795+ "rsquared": 0.4939090998347373
796+ },
797+ "h5": {
798+ "params": [
799+ 7.303627566100124e-05,
800+ 0.40237517399511974,
801+ -0.012151755617208201,
802+ -0.010149362030271447
803+ ],
804+ "hac_bse": [
805+ 8.862600633978347e-06,
806+ 0.042107670404322194,
807+ 0.058769867344117446,
808+ 0.09751138359952202
809+ ],
810+ "hac_lags": 7,
811+ "n": 1474,
812+ "ssr": 4.553106285292198e-06,
813+ "rsquared": 0.2470427244436465
814+ },
815+ "h22": {
816+ "params": [
817+ 0.0001079682069563529,
818+ 0.10933613277708529,
819+ -0.0015594242826553265,
820+ -0.02513758766905899
821+ ],
822+ "hac_bse": [
823+ 1.0735092262683719e-05,
824+ 0.019568145492281423,
825+ 0.03970034224388717,
826+ 0.0982148382834958
827+ ],
828+ "hac_lags": 21,
829+ "n": 1457,
830+ "ssr": 2.1253086279812884e-06,
831+ "rsquared": 0.047604184294901764
832+ },
833+ "log_h1": {
834+ "params": [
835+ -2.773144648710696,
836+ 0.6956416417576977,
837+ 0.01608375548941232,
838+ -0.0123652588421852
839+ ],
840+ "hac_bse": [
841+ 0.3583623660089911,
842+ 0.027231971275931997,
843+ 0.03648579501915967,
844+ 0.04777402944192476
845+ ],
846+ "hac_lags": 7,
847+ "n": 1478,
848+ "ssr": 253.84378776319585,
849+ "rsquared": 0.4939008420788008
850+ },
851+ "harq_h1": {
852+ "params": [
853+ 3.048016504762969e-05,
854+ 0.7593401271334446,
855+ -0.009638437619492339,
856+ -0.0027765923868793563,
857+ -153.55046863809284
858+ ],
859+ "hac_bse": [
860+ 6.591629821411091e-06,
861+ 0.04571371552002667,
862+ 0.04075106926582767,
863+ 0.057820223931294774,
864+ 126.5397411975311
865+ ],
866+ "hac_lags": 7,
867+ "n": 1478,
868+ "ssr": 4.894744455085396e-06,
869+ "rsquared": 0.4951349536718862
870+ }
204 } 871 }
205 } 872 }
\ No newline at end of file
modified docs/PROGRESS.md +29 −0
@@ -120,3 +120,32 @@ Executed:
120 compilation of the bundle is measured separately in E7 (toolchain-less nodes). 120 compilation of the bundle is measured separately in E7 (toolchain-less nodes).
121 121
122 Gate evidence: accuracy tests and the measured break-even table above; no claim beyond the tested shapes. 122 Gate evidence: accuracy tests and the measured break-even table above; no claim beyond the tested shapes.
123+
124+## Phase 4 — Econometrics, Tier A (2026-11-02, 16:30–17:40 ET) — GATE PASSED
125+Plan: HAR family, block bootstrap, R references (highfrequency, rugarch), Monte Carlo validation, gradient checks,
126+registry completion, Python/CLI exposure.
127+
128+Executed:
129+- `estimators/har.{hpp,cpp}`: HAR-RV / log-HAR / HAR-X / HARQ (causal lags, average or single targets, HAC with
130+ ≥ h−1 lags), `har_rolling` (causal re-estimation + QLIKE/MSE), `har_batch` (GPU sufficient statistics, FP64 solve).
131+ `statistics/bootstrap.{hpp,cpp}`: stationary / circular block / iid, deterministic streams, scalar and row variants.
132+- R references (`scripts/reference_r.R` → `datasets/fixtures/reference_r.json`, highfrequency 1.0.3, rugarch 1.5.6):
133+ RV/BPV/RSV±/RQ equal to 1e−10 after two documented conventions (highfrequency `rQuar` uses (M+1)/3; `rBPCov` with
134+ makeReturns=FALSE applies no M/(M−1) factor); `HARmodel` h=1 coefficients 1e−8 and h=5 (average target) 1e−6; HARQ
135+ equal once the regressor is (√RQ_t − √mean RQ)·RV_t as in highfrequency; rugarch sGARCH/gjrGARCH/eGARCH/sGARCH-std
136+ log-likelihoods within 2e−4 and parameters within 5 % (eGARCH alpha1/gamma1 swap documented; ν at the bound for
137+ Gaussian data in both packages).
138+- statsmodels references (`make_fixtures.py`): HAR h=1/5/22, log-HAR, HARQ with HAC → coefficients 1e−9, SE 1e−8.
139+- Calendar: the exchange_calendars comparison was previously **not running** (API error swallowed into a WARN) — fixed;
140+ the exact comparison 2000-01-03…2026-12-31 (6 790 sessions, 254 weekday holidays, 60 early closes) revealed three
141+ historical one-offs (early closes 2002-07-05 and 2003-12-26; full day 2002-07-03), now encoded. All sets equal.
142+- Monte Carlo (`tests/simulation`, printed to the test log): GARCH(1,1) n=2000, R=120: bias μ −0.0004, ω +0.0033,
143+ α −0.0020, β −0.0026; RMSE 0.019/0.009/0.014/0.019; 95 % QMLE coverage 0.950/0.942/0.900/0.933; 0 failures.
144+ HAR h=5 HAC coverage 0.895/0.945/0.910/0.905 (R=200, T=1200). RV RMSE vs √(2/M)·IV: 5.48e−5 vs 5.66e−5 (M=39),
145+ 1.85e−5 vs 1.79e−5 (390), 5.78e−6 vs 5.66e−6 (3 900). Stationary-bootstrap mean coverage 0.89 (R=100). Numerical
146+ NLL gradients agree across step sizes 1e−4/1e−5/1e−6.
147+- Python: `raid.har_fit/har_rolling/har_batch/bootstrap` (pytest 9/9, HAR+HAC equal to statsmodels); CLI `raid
148+ estimate har <bars> [--horizon] [--log] [--harq] [--window --step]`.
149+- Full suite: `ctest` all green (see summary in RESEARCH_STATUS).
150+
151+Gate evidence: reference tables (R + Python), Monte Carlo logs, registry entries with tolerances.
modified docs/methods/registry.md +12 −8
@@ -9,10 +9,10 @@ reference comparison pending · 🧭 experimental · ✖ not implemented. "Toler
9 | `calendar.xnys` | NYSE trading days 2000–2026 (rules + special closures), early closes 13:00, DST America/New_York | dates | exchange_calendars 4.13 XNYS | exact set equality (sessions, holidays, early closes 2000–2026) | ✅ | n/a | ✅ | 9 | `calendar.xnys` | NYSE trading days 2000–2026 (rules + special closures), early closes 13:00, DST America/New_York | dates | exchange_calendars 4.13 XNYS | exact set equality (sessions, holidays, early closes 2000–2026) | ✅ | n/a | ✅ |
10 | `bars.validate` | OHLC consistency, positivity, grid alignment, session membership, coverage vs 391/211, price jumps > 25 % | BarSeries | FinData `/market/sessions` semantics | counts | ✅ | n/a | ✅ (synthetic) | 10 | `bars.validate` | OHLC consistency, positivity, grid alignment, session membership, coverage vs 391/211, price jumps > 25 % | BarSeries | FinData `/market/sessions` semantics | counts | ✅ | n/a | ✅ (synthetic) |
11 | `bars.aggregate` | bins anchored at the session open (09:30 regular / 04:00 extended), the 16:00 closing print is its own bin, no empty bins, OHLC/sum | BarSeries | FinData derived 5m | exact OHLCV: extended policy 280/280 bars (AAPL 2024-11-25…29); regular policy differs only in the closing bin (FinData adds 16:01–16:04) | ✅ | n/a | ✅ (live 2026-11-02) | 11 | `bars.aggregate` | bins anchored at the session open (09:30 regular / 04:00 extended), the 16:00 closing print is its own bin, no empty bins, OHLC/sum | BarSeries | FinData derived 5m | exact OHLCV: extended policy 280/280 bars (AAPL 2024-11-25…29); regular policy differs only in the closing bin (FinData adds 16:01–16:04) | ✅ | n/a | ✅ (live 2026-11-02) |
12−| `realized.rv` | Σ r² | returns CSR | highfrequency `rCov` (univariate) / numpy | 1e−12 rel (numpy) | ✅ | Phase 3 | ✅ | 12+| `realized.rv` | Σ r² | returns CSR | highfrequency `rCov` 1e−10, numpy 1e−12 | 1e−10 | ✅ | ✅ 1e−6 | ✅ |
13−| `realized.bpv` | μ₁⁻²·M/(M−1)·Σ|r_j||r_{j−1}| (finite-sample factor optional) | returns CSR | highfrequency `rBPCov` (makeReturns=FALSE, scaled) | 1e−12 rel (numpy); R comparison Phase 4 | ✅ | Phase 3 | ✅ | 13+| `realized.bpv` | μ₁⁻²·[M/(M−1)]·Σ|r_j||r_{j−1}| (factor on by default; highfrequency `rBPCov(makeReturns=FALSE)` applies none → compared with factor off) | returns CSR | highfrequency 1e−10, numpy 1e−12 | 1e−10 | ✅ | ✅ 1e−6 | ✅ |
14−| `realized.rsv` | Σ r² 1{r<0}, Σ r² 1{r>0} | returns CSR | highfrequency `rSVar` | 1e−12 rel | ✅ | Phase 3 | ✅ | 14+| `realized.rsv` | Σ r² 1{r<0}, Σ r² 1{r>0} | returns CSR | highfrequency `rSVar` 1e−10 | 1e−10 | ✅ | ✅ 1e−6 | ✅ |
15−| `realized.rq` | (M/3) Σ r⁴ | returns CSR | highfrequency `rQuar` | 1e−12 rel | ✅ | Phase 3 | ✅ | 15+| `realized.rq` | (M/3) Σ r⁴ (BPQ 2016; M = number of returns) — highfrequency `rQuar` uses (M+1)/3 (number of prices): compared after conversion | returns CSR | highfrequency `rQuar` 1e−10 (converted), numpy 1e−12 | 1e−10 | ✅ | ✅ | ✅ |
16 | `realized.jump` | max(RV − BPV, 0) (proxy, no test statistic) | — | ABD 2007 | — | ✅ | — | ✅ | 16 | `realized.jump` | max(RV − BPV, 0) (proxy, no test statistic) | — | ABD 2007 | — | ✅ | — | ✅ |
17 | `realized.tripv` | μ_{4/3}⁻³·M/(M−2)·Σ Π|r|^{4/3} | returns CSR | highfrequency `rTPQuar` (differs: quarticity) — definition from BNS 2004 | 1e−12 (self) | ✅ | — | 🧪 | 17 | `realized.tripv` | μ_{4/3}⁻³·M/(M−2)·Σ Π|r|^{4/3} | returns CSR | highfrequency `rTPQuar` (differs: quarticity) — definition from BNS 2004 | 1e−12 (self) | ✅ | — | 🧪 |
18 | `realized.rcov` | Σ r_j r_j' on synchronized returns; corr from diag | T×N returns | highfrequency `rCov` | Phase 4 | ✅ | Phase 3 | 🧪 | 18 | `realized.rcov` | Σ r_j r_j' on synchronized returns; corr from diag | T×N returns | highfrequency `rCov` | Phase 4 | ✅ | Phase 3 | 🧪 |
@@ -23,13 +23,17 @@ reference comparison pending · 🧭 experimental · ✖ not implemented. "Toler
23 | `cov.cluster` | one-way CGM with G/(G−1)·(n−1)/(n−k) | cluster ids | statsmodels cluster (default correction) | 1e−9 | ✅ | — | ✅ | 23 | `cov.cluster` | one-way CGM with G/(G−1)·(n−1)/(n−k) | cluster ids | statsmodels cluster (default correction) | 1e−9 | ✅ | — | ✅ |
24 | `inference.t` | two-sided p from t(df_resid) (regularised incomplete beta); df ≤ 0 → normal | — | scipy.stats.t | 1e−12 | ✅ | — | ✅ | 24 | `inference.t` | two-sided p from t(df_resid) (regularised incomplete beta); df ≤ 0 → normal | — | scipy.stats.t | 1e−12 | ✅ | — | ✅ |
25 | `ols.rolling` | window-by-window QR; step parameter | X, y | statsmodels RollingOLS | self-consistency test; Phase 4 vs statsmodels | ✅ | Phase 3 | 🧪 | 25 | `ols.rolling` | window-by-window QR; step parameter | X, y | statsmodels RollingOLS | self-consistency test; Phase 4 vs statsmodels | ✅ | Phase 3 | 🧪 |
26−| `har.*` | HAR-RV, log-HAR, HAR-X, HARQ (BPQ 2016): RV_{t+h} regressed on RV_t, mean(RV_{t−4..t}), mean(RV_{t−21..t}) [, √RQ_t·RV_t]; causal lags; h ∈ {1,5,22} with overlapping targets → HAC(h−1 lags minimum) | daily RV panel | highfrequency `HARmodel`, statsmodels | Phase 4 | Phase 4 | Phase 4 | ✖ (Phase 4) | 26+| `har.rv.h{1,5,22}` | y_{t+h} = (1/h)Σ_{j=1..h} RV_{t+j} on [1, RV_t, mean RV_{t−4..t}, mean RV_{t−21..t}]; causal; HAC lags = max(h−1, ⌊4(n/100)^{2/9}⌋) | daily RV | highfrequency `HARmodel` (h=1 coef 1e−8, h=5 average target 1e−6), statsmodels HAC 1e−9 | 1e−8 | ✅ | ✅ batched sufficient stats 1e−4 (Metal) | ✅ |
27−| `garch.garch.gaussian` | σ²_t = ω + α ε²_{t−1} + β σ²_{t−1}; σ²_0 = sample variance of ε; constraints ω>0, α,β≥0, α+β<1 | returns | arch 8.0 `arch_model(vol="GARCH", rescale=False)` (backcast initialisation ≠ ours), rugarch (Phase 4) | loglik 5e−4 rel; params 5 % rel + 0.01 abs; forecasts 5 % | ✅ | likelihood batch Phase 3 | ✅ | 27+| `har.logrv` | same on log RV; forecast exp(ŷ) without smearing (factor reported) | daily RV | statsmodels 1e−9 | 1e−9 | ✅ | — | ✅ |
28+| `har.rv.harq` | + β_Q (√RQ_t − √mean RQ)·RV_t exactly as highfrequency `HARmodel(type="HARQ")` (demeaning optional) | daily RV, RQ | highfrequency 1e−6, statsmodels 1e−9 | 1e−6 | ✅ | — | ✅ |
29+| `har.rolling` | rolling/expanding refits, origin-ahead forecasts, MSE/QLIKE (Patton 2011) | daily RV | causality test (future perturbation leaves forecasts unchanged) | exact | ✅ | — | ✅ |
30+| `garch.garch.gaussian` | σ²_t = ω + α ε²_{t−1} + β σ²_{t−1}; σ²_0 = sample variance of ε; constraints ω>0, α,β≥0, α+β<1 | returns | arch 8.0 (loglik 5e−4, params 5 %), rugarch 1.5.6 `ugarchfit(sGARCH)` (loglik 2e−4, params 5 %) | as stated | ✅ | ✅ batched NLL 2e−5 | ✅ |
28 | `garch.gjr.*` | + γ 1{ε<0} ε²; α+γ ≥ 0; α+β+γ/2 < 1 | returns | arch GJR (o=1) | same | ✅ | — | ✅ | 31 | `garch.gjr.*` | + γ 1{ε<0} ε²; α+γ ≥ 0; α+β+γ/2 < 1 | returns | arch GJR (o=1) | same | ✅ | — | ✅ |
29−| `garch.egarch.*` | ln σ²_t = ω + α(|z|−E|z|) + γ z + β ln σ²_{t−1}; |β|<1; h>1 forecasts by simulation (20 000 paths, seeded) | returns | arch EGARCH | same (params); forecasts h>1 not compared | ✅ | — | ✅ | 32+| `garch.egarch.*` | ln σ²_t = ω + α(|z|−E|z|) + γ z + β ln σ²_{t−1}; |β|<1; h>1 forecasts by simulation (20 000 paths, seeded). **rugarch maps alpha1 ↔ RAID γ (sign) and gamma1 ↔ RAID α (magnitude)** | returns | arch EGARCH, rugarch eGARCH (loglik 2e−4, mapped params 5 %) | same | ✅ | ✅ | ✅ |
30 | `garch.*.student_t` | standardized t, ν ∈ (2.05, 500) (arch bounds); E|z| via lgamma | returns | arch dist="t" | same; ν skipped when > 100 (unidentified) | ✅ | — | ✅ | 33 | `garch.*.student_t` | standardized t, ν ∈ (2.05, 500) (arch bounds); E|z| via lgamma | returns | arch dist="t" | same; ν skipped when > 100 (unidentified) | ✅ | — | ✅ |
31 | `garch.cov` | QMLE sandwich H⁻¹ OPG H⁻¹ (Bollerslev–Wooldridge 1992), Hessian, OPG — numerical derivatives | — | arch robust/classic | Phase 4 (SE comparison) | ✅ | — | 🧪 | 34 | `garch.cov` | QMLE sandwich H⁻¹ OPG H⁻¹ (Bollerslev–Wooldridge 1992), Hessian, OPG — numerical derivatives | — | arch robust/classic | Phase 4 (SE comparison) | ✅ | — | 🧪 |
32−| `bootstrap.stationary` / `circular` | Politis–Romano 1994 / circular block; replica generation + statistic | series | arch.bootstrap | Phase 4 | Phase 4 | Phase 3/4 | ✖ | 35+| `bootstrap.stationary` / `circular` / `iid` | Politis–Romano 1994 (geometric blocks, mean length b or n^{1/3}) / circular blocks / iid (comparison only); replica r ← Rng(seed, r); percentile CI, SE, bias; `bootstrap_rows` for regressions; `bootstrap_rv` | series | theory: AR(1) long-run SE (block SE within 35 %, > 1.6× iid SE); MC coverage 0.89 (R = 100) | as stated | ✅ | ⏳ (GPU replicas, E5) | ✅ |
36+| `simulation.*` | Monte Carlo: GARCH(1,1) n=2000 R=120 — coverage 0.90–0.95, |bias| ≤ 0.003, no failures; HAR h=5 HAC coverage 0.895–0.945 (R=200, T=1200, pseudo-true from T=200 000); RV RMSE within 10 % of √(2/M)·IV; NLL finite-difference gradients stable across h | — | `tests/simulation` | — | ✅ | — | ✅ |
33 37
34 Conventions that differ from references and are **documented, not hidden**: 38 Conventions that differ from references and are **documented, not hidden**:
35 1. GARCH initial variance: RAID uses the sample variance of ε; `arch` uses a backcast (exponentially weighted) and 39 1. GARCH initial variance: RAID uses the sample variance of ε; `arch` uses a backcast (exponentially weighted) and
modified include/raid/estimators/har.hpp +3 −2
@@ -2,7 +2,7 @@
2 // HAR-RV (Corsi 2009): y_{t+h} = β0 + βd RV_t + βw RV^{(5)}_t + βm RV^{(22)}_t + ε, RV^{(k)}_t = (1/k) Σ_{j=0}^{k−1} RV_{t−j} 2 // HAR-RV (Corsi 2009): y_{t+h} = β0 + βd RV_t + βw RV^{(5)}_t + βm RV^{(22)}_t + ε, RV^{(k)}_t = (1/k) Σ_{j=0}^{k−1} RV_{t−j}
3 // log-HAR: same with log RV on both sides (forecast = exp(ŷ) × smearing optional, not applied by default) 3 // log-HAR: same with log RV on both sides (forecast = exp(ŷ) × smearing optional, not applied by default)
4 // HAR-X: + user covariates X_t (already aligned at t) 4 // HAR-X: + user covariates X_t (already aligned at t)
5−// HARQ (Bollerslev–Patton–Quaedvlieg 2016): βd → (βd + βq √RQ_t): term βq · √RQ_t · RV_t added 5+// HARQ (Bollerslev–Patton–Quaedvlieg 2016): βd → (βd + βq √RQ_t): term βq · (√RQ_t − mean √RQ) · RV_t added (demeaning optional)
6 // Target for horizon h: y_{t+h} = (1/h) Σ_{j=1}^{h} RV_{t+j} (average over the next h days, "overlapping" when h > 1) 6 // Target for horizon h: y_{t+h} = (1/h) Σ_{j=1}^{h} RV_{t+j} (average over the next h days, "overlapping" when h > 1)
7 // or the single-day RV_{t+h} (`target = single`). Overlapping targets induce MA(h−1) errors → HAC with ≥ h−1 lags. 7 // or the single-day RV_{t+h} (`target = single`). Overlapping targets induce MA(h−1) errors → HAC with ≥ h−1 lags.
8 #pragma once 8 #pragma once
@@ -26,12 +26,13 @@ struct HarSpec {
26 HarTarget target{HarTarget::average}; 26 HarTarget target{HarTarget::average};
27 bool log{false}; // log-HAR 27 bool log{false}; // log-HAR
28 bool harq{false}; // add √RQ_t · RV_t 28 bool harq{false}; // add √RQ_t · RV_t
29+ bool harq_demean_sqrt_rq{true}; // use (√RQ_t − √(mean RQ)) · RV_t exactly as highfrequency::HARmodel(type="HARQ"); the mean is over the sample passed to the fit (estimation window), never the future
29 stats::CovOptions cov{stats::CovType::hac_bartlett, -1, false, {}, true}; // hac_lags −1 → max(h−1, ⌊4(n/100)^{2/9}⌋) 30 stats::CovOptions cov{stats::CovType::hac_bartlett, -1, false, {}, true}; // hac_lags −1 → max(h−1, ⌊4(n/100)^{2/9}⌋)
30 std::string model_key() const { return std::string(log ? "har.logrv" : "har.rv") + (harq ? ".harq" : "") + ".h" + std::to_string(horizon); } 31 std::string model_key() const { return std::string(log ? "har.logrv" : "har.rv") + (harq ? ".harq" : "") + ".h" + std::to_string(horizon); }
31 }; 32 };
32 33
33 /// Builds the aligned design (y, X) from a daily RV series (and optional RQ and exogenous columns X_t, aligned at t). 34 /// Builds the aligned design (y, X) from a daily RV series (and optional RQ and exogenous columns X_t, aligned at t).
34−struct HarDesign { Eigen::MatrixXd X; Eigen::VectorXd y; std::vector<std::string> names; usize first_t{0}; usize n{0}; }; 35+struct HarDesign { Eigen::MatrixXd X; Eigen::VectorXd y; std::vector<std::string> names; usize first_t{0}; usize n{0}; f64 sqrt_rq_mean{0}; };
35 HarDesign har_design(std::span<const f64> rv, const HarSpec& spec, std::span<const f64> rq = {}, const Eigen::MatrixXd& exog = Eigen::MatrixXd(), const std::vector<std::string>& exog_names = {}); 36 HarDesign har_design(std::span<const f64> rv, const HarSpec& spec, std::span<const f64> rq = {}, const Eigen::MatrixXd& exog = Eigen::MatrixXd(), const std::vector<std::string>& exog_names = {});
36 37
37 /// Fit one HAR on one series (CPU QR + robust covariance). Estimate.extra contains fitted/residual summaries. 38 /// Fit one HAR on one series (CPU QR + robust covariance). Estimate.extra contains fitted/residual summaries.
added include/raid/statistics/bootstrap.hpp +55 −0
@@ -0,0 +1,55 @@
1+// Block bootstrap for dependent data (registry keys bootstrap.*):
2+// stationary (Politis & Romano 1994): blocks start at uniform random indices, lengths ~ Geometric(p = 1/mean_block),
3+// wrapping circularly; expected block length = mean_block.
4+// circular block (Politis & Romano 1992): fixed block length b, start indices uniform on [0, n), wrap around.
5+// iid (for comparison only; not valid for dependent data — flagged in the registry).
6+// Index generation is deterministic given (seed, replica id): replica r uses Rng(seed, r), so replicas can be generated
7+// in parallel (CPU threads) or on the GPU with the same streams.
8+#pragma once
9+#include <vector>
10+#include <span>
11+#include <functional>
12+#include "raid/core/types.hpp"
13+#include "raid/core/rng.hpp"
14+#include "raid/core/plan.hpp"
15+#include "raid/core/estimate.hpp"
16+
17+namespace raid::stats {
18+
19+enum class BootstrapScheme { stationary, circular_block, iid };
20+
21+struct BootstrapOptions {
22+ BootstrapScheme scheme{BootstrapScheme::stationary};
23+ f64 mean_block{0}; // 0 → n^{1/3} (rule of thumb; the paper reports the value used)
24+ usize replicas{999};
25+ u64 seed{20261102};
26+ unsigned threads{0};
27+ f64 ci_level{0.95};
28+};
29+
30+/// Index vector of one replica (length n).
31+std::vector<u32> bootstrap_indices(usize n, const BootstrapOptions& o, usize replica);
32+
33+struct BootstrapResult {
34+ std::vector<f64> statistics; // one per replica (NaN if the statistic failed)
35+ f64 point{0}; // statistic on the original sample
36+ f64 se{0}; // bootstrap standard error
37+ f64 ci_lo{0}, ci_hi{0}; // percentile CI
38+ f64 bias{0}; // mean(stat*) − point
39+ usize failures{0};
40+ f64 block_length{0};
41+ f64 seconds{0};
42+};
43+
44+/// Generic scalar statistic bootstrap: stat(x_resampled) evaluated for each replica.
45+BootstrapResult bootstrap(std::span<const f64> x, const std::function<f64(std::span<const f64>)>& stat, const BootstrapOptions& o);
46+
47+/// Multivariate: statistic returns a vector (e.g. regression coefficients); rows of (y, X) are resampled jointly.
48+struct BootstrapVecResult { std::vector<std::vector<f64>> statistics; std::vector<f64> point, se, ci_lo, ci_hi; usize failures{0}; f64 block_length{0}; f64 seconds{0}; };
49+BootstrapVecResult bootstrap_rows(usize n, const std::function<std::vector<f64>(std::span<const u32>)>& stat_of_indices, const BootstrapOptions& o);
50+
51+/// Realized-variance bootstrap: for each replica, resample intraday returns within a session by blocks and recompute
52+/// RV (Gonçalves & Meddahi 2009 use the iid wild bootstrap for RV; we use block schemes to respect dependence).
53+BootstrapResult bootstrap_rv(std::span<const f64> intraday_returns, const BootstrapOptions& o);
54+
55+} // namespace raid::stats
modified python/raid/__init__.py +2 −1
@@ -18,7 +18,8 @@ except ImportError: # pragma: no cover
18 from . import findata # noqa: E402 18 from . import findata # noqa: E402
19 from .api import ( # noqa: E402 19 from .api import ( # noqa: E402
20 devices, ols, realized_measures, garch_fit, validate_bars, calendar_sessions, Backend, available_backends, 20 devices, ols, realized_measures, garch_fit, validate_bars, calendar_sessions, Backend, available_backends,
21+ har_fit, har_rolling, har_batch, bootstrap,
21 ) 22 )
22 23
23 __all__ = ["__version__", "HAS_CORE", "devices", "ols", "realized_measures", "garch_fit", "validate_bars", 24 __all__ = ["__version__", "HAS_CORE", "devices", "ols", "realized_measures", "garch_fit", "validate_bars",
24− "calendar_sessions", "Backend", "available_backends", "findata"] 25+ "calendar_sessions", "Backend", "available_backends", "findata", "har_fit", "har_rolling", "har_batch", "bootstrap"]
modified python/raid/api.py +20 −0
@@ -76,3 +76,23 @@ def bars_to_intraday_returns(timestamps_us, close, kind: str = "log") -> dict[st
76 """Session-aware intraday log/arithmetic returns from (bar open timestamp, close) arrays; returns CSR layout.""" 76 """Session-aware intraday log/arithmetic returns from (bar open timestamp, close) arrays; returns CSR layout."""
77 t = np.ascontiguousarray(timestamps_us, dtype=np.int64) 77 t = np.ascontiguousarray(timestamps_us, dtype=np.int64)
78 return _core().intraday_returns(t, _f64(close), kind) 78 return _core().intraday_returns(t, _f64(close), kind)
79+
80+
81+def har_fit(rv, lags=(1, 5, 22), horizon: int = 1, log: bool = False, harq: bool = False, rq=None, cov: str = "hac", hac_lags: int = -1, target: str = "average") -> dict[str, Any]:
82+ """HAR-RV / log-HAR / HARQ on a daily RV series with HAC (Newey–West) inference by default; returns Estimate + forecast_next."""
83+ return _core().har_fit(_f64(rv), list(lags), int(horizon), bool(log), bool(harq), None if rq is None else _f64(rq), cov, int(hac_lags), target)
84+
85+
86+def har_rolling(rv, lags=(1, 5, 22), horizon: int = 1, log: bool = False, window: int = 1000, step: int = 1, harq: bool = False, rq=None) -> dict[str, Any]:
87+ """Causal rolling re-estimation with origin-ahead forecasts; returns forecasts, actuals, MSE and QLIKE."""
88+ return _core().har_rolling(_f64(rv), list(lags), int(horizon), bool(log), int(window), int(step), bool(harq), None if rq is None else _f64(rq))
89+
90+
91+def har_batch(rv_concat, offsets, lags=(1, 5, 22), horizon: int = 1, log: bool = False, backend: str | Backend = Backend.auto) -> dict[str, Any]:
92+ """Batched HAR over a CSR panel of daily RV series (sufficient statistics on the selected backend, FP64 solve)."""
93+ return _core().har_batch(_f64(rv_concat), np.ascontiguousarray(offsets, dtype=np.int64), list(lags), int(horizon), bool(log), str(Backend(backend).value))
94+
95+
96+def bootstrap(x, stat: str = "mean", scheme: str = "stationary", mean_block: float = 0.0, replicas: int = 999, seed: int = 20261102, level: float = 0.95) -> dict[str, Any]:
97+ """Stationary / circular block / iid bootstrap of mean, realized variance (sum of squares) or variance."""
98+ return _core().bootstrap(_f64(x), stat, scheme, float(mean_block), int(replicas), int(seed), float(level))
modified python/tests/test_api.py +23 −0
@@ -58,3 +58,26 @@ def test_validate_bars_counts_missing():
58 p = 100 + np.cumsum(np.random.default_rng(1).normal(0, 0.01, size=t.size)) 58 p = 100 + np.cumsum(np.random.default_rng(1).normal(0, 0.01, size=t.size))
59 q = raid.validate_bars(t, p, p + 0.01, p - 0.01, p, np.full(t.size, 100.0)) 59 q = raid.validate_bars(t, p, p + 0.01, p - 0.01, p, np.full(t.size, 100.0))
60 assert q["n_sessions"] == 1 and q["missing_regular_bars"] == 3 and not q["has_errors"] 60 assert q["n_sessions"] == 1 and q["missing_regular_bars"] == 3 and not q["has_errors"]
61+
62+
63+def test_har_fit_matches_statsmodels_hac():
64+ sm = pytest.importorskip("statsmodels.api")
65+ rng = np.random.default_rng(8); T = 800; lv = np.empty(T); lv[0] = np.log(1e-4)
66+ for t in range(1, T): lv[t] = 0.3 * np.log(1e-4) + 0.7 * lv[t - 1] + 0.4 * rng.standard_normal()
67+ rv = np.exp(lv); e = raid.har_fit(rv, horizon=1)
68+ rows = []; ys = []
69+ for t in range(21, T - 1):
70+ rows.append([1.0, rv[t], rv[t - 4:t + 1].mean(), rv[t - 21:t + 1].mean()]); ys.append(rv[t + 1])
71+ X = np.array(rows); y = np.array(ys); L = max(0, int(np.floor(4 * (len(y) / 100) ** (2 / 9))))
72+ f = sm.OLS(y, X).fit(cov_type="HAC", cov_kwds={"maxlags": L, "use_correction": False})
73+ np.testing.assert_allclose(e["coefficients"], f.params, rtol=1e-9); np.testing.assert_allclose(e["inference"]["std_errors"], f.bse, rtol=1e-8)
74+ assert e["forecast_next"] > 0
75+ r = raid.har_rolling(rv, horizon=5, window=400, step=20); assert r["n_fits"] > 10 and r["qlike"] >= 0
76+ b = raid.har_batch(np.concatenate([rv, rv * 2]), np.array([0, T, 2 * T]), backend="auto"); assert len(b["fits"]) == 2 and b["fits"][1]["ok"]
77+
78+
79+def test_bootstrap_block_vs_iid():
80+ rng = np.random.default_rng(2); n = 1500; x = np.empty(n); x[0] = 0
81+ for t in range(1, n): x[t] = 0.7 * x[t - 1] + rng.standard_normal()
82+ blk = raid.bootstrap(x, "mean", "stationary", mean_block=20, replicas=399); iid = raid.bootstrap(x, "mean", "iid", replicas=399)
83+ assert blk["se"] > 1.5 * iid["se"] and blk["failures"] == 0 and blk["ci_lo"] < blk["point"] < blk["ci_hi"]
modified scripts/make_fixtures.py +27 −4
@@ -53,11 +53,11 @@ print("wrote", len(df), "bars for", df.symbol.nunique(), "symbols;", df.groupby(
53 ref = {} 53 ref = {}
54 try: 54 try:
55 import exchange_calendars as xc 55 import exchange_calendars as xc
56− cal = xc.get_calendar("XNYS", start="2000-01-01", end="2026-12-31") 56+ cal = xc.get_calendar("XNYS", start="2000-01-03", end="2026-12-31")
57− sess = cal.sessions_in_range("2000-01-01", "2026-12-31") 57+ sess = cal.sessions_in_range("2000-01-03", "2026-12-31")
58 ref["xnys"] = {"n_sessions_2000_2026": int(len(sess)), "sessions_2024": [str(d.date()) for d in cal.sessions_in_range("2024-01-01", "2024-12-31")], 58 ref["xnys"] = {"n_sessions_2000_2026": int(len(sess)), "sessions_2024": [str(d.date()) for d in cal.sessions_in_range("2024-01-01", "2024-12-31")],
59− "early_closes_2000_2026": [str(d.date()) for d in cal.early_closes.sessions_in_range("2000-01-01", "2026-12-31")] if hasattr(cal, "early_closes") else None, 59+ "early_closes_2000_2026": [str(d.date()) for d in cal.early_closes if "2000-01-03" <= str(d.date()) <= "2026-12-31"],
60− "holidays_2000_2026": [str(d.date()) for d in pd.bdate_range("2000-01-01", "2026-12-31") if d not in sess], 60+ "holidays_2000_2026": [str(d.date()) for d in pd.bdate_range("2000-01-03", "2026-12-31") if d not in sess],
61 "exchange_calendars_version": xc.__version__} 61 "exchange_calendars_version": xc.__version__}
62 except Exception as e: 62 except Exception as e:
63 ref["xnys"] = {"error": str(e)} 63 ref["xnys"] = {"error": str(e)}
@@ -108,3 +108,26 @@ with open(os.path.join(out_dir, "synthetic_bars_page.arrow"), "wb") as fh:
108 w.write_table(tbl) 108 w.write_table(tbl)
109 pq.write_table(tbl, os.path.join(out_dir, "synthetic_bars_page.parquet")) 109 pq.write_table(tbl, os.path.join(out_dir, "synthetic_bars_page.parquet"))
110 print("wrote synthetic_bars_page.arrow/.parquet", tbl.num_rows, "rows") 110 print("wrote synthetic_bars_page.arrow/.parquet", tbl.num_rows, "rows")
111+
112+# --- HAR reference: simulated daily RV (log-AR(1)), HAR-RV h=1 and h=5 (average target) with HAC, log-HAR, HARQ -----
113+g = np.random.default_rng(40); T = 1500; lv = np.empty(T); lv[0] = np.log(1e-4)
114+for t in range(1, T): lv[t] = 0.3 * np.log(1e-4) + 0.7 * lv[t - 1] + 0.4 * g.standard_normal()
115+rv = np.exp(lv); rq = rv ** 2 * (1 + 0.5 * g.random(T))
116+np.savetxt(os.path.join(out_dir, "har_rv.csv"), np.column_stack([rv, rq]), delimiter=",", header="rv,rq", comments="", fmt="%.17g")
117+def har_design(x, lags=(1, 5, 22), h=1, log=False, harq=None, target="average"):
118+ z = np.log(x) if log else x; L = max(lags); rows = []; ys = []
119+ sqrt_rq_mean = np.sqrt(np.mean(np.maximum(harq, 0.0))) if harq is not None else 0.0
120+ for t in range(L - 1, len(x) - h):
121+ row = [1.0] + [z[t - l + 1:t + 1].mean() for l in lags]
122+ if harq is not None: row.append((np.sqrt(max(harq[t], 0.0)) - sqrt_rq_mean) * x[t])
123+ if target == "average": yv = x[t + 1:t + h + 1].mean(); yv = np.log(yv) if log else yv
124+ else: yv = z[t + h]
125+ rows.append(row); ys.append(yv)
126+ return np.array(rows), np.array(ys)
127+har = {}
128+for name, kw in [("h1", dict(h=1)), ("h5", dict(h=5)), ("h22", dict(h=22)), ("log_h1", dict(h=1, log=True)), ("harq_h1", dict(h=1, harq=rq))]:
129+ X, y = har_design(rv, **kw); n = len(y); h = kw["h"]; L = max(h - 1, int(np.floor(4 * (n / 100) ** (2 / 9))))
130+ f = sm.OLS(y, X).fit(cov_type="HAC", cov_kwds={"maxlags": L, "use_correction": False})
131+ har[name] = {"params": f.params.tolist(), "hac_bse": f.bse.tolist(), "hac_lags": L, "n": n, "ssr": float(f.ssr), "rsquared": float(f.rsquared)}
132+ref["har"] = har; json.dump(ref, open(os.path.join(out_dir, "reference_values.json"), "w"), indent=1)
133+print("HAR references:", {k: v["n"] for k, v in har.items()})
added scripts/reference_r.R +50 −0
@@ -0,0 +1,50 @@
1+#!/usr/bin/env Rscript
2+# Reference values from R: highfrequency (realized measures, HARmodel) and rugarch (GARCH family) on the committed
3+# synthetic fixtures. Output: datasets/fixtures/reference_r.json. Versions are recorded in the JSON.
4+suppressPackageStartupMessages({ library(highfrequency); library(rugarch); library(xts); library(jsonlite) })
5+root <- normalizePath(file.path(dirname(sub("--file=", "", grep("--file=", commandArgs(), value = TRUE)[1])), ".."))
6+fx <- file.path(root, "datasets", "fixtures")
7+out <- list(versions = list(R = R.version.string, highfrequency = as.character(packageVersion("highfrequency")), rugarch = as.character(packageVersion("rugarch"))))
8+
9+# ---- realized measures per session on the synthetic 1-minute bars (regular session, log returns) -------------------
10+bars <- read.csv(file.path(fx, "synthetic_bars_1m.csv"), stringsAsFactors = FALSE)
11+bars$ts <- as.POSIXct(bars$timestamp_utc, format = "%Y-%m-%dT%H:%M:%SZ", tz = "UTC")
12+bars$et <- format(bars$ts, tz = "America/New_York", format = "%H:%M")
13+bars$sess <- as.Date(format(bars$ts, tz = "America/New_York", format = "%Y-%m-%d"))
14+early <- as.Date("2024-11-29")
15+rm <- list()
16+for (sym in unique(bars$symbol)) {
17+ b <- bars[bars$symbol == sym, ]
18+ for (d in as.character(unique(b$sess))) {
19+ s <- b[b$sess == as.Date(d), ]; close_min <- if (as.Date(d) == early) "13:00" else "16:00"
20+ s <- s[s$et >= "09:30" & s$et <= close_min, ]
21+ p <- xts(s$close, order.by = s$ts); r <- diff(log(p))[-1]
22+ rm[[paste(sym, d)]] <- list(symbol = sym, session = d, n_returns = length(r),
23+ rv = as.numeric(rCov(r, makeReturns = FALSE)), bpv = as.numeric(rBPCov(r, makeReturns = FALSE)),
24+ rsv = as.list(as.numeric(rSVar(r, makeReturns = FALSE))), rq = as.numeric(rQuar(r, makeReturns = FALSE)),
25+ bns_jump_stat = tryCatch(as.numeric(BNSjumpTest(r, makeReturns = FALSE)$ztest), error = function(e) NA))
26+ }
27+}
28+out$realized <- unname(rm)
29+
30+# ---- HARmodel on the daily RV fixture -----------------------------------------------------------------------------
31+h <- read.csv(file.path(fx, "har_rv.csv")); dates <- seq(as.Date("2018-01-01"), by = "day", length.out = nrow(h))
32+rvx <- xts(h$rv, order.by = dates)
33+hm <- HARmodel(rvx, periods = c(1, 5, 22), RVest = c("rCov"), type = "HAR", h = 1, transform = NULL, inputType = "RM")
34+out$har_h1 <- list(coef = as.list(unname(coef(hm))), names = names(coef(hm)), n = length(hm$residuals), ssr = sum(hm$residuals^2))
35+hm5 <- HARmodel(rvx, periods = c(1, 5, 22), RVest = c("rCov"), type = "HAR", h = 5, transform = NULL, inputType = "RM")
36+out$har_h5 <- list(coef = as.list(unname(coef(hm5))), n = length(hm5$residuals), ssr = sum(hm5$residuals^2))
37+hq <- HARmodel(xts(cbind(h$rv, h$rq), order.by = dates), periods = c(1, 5, 22), periodsQ = c(1), RVest = c("rCov", "rQuar"), type = "HARQ", h = 1, transform = NULL, inputType = "RM")
38+out$harq_h1 <- list(coef = as.list(unname(coef(hq))), names = names(coef(hq)), n = length(hq$residuals), ssr = sum(hq$residuals^2))
39+
40+# ---- rugarch on the simulated GARCH returns ------------------------------------------------------------------------
41+r <- read.csv(file.path(fx, "garch_returns.csv"))$r
42+fit_one <- function(model, dist) {
43+ spec <- ugarchspec(variance.model = list(model = model, garchOrder = c(1, 1)), mean.model = list(armaOrder = c(0, 0), include.mean = TRUE), distribution.model = dist)
44+ f <- ugarchfit(spec, r, solver = "hybrid")
45+ list(coef = as.list(coef(f)), se = as.list(f@fit$matcoef[, 2]), robust_se = as.list(f@fit$robust.matcoef[, 2]), loglik = as.numeric(likelihood(f)), converged = f@fit$convergence == 0,
46+ forecast_h5 = as.numeric(sigma(ugarchforecast(f, n.ahead = 5)))^2)
47+}
48+out$garch <- list(sGARCH.norm = fit_one("sGARCH", "norm"), gjrGARCH.norm = fit_one("gjrGARCH", "norm"), eGARCH.norm = fit_one("eGARCH", "norm"), sGARCH.std = fit_one("sGARCH", "std"))
49+write(toJSON(out, auto_unbox = TRUE, digits = 17, pretty = TRUE), file.path(fx, "reference_r.json"))
50+cat("wrote reference_r.json\n")
modified src/estimators/har.cpp +7 −3
@@ -15,17 +15,20 @@ HarDesign har_design(std::span<const f64> rv, const HarSpec& spec, std::span<con
15 if (spec.harq) RAID_REQUIRE(rq.size() == T, invalid_argument, "harq: RQ series required with the same length"); 15 if (spec.harq) RAID_REQUIRE(rq.size() == T, invalid_argument, "harq: RQ series required with the same length");
16 const usize nex = exog.size() ? static_cast<usize>(exog.cols()) : 0; if (nex) RAID_REQUIRE(static_cast<usize>(exog.rows()) == T, invalid_argument, "har-x: exog rows must equal T"); 16 const usize nex = exog.size() ? static_cast<usize>(exog.cols()) : 0; if (nex) RAID_REQUIRE(static_cast<usize>(exog.rows()) == T, invalid_argument, "har-x: exog rows must equal T");
17 std::vector<f64> z(T); for (usize t = 0; t < T; ++t) z[t] = spec.log ? std::log(rv[t]) : rv[t]; 17 std::vector<f64> z(T); for (usize t = 0; t < T; ++t) z[t] = spec.log ? std::log(rv[t]) : rv[t];
18+ f64 sqrt_rq_mean = 0.0;
19+ if (spec.harq && spec.harq_demean_sqrt_rq) { f64 s = 0; for (usize t = 0; t < T; ++t) s += std::max(rq[t], 0.0); sqrt_rq_mean = std::sqrt(s / static_cast<f64>(T)); } // √(mean RQ) over the sample, as highfrequency::HARmodel
18 // prefix sums for the window means (FP64, Neumaier) 20 // prefix sums for the window means (FP64, Neumaier)
19 std::vector<f64> cs(T + 1, 0.0); { f64 s = 0, c = 0; for (usize t = 0; t < T; ++t) { const f64 v = z[t], tt = s + v; if (std::abs(s) >= std::abs(v)) c += (s - tt) + v; else c += (v - tt) + s; s = tt; cs[t + 1] = s + c; } } 21 std::vector<f64> cs(T + 1, 0.0); { f64 s = 0, c = 0; for (usize t = 0; t < T; ++t) { const f64 v = z[t], tt = s + v; if (std::abs(s) >= std::abs(v)) c += (s - tt) + v; else c += (v - tt) + s; s = tt; cs[t + 1] = s + c; } }
20 auto wmean = [&](usize t, usize k) { f64 s = 0; for (usize j = 0; j < k; ++j) s += z[t - j]; return s / static_cast<f64>(k); }; // direct sum (exact enough, k ≤ 22) 22 auto wmean = [&](usize t, usize k) { f64 s = 0; for (usize j = 0; j < k; ++j) s += z[t - j]; return s / static_cast<f64>(k); }; // direct sum (exact enough, k ≤ 22)
21 const usize first = maxlag - 1, last = T - 1 - h; // origins t with full lags and a full target 23 const usize first = maxlag - 1, last = T - 1 - h; // origins t with full lags and a full target
22 HarDesign d; d.first_t = first; d.n = last - first + 1; const usize k = 1 + spec.lags.size() + (spec.harq ? 1 : 0) + nex; 24 HarDesign d; d.first_t = first; d.n = last - first + 1; const usize k = 1 + spec.lags.size() + (spec.harq ? 1 : 0) + nex;
23 d.X.resize(static_cast<Eigen::Index>(d.n), static_cast<Eigen::Index>(k)); d.y.resize(static_cast<Eigen::Index>(d.n)); 25 d.X.resize(static_cast<Eigen::Index>(d.n), static_cast<Eigen::Index>(k)); d.y.resize(static_cast<Eigen::Index>(d.n));
24− d.names.push_back("const"); for (usize l : spec.lags) d.names.push_back((spec.log ? "logrv_" : "rv_") + std::to_string(l)); if (spec.harq) d.names.push_back("sqrt_rq_x_rv"); for (usize j = 0; j < nex; ++j) d.names.push_back(j < exog_names.size() ? exog_names[j] : "x" + std::to_string(j)); 26+ d.names.push_back("const"); for (usize l : spec.lags) d.names.push_back((spec.log ? "logrv_" : "rv_") + std::to_string(l)); if (spec.harq) d.names.push_back(spec.harq_demean_sqrt_rq ? "sqrt_rq_dm_x_rv" : "sqrt_rq_x_rv");
27+ d.sqrt_rq_mean = sqrt_rq_mean; for (usize j = 0; j < nex; ++j) d.names.push_back(j < exog_names.size() ? exog_names[j] : "x" + std::to_string(j));
25 for (usize t = first; t <= last; ++t) { 28 for (usize t = first; t <= last; ++t) {
26 const Eigen::Index i = static_cast<Eigen::Index>(t - first); Eigen::Index c = 0; d.X(i, c++) = 1.0; 29 const Eigen::Index i = static_cast<Eigen::Index>(t - first); Eigen::Index c = 0; d.X(i, c++) = 1.0;
27 for (usize l : spec.lags) d.X(i, c++) = wmean(t, l); 30 for (usize l : spec.lags) d.X(i, c++) = wmean(t, l);
28− if (spec.harq) d.X(i, c++) = std::sqrt(std::max(rq[t], 0.0)) * rv[t]; 31+ if (spec.harq) d.X(i, c++) = (std::sqrt(std::max(rq[t], 0.0)) - sqrt_rq_mean) * rv[t];
29 for (usize j = 0; j < nex; ++j) d.X(i, c++) = exog(static_cast<Eigen::Index>(t), static_cast<Eigen::Index>(j)); 32 for (usize j = 0; j < nex; ++j) d.X(i, c++) = exog(static_cast<Eigen::Index>(t), static_cast<Eigen::Index>(j));
30 if (spec.target == HarTarget::single) d.y[i] = z[t + h]; else { f64 s = 0; for (usize j = 1; j <= h; ++j) s += spec.log ? rv[t + j] : z[t + j]; s /= static_cast<f64>(h); d.y[i] = spec.log ? std::log(s) : s; } 33 if (spec.target == HarTarget::single) d.y[i] = z[t + h]; else { f64 s = 0; for (usize j = 1; j <= h; ++j) s += spec.log ? rv[t + j] : z[t + j]; s /= static_cast<f64>(h); d.y[i] = spec.log ? std::log(s) : s; }
31 } 34 }
@@ -39,6 +42,7 @@ Estimate har_fit(std::span<const f64> rv, const HarSpec& spec, std::span<const f
39 auto r = ols(d.X, d.y, o); Estimate e = r.estimate; e.model = spec.model_key(); 42 auto r = ols(d.X, d.y, o); Estimate e = r.estimate; e.model = spec.model_key();
40 e.extra["horizon"] = spec.horizon; e.extra["target"] = spec.target == HarTarget::average ? "average" : "single"; e.extra["lags"] = spec.lags; e.extra["first_origin"] = d.first_t; e.extra["log"] = spec.log; e.extra["harq"] = spec.harq; 43 e.extra["horizon"] = spec.horizon; e.extra["target"] = spec.target == HarTarget::average ? "average" : "single"; e.extra["lags"] = spec.lags; e.extra["first_origin"] = d.first_t; e.extra["log"] = spec.log; e.extra["harq"] = spec.harq;
41 if (spec.log) { f64 s = 0; for (Eigen::Index i = 0; i < r.residuals.size(); ++i) s += std::exp(r.residuals[i]); e.extra["smearing"] = s / static_cast<f64>(r.residuals.size()); } 44 if (spec.log) { f64 s = 0; for (Eigen::Index i = 0; i < r.residuals.size(); ++i) s += std::exp(r.residuals[i]); e.extra["smearing"] = s / static_cast<f64>(r.residuals.size()); }
45+ if (spec.harq) e.extra["sqrt_rq_mean"] = d.sqrt_rq_mean;
42 return e; 46 return e;
43 } 47 }
44 48
@@ -46,7 +50,7 @@ f64 har_forecast(const Estimate& fit, std::span<const f64> rv, const HarSpec& sp
46 const usize T = rv.size(); const usize maxlag = *std::max_element(spec.lags.begin(), spec.lags.end()); RAID_REQUIRE(T >= maxlag, insufficient_samples, "har_forecast: not enough history"); 50 const usize T = rv.size(); const usize maxlag = *std::max_element(spec.lags.begin(), spec.lags.end()); RAID_REQUIRE(T >= maxlag, insufficient_samples, "har_forecast: not enough history");
47 const usize t = T - 1; f64 yhat = fit.coefficients[0]; usize c = 1; 51 const usize t = T - 1; f64 yhat = fit.coefficients[0]; usize c = 1;
48 for (usize l : spec.lags) { f64 s = 0; for (usize j = 0; j < l; ++j) s += spec.log ? std::log(rv[t - j]) : rv[t - j]; yhat += fit.coefficients[c++] * s / static_cast<f64>(l); } 52 for (usize l : spec.lags) { f64 s = 0; for (usize j = 0; j < l; ++j) s += spec.log ? std::log(rv[t - j]) : rv[t - j]; yhat += fit.coefficients[c++] * s / static_cast<f64>(l); }
49− if (spec.harq) { RAID_REQUIRE(rq.size() == T, invalid_argument, "harq forecast needs RQ"); yhat += fit.coefficients[c++] * std::sqrt(std::max(rq[t], 0.0)) * rv[t]; } 53+ if (spec.harq) { RAID_REQUIRE(rq.size() == T, invalid_argument, "harq forecast needs RQ"); const f64 dm = fit.extra.value("sqrt_rq_mean", 0.0); yhat += fit.coefficients[c++] * (std::sqrt(std::max(rq[t], 0.0)) - dm) * rv[t]; }
50 for (Eigen::Index j = 0; j < exog_last.size(); ++j) yhat += fit.coefficients[c++] * exog_last[j]; 54 for (Eigen::Index j = 0; j < exog_last.size(); ++j) yhat += fit.coefficients[c++] * exog_last[j];
51 return spec.log ? std::exp(yhat) : yhat; 55 return spec.log ? std::exp(yhat) : yhat;
52 } 56 }
added src/statistics/bootstrap.cpp +48 −0
@@ -0,0 +1,48 @@
1+#include "raid/statistics/bootstrap.hpp"
2+#include "raid/core/error.hpp"
3+#include "raid/core/thread_pool.hpp"
4+#include "raid/statistics/reductions.hpp"
5+#include <algorithm>
6+#include <chrono>
7+#include <cmath>
8+
9+namespace raid::stats {
10+
11+namespace {
12+f64 block_len(usize n, const BootstrapOptions& o) { return o.mean_block > 0 ? o.mean_block : std::max(1.0, std::round(std::cbrt(static_cast<f64>(n)))); }
13+f64 quantile(std::vector<f64> v, f64 q) { v.erase(std::remove_if(v.begin(), v.end(), [](f64 x) { return !std::isfinite(x); }), v.end()); if (v.empty()) return std::numeric_limits<f64>::quiet_NaN(); std::sort(v.begin(), v.end()); const f64 pos = q * static_cast<f64>(v.size() - 1); const usize i = static_cast<usize>(pos); const f64 fr = pos - static_cast<f64>(i); return i + 1 < v.size() ? v[i] * (1 - fr) + v[i + 1] * fr : v[i]; }
14+}
15+
16+std::vector<u32> bootstrap_indices(usize n, const BootstrapOptions& o, usize replica) {
17+ RAID_REQUIRE(n >= 2, insufficient_samples, "bootstrap: n >= 2");
18+ Rng rng(o.seed, 1000003ULL + replica); std::vector<u32> idx(n); const f64 b = block_len(n, o);
19+ if (o.scheme == BootstrapScheme::iid) { for (usize i = 0; i < n; ++i) idx[i] = static_cast<u32>(rng.below(n)); return idx; }
20+ usize i = 0;
21+ if (o.scheme == BootstrapScheme::circular_block) { const usize bl = std::max<usize>(1, static_cast<usize>(std::llround(b))); while (i < n) { const usize start = rng.below(n); for (usize j = 0; j < bl && i < n; ++j) idx[i++] = static_cast<u32>((start + j) % n); } return idx; }
22+ const f64 p = 1.0 / b; // stationary
23+ while (i < n) { const usize start = rng.below(n); const usize len = static_cast<usize>(rng.geometric(p)); for (usize j = 0; j < len && i < n; ++j) idx[i++] = static_cast<u32>((start + j) % n); }
24+ return idx;
25+}
26+
27+BootstrapResult bootstrap(std::span<const f64> x, const std::function<f64(std::span<const f64>)>& stat, const BootstrapOptions& o) {
28+ const auto t0 = std::chrono::steady_clock::now(); BootstrapResult r; const usize n = x.size(); r.block_length = block_len(n, o); r.point = stat(x); r.statistics.assign(o.replicas, std::numeric_limits<f64>::quiet_NaN());
29+ ThreadPool pool(o.threads);
30+ pool.parallel_for(o.replicas, [&](usize b0, usize b1) { std::vector<f64> xs(n); for (usize b = b0; b < b1; ++b) { auto idx = bootstrap_indices(n, o, b); for (usize i = 0; i < n; ++i) xs[i] = x[idx[i]]; try { r.statistics[b] = stat(xs); } catch (...) { r.statistics[b] = std::numeric_limits<f64>::quiet_NaN(); } } });
31+ std::vector<f64> ok; for (f64 v : r.statistics) if (std::isfinite(v)) ok.push_back(v); else ++r.failures;
32+ if (ok.size() >= 2) { Welford w; for (f64 v : ok) w.add(v); r.se = std::sqrt(w.variance()); r.bias = w.mean - r.point; const f64 a = (1 - o.ci_level) / 2; r.ci_lo = quantile(ok, a); r.ci_hi = quantile(ok, 1 - a); }
33+ r.seconds = std::chrono::duration<f64>(std::chrono::steady_clock::now() - t0).count(); return r;
34+}
35+
36+BootstrapVecResult bootstrap_rows(usize n, const std::function<std::vector<f64>(std::span<const u32>)>& stat, const BootstrapOptions& o) {
37+ const auto t0 = std::chrono::steady_clock::now(); BootstrapVecResult r; r.block_length = block_len(n, o);
38+ std::vector<u32> id(n); for (usize i = 0; i < n; ++i) id[i] = static_cast<u32>(i); r.point = stat(id); const usize k = r.point.size();
39+ r.statistics.assign(o.replicas, std::vector<f64>(k, std::numeric_limits<f64>::quiet_NaN())); ThreadPool pool(o.threads);
40+ pool.parallel_for(o.replicas, [&](usize b0, usize b1) { for (usize b = b0; b < b1; ++b) { auto idx = bootstrap_indices(n, o, b); try { auto s = stat(idx); if (s.size() == k) r.statistics[b] = s; } catch (...) {} } });
41+ r.se.assign(k, 0); r.ci_lo.assign(k, 0); r.ci_hi.assign(k, 0); const f64 a = (1 - o.ci_level) / 2;
42+ for (usize j = 0; j < k; ++j) { std::vector<f64> col; for (auto& s : r.statistics) if (std::isfinite(s[j])) col.push_back(s[j]); if (j == 0) r.failures = o.replicas - col.size(); if (col.size() >= 2) { Welford w; for (f64 v : col) w.add(v); r.se[j] = std::sqrt(w.variance()); r.ci_lo[j] = quantile(col, a); r.ci_hi[j] = quantile(col, 1 - a); } }
43+ r.seconds = std::chrono::duration<f64>(std::chrono::steady_clock::now() - t0).count(); return r;
44+}
45+
46+BootstrapResult bootstrap_rv(std::span<const f64> r, const BootstrapOptions& o) { return bootstrap(r, [](std::span<const f64> x) { return sum_squares(x); }, o); }
47+
48+} // namespace raid::stats
added tests/reference/test_har_reference.cpp +37 −0
@@ -0,0 +1,37 @@
1+#include <catch2/catch_test_macros.hpp>
2+#include <catch2/matchers/catch_matchers_floating_point.hpp>
3+#include <nlohmann/json.hpp>
4+#include <fstream>
5+#include "raid/estimators/har.hpp"
6+#include "raid/core/rng.hpp"
7+using namespace raid; using json = nlohmann::json; using Catch::Matchers::WithinRel; using Catch::Matchers::WithinAbs;
8+
9+static void load_rv(std::vector<double>& rv, std::vector<double>& rq) { std::ifstream f(std::string(RAID_SOURCE_DIR) + "/datasets/fixtures/har_rv.csv"); REQUIRE(f.good()); std::string line; std::getline(f, line); while (std::getline(f, line)) { auto c = line.find(','); rv.push_back(std::stod(line.substr(0, c))); rq.push_back(std::stod(line.substr(c + 1))); } }
10+
11+TEST_CASE("HAR-RV / log-HAR / HARQ with HAC match statsmodels on the fixture", "[reference][har]") {
12+ std::ifstream f(std::string(RAID_SOURCE_DIR) + "/datasets/fixtures/reference_values.json"); json ref; f >> ref; auto har = ref["har"];
13+ std::vector<double> rv, rq; load_rv(rv, rq);
14+ struct C { const char* key; int h; bool log; bool harq; }; const C cases[] = {{"h1", 1, false, false}, {"h5", 5, false, false}, {"h22", 22, false, false}, {"log_h1", 1, true, false}, {"harq_h1", 1, false, true}};
15+ for (auto& c : cases) {
16+ est::HarSpec s; s.horizon = c.h; s.log = c.log; s.harq = c.harq; auto e = est::har_fit(rv, s, c.harq ? std::span<const double>(rq) : std::span<const double>());
17+ INFO(c.key); REQUIRE(e.ok()); auto r = har[c.key]; REQUIRE(e.n_obs == r["n"].get<usize>());
18+ for (usize j = 0; j < e.coefficients.size(); ++j) { CHECK_THAT(e.coefficients[j], WithinRel(r["params"][j].get<double>(), 1e-9)); CHECK_THAT(e.inference->std_errors[j], WithinRel(r["hac_bse"][j].get<double>(), 1e-8)); }
19+ CHECK(e.inference->covariance_type == "hac_bartlett(" + std::to_string(r["hac_lags"].get<int>()) + ")"); CHECK_THAT(e.loss, WithinRel(r["ssr"].get<double>(), 1e-9));
20+ }
21+}
22+TEST_CASE("HAR batched (sufficient statistics, auto backend) equals per-series QR fits", "[har]") {
23+ std::vector<double> rv, rq; load_rv(rv, rq); const usize S = 6; std::vector<double> cat; std::vector<i64> off = {0};
24+ Rng r(5); for (usize s = 0; s < S; ++s) { for (double v : rv) cat.push_back(v * (1 + 0.1 * r.normal()) * (s + 1)); off.push_back(static_cast<i64>(cat.size())); }
25+ est::HarSpec spec; spec.horizon = 1; spec.cov.type = stats::CovType::classical;
26+ for (auto bk : {Backend::cpu, Backend::automatic}) { ExecutionPlan p; p.backend = bk; auto b = est::har_batch(cat, off, spec, p); REQUIRE(b.fits.size() == S);
27+ for (usize s = 0; s < S; ++s) { auto single = est::har_fit(std::span<const double>(cat).subspan(static_cast<usize>(off[s]), static_cast<usize>(off[s + 1] - off[s])), spec); REQUIRE(b.fits[s].ok());
28+ for (usize j = 0; j < 4; ++j) { INFO("backend " << to_string(bk) << " s=" << s << " j=" << j); CHECK_THAT(b.fits[s].coefficients[j], WithinAbs(single.coefficients[j], bk == Backend::cpu ? 1e-9 : 1e-4 * std::max(1.0, std::abs(single.coefficients[j])))); } } }
29+}
30+TEST_CASE("HAR rolling forecasts are causal and losses are finite", "[har]") {
31+ std::vector<double> rv, rq; load_rv(rv, rq); est::HarSpec s; s.horizon = 5; auto roll = est::har_rolling(rv, s, 500, 10);
32+ CHECK(roll.n_fits > 50); for (usize i = 0; i < roll.origin.size(); ++i) { CHECK(roll.forecast[i] > 0); double a = 0; for (int j = 1; j <= 5; ++j) a += rv[roll.origin[i] + j]; CHECK_THAT(roll.actual[i], WithinRel(a / 5.0, 1e-12)); }
33+ auto l = est::forecast_loss(roll.actual, roll.forecast); CHECK(l.n == roll.actual.size()); CHECK(std::isfinite(l.qlike)); CHECK(l.qlike >= 0);
34+ // the forecast at origin t uses only rv[0..t]: refitting with the future perturbed must not change it
35+ std::vector<double> rv2 = rv; for (usize t = roll.origin[0] + 1; t < rv2.size(); ++t) rv2[t] *= 3.0; auto roll2 = est::har_rolling(rv2, s, 500, 10); CHECK_THAT(roll2.forecast[0], WithinRel(roll.forecast[0], 1e-12));
36+ est::HarSpec lg; lg.log = true; auto e = est::har_fit(rv, lg); CHECK(e.extra.contains("smearing")); CHECK(est::har_forecast(e, rv, lg) > 0);
37+}
added tests/reference/test_r_reference.cpp +55 −0
@@ -0,0 +1,55 @@
1+// RAID vs R (highfrequency 1.0.3, rugarch 1.5.6) on the committed fixtures — values from scripts/reference_r.R.
2+#include <catch2/catch_test_macros.hpp>
3+#include <catch2/matchers/catch_matchers_floating_point.hpp>
4+#include <nlohmann/json.hpp>
5+#include <fstream>
6+#include "raid/data/io.hpp"
7+#include "raid/data/returns.hpp"
8+#include "raid/estimators/realized.hpp"
9+#include "raid/estimators/har.hpp"
10+#include "raid/models/garch.hpp"
11+using namespace raid; using json = nlohmann::json; using Catch::Matchers::WithinRel; using Catch::Matchers::WithinAbs;
12+
13+static json load() { std::ifstream f(std::string(RAID_SOURCE_DIR) + "/datasets/fixtures/reference_r.json"); REQUIRE(f.good()); json j; f >> j; return j; }
14+
15+TEST_CASE("Realized measures match highfrequency (rCov, rBPCov, rSVar, rQuar)", "[reference][r][realized]") {
16+ auto R = load(); auto bars = data::read_bars_csv(std::string(RAID_SOURCE_DIR) + "/datasets/fixtures/synthetic_bars_1m.csv"); MarketCalendar cal;
17+ for (auto& e : R["realized"]) {
18+ const std::string sym = e["symbol"], sess = e["session"]; auto b = bars.at(sym); b.normalize(); auto reg = b.filter_session(cal, SessionPolicy::regular); auto ir = data::intraday_returns(reg);
19+ usize k = 0; while (k < ir.session_dates.size() && ir.session_dates[k].iso() != sess) ++k; REQUIRE(k < ir.session_dates.size());
20+ est::RealizedOptions o; o.plan.backend = Backend::cpu; o.bpv_finite_sample = false; auto m = est::realized_measures(ir, o); // highfrequency's rBPCov with makeReturns=FALSE applies no M/(M−1) factor
21+ INFO(sym << " " << sess); CHECK(m.n_returns[k] == e["n_returns"].get<usize>());
22+ CHECK_THAT(m.rv[k], WithinRel(e["rv"].get<double>(), 1e-10)); CHECK_THAT(m.bpv[k], WithinRel(e["bpv"].get<double>(), 1e-10));
23+ CHECK_THAT(m.rsv_neg[k], WithinRel(e["rsv"][0].get<double>(), 1e-10)); CHECK_THAT(m.rsv_pos[k], WithinRel(e["rsv"][1].get<double>(), 1e-10));
24+ // highfrequency::rQuar uses N = (number of returns + 1)/3 (number of prices); RAID uses M/3 (BPQ 2016, BNS 2002): convert
25+ const double M = static_cast<double>(m.n_returns[k]); CHECK_THAT(m.rq[k] * (M + 1.0) / M, WithinRel(e["rq"].get<double>(), 1e-10));
26+ }
27+}
28+TEST_CASE("HAR-RV coefficients match highfrequency::HARmodel (h = 1)", "[reference][r][har]") {
29+ auto R = load(); std::vector<double> rv, rq; { std::ifstream f(std::string(RAID_SOURCE_DIR) + "/datasets/fixtures/har_rv.csv"); std::string line; std::getline(f, line); while (std::getline(f, line)) { auto c = line.find(','); rv.push_back(std::stod(line.substr(0, c))); rq.push_back(std::stod(line.substr(c + 1))); } }
30+ est::HarSpec s; s.horizon = 1; auto e = est::har_fit(rv, s); auto h1 = R["har_h1"];
31+ CHECK(e.n_obs == h1["n"].get<usize>()); for (int j = 0; j < 4; ++j) CHECK_THAT(e.coefficients[j], WithinRel(h1["coef"][j].get<double>(), 1e-8)); CHECK_THAT(e.loss, WithinRel(h1["ssr"].get<double>(), 1e-8));
32+ // h = 5: highfrequency uses the h-day *average* RV as the dependent variable (same as our HarTarget::average)
33+ s.horizon = 5; auto e5 = est::har_fit(rv, s); auto h5 = R["har_h5"]; INFO("n ours " << e5.n_obs << " R " << h5["n"].get<usize>());
34+ if (e5.n_obs == h5["n"].get<usize>()) { for (int j = 0; j < 4; ++j) CHECK_THAT(e5.coefficients[j], WithinRel(h5["coef"][j].get<double>(), 1e-6)); }
35+ else WARN("HARmodel h=5 sample size differs (" + std::to_string(h5["n"].get<usize>()) + " vs " + std::to_string(e5.n_obs) + "): alignment convention documented in the registry");
36+ // HARQ: highfrequency's RQ1 term is sqrt(RQ_t) * RV_t (BPQ 2016); coefficient scale must agree
37+ est::HarSpec q; q.harq = true; auto eq = est::har_fit(rv, q, rq); auto hq = R["harq_h1"]; INFO("harq n ours " << eq.n_obs << " R " << hq["n"].get<usize>());
38+ if (eq.n_obs == hq["n"].get<usize>()) for (int j = 0; j < 5; ++j) CHECK_THAT(eq.coefficients[j], WithinRel(hq["coef"][j].get<double>(), 1e-6));
39+}
40+TEST_CASE("GARCH family matches rugarch within tolerance (parameter mapping documented)", "[reference][r][garch]") {
41+ auto R = load(); std::vector<double> r; { std::ifstream f(std::string(RAID_SOURCE_DIR) + "/datasets/fixtures/garch_returns.csv"); std::string line; std::getline(f, line); while (std::getline(f, line)) r.push_back(std::stod(line)); }
42+ using namespace models;
43+ auto check = [&](const char* key, GarchModel m, GarchDist d, std::vector<std::pair<int, const char*>> map) {
44+ GarchFitOptions o; o.model = m; o.dist = d; auto fit = garch_fit(r, o); INFO(key); REQUIRE(fit.ok()); auto g = R["garch"][key];
45+ // rugarch initialises σ² with the sample variance (as RAID) → log-likelihoods should agree to 1e-4 relative
46+ CHECK_THAT(-fit.loss, WithinRel(g["loglik"].get<double>(), 2e-4));
47+ for (auto& [j, name] : map) { const double ours = fit.coefficients[static_cast<usize>(j)], theirs = g["coef"][name].get<double>(); INFO(name << " ours " << ours << " rugarch " << theirs); CHECK((std::abs(ours - theirs) <= 0.05 * std::abs(theirs) + 0.01)); }
48+ return fit; };
49+ check("sGARCH.norm", GarchModel::garch, GarchDist::gaussian, {{0, "mu"}, {1, "omega"}, {2, "alpha1"}, {3, "beta1"}});
50+ check("gjrGARCH.norm", GarchModel::gjr, GarchDist::gaussian, {{0, "mu"}, {1, "omega"}, {2, "alpha1"}, {3, "gamma1"}, {4, "beta1"}});
51+ // rugarch eGARCH: log σ² = ω + α z + γ(|z| − E|z|) + β log σ² ⇒ rugarch alpha1 = RAID gamma (sign), rugarch gamma1 = RAID alpha (magnitude)
52+ check("eGARCH.norm", GarchModel::egarch, GarchDist::gaussian, {{0, "mu"}, {1, "omega"}, {2, "gamma1"}, {3, "alpha1"}, {4, "beta1"}});
53+ auto t = check("sGARCH.std", GarchModel::garch, GarchDist::student_t, {{0, "mu"}, {1, "omega"}, {2, "alpha1"}, {3, "beta1"}});
54+ CHECK(t.coefficients.back() > 30.0); // rugarch shape → 100 (its upper bound); RAID ν → its own upper bound (500): Gaussian data, ν unidentified
55+}
modified tests/reference/test_reference_values.cpp +2 −2
@@ -33,7 +33,7 @@ TEST_CASE("OLS and robust standard errors match statsmodels", "[reference][ols]"
33 33
34 TEST_CASE("XNYS calendar matches exchange_calendars", "[reference][calendar]") { 34 TEST_CASE("XNYS calendar matches exchange_calendars", "[reference][calendar]") {
35 auto ref = load_ref()["xnys"]; if (ref.contains("error")) { WARN("exchange_calendars unavailable when fixtures were generated: " + ref["error"].get<std::string>()); return; } 35 auto ref = load_ref()["xnys"]; if (ref.contains("error")) { WARN("exchange_calendars unavailable when fixtures were generated: " + ref["error"].get<std::string>()); return; }
36− MarketCalendar cal; std::set<std::string> ours; for (auto d : cal.sessions(Date::from_ymd(2000, 1, 1), Date::from_ymd(2026, 12, 31))) ours.insert(d.iso()); 36+ MarketCalendar cal; std::set<std::string> ours; for (auto d : cal.sessions(Date::from_ymd(2000, 1, 3), Date::from_ymd(2026, 12, 31))) ours.insert(d.iso());
37 CHECK(ours.size() == ref["n_sessions_2000_2026"].get<usize>()); 37 CHECK(ours.size() == ref["n_sessions_2000_2026"].get<usize>());
38 std::set<std::string> theirs2024; for (auto& s : ref["sessions_2024"]) theirs2024.insert(s.get<std::string>()); 38 std::set<std::string> theirs2024; for (auto& s : ref["sessions_2024"]) theirs2024.insert(s.get<std::string>());
39 std::set<std::string> ours2024; for (auto d : cal.sessions(Date::from_ymd(2024, 1, 1), Date::from_ymd(2024, 12, 31))) ours2024.insert(d.iso()); 39 std::set<std::string> ours2024; for (auto d : cal.sessions(Date::from_ymd(2024, 1, 1), Date::from_ymd(2024, 12, 31))) ours2024.insert(d.iso());
@@ -41,7 +41,7 @@ TEST_CASE("XNYS calendar matches exchange_calendars", "[reference][calendar]") {
41 usize mismatches = 0; for (auto& h : ref["holidays_2000_2026"]) if (ours.count(h.get<std::string>())) { ++mismatches; UNSCOPED_INFO("RAID trades on " << h.get<std::string>() << " but exchange_calendars does not"); } 41 usize mismatches = 0; for (auto& h : ref["holidays_2000_2026"]) if (ours.count(h.get<std::string>())) { ++mismatches; UNSCOPED_INFO("RAID trades on " << h.get<std::string>() << " but exchange_calendars does not"); }
42 CHECK(mismatches == 0); 42 CHECK(mismatches == 0);
43 if (!ref["early_closes_2000_2026"].is_null()) { usize bad = 0; for (auto& e : ref["early_closes_2000_2026"]) { Date d = date_from_iso(e.get<std::string>()); if (!cal.is_early_close(d)) { ++bad; UNSCOPED_INFO("missing early close " << e.get<std::string>()); } } CHECK(bad == 0); 43 if (!ref["early_closes_2000_2026"].is_null()) { usize bad = 0; for (auto& e : ref["early_closes_2000_2026"]) { Date d = date_from_iso(e.get<std::string>()); if (!cal.is_early_close(d)) { ++bad; UNSCOPED_INFO("missing early close " << e.get<std::string>()); } } CHECK(bad == 0);
44− usize extra = 0; for (auto d : cal.sessions(Date::from_ymd(2000, 1, 1), Date::from_ymd(2026, 12, 31))) if (cal.is_early_close(d)) { bool found = false; for (auto& e : ref["early_closes_2000_2026"]) if (e.get<std::string>() == d.iso()) found = true; if (!found) { ++extra; UNSCOPED_INFO("extra early close " << d.iso()); } } CHECK(extra == 0); } 44+ usize extra = 0; for (auto d : cal.sessions(Date::from_ymd(2000, 1, 3), Date::from_ymd(2026, 12, 31))) if (cal.is_early_close(d)) { bool found = false; for (auto& e : ref["early_closes_2000_2026"]) if (e.get<std::string>() == d.iso()) found = true; if (!found) { ++extra; UNSCOPED_INFO("extra early close " << d.iso()); } } CHECK(extra == 0); }
45 } 45 }
46 46
47 TEST_CASE("Realized measures match the fixture truth (numpy)", "[reference][realized]") { 47 TEST_CASE("Realized measures match the fixture truth (numpy)", "[reference][realized]") {
added tests/simulation/test_monte_carlo.cpp +57 −0
@@ -0,0 +1,57 @@
1+// Monte Carlo evaluation (charter §7): bias, RMSE, empirical coverage of 95 % intervals, convergence/failure rates.
2+// Sizes are kept small enough for CI (seconds); the full study with more replications runs in E5 (Phase 6).
3+#include <catch2/catch_test_macros.hpp>
4+#include <catch2/matchers/catch_matchers_floating_point.hpp>
5+#include "raid/models/garch.hpp"
6+#include "raid/estimators/har.hpp"
7+#include "raid/estimators/ols.hpp"
8+#include "raid/estimators/realized.hpp"
9+#include "raid/statistics/bootstrap.hpp"
10+#include "raid/statistics/reductions.hpp"
11+#include "raid/core/rng.hpp"
12+#include "raid/core/thread_pool.hpp"
13+#include <cmath>
14+#include <atomic>
15+using namespace raid; using Catch::Matchers::WithinAbs;
16+
17+TEST_CASE("GARCH(1,1) QML: bias, RMSE, coverage of QMLE 95% intervals (R = 120, n = 2000)", "[simulation][garch]") {
18+ const int R = 120; const usize n = 2000; const double mu = 0.0, omega = 0.02, alpha = 0.08, beta = 0.90;
19+ std::vector<std::vector<double>> est(R, std::vector<double>(4)); std::vector<std::vector<double>> se(R, std::vector<double>(4)); std::atomic<int> failures{0};
20+ ThreadPool::global().parallel_for(R, [&](usize a, usize b) { for (usize rep = a; rep < b; ++rep) { Rng rng(777, rep); std::vector<double> r(n); double s2 = omega / (1 - alpha - beta), e = 0;
21+ for (usize t = 0; t < n; ++t) { s2 = omega + alpha * e * e + beta * s2; e = std::sqrt(s2) * rng.normal(); r[t] = mu + e; }
22+ models::GarchFitOptions o; auto f = models::garch_fit(r, o); if (!f.ok()) { ++failures; est[rep][0] = NAN; continue; } for (int j = 0; j < 4; ++j) { est[rep][j] = f.coefficients[j]; se[rep][j] = f.inference->std_errors[j]; } } });
23+ const double truth[4] = {mu, omega, alpha, beta}; const char* names[4] = {"mu", "omega", "alpha", "beta"};
24+ int ok = 0; for (int rep = 0; rep < R; ++rep) if (std::isfinite(est[rep][0])) ++ok;
25+ CHECK(failures.load() <= R / 20);
26+ for (int j = 0; j < 4; ++j) { double bias = 0, mse = 0; int cover = 0, cnt = 0; for (int rep = 0; rep < R; ++rep) { if (!std::isfinite(est[rep][0])) continue; const double d = est[rep][j] - truth[j]; bias += d; mse += d * d; if (std::abs(d) <= 1.96 * se[rep][j]) ++cover; ++cnt; }
27+ bias /= cnt; const double rmse = std::sqrt(mse / cnt), cov = static_cast<double>(cover) / cnt;
28+ std::fprintf(stderr, "[mc] garch %-5s bias=%+.4f rmse=%.4f coverage95=%.3f (n=%zu, R=%d, failures=%d)\n", names[j], bias, rmse, cov, n, R, failures.load());
29+ INFO(names[j]); CHECK(std::abs(bias) < 2.5 * rmse / std::sqrt(static_cast<double>(cnt)) + 0.02); // no bias beyond MC noise + 0.02 (β is known to be slightly downward biased in finite samples)
30+ CHECK(cov >= 0.85); CHECK(cov <= 0.995); }
31+}
32+TEST_CASE("HAR-RV with HAC: coverage of 95% intervals under an AR(1) log-RV DGP with overlapping h = 5 targets (R = 200)", "[simulation][har]") {
33+ const int R = 200; const usize T = 1200;
34+ // DGP: log RV_t = c + φ log RV_{t-1} + σ ε_t. The HAR population coefficients are not analytical for an AR(1) in logs;
35+ // we instead check coverage of the *pseudo-true* value obtained from one very long sample (T = 200 000), which is the
36+ // relevant target for inference on a misspecified-but-well-defined projection.
37+ auto simulate = [](usize n, u64 seed) { Rng g(4242, seed); std::vector<double> rv(n); double lv = std::log(1e-4); for (usize t = 0; t < n; ++t) { lv = 0.3 * std::log(1e-4) + 0.7 * lv + 0.4 * g.normal(); rv[t] = std::exp(lv); } return rv; };
38+ est::HarSpec spec; spec.horizon = 5; auto big = simulate(200000, 999); auto pseudo = est::har_fit(big, spec);
39+ std::vector<int> cover(4, 0); std::atomic<int> cnt{0}; std::mutex m;
40+ ThreadPool::global().parallel_for(R, [&](usize a, usize b) { for (usize rep = a; rep < b; ++rep) { auto rv = simulate(T, rep); auto f = est::har_fit(rv, spec); std::lock_guard<std::mutex> lk(m); ++cnt; for (int j = 0; j < 4; ++j) if (std::abs(f.coefficients[j] - pseudo.coefficients[j]) <= 1.96 * f.inference->std_errors[j]) ++cover[j]; } });
41+ for (int j = 0; j < 4; ++j) { const double c = static_cast<double>(cover[j]) / cnt; std::fprintf(stderr, "[mc] har h=5 coef %d coverage95(HAC)=%.3f (T=%zu, R=%d)\n", j, c, T, R); CHECK(c >= 0.85); }
42+}
43+TEST_CASE("Realized variance converges to integrated variance as M grows; semivariances sum to RV", "[simulation][realized]") {
44+ const double iv = 2.5e-4; for (usize M : {39ul, 390ul, 3900ul}) { double rmse = 0; const int R = 200; for (int rep = 0; rep < R; ++rep) { Rng g(5, static_cast<u64>(M) * 1000 + rep); std::vector<double> r(M); for (auto& v : r) v = std::sqrt(iv / M) * g.normal(); std::vector<i64> off = {0, static_cast<i64>(M)}; est::RealizedOptions o; o.plan.backend = Backend::cpu; auto m = est::realized_measures_batch(backend::Batch{r, off}, o); rmse += (m.rv[0] - iv) * (m.rv[0] - iv); CHECK_THAT(m.rsv_neg[0] + m.rsv_pos[0], WithinAbs(m.rv[0], 1e-18)); }
45+ rmse = std::sqrt(rmse / R); const double theory = iv * std::sqrt(2.0 / M); std::fprintf(stderr, "[mc] RV rmse M=%zu: %.3e (theory √(2/M)·IV = %.3e)\n", M, rmse, theory); CHECK_THAT(rmse, WithinAbs(theory, 0.3 * theory)); }
46+}
47+TEST_CASE("Numerical gradient of the GARCH NLL is stable across step sizes (finite-difference check)", "[simulation][garch]") {
48+ Rng g(3); const usize n = 1500; std::vector<double> r(n); double s2 = 0.2, e = 0; for (usize t = 0; t < n; ++t) { s2 = 0.02 + 0.08 * e * e + 0.9 * s2; e = std::sqrt(s2) * g.normal(); r[t] = e; }
49+ std::vector<double> th = {0.0, 0.02, 0.08, 0.9}; auto f = [&](const std::vector<double>& t) { return models::garch_nll(r, t, models::GarchModel::garch, models::GarchDist::gaussian); };
50+ for (usize j = 0; j < 4; ++j) { double gs[3]; int i = 0; for (double h : {1e-4, 1e-5, 1e-6}) { auto a = th, b = th; a[j] += h; b[j] -= h; gs[i++] = (f(a) - f(b)) / (2 * h); } INFO("param " << j << " grads " << gs[0] << " " << gs[1] << " " << gs[2]); CHECK(std::abs(gs[0] - gs[1]) <= 1e-3 * std::max(1.0, std::abs(gs[1]))); CHECK(std::abs(gs[1] - gs[2]) <= 1e-2 * std::max(1.0, std::abs(gs[1]))); }
51+}
52+TEST_CASE("Stationary bootstrap CI for the mean of an AR(1): empirical coverage (R = 100)", "[simulation][bootstrap]") {
53+ const int R = 100; std::atomic<int> cover{0};
54+ ThreadPool::global().parallel_for(R, [&](usize a, usize b) { for (usize rep = a; rep < b; ++rep) { Rng g(12, rep); const usize n = 800; std::vector<double> x(n); x[0] = 0; for (usize t = 1; t < n; ++t) x[t] = 0.5 * x[t - 1] + g.normal();
55+ stats::BootstrapOptions o; o.replicas = 299; o.mean_block = 10; o.seed = 100 + rep; o.threads = 1; auto bs = stats::bootstrap(x, [](std::span<const double> v) { return stats::mean<double>(v); }, o); if (bs.ci_lo <= 0.0 && 0.0 <= bs.ci_hi) ++cover; } });
56+ const double c = cover.load() / static_cast<double>(R); std::fprintf(stderr, "[mc] stationary bootstrap mean AR(1) coverage95=%.2f\n", c); CHECK(c >= 0.82);
57+}
added tests/unit/test_bootstrap.cpp +32 −0
@@ -0,0 +1,32 @@
1+#include <catch2/catch_test_macros.hpp>
2+#include <catch2/matchers/catch_matchers_floating_point.hpp>
3+#include "raid/statistics/bootstrap.hpp"
4+#include "raid/statistics/reductions.hpp"
5+#include "raid/core/rng.hpp"
6+#include <cmath>
7+#include <set>
8+using namespace raid; using namespace raid::stats; using Catch::Matchers::WithinAbs;
9+
10+TEST_CASE("Bootstrap indices: valid, deterministic per (seed, replica), block structure", "[bootstrap]") {
11+ BootstrapOptions o; o.scheme = BootstrapScheme::circular_block; o.mean_block = 5; auto a = bootstrap_indices(100, o, 3), b = bootstrap_indices(100, o, 3), c = bootstrap_indices(100, o, 4);
12+ CHECK(a == b); CHECK(a != c); for (u32 i : a) CHECK(i < 100);
13+ usize runs = 0; for (usize i = 1; i < a.size(); ++i) if (a[i] != (a[i - 1] + 1) % 100) ++runs; CHECK(runs <= 21); // ≤ 20 blocks + wrap
14+ o.scheme = BootstrapScheme::stationary; o.mean_block = 10; auto s = bootstrap_indices(10000, o, 0); usize starts = 1; for (usize i = 1; i < s.size(); ++i) if (s[i] != (s[i - 1] + 1) % 10000) ++starts;
15+ CHECK_THAT(10000.0 / static_cast<double>(starts), WithinAbs(10.0, 2.5)); // mean block length ≈ 10
16+}
17+TEST_CASE("Block bootstrap SE of the mean of an AR(1) exceeds the iid SE", "[bootstrap]") {
18+ Rng r(77); const usize n = 2000; std::vector<f64> x(n); x[0] = 0; for (usize t = 1; t < n; ++t) x[t] = 0.7 * x[t - 1] + r.normal();
19+ auto m = [](std::span<const f64> v) { return mean(v); };
20+ BootstrapOptions bo; bo.replicas = 499; bo.scheme = BootstrapScheme::stationary; bo.mean_block = 20; auto blk = bootstrap(x, m, bo);
21+ bo.scheme = BootstrapScheme::iid; auto iid = bootstrap(x, m, bo);
22+ const double true_se = std::sqrt((1.0 / (1 - 0.49)) / (1 - 0.7) / (1 - 0.7) / n); // long-run variance of AR(1): σ²/(1−φ)² with σ²_x = 1/(1−φ²)
23+ CHECK(blk.se > 1.6 * iid.se); CHECK_THAT(blk.se, WithinAbs(true_se, 0.35 * true_se)); CHECK(blk.failures == 0); CHECK(blk.ci_lo < blk.point); CHECK(blk.ci_hi > blk.point);
24+}
25+TEST_CASE("bootstrap_rows resamples (y,X) jointly and is reproducible", "[bootstrap]") {
26+ BootstrapOptions o; o.replicas = 50; auto st = [](std::span<const u32> idx) { double s = 0; for (u32 i : idx) s += i; return std::vector<f64>{s / static_cast<double>(idx.size()), static_cast<double>(idx[0])}; };
27+ auto a = bootstrap_rows(500, st, o), b = bootstrap_rows(500, st, o); CHECK(a.statistics == b.statistics); CHECK(a.point[0] == 249.5); CHECK(a.se[0] > 0);
28+}
29+TEST_CASE("bootstrap_rv on iid returns brackets the true integrated variance", "[bootstrap]") {
30+ Rng r(5); std::vector<f64> ret(390); for (auto& v : ret) v = 1e-3 * r.normal(); BootstrapOptions o; o.replicas = 399; o.mean_block = 5; auto b = bootstrap_rv(ret, o);
31+ const double iv = 390 * 1e-6; CHECK(b.ci_lo < iv); CHECK(b.ci_hi > iv); CHECK_THAT(b.point, WithinAbs(sum_squares(std::span<const f64>(ret)), 1e-18));
32+}
33
Menu

Theme