Skip to content

[BUG] GeneralizedPareto: false log_pdf exact tag, missing distr:paramtype, insufficient test params #961

@ANANYA542

Description

@ANANYA542

Describe the bug

GeneralizedPareto in skpro/distributions/gen_pareto.py has three related issues:

  1. log_pdf falsely listed as capabilities:exact
    The _tags dictionary includes "log_pdf" in "capabilities:exact", but the class has no _log_pdf method. Since GeneralizedPareto extends BaseDistribution directly and not _ScipyAdapter, there is no adapter to provide it automatically. Every call to log_pdf() silently falls back to np.log(self.pdf(x)) in the base class and raises a warning — directly contradicting the "exact" tag.
  2. Missing distr:paramtype tag
    GeneralizedPareto.get_class_tag("distr:paramtype") returns "general", falling back to the base class default. Every other scipy-backed parametric distribution in the library explicitly sets "distr:paramtype": "parametric".
  3. Only 2 test parameter sets
    The standard across the library is 3 sets covering array case, index/columns case, and scalar case. GeneralizedPareto only has 2 and neither is a scalar case.

To Reproduce
import warnings
import pandas as pd
from skpro.distributions.gen_pareto import GeneralizedPareto
d = GeneralizedPareto(
xi=0.1, mu=0.0, sigma=1.0,
index=pd.Index([0]), columns=pd.Index(["y"])
)
x_df = pd.DataFrame({"y": [1.0]})
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")
result = d.log_pdf(x_df)
if w:
print("Warning:", w[0].message)

print("log_pdf result:", result.iloc[0, 0])
print("_log_pdf in class:", "_log_pdf" in GeneralizedPareto.dict)
print("distr:paramtype:", GeneralizedPareto.get_class_tag("distr:paramtype"))

A screenshot of the reproduction output is attached below:
Image

Expected behavior

  1. log_pdf should not be listed under "capabilities:exact" unless _log_pdf is actually implemented
  2. "distr:paramtype" should return "parametric" not "general"
  3. There should be 3 test parameter sets consistent with library convention

Environment
OS: macOS
Python: 3.x
skpro: main branch (latest)

Additional context
All three issues live in skpro/distributions/gen_pareto.py. If confirmed, happy to open a PR fixing all three in the same file

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions