Skip to content

[ENH] add explicit energy computations to 10 distributions#803

Open
sakun15 wants to merge 1 commit intosktime:mainfrom
sakun15:enh/explicit-energy-computations
Open

[ENH] add explicit energy computations to 10 distributions#803
sakun15 wants to merge 1 commit intosktime:mainfrom
sakun15:enh/explicit-energy-computations

Conversation

@sakun15
Copy link

@sakun15 sakun15 commented Mar 6, 2026

What this PR does

Closes #267 (partial — adds energy for 10 distributions that previously used Monte Carlo approximation).

Adds _energy_self and _energy_x methods to:

  • HalfNormal — numerical CDF integration (2∫F(1-F)dt)
  • HalfLogistic — numerical CDF integration
  • Erlang — numerical CDF integration (promoted from approx to exact)
  • Fisk (log-logistic) — numerical CDF integration (promoted from approx to exact)
  • LogLaplace — numerical CDF integration
  • SkewNormal — numerical CDF integration (promoted from approx to exact)
  • BurrXII — numerical CDF integration
  • BurrIII — numerical CDF integration
  • FatigueLife — numerical CDF integration
  • GeneralizedPareto — numerical CDF integration with adaptive bounds

All use scipy.integrate.quad with deterministic quadrature, so all distributions are now listed under capabilities:exact.

Verification

Checked against Monte Carlo (n=200k-500k): all implementations within 2% of MC estimate.
All 320 test_methods_scalar[*-energy-*] pytest tests pass.

- HalfNormal: numerical CDF integration via 2∫F(1-F)dt
- HalfLogistic: numerical CDF integration via 2∫F(1-F)dt
- Erlang: numerical CDF integration, promotes energy to capabilities:exact
- Fisk (log-logistic): numerical CDF integration, promotes energy to exact
- LogLaplace: numerical CDF integration
- SkewNormal: numerical CDF integration, promotes energy to exact
- BurrXII: numerical CDF integration
- BurrIII: numerical CDF integration (uses BurrXII with d=1)
- FatigueLife: numerical CDF integration
- GeneralizedPareto: numerical CDF integration with adaptive bounds

All implementations use scipy.integrate.quad with 2∫F(1-F)dt for
_energy_self and ∫|t-x|f(t)dt for _energy_x, replacing the default
Monte Carlo approximation with deterministic numerical integration.

Verified against Monte Carlo simulation (n=200k-500k): all within 2%.
All 320 pytest energy tests pass.

Closes sktime#267
@sakun15
Copy link
Author

sakun15 commented Mar 6, 2026

@fkiraly @felipeangelimvieira Sir can you please review my PR. Thank you.

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.

[ENH] distributions: add missing explicit energy computations

1 participant