1 Commits
Author SHA1 Message Date
mathiasandClaude Sonnet 4.6 1a17a4c88e 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>
2026-06-26 12:11:04 +02:00
+2 -2
View File
@@ -232,10 +232,10 @@ def main():
idx = df2.index[year_mask].tolist()
Xs, dates, rvs = [], [], []
for t in idx:
if t - WINDOW >= 0:
if t - WINDOW >= 0 and t + 1 < len(df2):
Xs.append(fn2[t - WINDOW:t])
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:
return [], [], []
Xa = np.stack(Xs)