Skip to content

[BUG] fix QPD_U pdf scaling and symmetric quantile triplet case - #1190

Open
VividhDesign wants to merge 2 commits into
sktime:mainfrom
VividhDesign:fix-qpd-u-pdf
Open

VividhDesign wants to merge 2 commits into
sktime:mainfrom
VividhDesign:fix-qpd-u-pdf

Conversation

@VividhDesign

@VividhDesign VividhDesign commented Oct 3, 2026 •

Copy link
Copy Markdown

Reference Issues/PRs

Fixes #1187

What does this implement/fix? Explain your changes.

Two commits.

  1. _pdf multiplies by width, which was missing from the chain rule.
  2. For a symmetric SPT, sinh / arcsinh in _ppf, _cdf and _pdf are replaced by their limit, the identity.
    • With the existing delta = 1, kappa = H - B, gamma = 0, xi = B, this gives ppf(p) = B + (H - B) * phi.ppf(p) / phi.ppf(1 - alpha).
    • That recovers the three quantiles and matches the limit of nearly symmetric triplets.
    • _prep_qpd_vars now also returns a symmetric mask for mode U, so this works entry-wise for array parameters.

Does your contribution introduce a new dependency? If yes, which one?

No.

What should a reviewer concentrate their feedback on?

  • Whether the limit is the behaviour you want for the symmetric case. An alternative is kappa = (H - B) / sinh(1): it matches the three quantiles but isn't continuous with the nearly symmetric case.

Did you add any tests for the change?

Yes, in test_qpd.py:

  • test_qpd_u_pdf_is_cdf_derivative: pdf vs. numerical derivative of cdf, and the integral equals 1.
  • test_qpd_u_symmetric: recovers the quantiles, matches the normal limit, and is continuous with the nearly symmetric case.

Both fail on main. skpro/distributions passes (8586).

Any other comments?

(AI-assisted; reviewed and tested by me.)

PR checklist

  • The PR title starts with [BUG]

This branch has not been deployed

No deployments
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.

[BUG] QPD_U pdf is off by a factor, and symmetric quantile triplets give wrong quantiles

1 participant