fix(eval): export block uses next-period RV target (t+1) to match Python probe
CD / Lint / Test / Vet (push) Successful in 4s
CD / Build & Import (push) Failing after 7s
CD / Deploy via GitOps (push) Has been skipped

Go harness reported 0.42 vs Python 0.36 because export used realized_vol[t]
(current) while Python probe used realized_vol[t+1] (next-period). Fix adds
t+1 < len(df2) guard and uses iloc[t+1] as target. Go now matches Python: 0.3585.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-26 12:11:04 +02:00
co-authored by Claude Sonnet 4.6
parent fa6d6c634a
commit 1a17a4c88e
+2 -2
View File
@@ -232,10 +232,10 @@ def main():
idx = df2.index[year_mask].tolist() idx = df2.index[year_mask].tolist()
Xs, dates, rvs = [], [], [] Xs, dates, rvs = [], [], []
for t in idx: for t in idx:
if t - WINDOW >= 0: if t - WINDOW >= 0 and t + 1 < len(df2):
Xs.append(fn2[t - WINDOW:t]) Xs.append(fn2[t - WINDOW:t])
dates.append(str(df2["date"].iloc[t].date())) dates.append(str(df2["date"].iloc[t].date()))
rvs.append(float(df2["realized_vol"].iloc[t])) rvs.append(float(df2["realized_vol"].iloc[t + 1]))
if not Xs: if not Xs:
return [], [], [] return [], [], []
Xa = np.stack(Xs) Xa = np.stack(Xs)