Skip to content

fix: preserve AutoTheta configuration across forecast paths - #1240

Closed
Dresden Goehner (DresdenGman) wants to merge 2 commits into
Nixtla:mainfrom
DresdenGman:fix/autotheta-preserve-configuration
Closed

Dresden Goehner (DresdenGman) wants to merge 2 commits into
Nixtla:mainfrom
DresdenGman:fix/autotheta-preserve-configuration

Conversation

@DresdenGman

Copy link
Copy Markdown
Contributor

Summary

  • preserve the configured error distribution in AutoTheta.forecast
  • preserve the fitted error distribution and seasonal decomposition type in forward_theta
  • add regression coverage across normal and non-normal distributions and additive/multiplicative decomposition

Problem

The regular fit path passes both distribution and decomposition_type into auto_theta, but two equivalent call paths dropped part of that configuration:

  • the memory-efficient forecast path omitted distribution, silently reverting non-normal models to normal errors
  • forward_theta omitted both values, silently reverting the fitted model to normal errors and multiplicative decomposition

As a result, equivalent public APIs could return materially different point forecasts and prediction intervals. On current main, the regression cases in this PR differed by as much as 39.80 across forecast outputs for non-normal distributions and 337.41 across forward outputs for additive decomposition. With the fix, every tested path agrees exactly.

Validation

  • 104 passed across TestTheta, tests/test_theta.py, and tests/test_distributions.py
  • regression coverage for normal, Laplace, Student-t, skew-normal, and GED forecast paths
  • forward-path coverage for normal/Laplace errors and multiplicative/additive decomposition
  • Ruff lint passes for every changed file
  • diff whitespace validation passes

This is a focused follow-up to the distribution support introduced in #1116.

@codspeed

codspeed Bot commented Sep 21, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 38 untouched benchmarks


Comparing DresdenGman:fix/autotheta-preserve-configuration (19a689a) with main (99f2408)

Open in CodSpeed

@DresdenGman
Dresden Goehner (DresdenGman) force-pushed the fix/autotheta-preserve-configuration branch from 19a689a to 517c4e5 Compare November 3, 2026 03:45
@DresdenGman

Copy link
Copy Markdown
Contributor Author

Hi, following up on this PR - I have rebased it onto current main (f9cd2f2). The one conflict was in AutoTheta.forecast in models.py: #1241 (my earlier fixed-theta change, already merged) added theta=self.theta at the same spot where this PR adds distribution=self.distribution. Both lines are kept, and the diff against main is otherwise unchanged (3 files, +40/-0).

Re-verified locally after the rebase: the new regression tests pass (9/9), the full TestTheta class passes (13/13), and the theta parameter tests from #1241 pass (8/8). CI is re-running on the new head. Happy to make any further changes if needed - thanks!

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