Skip to content

feat(ladder): -O g, the origin of the forecast report, as in the C - #42

Merged
davidesg merged 1 commit into
masterfrom
origen-prevision
Nov 30, 2026
Merged

davidesg merged 1 commit into
masterfrom
origen-prevision

Conversation

@davidesg

Copy link
Copy Markdown
Owner

What it adds

-O g, the origin of the forecast report, which the C of record gained in atsw-gui #231 (and drtran already had). The port follows the C:

  • -O g: the report leaves from observation g of the first series; -O -1: from the current end of the data; without -O: from the end of the estimation sample, as before.
  • Ladder.forecast(L, origin=...) is the same in Python.
  • The parameters and σ² stay the estimation's. -estwin N -O -1 is the tracking mode: new observations, the same parameters, the forecast from the last datum.
  • The C's checks and messages (-O needs a horizon, -O g is beyond the N observations of …).

One fix that came with it: the forecast block of the report indexed the path with the series' current length; it now uses the history the forecast was made with (they only differ with -O).

Homologation

VAR(1) of the three price indices, -estwin 216 -forecast 6, against the C built from atsw-gui main (e964abd):

origin max difference over the 7 columns of .forecast (18 rows)
-O -1 (11/2023) 0.0 at the printed precision
-O 240 (12/2021) 0.0 at the printed precision

The C's two files are in tests/data/ladder/origin/.

Verification

  • tests/test_origin.py: 6 tests (the C's files, the last origin of recursive(), the estimation sample untouched, the estimation's scale, the refusals). They also pass in pure Python, without the compiled engine.
  • Full battery, local, with the engine: 412 passed, 75 skipped, 2 xfailed.

Left apart

The port's .out does not write fuf's FORECAST REPORT (the table with the ERR column) that the C's .out carries. It predates this change; to be registered.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LHFMF3teQWFeXfDJVGj2p5

The C of record gained -O g in atsw-gui #231: the origin of the forecast
report is independent of the estimation window, as in drtran. The port
follows: -O g / -O -1 on the command line and Ladder.forecast(L, origin=...).
The parameters and sigma2 stay the estimation's; -estwin N -O -1 is the
tracking mode. The C's checks and messages. Without -O nothing changes.

The forecast block of the report used the series' current length to index
the path; it now uses the history the forecast was made with.

On a VAR(1) of the three price indices the port writes the C's .forecast
number for number, from the last datum and from an inner origin
(tests/test_origin.py, 6 tests, references in tests/data/ladder/origin).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHFMF3teQWFeXfDJVGj2p5
@davidesg
davidesg merged commit e8e0bee into master Nov 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant