diff --git a/Taskfile.yml b/Taskfile.yml index d0a27b7..e637399 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -43,7 +43,7 @@ tasks: cmds: [.venv/bin/python scripts/fetch_multipair.py] data:prepare:pair: desc: "Build {PAIR}_hourly.parquet from data/raw/{PAIR}/ (e.g. PAIR=gbpusd)" - cmds: [PAIR={{.PAIR}} .venv/bin/python scripts/prepare_hourly.py {{.EXTRA_ARGS}}] + cmds: ["PAIR={{.PAIR}} .venv/bin/python scripts/prepare_hourly.py {{.EXTRA_ARGS}}"] vars: PAIR: '{{default "eurusd" .PAIR}}' data:prepare:multipair: diff --git a/internal/eval/var.go b/internal/eval/var.go index aa55bb7..5efe236 100644 --- a/internal/eval/var.go +++ b/internal/eval/var.go @@ -40,11 +40,11 @@ func kupiecPOF(n, n1 int, p0 float64) float64 { phat := float64(n1) / float64(n) var lr float64 - switch { - case n1 == 0: + switch n1 { + case 0: // 0 × ln(0/p0) = 0 by convention; only the n0 term contributes lr = 2 * float64(n0) * math.Log((1-phat)/(1-p0)) - case n1 == n: + case n: // n0 term vanishes lr = 2 * float64(n1) * math.Log(phat/p0) default: