[Scipy-tickets] [SciPy] #767: Add the limiting gumbel distribution to genextreme distribution when shape c=0

SciPy scipy-tickets@scipy....
Fri Oct 31 17:26:44 CDT 2008


#767: Add the limiting gumbel distribution to genextreme distribution when shape
c=0
-------------------------+--------------------------------------------------
 Reporter:  pbrod        |        Owner:  somebody
     Type:  enhancement  |       Status:  new     
 Priority:  normal       |    Milestone:          
Component:  scipy.stats  |      Version:          
 Severity:  normal       |   Resolution:          
 Keywords:               |  
-------------------------+--------------------------------------------------
Comment (by pbrod):

 The implementation of genextreme in the attached genextreme.py file is
 also more accurate than the current implementation and espesially for
 small values of the shape parameter c.

 In the current version of genextreme the accurracy of ppf(cdf(x,c),c)-x is
 about 1e-12 for c=0.0001 as showed here:

 {{{
 In [30]: x = linspace(-5,5)
 In [32]: c=0.0001;genextreme.ppf(genextreme.cdf(x,c),c)-x
 Out[32]:
 array([  5.49782442e-13,   6.64357458e-13,   7.78044296e-13,
          8.90842955e-13,   1.00452979e-12,  -1.10222942e-12,
         -9.88986670e-13,  -8.74855743e-13,  -7.62501173e-13,
         -6.48370246e-13,  -5.35571587e-13,  -4.21884749e-13,
         -3.08197912e-13,  -1.94511074e-13,  -8.12683254e-14,
          3.19744231e-14,   1.45439216e-13,   2.59348099e-13,
          3.72590847e-13,   4.85833596e-13,   5.99409411e-13,
          7.13207271e-13,   8.26116953e-13,   9.39692768e-13,
          1.05336573e-12,   5.68156633e-14,   1.70530257e-13,
          2.83328916e-13,   3.97015754e-13,   5.10924636e-13,
         -4.86943819e-13,  -3.72812892e-13,  -2.59348099e-13,
         -1.45661261e-13,  -3.24185123e-14,   8.08242362e-14,
          1.94511074e-13,   3.08642001e-13,   4.22328839e-13,
          5.35127498e-13,  -4.61852778e-13,  -3.48165941e-13,
         -2.33146835e-13,  -1.19459997e-13,  -1.02140518e-14,
          1.07469589e-13,   2.20268248e-13,   3.35731443e-13,
          4.43201031e-13,  -5.46229728e-13])
 }}}
 where as the accuracy for genextreme in the attached file is to machine
 precision, i.e., about 1e-15, as shown here:
 {{{
 In [33]: c=0.0001;genextreme.ppf(genextreme.cdf(x,c),c)-x
 Out[33]:
 array([  0.00000000e+00,   0.00000000e+00,   0.00000000e+00,
          0.00000000e+00,  -8.88178420e-16,   0.00000000e+00,
          0.00000000e+00,   0.00000000e+00,  -4.44089210e-16,
          0.00000000e+00,   0.00000000e+00,   4.44089210e-16,
          0.00000000e+00,   0.00000000e+00,  -4.44089210e-16,
          0.00000000e+00,   2.22044605e-16,   0.00000000e+00,
          0.00000000e+00,   0.00000000e+00,   0.00000000e+00,
         -1.11022302e-16,   0.00000000e+00,  -1.11022302e-16,
         -1.11022302e-16,   1.38777878e-17,   0.00000000e+00,
         -3.33066907e-16,  -1.11022302e-16,   1.11022302e-16,
          2.22044605e-16,  -4.44089210e-16,   0.00000000e+00,
          0.00000000e+00,   0.00000000e+00,  -4.44089210e-16,
          0.00000000e+00,   8.88178420e-16,   0.00000000e+00,
          4.44089210e-16,   1.33226763e-15,   1.33226763e-15,
         -1.33226763e-15,  -1.33226763e-15,   1.77635684e-15,
          3.55271368e-15,   1.77635684e-15,   3.55271368e-15,
         -3.55271368e-15,   8.88178420e-16])
 }}}

-- 
Ticket URL: <http://scipy.org/scipy/scipy/ticket/767#comment:4>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list