2

I'm trying to construct a distribution using scipy.stats.pearson3, but I'm running into inconsistent results when looking at the cumulative distribution function (or the survival function).

As an example:

scipy.stats.pearson3.cdf(-1, skew=0, loc=0, scale=1) 
>> 0.15865525393145707

scipy.stats.pearson3.cdf(-1, skew=-0.0001, loc=0, scale=1) 
>> 0.8413447461693605

scipy.stats.pearson3.cdf(+1, skew=-0.0001, loc=0, scale=1) 
>> 0.1586552538306324

The first result is fine; as in, it is what you should expect from a skew=0 pearson3 (same result as with a normal distribution).

But the second and third results are inconsistent: they show a decreasing CDF which doesn't make sense (This does not occur if the skew is positive). It seems that a negatively skewed pearson3 distribution has inverted CDF and SF functions. Oddly, the PDF appears to be correct, which leads to even more confusion.

Does anyone know if this is a known issue with scipy or if I am missing something?

ecortazar
  • 1,382
  • 1
  • 6
  • 12

1 Answers1

1

Try plotting 1 - pearson3.cdf for the negatively skewed data.

The CDF = F(x) for positively skewed distribution (skew > 0)

The CDF = 1 - F(x) for negatively skewed distribution (skew < 0)

Reference: Rao, D. V. (2009). Discussion of “Log-pearson type distribution and its application in flood frequency analysis. I: Distribution characteristics” by V. W. Griffis and J. R. Stedinger. Journal of Hydrologic Engineering, 14(3), 301. https://doi.org/10.1061/(ASCE)1084-0699(2009)14:3(301)