statsmodels: Copula density not correct for d>2
It seems that the pdf of some Archimedian Copulas are incorrect for d>2. They do not throw an error or warning in this case. The formulas look generic for any dimension at first but are restricted to d=2. At least for Gumbel and Clayton. I compared with this: https://arxiv.org/pdf/1207.1708.pdf For Frank there is a dim check (“pdf is currently only available for bivariate copula”).
from statsmodels.distributions.copula.archimedean import GumbelCopula
c=GumbelCopula()
c.pdf([.7,.7,.7],20)
> array([3.97063356e-08])
For example in this case, a high value for the density would be expected.
Also it would be good to know the source where the formulas have been taken from.
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 21 (21 by maintainers)
parking this here for now
Sterling code is from Rosetta Code converted to class for cache polylog Li code formulas from Wikipedia (I also have a brute force polynomial series function for Li, but finding truncation point is non-trivial, and not needed for negative integer values)
n = k_dim, but Li argument is -n (defined for first argument is negative integer)