+
    0i	?                    B   ^ RI t ^ RIHt ^ RIHtHt ^ RIt^ RIt^ RIt	^ RI
Ht ^ RIHt ^ RIHtHtHt ^ RIHt ^ RIHt ^ R	IHt ^ RIHt ^ RIHu Ht ^ R
IHt ^ RIH u H!t" ^ RI#H$t$ ^RI%H&t& ^RI'H(t)H*t+ ^RI,H-t-H.t.H/t/H0t0H1t1H2t2H3t3H4t4H5t5 ^RI6H7t7H8t8H9t9 ^RI:H;t;H<t<H=t=H>t>H?t?H@t@HAtAHBtB ^RICHDtD ^ RIEHFtF ^ RIGHHtH ^ RIIHJtJ R tKR tLERR ltM ! R R]14      tN]N! RRRR7      tO ! R R]14      tP]P! ^ RRRR 7      tQ ! R! R"]14      tR]R! RR#R$7      tS]	P                  ! ^]	P                  ,          4      tV]	P                  ! ]V4      tXR% tYR& tZR' t[R( t\R) t]R* t^R+ t_R, t` ! R- R.]14      ta]a! R/R07      tb ! R1 R2]14      tc]c! RR3R$7      td ! R4 R5]14      te]e! ]	P                  ) ^,          ]	P                  ^,          R6R7      tf ! R7 R8]14      tg]g! RRR9R7      th ! R: R;]i4      tj ! R< R=]H4      tkR> tlR? tm ! R@ RA]14      tn]n! RRRBR7      to ! RC RD]14      tp]p! RRER$7      tq ! RF RG]14      tr]r! RRRHR7      ts ! RI RJ]14      tt]t! RRKR$7      tu ! RL RM]14      tv]v! RRNR$7      tw ! RO RP]t4      tx]x! RRQR$7      ty ! RR RS]14      tz]z! RTR07      t{ ! RU RV]14      t|]|! RRWR$7      t} ! RX RY]14      t~]~! RRZR$7      t ! R[ R\]14      t]! ]	P                  ) ]	P                  R]R7      t ! R^ R_]14      t]! R`R07      t ! Ra Rb]14      t]! ^ RcR$7      t ! Rd Re]14      t]! RfR07      t ! Rg Rh]14      t]! RRiR$7      t ! Rj Rk]14      t]! RlR07      tRm t ! Rn Ro]14      t]! RRpR$7      t ! Rq Rr]14      t]! RRsR$7      t ! Rt Ru]14      t]! RRvR$7      t ! Rw Rx]14      t]! RRyR$7      t ! Rz R{]14      t]! RR|R$7      t ! R} R~]14      t]! RRR$7      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RR07      tER]n         ! R R]14      t]! RRR7      t ! R R]14      t]! RR07      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RR07      tR t ! R R]14      t]! RRR$7      t ! R R]4      t]! RRR$7      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RR07      t ! R R]14      t]! RRR$7      tR t ! R R]14      t]! RR07      t ! R R]14      t]! RR07      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RR07      t ! R R]14      t]! RRRR7      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RR07      t ! R R]14      t]! ^ RR$7      t ! R R]14      t]! RR07      t ! R R]14      t]! RRRR7      t ! R R]14      t]! RR07      t ! R R]14      t]! RR07      t ! R R]14      t]! RR07      t ! R R]14      t]! RR07      tR t ! R R]14      t]! RRR$7      t ! R R]14      t]! RRR7      t ! R R]14      t]! RR07      t ! R R]14      t]! RR07      t ! R R]14      t]! RRR$7      tR t ! R R]14      t]! RRR$7      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RRR$7      t ! R R]14      t]! RR07      t ! ER  ER]14      t]! RERR$7      t ! ER ER]14      t]! ERR07      t ! ER ER]14      t]! RERR$7      tER	 t ! ER
 ER]14      t]! RERR$7      t ! ER ER]14      t]! RERR$7      t ! ER ER]14      t]! ERR07      t ! ER ER]14      t]! ERR07      t ! ER ER]14      t]! RERR$7      Et  ! ER ER]14      EtE]! RERR$7      Et ! ER ER]14      EtE]! ERR07      Et ! ER ER ]14      EtE]! RRER!R7      Et ! ER" ER#]14      EtE]! RER$R$7      Et ! ER% ER&]14      Et	E]	! ER'R07      Et
 ! ER( ER)]14      EtE]! ERRER*R7      Et ! ER+ ER,]14      EtE]! RER-R$7      Et ! ER. ER/]14      EtE]! ER0R07      EtE]! ER1R07      EtERE]n        ERE]n         ! ER2 ER3]14      EtE]! RER4R$7      Et ! ER5 ER6]14      EtE]! ER7R07      EtERE]n         ! ER8 ER9]14      EtE]! RER:R$7      Et ! ER; ER<]14      EtE]! ERRER=R7      Et ! ER> ER?]14      EtE]! ER@R07      Et ! ERA ERB]14      EtE]! ERCR07      Et ! ERD ERE]14      EtE]! RRERFR7      Et ! ERG ERH]14      Et E] ! RRERIR7      Et! ! ERJ ERK]14      Et"E]"! RERLR$7      Et#ERE]#n        ERM Et$ERN Et%ERO Et& ! ERP ERQ]14      Et'E]'! ERR^ERS7      Et(ERE](n         ! ERT ERU]14      Et)E])! RERVR$7      Et*ERE]*n         ! ERW ERX]14      Et+E]+! ERYR07      Et, ! ERZ ER[]j4      Et- ! ER\ ER]]14      Et.E].! RRER^R7      Et/ ! ER_ ER`]14      Et0E]0! ERaR07      Et1E]0! ]	P                  ) ]	P                  ERbR7      Et2 ! ERc ERd]4      Et3E]3! REReR$7      Et4 ! ERf ERg]14      Et5E]5! R^]	P                  ,          ERhR7      Et6 ! ERi ERj]14      Et7E]7! ERkR07      Et8 ! ERl ERm]14      Et9E]9! ^ ERnR$7      Et: ! ERo ERp]14      Et;E];! ERqERrERs7      Et<ERt Et= ! ERu ERv]14      Et>E]>! ERwERxRRERy7      Et? ! ERz ER{]14      Et@ ! ER| ER}]14      EtAE]A! ER~^ ]	EP                  ER7      EtC ! ER ER]14      EtDE]D! RERR$7      EtEE]F! E]G! 4       EP                  4       EP                  4       4      EtJ].! E]J]14      w  EtKEtLE]KE]L,           ER{.,           EtMR# (      N)Iterable)wrapscached_property
Polynomial)BSpline)extend_notes_in_docstringreplace_notes_in_docstringinherit_docstring_from)LowLevelCallable)optimize)	integrate_lazyselect)
xp_promote)_stats)tukeylambda_variancetukeylambda_kurtosis)	_vectorize_rvs_over_shapesget_distribution_names	_kurtosis_isintegralrv_continuous_skew_get_fixed_fit_value_check_shape
_ShapeInfo)kolmognkolmognpkolmogni)_XMIN_LOGXMIN_EULER_ZETA3_SQRT_PI_SQRT_2_OVER_PI_LOG_PI_LOG_SQRT_2_OVER_PI)CensoredData)root_scalar)FitErrorc                    V P                  RR4       V P                  RR4       V P                  RR4       V P                  RR4       V '       d   \        RV  R24      hR# )aj  
Remove the optimizer-related keyword arguments 'loc', 'scale' and
'optimizer' from `kwds`.  Then check that `kwds` is empty, and
raise `TypeError("Unknown arguments: %s." % kwds)` if it is not.

This function is used in the fit method of distributions that override
the default method and do not use the default optimization code.

`kwds` is modified in-place.
locNscale	optimizermethodzUnknown arguments: .)pop	TypeError)kwdss   &\/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/stats/_continuous_distns.py_remove_optimizer_parametersr6   )   sY     	HHUDHHWdHH[$HHXt-dV1566     c                 0   a  \        S 4      V 3R  l4       pV# )c                 &  < VP                  R R4      P                  4       p\        V\        4      pVR8X  g   V'       d3   VP	                  4       ^ 8  d   \
        \        V 4      V `  ! V.VO5/ VB # V'       d   VP                  pS! W.VO5/ VB # )r0   mlemm)	getlower
isinstancer)   num_censoredsupertypefit_uncensored)selfdataargsr4   r0   censoredfuns   &&*,  r5   wrapper _call_super_mom.<locals>.wrapper@   s    (E*002dL1T>h4+<+<+>+BdT.tCdCdCC ''t1D1D11r7   )r   )rH   rI   s   f r5   _call_super_momrK   <   s"     3Z2 2 Nr7   c                    a  T;'       g
    V^,
          pW,
          pV 3R lpV! W!4      '       g=   V^,          pW,
          pRp\         P                  ! V4      '       g   K?  \        V4      hV# )   c                 v   < \         P                  ! S! V 4      4      \         P                  ! S! V4      4      8g  # Nnpsign)lbrackrbrackrH   s   &&r5   interval_contains_root1_get_left_bracket.<locals>.interval_contains_rootX   s(    wws6{#rwws6{';;;r7   zVThe solver could not find a bracket containing a root to an MLE first order condition.)rQ   isinfFitSolverError)rH   rT   rS   diffrU   msgs   f&&   r5   _get_left_bracketr[   Q   sc    !!vzF?D< %V44	788F %%Mr7   c                   N   a  ] tR t^ht o RtR tR tR tR tR t	R t
R tR	tV tR
# )	ksone_gena!  Kolmogorov-Smirnov one-sided test statistic distribution.

This is the distribution of the one-sided Kolmogorov-Smirnov (KS)
statistics :math:`D_n^+` and :math:`D_n^-`
for a finite sample size ``n >= 1`` (the shape parameter).

%(before_notes)s

See Also
--------
kstwobign, kstwo, kstest

Notes
-----
:math:`D_n^+` and :math:`D_n^-` are given by

.. math::

    D_n^+ &= \text{sup}_x (F_n(x) - F(x)),\\
    D_n^- &= \text{sup}_x (F(x) - F_n(x)),\\

where :math:`F` is a continuous CDF and :math:`F_n` is an empirical CDF.
`ksone` describes the distribution under the null hypothesis of the KS test
that the empirical CDF corresponds to :math:`n` i.i.d. random variates
with CDF :math:`F`.

%(after_notes)s

References
----------
.. [1] Birnbaum, Z. W. and Tingey, F.H. "One-sided confidence contours
   for probability distribution functions", The Annals of Mathematical
   Statistics, 22(4), pp 592-596 (1951).

Examples
--------
>>> import numpy as np
>>> from scipy.stats import ksone
>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots(1, 1)

Display the probability density function (``pdf``):

>>> n = 1e+03
>>> x = np.linspace(ksone.ppf(0.01, n),
...                 ksone.ppf(0.99, n), 100)
>>> ax.plot(x, ksone.pdf(x, n),
...         'r-', lw=5, alpha=0.6, label='ksone pdf')

Alternatively, the distribution object can be called (as a function)
to fix the shape, location and scale parameters. This returns a "frozen"
RV object holding the given parameters fixed.

Freeze the distribution and display the frozen ``pdf``:

>>> rv = ksone(n)
>>> ax.plot(x, rv.pdf(x), 'k-', lw=2, label='frozen pdf')
>>> ax.legend(loc='best', frameon=False)
>>> plt.show()

Check accuracy of ``cdf`` and ``ppf``:

>>> vals = ksone.ppf([0.001, 0.5, 0.999], n)
>>> np.allclose([0.001, 0.5, 0.999], ksone.cdf(vals, n))
True

c                H    V^8  V\         P                  ! V4      8H  ,          # rM   rQ   roundrD   ns   &&r5   	_argcheckksone_gen._argcheck       Q1+,,r7   c                @    \        R R^\        P                  3R4      .# rc   TTFr   rQ   infrD   s   &r5   _shape_infoksone_gen._shape_info       3q"&&k=ABBr7   c                0    \         P                  ! W!4      ) # rO   )scu	_smirnovprD   xrc   s   &&&r5   _pdfksone_gen._pdf   s    a###r7   c                .    \         P                  ! W!4      # rO   )rq   	_smirnovcrs   s   &&&r5   _cdfksone_gen._cdf   s    }}Q""r7   c                .    \         P                  ! W!4      # rO   )scsmirnovrs   s   &&&r5   _sfksone_gen._sf   s    zz!r7   c                .    \         P                  ! W!4      # rO   )rq   
_smirnovcirD   qrc   s   &&&r5   _ppfksone_gen._ppf   s    ~~a##r7   c                .    \         P                  ! W!4      # rO   )r|   smirnovir   s   &&&r5   _isfksone_gen._isf       {{1  r7    N)__name__
__module____qualname____firstlineno____doc__rd   rm   ru   ry   r~   r   r   __static_attributes____classdictcell____classdict__s   @r5   r]   r]   h   s5     BF-C$# $! !r7   r]                 ?ksone)abnamec                   T   a  ] tR t^t o RtR tR tR tR tR t	R t
R tR	 tR
tV tR# )	kstwo_gena  Kolmogorov-Smirnov two-sided test statistic distribution.

This is the distribution of the two-sided Kolmogorov-Smirnov (KS)
statistic :math:`D_n` for a finite sample size ``n >= 1``
(the shape parameter).

%(before_notes)s

See Also
--------
kstwobign, ksone, kstest

Notes
-----
:math:`D_n` is given by

.. math::

    D_n = \text{sup}_x |F_n(x) - F(x)|

where :math:`F` is a (continuous) CDF and :math:`F_n` is an empirical CDF.
`kstwo` describes the distribution under the null hypothesis of the KS test
that the empirical CDF corresponds to :math:`n` i.i.d. random variates
with CDF :math:`F`.

%(after_notes)s

References
----------
.. [1] Simard, R., L'Ecuyer, P. "Computing the Two-Sided
   Kolmogorov-Smirnov Distribution",  Journal of Statistical Software,
   Vol 39, 11, 1-18 (2011).

Examples
--------
>>> import numpy as np
>>> from scipy.stats import kstwo
>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots(1, 1)

Display the probability density function (``pdf``):

>>> n = 10
>>> x = np.linspace(kstwo.ppf(0.01, n),
...                 kstwo.ppf(0.99, n), 100)
>>> ax.plot(x, kstwo.pdf(x, n),
...         'r-', lw=5, alpha=0.6, label='kstwo pdf')

Alternatively, the distribution object can be called (as a function)
to fix the shape, location and scale parameters. This returns a "frozen"
RV object holding the given parameters fixed.

Freeze the distribution and display the frozen ``pdf``:

>>> rv = kstwo(n)
>>> ax.plot(x, rv.pdf(x), 'k-', lw=2, label='frozen pdf')
>>> ax.legend(loc='best', frameon=False)
>>> plt.show()

Check accuracy of ``cdf`` and ``ppf``:

>>> vals = kstwo.ppf([0.001, 0.5, 0.999], n)
>>> np.allclose([0.001, 0.5, 0.999], kstwo.cdf(vals, n))
True

c                H    V^8  V\         P                  ! V4      8H  ,          # r_   r`   rb   s   &&r5   rd   kstwo_gen._argcheck  rf   r7   c                @    \        R R^\        P                  3R4      .# rh   rj   rl   s   &r5   rm   kstwo_gen._shape_info  ro   r7   c                    R \        V\        4      '       g   V,          R3# \        P                  ! V4      ,          R3#       ?r   )r>   r   rQ   
asanyarrayrb   s   &&r5   _get_supportkstwo_gen._get_support  s>    jH55QL 	2==;KL 	r7   c                    \        W!4      # rO   )r   rs   s   &&&r5   ru   kstwo_gen._pdf  s    ~r7   c                    \        W!4      # rO   r   rs   s   &&&r5   ry   kstwo_gen._cdf  s    q}r7   c                    \        W!R R7      # Fcdfr   rs   s   &&&r5   r~   kstwo_gen._sf  s    q''r7   c                    \        W!R R7      # )Tr   r    r   s   &&&r5   r   kstwo_gen._ppf  s    $''r7   c                    \        W!R R7      # r   r   r   s   &&&r5   r   kstwo_gen._isf  s    %((r7   r   N)r   r   r   r   r   rd   rm   r   ru   ry   r~   r   r   r   r   r   s   @r5   r   r      s:     AD-C(() )r7   r   kstwo)momtyper   r   r   c                   H   a  ] tR tRt o RtR tR tR tR tR t	R t
R	tV tR
# )kstwobign_geni&  a  Limiting distribution of scaled Kolmogorov-Smirnov two-sided test statistic.

This is the asymptotic distribution of the two-sided Kolmogorov-Smirnov
statistic :math:`\sqrt{n} D_n` that measures the maximum absolute
distance of the theoretical (continuous) CDF from the empirical CDF.
(see `kstest`).

%(before_notes)s

See Also
--------
ksone, kstwo, kstest

Notes
-----
:math:`\sqrt{n} D_n` is given by

.. math::

    D_n = \text{sup}_x |F_n(x) - F(x)|

where :math:`F` is a continuous CDF and :math:`F_n` is an empirical CDF.
`kstwobign`  describes the asymptotic distribution (i.e. the limit of
:math:`\sqrt{n} D_n`) under the null hypothesis of the KS test that the
empirical CDF corresponds to i.i.d. random variates with CDF :math:`F`.

%(after_notes)s

References
----------
.. [1] Feller, W. "On the Kolmogorov-Smirnov Limit Theorems for Empirical
   Distributions",  Ann. Math. Statist. Vol 19, 177-189 (1948).

%(example)s

c                    . # rO   r   rl   s   &r5   rm   kstwobign_gen._shape_infoK      	r7   c                0    \         P                  ! V4      ) # rO   )rq   _kolmogprD   rt   s   &&r5   ru   kstwobign_gen._pdfN  s    Qr7   c                .    \         P                  ! V4      # rO   )rq   _kolmogcr   s   &&r5   ry   kstwobign_gen._cdfQ  s    ||Ar7   c                .    \         P                  ! V4      # rO   )r|   
kolmogorovr   s   &&r5   r~   kstwobign_gen._sfT  s    }}Qr7   c                .    \         P                  ! V4      # rO   )rq   	_kolmogcirD   r   s   &&r5   r   kstwobign_gen._ppfW  s    }}Qr7   c                .    \         P                  ! V4      # rO   )r|   kolmogir   s   &&r5   r   kstwobign_gen._isfZ  s    zz!}r7   r   N)r   r   r   r   r   rm   ru   ry   r~   r   r   r   r   r   s   @r5   r   r   &  s.     #H    r7   r   	kstwobign)r   r   c                 b    \         P                  ! V ^,          ) R,          4      \        ,          #           @)rQ   exp_norm_pdf_Crt   s   &r5   	_norm_pdfr   j  s     661a4%){**r7   c                 :    V ^,          ) R,          \         ,
          # r   )_norm_pdf_logCr   s   &r5   _norm_logpdfr   n  s    qD53;''r7   c                 .    \         P                  ! V 4      # rO   )r|   ndtrr   s   &r5   	_norm_cdfr   r  s    771:r7   c                 .    \         P                  ! V 4      # rO   )r|   log_ndtrr   s   &r5   _norm_logcdfr   v  s    ;;q>r7   c                 .    \         P                  ! V 4      # rO   )r|   ndtrir   s   &r5   	_norm_ppfr   z  s    88A;r7   c                     \        V ) 4      # rO   r   r   s   &r5   _norm_sfr   ~  s    aR=r7   c                     \        V ) 4      # rO   r   r   s   &r5   _norm_logsfr     s    r7   c                     \        V 4      ) # rO   r   r   s   &r5   	_norm_isfr     s    aL=r7   c                      a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 tR tR tR tR tR t]]! ]RR7      R 4       4       tR tRtV tR# )norm_geni  a]  A normal continuous random variable.

The location (``loc``) keyword specifies the mean.
The scale (``scale``) keyword specifies the standard deviation.

%(before_notes)s

Notes
-----
The probability density function for `norm` is:

.. math::

    f(x) = \frac{\exp(-x^2/2)}{\sqrt{2\pi}}

for a real number :math:`x`.

%(after_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   norm_gen._shape_info  r   r7   Nc                $    VP                  V4      # rO   )standard_normalrD   sizerandom_states   &&&r5   _rvsnorm_gen._rvs  s    ++D11r7   c                    \        V4      # rO   r   r   s   &&r5   ru   norm_gen._pdf  s    |r7   c                    \        V4      # rO   r   r   s   &&r5   _logpdfnorm_gen._logpdf      Ar7   c                    \        V4      # rO   r   r   s   &&r5   ry   norm_gen._cdf      |r7   c                    \        V4      # rO   r   r   s   &&r5   _logcdfnorm_gen._logcdf  r   r7   c                    \        V4      # rO   r   r   s   &&r5   r~   norm_gen._sf  s    {r7   c                    \        V4      # rO   )r   r   s   &&r5   _logsfnorm_gen._logsf  s    1~r7   c                    \        V4      # rO   r   r   s   &&r5   r   norm_gen._ppf  r  r7   c                    \        V4      # rO   r   r   s   &&r5   r   norm_gen._isf  r  r7   c                    R# )r   )r   r   r   r   r   rl   s   &r5   r   norm_gen._stats      !!r7   c                t    R \         P                  ! ^\         P                  ,          4      ^,           ,          # r   rQ   logpirl   s   &r5   _entropynorm_gen._entropy  s"    BFF1RUU7OA%&&r7   a}          For the normal distribution, method of moments and maximum likelihood
        estimation give identical fits, and explicit formulas for the estimates
        are available.
        This function uses these explicit formulas for the maximum likelihood
        estimation of the normal distribution parameters, so the
        `optimizer` and `method` arguments are ignored.

notesc                   VP                  R R4      pVP                  RR4      p\        V4       Ve   Ve   \        R4      h\        P                  ! V4      p\        P
                  ! V4      P                  4       '       g   \        R4      hVf   VP                  4       pMTpVf5   \        P                  ! W,
          ^,          P                  4       4      pWV3# TpWV3# )flocNfscale3All parameters fixed. There is nothing to optimize.$The data contains non-finite values.)	r2   r6   
ValueErrorrQ   asarrayisfiniteallmeansqrt)rD   rE   r4   r  r  r-   r.   s   &&,    r5   rB   norm_gen.fit  s     xx%(D)$T* 2  ) * * zz${{4 $$&&CDD<))+CC>GGdj1_2245E z Ezr7   c                    V^ 8X  d   R# V^,          ^ 8X  d'   \         P                  ! \        V4      ^,
          4      # R# )zv
@returns Moments of standard normal distribution for integer n >= 0

See eq. 16 of https://arxiv.org/abs/1209.4340v2
r   r   )r|   
factorial2intrb   s   &&r5   _munpnorm_gen._munp  s3     6q5A:==Q!,,r7   r   NN)r   r   r   r   r   rm   r   ru   r   ry   r  r~   r
  r   r   r   r  rK   r
   r   rB   r,  r   r   r   s   @r5   r   r     sz     ,2"'  6? @@ < r7   r   norm)r   c                   `   a  ] tR tRt o Rt]P                  tR tR t	R t
R tR tR tR	tV tR
# )	alpha_geni  a  An alpha continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `alpha` ([1]_, [2]_) is:

.. math::

    f(x, a) = \frac{1}{x^2 \Phi(a) \sqrt{2\pi}} *
              \exp(-\frac{1}{2} (a-1/x)^2)

where :math:`\Phi` is the normal CDF, :math:`x > 0`, and :math:`a > 0`.

`alpha` takes ``a`` as a shape parameter.

%(after_notes)s

References
----------
.. [1] Johnson, Kotz, and Balakrishnan, "Continuous Univariate
       Distributions, Volume 1", Second Edition, John Wiley and Sons,
       p. 173 (1994).
.. [2] Anthony A. Salvia, "Reliability applications of the Alpha
       Distribution", IEEE Transactions on Reliability, Vol. R-34,
       No. 3, pp. 251-252 (1985).

%(example)s

c                @    \        R R^ \        P                  3R4      .# r   FFFrj   rl   s   &r5   rm   alpha_gen._shape_info      3266{NCDDr7   c                ~    R V^,          ,          \        V4      ,          \        VR V,          ,
          4      ,          # r   )r   r   rD   rt   r   s   &&&r5   ru   alpha_gen._pdf"  s+    AqDz)A,&y3q5'999r7   c                    R\         P                  ! V4      ,          \        VRV,          ,
          4      ,           \         P                  ! \        V4      4      ,
          # )r   r   )rQ   r  r   r   r9  s   &&&r5   r   alpha_gen._logpdf&  s8    "&&)|l1SU733bffYq\6JJJr7   c                T    \        VR V,          ,
          4      \        V4      ,          # r8  r   r9  s   &&&r5   ry   alpha_gen._cdf)  s    3q5!IaL00r7   c           
     |    R \         P                  ! V\        V\        V4      ,          4      ,
          4      ,          # r8  )rQ   r#  r   r   rD   r   r   s   &&&r5   r   alpha_gen._ppf,  s(    2::a)AilN";;<<<r7   c                l    \         P                  .^,          \         P                  .^,          ,           # r   rQ   rk   nanrD   r   s   &&r5   r   alpha_gen._stats/  s!    xzRVVHQJ&&r7   r   N)r   r   r   r   r   r   _open_support_mask_support_maskrm   ru   r   ry   r   r   r   r   r   s   @r5   r1  r1    s<     > "44ME:K1=' 'r7   r1  alphac                   N   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
tV tR# )
anglit_geni6  zAn anglit continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `anglit` is:

.. math::

    f(x) = \sin(2x + \pi/2) = \cos(2x)

for :math:`-\pi/4 \le x \le \pi/4`.

%(after_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   anglit_gen._shape_infoJ  r   r7   c                <    \         P                  ! ^V,          4      # rD  )rQ   cosr   s   &&r5   ru   anglit_gen._pdfM  s    vvac{r7   c                t    \         P                  ! V\         P                  ^,          ,           4      R,          #    r   rQ   sinr  r   s   &&r5   ry   anglit_gen._cdfQ  s"    vvaai #%%r7   c                t    \         P                  ! V\         P                  ^,          ,           4      R,          # rT  )rQ   rQ  r  r   s   &&r5   r~   anglit_gen._sfT  s"    vva"%%!)m$++r7   c                    \         P                  ! \         P                  ! V4      4      \         P                  ^,          ,
          # rU  )rQ   arcsinr'  r  r   s   &&r5   r   anglit_gen._ppfW  s&    yy$RUU1W,,r7   c                &   R \         P                  \         P                  ,          ^,          R,
          R R\         P                  ^,          ^`,
          ,          \         P                  \         P                  ,          ^,
          ^,          ,          3# )r   r   r<  rQ   r  rl   s   &r5   r   anglit_gen._statsZ  sR    BEE"%%KN3&RB-?ruuQQR@R-RRRr7   c                <    ^\         P                  ! ^4      ,
          # r_   rQ   r  rl   s   &r5   r  anglit_gen._entropy]      {r7   r   N)r   r   r   r   r   rm   ru   ry   r~   r   r   r  r   r   r   s   @r5   rM  rM  6  s3     &&,-S r7   rM  anglitc                   H   a  ] tR tRt o RtR tR tR tR tR t	R t
R	tV tR
# )arcsine_genid  zAn arcsine continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `arcsine` is:

.. math::

    f(x) = \frac{1}{\pi \sqrt{x (1-x)}}

for :math:`0 < x < 1`.

%(after_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   arcsine_gen._shape_infox  r   r7   c                    \         P                  ! R R7      ;_uu_ 4        R\         P                  ,          \         P                  ! V^V,
          ,          4      ,          uuRRR4       #   + '       g   i     R# ; i)ignoredivider   N)rQ   errstater  r'  r   s   &&r5   ru   arcsine_gen._pdf{  sA    [[))ruu9RWWQ!W-- *)))s   A A++A<	c                    R \         P                  ,          \         P                  ! \         P                  ! V4      4      ,          # r   )rQ   r  r]  r'  r   s   &&r5   ry   arcsine_gen._cdf  s&    255y2771:...r7   c                t    \         P                  ! \         P                  R ,          V,          4      R ,          # rr  rV  r   s   &&r5   r   arcsine_gen._ppf  s"    vvbeeCik"C''r7   c                    R pRp^ pRpWW43# )r   g      ?      r   rD   mumu2g1g2s   &    r5   r   arcsine_gen._stats  s     r7   c                    R# )g?gοr   rl   s   &r5   r  arcsine_gen._entropy  s    &&r7   r   Nr   r   r   r   r   rm   ru   ry   r   r   r  r   r   r   s   @r5   rh  rh  d  s-     &.
/(' 'r7   rh  arcsinec                   *   a  ] tR tRt o RtR tRtV tR# )FitDataErrori  z=Raised when input data is inconsistent with fixed parameters.c                0    R V: RV: RV: R23V n         R# )z>Invalid values in `data`.  Maximum likelihood estimation with z requires that z < (x - loc)/scale  < z for each x in `data`.NrF   )rD   distrr=   uppers   &&&&r5   __init__FitDataError.__init__  s/    $iui @""'*@B
	r7   r  Nr   r   r   r   r   r  r   r   r   s   @r5   r  r    s     G
 
r7   r  c                   *   a  ] tR tRt o RtR tRtV tR# )rX   i  zF
Raised when a solver fails to converge while fitting a distribution.
c                J    R pW!P                  RR4      ,          pV3V n        R# )z1Solver for the MLE equations failed to converge: 
 N)replacerF   )rD   mesgemsgs   && r5   r  FitSolverError.__init__  s#    BT2&&G	r7   r  Nr  r   s   @r5   rX   rX     s     
 r7   rX   c                     \         P                  ! W,           4      pW2V) \         P                  ! V 4      ,           ,          ,
          pV# rO   r|   psi)r   r   rc   s1psiabfuncs   &&&&  r5   _beta_mle_ar    s4     FF15MEeVbffQi'((DKr7   c                     V w  rE\         P                  ! WE,           4      pW!V) \         P                  ! V4      ,           ,          ,
          W1V) \         P                  ! V4      ,           ,          ,
          .pV# rO   r  )thetarc   r  s2r   r   r  r  s   &&&&    r5   _beta_mle_abr    sZ     DAFF15MEufrvvay())ufrvvay())+DKr7   c                      a a ] tR tRt oRtR tRR ltR tR tR t	R t
R	 tR
 tR tV 3R lt]]! ]RR7      V 3R l4       4       tR tRtVtV ;t# )beta_geni  a  A beta continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `beta` is:

.. math::

    f(x, a, b) = \frac{\Gamma(a+b) x^{a-1} (1-x)^{b-1}}
                      {\Gamma(a) \Gamma(b)}

for :math:`0 <= x <= 1`, :math:`a > 0`, :math:`b > 0`, where
:math:`\Gamma` is the gamma function (`scipy.special.gamma`).

`beta` takes :math:`a` and :math:`b` as shape parameters.

This distribution uses routines from the Boost Math C++ library for
the computation of the ``pdf``, ``cdf``, ``ppf``, ``sf`` and ``isf``
methods. [1]_

Maximum likelihood estimates of parameters are only available when the location and
scale are fixed. When either of these parameters is free, ``beta.fit`` resorts to
numerical optimization, but this problem is unbounded: the location and scale may be
chosen to make the minimum and maximum elements of the data coincide with the
endpoints of the support, and the shape parameters may be chosen to make the PDF at
these points infinite. For best results, pass ``floc`` and ``fscale`` keyword
arguments to fix the location and scale, or use `scipy.stats.fit` with
``method='mse'``.

%(after_notes)s

References
----------
.. [1] The Boost Developers. "Boost C++ Libraries". https://www.boost.org/.

%(example)s

c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      pW.# r   Fr   r4  rj   rD   iaibs   &  r5   rm   beta_gen._shape_info  9    UQK@UQK@xr7   c                &    VP                  WV4      # rO   beta)rD   r   r   r   r   s   &&&&&r5   r   beta_gen._rvs  s      t,,r7   c                    \         P                  ! R R7      ;_uu_ 4        \        P                  ! WV4      uuRRR4       #   + '       g   i     R# ; irl  overN)rQ   ro  rq   	_beta_pdfrD   rt   r   r   s   &&&&r5   ru   beta_gen._pdf  s0     [[h''==q) ('''   AA	c                    \         P                  ! VR ,
          V) 4      \         P                  ! VR ,
          V4      ,           pV\         P                  ! W#4      ,          pV# r8  )r|   xlog1pyxlogybetaln)rD   rt   r   r   lPxs   &&&& r5   r   beta_gen._logpdf  sC    jjS1"%S!(<<ryy
r7   c                0    \         P                  ! W#V4      # rO   )r|   betaincr  s   &&&&r5   ry   beta_gen._cdf  s    zz!""r7   c                0    \         P                  ! W#V4      # rO   )r|   betainccr  s   &&&&r5   r~   beta_gen._sf  s    {{1##r7   c                0    \         P                  ! W#V4      # rO   )r|   betainccinvr  s   &&&&r5   r   beta_gen._isf  s    ~~aA&&r7   c                0    \         P                  ! WV4      # rO   )rq   	_beta_ppfrD   r   r   r   s   &&&&r5   r   beta_gen._ppf
  s    }}Q1%%r7   c                   W,           pW,          pW,          V^,          V^,           ,          ,          p^W!,
          ,          \         P                  ! V^,           4      ,          V^,           \         P                  ! W,          4      ,          ,          p^W,
          ^,          V^,           ,          W,          V^,           ,          ,
          ,          pW,          V^,           ,          V^,           ,          pWx,          p	VVVV	3# rD  rQ   r'  )
rD   r   r   a_plus_b
_beta_mean_beta_variance_beta_skewness_beta_kurtosis_excess_n_beta_kurtosis_excess_d_beta_kurtosis_excesss
   &&&       r5   r   beta_gen._stats  s    5Z
!x!| <=;A)>>$qLBGGAEN:<"#zX\'B'(u1'=(> #?"#%8a<"8HqL"I 7 Q!	# 	#r7   c                   <aa \        V\        4      '       d   VP                  4       p\        V4      o\	        V4      oVV3R  lp\
        P                  ! VR4      w  r4\        SV `!  WV3R7      # )c                 ^  < V w  r^W!,
          ,          \         P                  ! W,           ^,           4      ,          W,           ^,           ,          \         P                  ! W,          4      ,          pV^,          V^,          ^V,          ^,
          ,          ,
          V^,          V^,           ,          ,           ^V,          V,          V^,           ,          ,
          pWAV,          W,           ^,           ,          W,           ^,           ,          ,          pV^,          pVS,
          VS,
          .# rD  r  )rt   r   r   skkur{  r|  s   &    r5   r   beta_gen._fitstart.<locals>.func$  s    DAAC++quqy9BGGACLHBA1ac!e$q!tQqSz1AaCE1Q3K?BA#qs1u+qs1u%%B!GBrE2b5>!r7   r  )r   r   )	r>   r)   	_uncensorr   r   r   fsolver@   	_fitstart)rD   rE   r  r   r   r{  r|  	__class__s   &&   @@r5   r  beta_gen._fitstart  s^    dL))>>#D4[t_	" tZ0w F 33r7   z        In the special case where `method="MLE"` and
        both `floc` and `fscale` are given, a
        `ValueError` is raised if any value `x` in `data` does not satisfy
        `floc < x < floc + fscale`.

r  c           	       < VP                  R R4      pVP                  RR4      pVe   Vf   \        SV `  ! V.VO5/ VB # VP                  R R4       VP                  RR4       \	        V. RO4      p\	        V. RO4      p\        V4       Ve   Ve   \        R4      h\        P                  ! V4      P                  4       '       g   \        R4      h\        P                  ! V4      V,
          V,          p\        P                  ! V^ 8*  4      '       g    \        P                  ! V^8  4      '       d   \        RWDV,           R7      hVP                  4       pVf   Ve   Ve   Tp	^V,
          p^V,
          pMTp	W,          ^V,
          ,          p
\        P                  ! \         V
V	\#        V4      \        P$                  ! V4      P'                  4       3RR7      w  rrV^8w  d   \)        VR	7      hV^ ,          p
Ve   YrM\        P$                  ! V4      P'                  4       p\*        P,                  ! V) 4      P'                  4       pV^V,
          ,          VP/                  ^ R
7      ,          ^,
          pVV,          p
^V,
          V,          p	\        P                  ! \0        W.\#        V4      VV3RR7      w  rrV^8w  d   \)        VR	7      hVw  rWWE3# )r  Nr  r   r!  r  r=   r  T)rF   full_output)r  )ddoff0fafix_a)f1fbfix_b)r<   r@   rB   r2   r   r6   r"  rQ   r$  r%  ravelanyr  r&  r   r  r  lenr  sumrX   r|   log1pvarr  )rD   rE   rF   r4   r  r  r  r  xbarr   r   r  infoierr  r  r  facr  s   &&*,              r5   rB   beta_gen.fit.  s    xx%(D)<6>7;t3d3d33 	4 !$(=>!$(=>$T*>bn ) * * {{4 $$&&CDD %/66$!)tqy 1 1vTGGyy{>R^ ~ 4x4x AH%A &.__QTBFF4L$4$4$67 &"E
 ax$$//aA~ 1 !!#B4%$$&B !d(#dhhAh&66:Cs
ATS A &.__qf$iR( &"E
 ax$$//DAT!!r7   c                  a	 R  pR pR o	V	3R lpR pV! V4      pV! V4      p\        VR8  VR8  ,          VR8*  W!,
          R8  ,          W'8  ,          VR8*  W,
          R8  ,          W8  ,          VR8  VR8  ,          .VS	WS.W.4      # )c                 <   \         P                  ! W4      V ^,
          \         P                  ! V 4      ,          ,
          V^,
          \         P                  ! V4      ,          ,
          W,           ^,
          \         P                  ! W,           4      ,          ,           # r_   )r|   r  r  r   r   s   &&r5   regular"beta_gen._entropy.<locals>.regular  s`    IIaOq1uq	&99UbffQi'(+,519qu*EF Gr7   c                    W,           pR \         P                  ! ^\         P                  ,          4      \         P                  ! V 4      ,           \         P                  ! V4      ,           ^\         P                  ! V4      ,          ,
          ^,           ,          p^nV,          ^VR,          ,          ,           VR,          ,           ^VR,          ,          ,
          pRV ,          ^
V R,          ,          ,
          V R,          ,
          V R,          ,           pRV,          ^
VR,          ,          ,
          VR,          ,
          VR,          ,           pW4V,           V,           ^x,          ,           # )r                      ir  )r   r   sum_ablog_termt1t2t3s   &&     r5   asymptotic_ab_large.beta_gen._entropy.<locals>.asymptotic_ab_large  s    UFqw"&&)+bffQi7!BFF6N:JJQNH Vbo-<q~MBQAtG#ag-47BQAtG#ag-47BBw|s222r7   c                    W,           p\         P                  ! V 4      V ^,
          \         P                  ! V 4      ,          ,
          pR^V,          ,          ^^V,          ,          ,           VR,          ^,          ,
          VR,          ^x,          ,
          VR,          ^x,          ,           VR,          ^,          ,           VR,          ^,          ,
          ^V,          ,           ^^V,          ,          ,
          VR,          ^,          ,           VR,          ^x,          ,           VR,          ^<,          ,
          VR,          ^,          ,
          VR,          ^~,          ,           pV\        P                  ! W,          4      ,          \        P
                  ! V4      ,           ^\        P
                  ! V4      ,          ,
          pW4,           V,           # )rM   r  r  r              )r|   gammalnr  rQ   r  r  )r   r   r  r  r  r  s   &&    r5   asymptotic_b_large-beta_gen._entropy.<locals>.asymptotic_b_large  sG   UFA!a%266!9!44BQqS	Ar!tH$q$wrz1AtGCK?!T'#+MT'#+ !4,./h79:BvIG$,q.!#)4<#346<dl2oF $,s"# &,T\#%56  bhhqsm+bffQi7!BFF6N:JJH7X%%r7   c                    < S! W4      # rO   r   )r   r   r  s   &&r5   asymptotic_a_large-beta_gen._entropy.<locals>.asymptotic_a_large  s    %a++r7   c                     \         P                  ! \         P                  ! V 4      4      p\         P                  ! V ^
V,          ,          4      ^,           p\        P                  ! V R8g  W!3R RR7      # )
   r   c                 0    V ^
^V,           ,          ,          # )r  r   )d_j_s   &&r5   <lambda><beta_gen._entropy.<locals>.threshold_large.<locals>.<lambda>  s    BaRTfDUr7   i  
fill_value)rQ   floorlog10xpxapply_where)vjds   &  r5   threshold_large*beta_gen._entropy.<locals>.threshold_large  sT    !%AR1W%)A??18aV5U.24 4r7   g    RAg    (RAg    .Ar   )
rD   r   r   r  r  r  r  threshold_athreshold_br  s
   &&&      @r5   r  beta_gen._entropy  s    	G	3
	&	,	4 &a(%a(Q&[Q&[9%ZAESL9Q=MN%ZAESL9Q=MNY1u95
 01C.96
 	
r7   r   r.  )r   r   r   r   r   rm   r   ru   r   ry   r~   r   r   r   r  rK   r	   r   rB   r  r   r   __classcell__r  r   s   @@r5   r  r    sr     'P
-*
#$'&# 4" } 5+ ,
c", c"J.
 .
r7   r  r  c                   p   a  ] tR tRt o Rt]P                  tR tRR lt	R t
R tR tR	 tR
 tR tRtV tR# )betaprime_geni  a'  A beta prime continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `betaprime` is:

.. math::

    f(x, a, b) = \frac{x^{a-1} (1+x)^{-a-b}}{\beta(a, b)}

for :math:`x >= 0`, :math:`a > 0`, :math:`b > 0`, where
:math:`\beta(a, b)` is the beta function (see `scipy.special.beta`).

`betaprime` takes ``a`` and ``b`` as shape parameters.

The distribution is related to the `beta` distribution as follows:
If :math:`X` follows a beta distribution with parameters :math:`a, b`,
then :math:`Y = X/(1-X)` has a beta prime distribution with
parameters :math:`a, b` ([1]_).

The beta prime distribution is a reparametrized version of the
F distribution.  The beta prime distribution with shape parameters
``a`` and ``b`` and ``scale = s`` is equivalent to the F distribution
with parameters ``d1 = 2*a``, ``d2 = 2*b`` and ``scale = (a/b)*s``.
For example,

>>> from scipy.stats import betaprime, f
>>> x = [1, 2, 5, 10]
>>> a = 12
>>> b = 5
>>> betaprime.pdf(x, a, b, scale=2)
array([0.00541179, 0.08331299, 0.14669185, 0.03150079])
>>> f.pdf(x, 2*a, 2*b, scale=(a/b)*2)
array([0.00541179, 0.08331299, 0.14669185, 0.03150079])

%(after_notes)s

References
----------
.. [1] Beta prime distribution, Wikipedia,
       https://en.wikipedia.org/wiki/Beta_prime_distribution

%(example)s

c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      pW.# r  rj   r  s   &  r5   rm   betaprime_gen._shape_info  r  r7   Nc                n    \         P                  WVR 7      p\         P                  W#VR 7      pWV,          # r   r   )gammarvs)rD   r   r   r   r   u1u2s   &&&&&  r5   r   betaprime_gen._rvs  s-    YYq,Y?YYq,Y?wr7   c                N    \         P                  ! V P                  WV4      4      # rO   rQ   r   r   r  s   &&&&r5   ru   betaprime_gen._pdf	      vvdll1+,,r7   c                    \         P                  ! VR ,
          V4      \         P                  ! W#,           V4      ,
          \         P                  ! W#4      ,
          # r8  )r|   r  r  r  r  s   &&&&r5   r   betaprime_gen._logpdf  s6    xxC#bjj&::RYYq_LLr7   c                B    \         P                  ! V^8  WV3R R 4      # )rM   c                 J    \         P                  ^^V ,           ,          W!4      # r_   r  r~   x_a_b_s   &&&r5   r  $betaprime_gen._cdf.<locals>.<lambda>  s    txxQVb=r7   c                 J    \         P                  V ^V ,           ,          W4      # r_   r  ry   r6  s   &&&r5   r  r:    s    tyyq2v?r7   r  r  r  s   &&&&r5   ry   betaprime_gen._cdf  s*     EA!9=?A 	Ar7   c                B    \         P                  ! V^8  WV3R R 4      # )rM   c                 J    \         P                  ^^V ,           ,          W!4      # r_   r<  r6  s   &&&r5   r  #betaprime_gen._sf.<locals>.<lambda>   s    tyya"fr>r7   c                 J    \         P                  V ^V ,           ,          W4      # r_   r5  r6  s   &&&r5   r  rA  !  s    txxa"fr>r7   r=  r  s   &&&&r5   r~   betaprime_gen._sf  s(    EA!9>>@ 	@r7   c                J   \         P                  ! WV4      w  rp\        P                  P	                  WV4      p\         P
                  ! R R7      ;_uu_ 4        V^V,
          ,          pRRR4       VR8  p\         P                  ! V4      '       d9   V'       d/   ^\        P                  P                  WV4      ,          ^,
          pX# ^\        P                  P                  W,          W6,          W&,          4      ,          ^,
          XV&   V#   + '       g   i     L; i)rl  rm  NgH.?)rQ   broadcast_arraysstatsr  r   ro  isscalarr   )rD   pr   r   routrnear1s   &&&&   r5   r   betaprime_gen._ppf#  s    %%aA.a JJOOA!$[[))q1u+C *V;;q>>

a0014 
 EJJOOAIqy!)LLqPCK
 *)s   DD"	c                d   a \         P                  ! VS8  W#3V3R  l\        P                  R7      # )c                    < \         P                  ! \        ^\        S4      ^,           4       Uu. uF  q V,           ^,
          W,
          ,          NK!  	  up^ R7      # u upi )rM   axis)rQ   prodranger+  )r   r   irc   s   && r5   r  %betaprime_gen._munp.<locals>.<lambda>8  sB    q#a&(9K!L9KAQ3q513--9K!LSTU!Ls   %Ar  r  r  rQ   rk   )rD   rc   r   r   s   &f&&r5   r,  betaprime_gen._munp5  s)    EA6Uvv 	r7   r   r.  )r   r   r   r   r   r   rI  rJ  rm   r   ru   r   ry   r~   r   r,  r   r   r   s   @r5   r"  r"    sH     .^ "44M

-MA@$ r7   r"  	betaprimec                   L   a  ] tR tRt o RtR tR tR tR tRR lt	R t
R	tV tR
# )bradford_geni?  a6  A Bradford continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `bradford` is:

.. math::

    f(x, c) = \frac{c}{\log(1+c) (1+cx)}

for :math:`0 <= x <= 1` and :math:`c > 0`.

`bradford` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# cFr4  rj   rl   s   &r5   rm   bradford_gen._shape_infoU  r6  r7   c                d    W"V,          R ,           ,          \         P                  ! V4      ,          # r8  r|   r  rD   rt   r\  s   &&&r5   ru   bradford_gen._pdfX  s    aC#I!,,r7   c                p    \         P                  ! W!,          4      \         P                  ! V4      ,          # rO   r_  r`  s   &&&r5   ry   bradford_gen._cdf\  s    xx}rxx{**r7   c                r    \         P                  ! V\         P                  ! V4      ,          4      V,          # rO   r|   expm1r  rD   r   r\  s   &&&r5   r   bradford_gen._ppf_  s"    xxBHHQK(1,,r7   c                   \         P                  ! R V,           4      pW,
          W,          ,          pVR,           V,          RV,          ,
          ^V,          V,          V,          ,          pRpRpRV9   d   \         P                  ! ^4      ^V,          V,          ^	V,          V,          V^,           ,          ,
          ^V,          V,          W^,           ,          ^,           ,          ,           ,          pV\         P                  ! WV^,
          ,          ^V,          ,           ,          4      ^V,          V^,
          ,          ^V,          ,           ,          ,          pRV9   d   V^,          V^,
          ,          V^V,          ^,
          ,          ^,           ,          ^V,          V,          V,          V^,
          ,          V^,
          ,          ,           ^V,          V,          V,          ^V,          ^,
          ,          ,           ^V^,          ,          ,           pV^V,          W^,
          ,          ^V,          ,           ^,          ,          ,          pWEWg3# )r   r   Nsk)rQ   r  r'  )rD   r\  momentsrk  ry  rz  r{  r|  s   &&&     r5   r   bradford_gen._statsb  s   FF3q5McAC[#qyQ1Qq)'>RT!VAaCE1Q3K/!AqA#wqy0AABB"''!!WQqS[/*AaC1IacM::B'>Q$!*a1Rjm,RT!VAXqs^QqS-AAA#a%'1Q3r6"#%'1W-B!A#qA#wqs{Q&&&Br7   c                    \         P                  ! ^V,           4      pVR,          \         P                  ! W,          4      ,
          # rM   r   rc  )rD   r\  rk  s   && r5   r  bradford_gen._entropyq  s,    FF1Q3Kurvvac{""r7   r   Nmvr  r   s   @r5   rY  rY  ?  s.     *E-+-# #r7   rY  bradfordc                   f   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tR tRtV tR# )burr_geniy  a  A Burr (Type III) continuous random variable.

%(before_notes)s

See Also
--------
fisk : a special case of either `burr` or `burr12` with ``d=1``
burr12 : Burr Type XII distribution
mielke : Mielke Beta-Kappa / Dagum distribution

Notes
-----
The probability density function for `burr` is:

.. math::

    f(x; c, d) = c d \frac{x^{-c - 1}}
                          {{(1 + x^{-c})}^{d + 1}}

for :math:`x >= 0` and :math:`c, d > 0`.

`burr` takes ``c`` and ``d`` as shape parameters for :math:`c` and
:math:`d`.

This is the PDF corresponding to the third CDF given in Burr's list;
specifically, it is equation (11) in Burr's paper [1]_. The distribution
is also commonly referred to as the Dagum distribution [2]_. If the
parameter :math:`c < 1` then the mean of the distribution does not
exist and if :math:`c < 2` the variance does not exist [2]_.
The PDF is finite at the left endpoint :math:`x = 0` if :math:`c * d >= 1`.

%(after_notes)s

References
----------
.. [1] Burr, I. W. "Cumulative frequency functions", Annals of
   Mathematical Statistics, 13(2), pp 215-232 (1942).
.. [2] https://en.wikipedia.org/wiki/Dagum_distribution
.. [3] Kleiber, Christian. "A guide to the Dagum distributions."
   Modeling Income Distributions and Lorenz Curves  pp 97-117 (2008).

%(example)s

c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      pW.# r\  Fr  r4  rj   rD   icids   &  r5   rm   burr_gen._shape_info  r  r7   c                z    \         P                  ! V^ 8H  WV3R R 4      pVP                  ^ 8X  d
   VR,          # T# )r   c                 p    W,          WV,          ^,
          ,          ,          ^W,          ,           ,          # r_   r   r7  c_r  s   &&&r5   r  burr_gen._pdf.<locals>.<lambda>  s     rw""uQw-8AJGr7   c                     W,          W) R ,
          ,          ,          ^W) ,          ,           VR ,           ,          ,          # r8  r   r~  s   &&&r5   r  r    s.    2#)+< ="#bSk/rCx!@!Br7   r   r  r  ndimrD   rt   r\  r  outputs   &&&& r5   ru   burr_gen._pdf  sC    FQ1IGCD
 $[[A-vbz969r7   c                z    \         P                  ! V^ 8H  WV3R R 4      pVP                  ^ 8X  d
   VR,          # T# )r   c                    \         P                  ! V4      \         P                  ! V4      ,           \        P                  ! W,          ^,
          V 4      ,           V^,           \        P                  ! W,          4      ,          ,
          # r_   )rQ   r  r|   r  r  r~  s   &&&r5   r  "burr_gen._logpdf.<locals>.<lambda>  sK    r
RVVBZ 7"((2519b:Q Q#%a4288BH+="=!>r7   c                     \         P                  ! V4      \         P                  ! V4      ,           \        P                  ! V) ^,
          V 4      ,           \        P                  ! V^,           W) ,          4      ,
          # r_   rQ   r  r|   r  r  r~  s   &&&r5   r  r    sM    r
RVVBZ 7"$((B37B"7!8"$**RT29"=!>r7   r   r  r  s   &&&& r5   r   burr_gen._logpdf  sD    FQ1I??	@ $[[A-vbz969r7   c                2    ^W) ,          ,           V) ,          # r_   r   rD   rt   r\  r  s   &&&&r5   ry   burr_gen._cdf  s    AGr""r7   c                L    \         P                  ! W) ,          4      V) ,          # rO   r_  r  s   &&&&r5   r  burr_gen._logcdf  s    xxB QB''r7   c                N    \         P                  ! V P                  WV4      4      # rO   rQ   r   r
  r  s   &&&&r5   r~   burr_gen._sf      vvdkk!*++r7   c                \    \         P                  ! ^W) ,          ,           V) ,          ) 4      # r_   rQ   r  r  s   &&&&r5   r
  burr_gen._logsf  s#    xx1q2w;1"--..r7   c                L    VRV,          ,          ^,
          RV,          ,          # r         r   rD   r   r\  r  s   &&&&r5   r   burr_gen._ppf  s    DFa46**r7   c                    \         P                  ! RV,          V) 4      p\         P                  ! V4      RV,          ,          # r  r|   r  rf  )rD   r   r\  r  _qs   &&&& r5   r   burr_gen._isf  s/    ZZq1"%xx|q))r7   c                   \         P                  ! ^^4      P                  ^^4      V,          p\        P                  ! W#,           RV,
          4      V,          w  rErg\         P
                  ! VR8  V\         P                  4      pWX^,          ,
          p	\         P
                  ! VR8  V	\         P                  4      p
\        P                  ! VR8  WEWi3R \         P                  R7      p\        P                  ! VR8  WEWgV	3R \         P                  R7      p\         P                  ! V4      ^ 8X  d?   VP                  4       V
P                  4       VP                  4       VP                  4       3# WW3# )rM   r   r         @c                     V^V,          V ,          ,
          ^V ^,          ,          ,           \         P                  ! V^,          4      ,          #    r  )e1e2e3mu2_if_cs   &&&&r5   r  !burr_gen._stats.<locals>.<lambda>  s3    2"R<!BE'+A-/WWh]-C+Dr7   r        @c                     V^V,          V ,          ,
          ^V,          V ^,          ,          ,           ^V ^,          ,          ,
          V^,          ,          ^,
          # r\  r   )r  r  r  e4r  s   &&&&&r5   r  r    s=    qtBw,2b!e+aAg51DIr7   )rQ   arangereshaper|   r  whererF  r  r  r  item)rD   r\  r  ncr  r  r  r  ry  r  rz  r{  r|  s   &&&          r5   r   burr_gen._stats  s   YYq!_$$Qq)A-b1A5XXa#gr266*A:hhq3w"&&1__Gbb+Evv	
 __Gbbh/Kvv	
 771:?779chhj"'')RWWY>>r7   c                   R  p\         P                  ! V4      \         P                  ! V4      \         P                  ! V4      r2p\        P                  ! W!8  W8H  ,          W38H  ,          WV3V\         P                  R7      # )c                 x    R V ,          V,          pV\         P                  ! R V,
          W#,           4      ,          # r8  r|   r  rc   r\  r  r  s   &&& r5   __munpburr_gen._munp.<locals>.__munp  +    a!BrwwsRx000r7   r  )rQ   r#  r  r  rF  )rD   rc   r\  r  _burr_gen__munps   &&&& r5   r,  burr_gen._munp  s`    	1 **Q-A

1a!&1QV< !ay&RVVE 	Er7   r   N)r   r   r   r   r   rm   ru   r   ry   r  r~   r
  r   r   r   r,  r   r   r   s   @r5   ru  ru  y  sI     +`
::#(,/+**E Er7   ru  burrc                   `   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tRtV tR# )
burr12_geni  a  A Burr (Type XII) continuous random variable.

%(before_notes)s

See Also
--------
fisk : a special case of either `burr` or `burr12` with ``d=1``
burr : Burr Type III distribution

Notes
-----
The probability density function for `burr12` is:

.. math::

    f(x; c, d) = c d \frac{x^{c-1}}
                          {(1 + x^c)^{d + 1}}

for :math:`x >= 0` and :math:`c, d > 0`.

`burr12` takes ``c`` and ``d`` as shape parameters for :math:`c`
and :math:`d`.

This is the PDF corresponding to the twelfth CDF given in Burr's list;
specifically, it is equation (20) in Burr's paper [1]_.

%(after_notes)s

The Burr type 12 distribution is also sometimes referred to as
the Singh-Maddala distribution from NIST [2]_.

References
----------
.. [1] Burr, I. W. "Cumulative frequency functions", Annals of
   Mathematical Statistics, 13(2), pp 215-232 (1942).

.. [2] https://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/b12pdf.htm

.. [3] "Burr distribution",
   https://en.wikipedia.org/wiki/Burr_distribution

%(example)s

c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      pW.# rw  rj   rx  s   &  r5   rm   burr12_gen._shape_info#  r  r7   c                N    \         P                  ! V P                  WV4      4      # rO   r.  r  s   &&&&r5   ru   burr12_gen._pdf(  r0  r7   c                    \         P                  ! V4      \         P                  ! V4      ,           \        P                  ! V^,
          V4      ,           \        P                  ! V) ^,
          W,          4      ,           # r_   r  r  s   &&&&r5   r   burr12_gen._logpdf,  sI    vvay266!9$rxxAq'99BJJr!tQT<RRRr7   c                P    \         P                  ! V P                  WV4      4      ) # rO   r|   rf  r
  r  s   &&&&r5   ry   burr12_gen._cdf/      Q1-...r7   c                Z    \         P                  ! ^W,          ,           V) ,          ) 4      # r_   r_  r  s   &&&&r5   r  burr12_gen._logcdf2  s!    xx!ad(qb))**r7   c                N    \         P                  ! V P                  WV4      4      # rO   r  r  s   &&&&r5   r~   burr12_gen._sf5  r  r7   c                >    \         P                  ! V) W,          4      # rO   r|   r  r  s   &&&&r5   r
  burr12_gen._logsf8  s    zz1"ad##r7   c                    \         P                  ! RV,          \         P                  ! V) 4      ,          4      ^V,          ,          # rM   r  re  r  s   &&&&r5   r   burr12_gen._ppf;  s/     xx1rxx|+,qs33r7   c                    \         P                  ! RV,          \        P                  ! V4      ,          4      ^V,          ,          # r  )r|   rf  rQ   r  )rD   rH  r\  r  s   &&&&r5   r   burr12_gen._isfA  s+    xx1rvvay()AaC00r7   c                n    R  p\         P                  ! W#,          V8  WV3V\        P                  R7      # )c                 x    R V ,          V,          pV\         P                  ! R V,           W#,
          4      ,          # r8  r  r  s   &&& r5   moment_if_exists*burr12_gen._munp.<locals>.moment_if_existsE  r  r7   r  r  r  rQ   rF  )rD   rc   r\  r  r  s   &&&& r5   r,  burr12_gen._munpD  s2    	1 quqy1)5E*,&&2 	2r7   r   N)r   r   r   r   r   rm   ru   r   ry   r  r~   r
  r   r   r,  r   r   r   s   @r5   r  r    sC     +X
-S/+,$412 2r7   r  burr12c                   l   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tRtV tR# )fisk_geniP  aV  A Fisk continuous random variable.

The Fisk distribution is also known as the log-logistic distribution.

%(before_notes)s

See Also
--------
burr

Notes
-----
The probability density function for `fisk` is:

.. math::

    f(x, c) = \frac{c x^{c-1}}
                   {(1 + x^c)^2}

for :math:`x >= 0` and :math:`c > 0`.

Please note that the above expression can be transformed into the following
one, which is also commonly used:

.. math::

    f(x, c) = \frac{c x^{-c-1}}
                   {(1 + x^{-c})^2}

`fisk` takes ``c`` as a shape parameter for :math:`c`.

`fisk` is a special case of `burr` or `burr12` with ``d=1``.

Suppose ``X`` is a logistic random variable with location ``l``
and scale ``s``. Then ``Y = exp(X)`` is a Fisk (log-logistic)
random variable with ``scale = exp(l)`` and shape ``c = 1/s``.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   fisk_gen._shape_info{  r6  r7   c                .    \         P                  WR 4      # r8  )r  ru   r`  s   &&&r5   ru   fisk_gen._pdf~  s    yys##r7   c                .    \         P                  WR 4      # r8  )r  ry   r`  s   &&&r5   ry   fisk_gen._cdf      yys##r7   c                .    \         P                  WR 4      # r8  )r  r~   r`  s   &&&r5   r~   fisk_gen._sf  s    xxc""r7   c                .    \         P                  WR 4      # r8  )r  r   r`  s   &&&r5   r   fisk_gen._logpdf  s    ||A#&&r7   c                .    \         P                  WR 4      # r8  )r  r  r`  s   &&&r5   r  fisk_gen._logcdf  s    ||A#&&r7   c                .    \         P                  WR 4      # r8  )r  r
  r`  s   &&&r5   r
  fisk_gen._logsf  s    {{1%%r7   c                .    \         P                  WR 4      # r8  )r  r   r`  s   &&&r5   r   fisk_gen._ppf  r  r7   c                .    \         P                  WR 4      # r8  )r  r   rg  s   &&&r5   r   fisk_gen._isf  r  r7   c                .    \         P                  WR 4      # r8  )r  r,  rD   rc   r\  s   &&&r5   r,  fisk_gen._munp  s    zz!$$r7   c                .    \         P                  VR 4      # r8  )r  r   rD   r\  s   &&r5   r   fisk_gen._stats  s    {{1c""r7   c                <    ^\         P                  ! V4      ,
          # rD  rc  r  s   &&r5   r  fisk_gen._entropy      266!9}r7   r   N)r   r   r   r   r   rm   ru   ry   r~   r   r  r
  r   r   r,  r   r  r   r   r   s   @r5   r  r  P  sM     )TE$$#''&$$%# r7   r  fiskc                   d   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tRR ltRtV tR# )
cauchy_geni  a  A Cauchy continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `cauchy` is

.. math::

    f(x) = \frac{1}{\pi (1 + x^2)}

for a real number :math:`x`.

This distribution uses routines from the Boost Math C++ library for
the computation of the ``ppf`` and ``isf`` methods. [1]_

%(after_notes)s

References
----------
.. [1] The Boost Developers. "Boost C++ Libraries". https://www.boost.org/.

%(example)s

c                    . # rO   r   rl   s   &r5   rm   cauchy_gen._shape_info  r   r7   c                    \         P                  ! R R7      ;_uu_ 4        R\         P                  ,          RW,          ,           ,          uuRRR4       #   + '       g   i     R# ; i)rl  r  r   N)rQ   ro  r  r   s   &&r5   ru   cauchy_gen._pdf  s6    [[h''ruu9c!#g& ('''s   +AA'	c                j    \         P                  ! V4      p\        P                  ! V^8  VR R 4      # )rM   c                 T    \         ) \        P                  ! V ^,          4      ,
          # rD  )r'   rQ   r  absxs   &r5   r  $cauchy_gen._logpdf.<locals>.<lambda>  s    'BHHT1W$55r7   c                     \         ) ^\        P                  ! V 4      ,          \        P                  ! ^V ,          ^,          4      ,           ,
          # rD  )r'   rQ   r  r  r  s   &r5   r  r    s-    7(atnrxx4!7L&LMr7   )rQ   absr  r  )rD   rt   r  s   && r5   r   cauchy_gen._logpdf  s5     vvay 1Hd5NP 	Pr7   c                \    \         P                  ! ^V) 4      \         P                  ,          # r_   rQ   arctan2r  r   s   &&r5   ry   cauchy_gen._cdf  s    zz!aR &&r7   c                2    \         P                  ! V^ ^4      # r   )rq   _cauchy_ppfr   s   &&r5   r   cauchy_gen._ppf      q!Q''r7   c                Z    \         P                  ! ^V4      \         P                  ,          # r_   r  r   s   &&r5   r~   cauchy_gen._sf  s    zz!Q%%r7   c                2    \         P                  ! V^ ^4      # r  )rq   _cauchy_isfr   s   &&r5   r   cauchy_gen._isf  r  r7   c                ~    \         P                  \         P                  \         P                  \         P                  3# rO   rQ   rF  rl   s   &r5   r   cauchy_gen._stats  !    vvrvvrvvrvv--r7   c                X    \         P                  ! ^\         P                  ,          4      # r\  r  rl   s   &r5   r  cauchy_gen._entropy      vvagr7   Nc                    \        V\        4      '       d   VP                  4       p\        P                  ! V. RO4      w  r4pWEV,
          ^,          3#    r"  2   K   r>   r)   r  rQ   
percentilerD   rE   rF   p25p50p75s   &&&   r5   r  cauchy_gen._fitstart  @    dL))>>#DdL9#3YM!!r7   r   rO   )r   r   r   r   r   rm   ru   r   ry   r   r~   r   r   r  r  r   r   r   s   @r5   r  r    sB     4'
P'(&(." "r7   r  cauchyc                   d   a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 tR tR tR tRtV tR# )chi_geni  a  A chi continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `chi` is:

.. math::

    f(x, k) = \frac{1}{2^{k/2-1} \Gamma \left( k/2 \right)}
               x^{k-1} \exp \left( -x^2/2 \right)

for :math:`x >= 0` and :math:`k > 0` (degrees of freedom, denoted ``df``
in the implementation). :math:`\Gamma` is the gamma function
(`scipy.special.gamma`).

Special cases of `chi` are:

    - ``chi(1, loc, scale)`` is equivalent to `halfnorm`
    - ``chi(2, 0, scale)`` is equivalent to `rayleigh`
    - ``chi(3, 0, scale)`` is equivalent to `maxwell`

`chi` takes ``df`` as a shape parameter.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# dfFr4  rj   rl   s   &r5   rm   chi_gen._shape_info      4BFF^DEEr7   Nc                X    \         P                  ! \        P                  WVR 7      4      # r&  )rQ   r'  chi2r)  rD   r3  r   r   s   &&&&r5   r   chi_gen._rvs  s    wwtxxLxIJJr7   c                L    \         P                  ! V P                  W4      4      # rO   r.  rD   rt   r3  s   &&&r5   ru   chi_gen._pdf  s     vvdll1)**r7   c                8   \         P                  ! ^4      R\         P                  ! ^4      ,          V,          ,
          \        P                  ! RV,          4      ,
          pV\        P                  ! VR,
          V4      ,           RV^,          ,          ,
          # )r   r   r   )rQ   r  r|   r  r  )rD   rt   r3  ls   &&& r5   r   chi_gen._logpdf  s]    FF1I266!9R'"**RU*;;288BGQ''"QT'11r7   c                Z    \         P                  ! R V,          R V^,          ,          4      # r  r|   gammaincr;  s   &&&r5   ry   chi_gen._cdf#  s    {{2b5"QT'**r7   c                Z    \         P                  ! R V,          R V^,          ,          4      # r  r|   	gammainccr;  s   &&&r5   r~   chi_gen._sf&  s    ||BrE2ad7++r7   c                t    \         P                  ! ^\        P                  ! RV,          V4      ,          4      # r   r   rQ   r'  r|   gammaincinvrD   r   r3  s   &&&r5   r   chi_gen._ppf)  s%    wwq2q1122r7   c                t    \         P                  ! ^\        P                  ! RV,          V4      ,          4      # rI  rQ   r'  r|   gammainccinvrL  s   &&&r5   r   chi_gen._isf,  s%    wwqB2233r7   c                F   \         P                  ! ^4      \        P                  ! RV,          R4      ,          pWV,          ,
          p^VR,          ,          V^^V,          ,
          ,          ,           \         P                  ! \         P
                  ! VR4      4      ,          p^V,          RV,
          ,          ^V^,          ,          ,
          ^V^,          ,          ^V,          ^,
          ,          ,           pV\         P                  ! VR,          4      ,          pW#WE3# )r   r   r        ?r   r   )rQ   r'  r|   pochr#  powerrD   r3  ry  rz  r{  r|  s   &&    r5   r   chi_gen._stats/  s    WWQZ"''#(C00b5jCi"a"f+%rzz"((32D'EErT3r6]1RU7"Qr1uW"Q%77
bjjc""r7   c                D    R  pR p\         P                  ! VR8  WV4      # )c                     \         P                  ! R V ,          4      R V \        P                  ! ^4      ,
          V ^,
          \         P                  ! R V ,          4      ,          ,
          ,          ,           # r  )r|   r  rQ   r  digammar3  s   &r5   regular_formula)chi_gen._entropy.<locals>.regular_formula:  sM    JJrBw'R"&&)^rAvC"H9M.MMNO Pr7   c                    R \         P                  ! \         P                  4      ^,          ,           V R,          ^,          ,
          V R,          ^,          ,
          RV R,          ,          ,
          V R,          ^,          ,           # )r   r  r<  gll?r  r[  s   &r5   asymptotic_formula,chi_gen._entropy.<locals>.asymptotic_formula>  sY    "&&-/)RVQJ6"b&!CBFm$')2vrk2 3r7   i,  r=  )rD   r3  r\  ra  s   &&  r5   r  chi_gen._entropy8  s'    	P	3 rCx>PQQr7   r   r.  r   r   r   r   r   rm   r   ru   r   ry   r~   r   r   r   r  r   r   r   s   @r5   r0  r0    sE     <FK+2+,34
R 
Rr7   r0  chic                   d   a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 tR tR tR tRtV tR# )chi2_geniH  a|  A chi-squared continuous random variable.

For the noncentral chi-square distribution, see `ncx2`.

%(before_notes)s

See Also
--------
ncx2

Notes
-----
The probability density function for `chi2` is:

.. math::

    f(x, k) = \frac{1}{2^{k/2} \Gamma \left( k/2 \right)}
               x^{k/2-1} \exp \left( -x/2 \right)

for :math:`x > 0`  and :math:`k > 0` (degrees of freedom, denoted ``df``
in the implementation).

`chi2` takes ``df`` as a shape parameter.

The chi-squared distribution is a special case of the gamma
distribution, with gamma parameters ``a = df/2``, ``loc = 0`` and
``scale = 2``.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r2  rj   rl   s   &r5   rm   chi2_gen._shape_infoj  r5  r7   Nc                $    VP                  W4      # rO   )	chisquarer8  s   &&&&r5   r   chi2_gen._rvsm  s    %%b//r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  r;  s   &&&r5   ru   chi2_gen._pdfp  s    vvdll1)**r7   c                    \         P                  ! VR ,          ^,
          V4      VR ,          ,
          \         P                  ! VR ,          4      ,
          \        P                  ! ^4      V,          R ,          ,
          # rr  )r|   r  r  rQ   r  r;  s   &&&r5   r   chi2_gen._logpdft  sM    xx2a#ad*RZZ2->>"&&)B,PRARRRr7   c                .    \         P                  ! W!4      # rO   )r|   chdtrr;  s   &&&r5   ry   chi2_gen._cdfw      xxr7   c                .    \         P                  ! W!4      # rO   )r|   chdtrcr;  s   &&&r5   r~   chi2_gen._sfz      yyr7   c                .    \         P                  ! W!4      # rO   )r|   chdtrirD   rH  r3  s   &&&r5   r   chi2_gen._isf}  rx  r7   c                L    ^\         P                  ! V^,          V4      ,          # rD  r|   rK  r{  s   &&&r5   r   chi2_gen._ppf  s    1a(((r7   c                z    Tp^V,          p^\         P                  ! RV,          4      ,          pRV,          pW#WE3# )r   r         (@r  rV  s   &&    r5   r   chi2_gen._stats  s9    drwws2v"Wr7   c                V    R V,          pR pR p\         P                  ! V^}8  VW44      # )r   c                     V \         P                  ! ^4      ,           \        P                  ! V 4      ,           ^V ,
          \        P                  ! V 4      ,          ,           # rD  )rQ   r  r|   r  r  )half_dfs   &r5   r\  *chi2_gen._entropy.<locals>.regular_formula  s>    bffQi'"**W*==[BFF7O34 5r7   c                 t   \         P                  ! ^4      R^\         P                  ! ^\         P                  ,          4      ,           ,          ,           pRV ,          pVRVRVRVR,          ,           ,          ,           ,          ,           ,          R\         P                  ! V 4      ,          ,           V,           # )r   r   g      @gUUUUUUUUUUUUտgllr  )r  r\  hs   &  r5   ra  -chi2_gen._entropy.<locals>.asymptotic_formula  s     q	CRVVAbeeG_!455AGAta51S5=(9!9::;w'(*+, -r7   r=  )rD   r3  r  r\  ra  s   &&   r5   r  chi2_gen._entropy  s5    (	5		- w}g.D 	Dr7   r   r.  )r   r   r   r   r   rm   r   ru   r   ry   r~   r   r   r   r  r   r   r   s   @r5   rg  rg  H  sF      BF0+S  )D Dr7   rg  r7  c                   Z   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tRtV tR# )
cosine_geni  a0  A cosine continuous random variable.

%(before_notes)s

Notes
-----
The cosine distribution is an approximation to the normal distribution.
The probability density function for `cosine` is:

.. math::

    f(x) = \frac{1}{2\pi} (1+\cos(x))

for :math:`-\pi \le x \le \pi`.

%(after_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   cosine_gen._shape_info  r   r7   c                t    R\         P                  ,          ^\         P                  ! V4      ,           ,          # r   r   rQ   r  rQ  r   s   &&r5   ru   cosine_gen._pdf  s!    RUU{AbffQiK((r7   c                    \         P                  ! V4      p\        P                  ! VR8g  VR \         P                  ) R7      # )rM   c                     \         P                  ! V 4      \         P                  ! ^\         P                  ,          4      ,
          # rD  )rQ   r  r  r  r\  s   &r5   r  $cosine_gen._logpdf.<locals>.<lambda>  s!    !rvvag)Fr7   r  r  )rQ   rQ  r  r  rk   r`  s   && r5   r   cosine_gen._logpdf  s4    FF1IqBwF+-66'3 	3r7   c                .    \         P                  ! V4      # rO   rq   _cosine_cdfr   s   &&r5   ry   cosine_gen._cdf  s    q!!r7   c                0    \         P                  ! V) 4      # rO   r  r   s   &&r5   r~   cosine_gen._sf  s    r""r7   c                .    \         P                  ! V4      # rO   rq   _cosine_invcdfrD   rH  s   &&r5   r   cosine_gen._ppf  s    !!!$$r7   c                0    \         P                  ! V4      ) # rO   r  r  s   &&r5   r   cosine_gen._isf  s    ""1%%%r7   c                <   \         P                  \         P                  ,          R ,          R,
          pR\         P                  ^,          ^Z,
          ,          R\         P                  \         P                  ,          ^,
          ^,          ,          ,          pRVRV3# )r  r         @r   r  r`  )rD   r  rk  s   &  r5   r   cosine_gen._stats  sa    UURUU]S C'BEE1HrM"cRUURUU]Q->,B&BCAsA~r7   c                f    \         P                  ! ^\         P                  ,          4      R,
          # )rU  r   r  rl   s   &r5   r  cosine_gen._entropy  s    vvags""r7   r   Nr   r   r   r   r   rm   ru   r   ry   r~   r   r   r   r  r   r   r   s   @r5   r  r    s<     ()3"#%&
# #r7   r  cosinec                   d   a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 tR tR tR tRtV tR# )
dgamma_geni  a  A double gamma continuous random variable.

The double gamma distribution is also known as the reflected gamma
distribution [1]_.

%(before_notes)s

Notes
-----
The probability density function for `dgamma` is:

.. math::

    f(x, a) = \frac{1}{2\Gamma(a)} |x|^{a-1} \exp(-|x|)

for a real number :math:`x` and :math:`a > 0`. :math:`\Gamma` is the
gamma function (`scipy.special.gamma`).

`dgamma` takes ``a`` as a shape parameter for :math:`a`.

%(after_notes)s

References
----------
.. [1] Johnson, Kotz, and Balakrishnan, "Continuous Univariate
       Distributions, Volume 1", Second Edition, John Wiley and Sons
       (1994).

%(example)s

c                @    \        R R^ \        P                  3R4      .# r3  rj   rl   s   &r5   rm   dgamma_gen._shape_info  r6  r7   Nc                    VP                  VR 7      p\        P                  WVR7      pV\        P                  ! VR8  ^R4      ,          # r   r'  r   r  )uniformr(  r)  rQ   r  )rD   r   r   r   ugms   &&&&  r5   r   dgamma_gen._rvs   sC      d +YYq,Y?BHHQ#Xq"---r7   c                    \        V4      pR ^\        P                  ! V4      ,          ,          W2R ,
          ,          ,          \        P                  ! V) 4      ,          # r8  )r	  r|   r(  rQ   r   rD   rt   r   axs   &&& r5   ru   dgamma_gen._pdf  s<    VAbhhqkM"2#;.<<r7   c                    \        V4      p\        P                  ! VR ,
          V4      V,
          \        P                  ! ^4      ,
          \        P
                  ! V4      ,
          # r8  )r	  r|   r  rQ   r  r  r  s   &&& r5   r   dgamma_gen._logpdf
  s?    VxxC$r)BFF1I5

1EEr7   c           	         \         P                  ! V^ 8  RR\        P                  ! W!4      ,          ,           R\        P                  ! W!) 4      ,          4      # r   r   )rQ   r  r|   rB  rF  r9  s   &&&r5   ry   dgamma_gen._cdf  sB    xxAc"++a"333BLLB//1 	1r7   c           
         \         P                  ! V^ 8  R\        P                  ! W!4      ,          RR\        P                  ! W!) 4      ,          ,           4      # r  )rQ   r  r|   rF  rB  r9  s   &&&r5   r~   dgamma_gen._sf  sB    xxABLL..c"++a"4446 	6r7   c                v    \         P                  P                  V4      \        P                  ! R 4      ,
          # r  )rF  r(  r  rQ   r  rG  s   &&r5   r  dgamma_gen._entropy  s$    {{##A&44r7   c           	         \         P                  ! VR 8  \        P                  ! V^V,          ^,
          4      \        P                  ! V^V,          4      ) 4      # r  rQ   r  r|   rK  rP  rA  s   &&&r5   r   dgamma_gen._ppf  sD    xxCq!A#'2AaC002 	2r7   c           	         \         P                  ! VR 8  \        P                  ! V^V,          ^,
          4      ) \        P                  ! V^V,          4      4      # r  r  rA  s   &&&r5   r   dgamma_gen._isf   sD    xxC1Q37331Q3/1 	1r7   c                r    WR ,           ,          pRVRVR,           VR,           ,          V,          R,
          3# )r   r   r   r  r   )rD   r   rz  s   && r5   r   dgamma_gen._stats%  s2    3iCququoc1#555r7   r   r.  )r   r   r   r   r   rm   r   ru   r   ry   r~   r  r   r   r   r   r   r   s   @r5   r  r    sC     >E.
=
F1
6
52
1
6 6r7   r  dgammac                      a  ] tR tRt o Rt]P                  t]P                  t	]P                  t]P                  t]P                  t]P                   tR tR tR tR tRR ltR	 tR
 tR t
R tR tR tR tRtV tR# )dpareto_lognorm_geni-  a  A double Pareto lognormal continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `dpareto_lognorm` is:

.. math::

    f(x, \mu, \sigma, \alpha, \beta) =
    \frac{\alpha \beta}{(\alpha + \beta) x}
    \phi\left( \frac{\log x - \mu}{\sigma} \right)
    \left( R(y_1) + R(y_2) \right)

where :math:`R(t) = \frac{1 - \Phi(t)}{\phi(t)}`,
:math:`\phi` and :math:`\Phi` are the normal PDF and CDF, respectively,
:math:`y_1 = \alpha \sigma - \frac{\log x - \mu}{\sigma}`,
and :math:`y_2 = \beta \sigma + \frac{\log x - \mu}{\sigma}`
for real numbers :math:`x` and :math:`\mu`, :math:`\sigma > 0`,
:math:`\alpha > 0`, and :math:`\beta > 0` [1]_.

`dpareto_lognorm` takes
``u`` as a shape parameter for :math:`\mu`,
``s`` as a shape parameter for :math:`\sigma`,
``a`` as a shape parameter for :math:`\alpha`, and
``b`` as a shape parameter for :math:`\beta`.

A random variable :math:`X` distributed according to the PDF above
can be represented as :math:`X = U \frac{V_1}{V_2}` where :math:`U`,
:math:`V_1`, and :math:`V_2` are independent, :math:`U` is lognormally
distributed such that :math:`\log U \sim N(\mu, \sigma^2)`, and
:math:`V_1` and :math:`V_2` follow Pareto distributions with parameters
:math:`\alpha` and :math:`\beta`, respectively [2]_.

%(after_notes)s

References
----------
.. [1] Hajargasht, Gholamreza, and William E. Griffiths. "Pareto-lognormal
       distributions: Inequality, poverty, and estimation from grouped income
       data." Economic Modelling 33 (2013): 593-604.
.. [2] Reed, William J., and Murray Jorgensen. "The double Pareto-lognormal
       distribution - a new parametric model for size distributions."
       Communications in Statistics - Theory and Methods 33.8 (2004): 1733-1753.

%(example)s

c                P    V P                  V4      V P                  V4      ,          # rO   )_Phic_phirD   zs   &&r5   _Rdpareto_lognorm_gen._Rf  s    zz!}tyy|++r7   c                P    V P                  V4      V P                  V4      ,
          # rO   )_logPhic_logphir  s   &&r5   _logRdpareto_lognorm_gen._logRi  s    }}Q$,,q/11r7   c           	        \        R R\        P                  ) \        P                  3R4      \        RR^ \        P                  3R4      \        RR^ \        P                  3R4      \        RR^ \        P                  3R4      .# )r  Frj  r   r   r4  rj   rl   s   &r5   rm   dpareto_lognorm_gen._shape_infol  sm    3'8.I3266{NC3266{NC3266{NCE 	Er7   c                4    V^ 8  V^ 8  ,          V^ 8  ,          # r  r   )rD   r  rj  r   r   s   &&&&&r5   rd   dpareto_lognorm_gen._argcheckr  s    A!a% AE**r7   Nc                    VP                  WVR 7      pVP                  VR 7      pVP                  VR 7      p	\        P                  ! WxV,          ,           W,          ,
          4      # r  )normalstandard_exponentialrQ   r   )
rD   r  rj  r   r   r   r   ZE1E2s
   &&&&&&&   r5   r   dpareto_lognorm_gen._rvsu  s[     40..D.9..D.9vvaq&j26)**r7   c           	        \         P                  ! R R R7      ;_uu_ 4        \         P                  ! V4      TrvWg,
          V,          pWC,          V,
          p	WS,          V,           p
\         P                  ! \         P                  ! V4      \         P                  ! V4      ,           \         P                  ! WE,           4      ,
          V,
          4      pWP	                  V4      ,          pV\         P
                  ! V P                  V	4      V P                  V
4      4      ,          pRRR4       \         P                  ) XV^ 8H  \         P                  ! V4      ,          &   VR,          #   + '       g   i     LK; i)rl  invalidrn  Nr   )	rQ   ro  r  r#  r  	logaddexpr  rk   rW   )rD   rt   r  rj  r   r   log_ymr  x1x2rJ  s   &&&&&&      r5   r   dpareto_lognorm_gen._logpdf~  s    [[(;;vvay!1aABB**RVVAY2RVVAE]BUJKC<<?"C2<<

2

2??C < (*vvgQ!Vrxx{"#2w <;s   DE))E9	c           
     p   \         P                  ! R R R7      ;_uu_ 4        \         P                  ! V4      TrvWg,
          V,          pWC,          V,
          p	WS,          V,           p
V P                  V4      pV P	                  V4      p\         P                  ! V4      V P                  V	4      ,           p\         P                  ! V4      V P                  V
4      ,           p\         P                  ! WW^4      w  rrp\        P                  ! W.W) .^ RR7      w  ppWV,           \         P                  ! WE,           4      ,
          .p\         P                  ! \        P                  ! VW) V,          .^ R7      4      pRRR4       \         P                  ) XV^ 8H  &   VR,          #   + '       g   i     L0; i)rl  r  T)r   rP  return_sign)r   rP  Nr   )rQ   ro  r  _logPhir  r  rE  r|   	logsumexpr#  rk   )rD   rt   r  rj  r   r   r  r  r  r  r  r  r  r  t4onet5rR   temprJ  s   &&&&&&              r5   r  dpareto_lognorm_gen._logcdf  s8   [[(;;vvay!1aABBaBaB&&)djjn,B&&)djjn,B"$"5"5bba"HBBC bX#t1RVWHBR"&&-/0D**R\\$3T	2BKLC <  vvgAF2w# <;s   EF%%F5	c           	     P    \         P                  ! V P                  WW4V4      4      # rO   )rq   	_log1mexpr  rD   rt   r  rj  r   r   s   &&&&&&r5   r
  dpareto_lognorm_gen._logsf  s    }}T\\!a899r7   c           	     P    \         P                  ! V P                  WW4V4      4      # rO   r.  r  s   &&&&&&r5   ru   dpareto_lognorm_gen._pdf      vvdll1q122r7   c           	     P    \         P                  ! V P                  WW4V4      4      # rO   rQ   r   r  r  s   &&&&&&r5   ry   dpareto_lognorm_gen._cdf  r  r7   c           	     P    \         P                  ! V P                  WW4V4      4      # rO   r  r  s   &&&&&&r5   r~   dpareto_lognorm_gen._sf  s    vvdkk!a011r7   c                @   T\        V4      rvWE,          WG,
          WW,           ,          ,          \        P                  ! Wv,          V^,          V^,          ,          ^,          ,           4      ,          p\        P                  ! V4      p\        P                  WV8*  &   V# rD  )floatrQ   r   r#  rF  )	rD   rc   r  rj  r   r   r  rk  rJ  s	   &&&&&&   r5   r,  dpareto_lognorm_gen._munp  si    %(1u!%AE*+bffQUQ!Va1f_q=P5P.QQjjoffF
r7   r   r.  )r   r   r   r   r   r/  r   r  r  r  r
  r  ru   r  ry   _Phir~   r  r  r  rm   rd   r   r,  r   r   r   s   @r5   r  r  -  s     0b llGllG{{H99D99DHHE,2E++
(:
332 r7   r  dpareto_lognormc                   j   a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 tR tR tR tR tRtV tR# )dweibull_geni  aJ  A double Weibull continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `dweibull` is given by

.. math::

    f(x, c) = c / 2 |x|^{c-1} \exp(-|x|^c)

for a real number :math:`x` and :math:`c > 0`.

`dweibull` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   dweibull_gen._shape_info  r6  r7   Nc                    VP                  VR 7      p\        P                  WVR7      pV\        P                  ! VR8  ^R4      ,          # r  )r  weibull_minr)  rQ   r  )rD   r\  r   r   r  ws   &&&&  r5   r   dweibull_gen._rvs  sC      d +OOA|ODBHHQ#Xq"-..r7   c                    \        V4      pVR ,          W2R,
          ,          ,          \        P                  ! W2,          ) 4      ,          pV# r   r   )r	  rQ   r   )rD   rt   r\  r  Pxs   &&&  r5   ru   dweibull_gen._pdf  s5    VWrcE{"RVVRUF^3	r7   c                    \        V4      p\        P                  ! V4      \        P                  ! R 4      ,
          \        P                  ! VR,
          V4      ,           W2,          ,
          # r  )r	  rQ   r  r|   r  )rD   rt   r\  r  s   &&& r5   r   dweibull_gen._logpdf  sA    Vvvay266#;&!c'2)>>FFr7   c                    R \         P                  ! \        V4      V,          ) 4      ,          p\         P                  ! V^ 8  ^V,
          V4      # r  )rQ   r   r	  r  )rD   rt   r\  Cx1s   &&& r5   ry   dweibull_gen._cdf  s:    BFFCFAI:&&xxAq3w,,r7   c                    R \         P                  ! VR8*  VRV,
          4      ,          p\         P                  ! \         P                  ! V4      ) RV,          4      p\         P                  ! VR8  W3) 4      # r   r   r   )rQ   r  rU  r  )rD   r   r\  r  s   &&& r5   r   dweibull_gen._ppf  sV    288AHaa00hhs|S1W-xxCd++r7   c                    R \         P                  P                  \        P                  ! V4      V4      ,          p\        P
                  ! V^ 8  V^V,
          4      # r  )rF  r  r~   rQ   r	  r  )rD   rt   r\  half_weibull_min_sfs   &&& r5   r~   dweibull_gen._sf  sF    !E$5$5$9$9"&&)Q$GGxxA2A8K4KLLr7   c                    R \         P                  ! VR8*  VRV,
          4      ,          p\        P                  P	                  W24      p\         P                  ! VR8  V) V4      # r  )rQ   r  rF  r  r   )rD   r   r\  double_qweibull_min_isfs   &&&  r5   r   dweibull_gen._isf  sQ    c1b1f55++00=xxC/!1?CCr7   c                    ^V^,          ,
          \         P                  ! RRV,          V,          ,           4      ,          # rM   r   r|   r(  r  s   &&&r5   r,  dweibull_gen._munp  s+    QUrxxcAgk(9:::r7   c                    R# r   )r   Nr   Nr   r  s   &&r5   r   dweibull_gen._stats      r7   c                z    \         P                  P                  V4      \        P                  ! R 4      ,
          pV# r  )rF  r  r  rQ   r  )rD   r\  r  s   && r5   r  dweibull_gen._entropy  s*    &&q)BFF3K7r7   r   r.  )r   r   r   r   r   rm   r   ru   r   ry   r   r~   r   r,  r   r  r   r   r   s   @r5   r  r    sJ     *E/
G-,
MD
;  r7   r  dweibullc                      a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 tR tR tR tR t]]! ]RR7      R 4       4       tRtV tR# )	expon_geni  a	  An exponential continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `expon` is:

.. math::

    f(x) = \exp(-x)

for :math:`x \ge 0`.

%(after_notes)s

A common parameterization for `expon` is in terms of the rate parameter
``lambda``, such that ``pdf = lambda * exp(-lambda * x)``. This
parameterization corresponds to using ``scale = 1 / lambda``.

The exponential distribution is a special case of the gamma
distributions, with gamma shape parameter ``a = 1``.

%(example)s

c                    . # rO   r   rl   s   &r5   rm   expon_gen._shape_info  r   r7   Nc                $    VP                  V4      # rO   )r  r   s   &&&r5   r   expon_gen._rvs   s    0066r7   c                0    \         P                  ! V) 4      # rO   rQ   r   r   s   &&r5   ru   expon_gen._pdf#  s    vvqbzr7   c                    V) # rO   r   r   s   &&r5   r   expon_gen._logpdf'  	    r	r7   c                2    \         P                  ! V) 4      ) # rO   r|   rf  r   s   &&r5   ry   expon_gen._cdf*      !}r7   c                2    \         P                  ! V) 4      ) # rO   r_  r   s   &&r5   r   expon_gen._ppf-  r?  r7   c                0    \         P                  ! V) 4      # rO   r7  r   s   &&r5   r~   expon_gen._sf0  s    vvqbzr7   c                    V) # rO   r   r   s   &&r5   r
  expon_gen._logsf3  r;  r7   c                0    \         P                  ! V4      ) # rO   rc  r   s   &&r5   r   expon_gen._isf6      q	zr7   c                    R# )r   )r   r   r         @r   rl   s   &r5   r   expon_gen._stats9  r  r7   c                    R # r8  r   rl   s   &r5   r  expon_gen._entropy<      r7   z        When `method='MLE'`,
        this function uses explicit formulas for the maximum likelihood
        estimation of the exponential distribution parameters, so the
        `optimizer`, `loc` and `scale` keyword arguments are
        ignored.

r  c                0   \        V4      ^ 8  d   \        R4      hVP                  RR4      pVP                  RR4      p\        V4       Ve   Ve   \	        R4      h\
        P                  ! V4      p\
        P                  ! V4      P                  4       '       g   \	        R4      hVP                  4       pVf   TpM$TpWg8  d   \        RV\
        P                  R7      hVf   VP                  4       V,
          pMTp\        V4      \        V4      3# )	r   Too many arguments.r  Nr  r   r!  exponr  )r  r3   r2   r6   r"  rQ   r#  r$  r%  minr  rk   r&  r  )	rD   rE   rF   r4   r  r  data_minr-   r.   s	   &&*,     r5   rB   expon_gen.fit?  s     t9q=122xx%(D)$T* 2 ) * * zz${{4 $$&&CDD88:<CC~"7$bffEE>IIK#%EE Sz5<''r7   r   r.  )r   r   r   r   r   rm   r   ru   r   ry   r   r~   r
  r   r   r  rK   r
   r   rB   r   r   r   s   @r5   r1  r1    si     47"  6 &( &(r7   r1  rQ  c                   R   a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 tRtV tR# )exponnorm_genir  a  An exponentially modified Normal continuous random variable.

Also known as the exponentially modified Gaussian distribution [1]_.

%(before_notes)s

Notes
-----
The probability density function for `exponnorm` is:

.. math::

    f(x, K) = \frac{1}{2K} \exp\left(\frac{1}{2 K^2} - x / K \right)
              \text{erfc}\left(-\frac{x - 1/K}{\sqrt{2}}\right)

where :math:`x` is a real number and :math:`K > 0`.

It can be thought of as the sum of a standard normal random variable
and an independent exponentially distributed random variable with rate
``1/K``.

%(after_notes)s

An alternative parameterization of this distribution (for example, in
the Wikipedia article [1]_) involves three parameters, :math:`\mu`,
:math:`\lambda` and :math:`\sigma`.

In the present parameterization this corresponds to having ``loc`` and
``scale`` equal to :math:`\mu` and :math:`\sigma`, respectively, and
shape parameter :math:`K = 1/(\sigma\lambda)`.

.. versionadded:: 0.16.0

References
----------
.. [1] Exponentially modified Gaussian distribution, Wikipedia,
       https://en.wikipedia.org/wiki/Exponentially_modified_Gaussian_distribution

%(example)s

c                @    \        R R^ \        P                  3R4      .# )KFr4  rj   rl   s   &r5   rm   exponnorm_gen._shape_info  r6  r7   Nc                d    VP                  V4      V,          pVP                  V4      pWE,           # rO   )r  r   )rD   rX  r   r   expvalgvals   &&&&  r5   r   exponnorm_gen._rvs  s/    22481<++D1}r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  )rD   rt   rX  s   &&&r5   ru   exponnorm_gen._pdf      vvdll1())r7   c                    R V,          pVRV,          V,
          ,          pV\        W,
          4      ,           \        P                  ! V4      ,
          # r  r   rQ   r  )rD   rt   rX  invKexpargs   &&&  r5   r   exponnorm_gen._logpdf  s<    Qwta(QX..::r7   c                    R V,          pVRV,          V,
          ,          pV\        W,
          4      ,           p\        V4      \        P                  ! V4      ,
          # r  r   r   rQ   r   rD   rt   rX  rc  r[  logprods   &&&   r5   ry   exponnorm_gen._cdf  sE    Qwta(<11|bffWo--r7   c                    R V,          pVRV,          V,
          ,          pV\        W,
          4      ,           p\        V) 4      \        P                  ! V4      ,           # r  rg  rh  s   &&&   r5   r~   exponnorm_gen._sf  sG    Qwta(<11!}rvvg..r7   c                    W,          pR V,           p^V^,          ,          VR,          ,          pRV,          V,          VR,          ,          pWWE3# )r   rJ  rw  r<  r   )rD   rX  K2opK2skwkrts   &&    r5   r   exponnorm_gen._stats  sI    URx!Q$h%BhmdRj(  r7   r   r.  )r   r   r   r   r   rm   r   ru   r   ry   r~   r   r   r   r   s   @r5   rV  rV  r  s4     (RE
*;
./! !r7   rV  	exponnormc                V    \         P                  ! \        P                  ! W4      4      # )a  
Compute (1 + x)**y - 1.

Uses expm1 and xlog1py to avoid loss of precision when
(1 + x)**y is close to 1.

Note that the inverse of this function with respect to x is
``_pow1pm1(x, 1/y)``.  That is, if

    t = _pow1pm1(x, y)

then

    x = _pow1pm1(t, 1/y)
)rQ   rf  r|   r  rt   ys   &&r5   _pow1pm1rw    s      88BJJq$%%r7   c                   N   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
tV tR# )exponweib_geni  a@  An exponentiated Weibull continuous random variable.

%(before_notes)s

See Also
--------
weibull_min, numpy.random.Generator.weibull

Notes
-----
The probability density function for `exponweib` is:

.. math::

    f(x, a, c) = a c [1-\exp(-x^c)]^{a-1} \exp(-x^c) x^{c-1}

and its cumulative distribution function is:

.. math::

    F(x, a, c) = [1-\exp(-x^c)]^a

for :math:`x > 0`, :math:`a > 0`, :math:`c > 0`.

`exponweib` takes :math:`a` and :math:`c` as shape parameters:

* :math:`a` is the exponentiation parameter,
  with the special case :math:`a=1` corresponding to the
  (non-exponentiated) Weibull distribution `weibull_min`.
* :math:`c` is the shape parameter of the non-exponentiated Weibull law.

%(after_notes)s

References
----------
https://en.wikipedia.org/wiki/Exponentiated_Weibull_distribution

%(example)s

c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      pW.# r   Fr\  r4  rj   rD   r  ry  s   &  r5   rm   exponweib_gen._shape_info  r  r7   c                N    \         P                  ! V P                  WV4      4      # rO   r.  rD   rt   r   r\  s   &&&&r5   ru   exponweib_gen._pdf	       vvdll1+,,r7   c                B   W,          ) p\         P                  ! V4      ) p\        P                  ! V4      \        P                  ! V4      ,           \         P                  ! VR ,
          V4      ,           V,           \         P                  ! VR ,
          V4      ,           pV# r8  )r|   rf  rQ   r  r  )rD   rt   r   r\  negxcexm1clogps   &&&&   r5   r   exponweib_gen._logpdf		  sm    % q	BFF1I%S%(@@S!,-r7   c                N    \         P                  ! W,          ) 4      ) pWB,          # rO   r=  )rD   rt   r   r\  r  s   &&&& r5   ry   exponweib_gen._cdf	  s    14% xr7   c                    \         P                  ! VR V,          ,          ) 4      ) \        P                  ! R V,          4      ,          # r8  )r|   r  rQ   r#  )rD   r   r   r\  s   &&&&r5   r   exponweib_gen._ppf	  s0    1s1u:+&&CE):::r7   c                T    \        \        P                  ! W,          ) 4      ) V4      ) # rO   )rw  rQ   r   r  s   &&&&r5   r~   exponweib_gen._sf	  s     "&&!$-+++r7   c                r    \         P                  ! \        V) ^V,          4      ) 4      ) ^V,          ,          # r_   )rQ   r  rw  )rD   rH  r   r\  s   &&&&r5   r   exponweib_gen._isf	  s-    1"ac**++qs33r7   r   Nr   r   r   r   r   rm   ru   r   ry   r   r~   r   r   r   r   s   @r5   ry  ry    s3     'P
-
;,4 4r7   ry  	exponweibc                   N   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
tV tR# )exponpow_geni!	  aC  An exponential power continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `exponpow` is:

.. math::

    f(x, b) = b x^{b-1} \exp(1 + x^b - \exp(x^b))

for :math:`x \ge 0`, :math:`b > 0`.  Note that this is a different
distribution from the exponential power distribution that is also known
under the names "generalized normal" or "generalized Gaussian".

`exponpow` takes ``b`` as a shape parameter for :math:`b`.

%(after_notes)s

References
----------
http://www.math.wm.edu/~leemis/chart/UDR/PDFs/Exponentialpower.pdf

%(example)s

c                @    \        R R^ \        P                  3R4      .# r   Fr4  rj   rl   s   &r5   rm   exponpow_gen._shape_info=	  r6  r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  rD   rt   r   s   &&&r5   ru   exponpow_gen._pdf@	      vvdll1())r7   c                    W,          p^\         P                  ! V4      ,           \        P                  ! VR,
          V4      ,           V,           \         P                  ! V4      ,
          pV# r&  )rQ   r  r|   r  r   )rD   rt   r   xbfs   &&&  r5   r   exponpow_gen._logpdfD	  sE    Tq	MBHHQWa0025r
Br7   c                f    \         P                  ! \         P                  ! W,          4      ) 4      ) # rO   r=  r  s   &&&r5   ry   exponpow_gen._cdfI	  s     "((14.)))r7   c                d    \         P                  ! \        P                  ! W,          4      ) 4      # rO   rQ   r   r|   rf  r  s   &&&r5   r~   exponpow_gen._sfL	  s    vvrxx~o&&r7   c                t    \         P                  ! \        P                  ! V4      ) 4      R V,          ,          # r8  r|   r  rQ   r  r  s   &&&r5   r   exponpow_gen._isfO	  s$    "&&)$1--r7   c                |    \        \        P                  ! \        P                  ! V) 4      ) 4      R V,          4      # r8  powr|   r  rD   r   r   s   &&&r5   r   exponpow_gen._ppfR	  s(    288RXXqb\M*CE22r7   r   N)r   r   r   r   r   rm   ru   r   ry   r~   r   r   r   r   r   s   @r5   r  r  !	  s3     6E*
*'.3 3r7   r  exponpowc                   v   a  ] tR tRt o Rt]P                  tR tRR lt	R t
R tR tR	 tR
 tR tR tRtV tR# )fatiguelife_geniY	  a  A fatigue-life (Birnbaum-Saunders) continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `fatiguelife` is:

.. math::

    f(x, c) = \frac{x+1}{2c\sqrt{2\pi x^3}} \exp(-\frac{(x-1)^2}{2x c^2})

for :math:`x >= 0` and :math:`c > 0`.

`fatiguelife` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

References
----------
.. [1] "Birnbaum-Saunders distribution",
       https://en.wikipedia.org/wiki/Birnbaum-Saunders_distribution

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   fatiguelife_gen._shape_infov	  r6  r7   Nc                    VP                  V4      pR V,          V,          pWU,          pR^V,          ,           ^V,          \        P                  ! ^V,           4      ,          ,           pV# r   )r   rQ   r'  )rD   r\  r   r   r  rt   r  ts   &&&&    r5   r   fatiguelife_gen._rvsy	  sR    ((.E!GS!B$J1RWWQV_,,r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  r`  s   &&&r5   ru   fatiguelife_gen._pdf	  s     vvdll1())r7   c                   \         P                  ! V^,           4      V^,
          ^,          RV,          V^,          ,          ,          ,
          \         P                  ! ^V,          4      ,
          R\         P                  ! ^\         P                  ,          4      ^\         P                  ! V4      ,          ,           ,          ,
          # rM   r   r   r  r`  s   &&&r5   r   fatiguelife_gen._logpdf	  ss    qsqsQh#a%1*55qsCRVVAbeeG_q{234 	5r7   c                    \        R V,          \        P                  ! V4      R \        P                  ! V4      ,          ,
          ,          4      # r8  )r   rQ   r'  r`  s   &&&r5   ry   fatiguelife_gen._cdf	  s/    qBGGAJRWWQZ$?@AAr7   c                    V\        V4      ,          pR V\        P                  ! V^,          ^,           4      ,           ^,          ,          #       ?r   rQ   r'  rD   r   r\  tmps   &&& r5   r   fatiguelife_gen._ppf	  s6    )A,sRWWS!VaZ001444r7   c                    \        R V,          \        P                  ! V4      R \        P                  ! V4      ,          ,
          ,          4      # r8  )r   rQ   r'  r`  s   &&&r5   r~   fatiguelife_gen._sf	  s/    a2771:BGGAJ#>?@@r7   c                    V) \        V4      ,          pR V\        P                  ! V^,          ^,           4      ,           ^,          ,          # r  r  r  s   &&& r5   r   fatiguelife_gen._isf	  s8    b9Q<sRWWS!VaZ001444r7   c                D   W,          pVR ,          R,           pRV,          R,           pW$,          R,          p^V,          ^V,          R,           ,          \         P                  ! VR4      ,          p^V,          ^]V,          R,           ,          VR ,          ,          pW5Wg3# )r   r   r  r  rJ  rS  g      D@rQ   rU  )rD   r\  c2ry  denrz  r{  r|  s   &&      r5   r   fatiguelife_gen._stats	  s     S#X^BhnfslUbeck"RXXc3%77Vr"ut|$sCx/r7   r   r.  )r   r   r   r   r   r   rI  rJ  rm   r   ru   r   ry   r   r~   r   r   r   r   r   s   @r5   r  r  Y	  sL     4 "44ME*
5B5A5 r7   r  fatiguelifec                   R   a  ] tR tRt o RtR tR tRR ltR tR t	R	 t
R
 tRtV tR# )foldcauchy_geni	  aG  A folded Cauchy continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `foldcauchy` is:

.. math::

    f(x, c) = \frac{1}{\pi (1+(x-c)^2)} + \frac{1}{\pi (1+(x+c)^2)}

for :math:`x \ge 0` and :math:`c \ge 0`.

`foldcauchy` takes ``c`` as a shape parameter for :math:`c`.

%(example)s

c                    V^ 8  # r  r   r  s   &&r5   rd   foldcauchy_gen._argcheck	      Avr7   c                @    \        R R^ \        P                  3R4      .# r\  Fri   rj   rl   s   &r5   rm   foldcauchy_gen._shape_info	      3266{MBCCr7   Nc                B    \        \        P                  WVR 7      4      # )r-   r   r   )r	  r.  r)  rD   r\  r   r   s   &&&&r5   r   foldcauchy_gen._rvs	  s$    6::!+7  9 : 	:r7   c                    R \         P                  ,          R ^W,
          ^,          ,           ,          R ^W,           ^,          ,           ,          ,           ,          # r8  r`  r`  s   &&&r5   ru   foldcauchy_gen._pdf	  s8    255y#q!#z*S!QS1H*-==>>r7   c                    R \         P                  ,          \         P                  ! W,
          4      \         P                  ! W,           4      ,           ,          # r8  rQ   r  arctanr`  s   &&&r5   ry   foldcauchy_gen._cdf	  s.    255y"))AC.299QS>9::r7   c                    \         P                  ! ^W,
          4      \         P                  ! ^W,           4      ,           \         P                  ,          # r_   r  r`  s   &&&r5   r~   foldcauchy_gen._sf	  s2    
 

1ae$rzz!QU';;RUUBBr7   c                ~    \         P                  \         P                  \         P                  \         P                  3# rO   rE  r  s   &&r5   r   foldcauchy_gen._stats	  r  r7   r   r.  r   r   r   r   r   rd   rm   r   ru   ry   r~   r   r   r   r   s   @r5   r  r  	  s4     &D:?;C. .r7   r  
foldcauchyc                   ^   a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 tR tR tRtV tR# )f_geni	  a  An F continuous random variable.

For the noncentral F distribution, see `ncf`.

%(before_notes)s

See Also
--------
ncf

Notes
-----
The F distribution with :math:`df_1 > 0` and :math:`df_2 > 0` degrees of freedom is
the distribution of the ratio of two independent chi-squared distributions with
:math:`df_1` and :math:`df_2` degrees of freedom, after rescaling by
:math:`df_2 / df_1`.

The probability density function for `f` is:

.. math::

    f(x, df_1, df_2) = \frac{df_2^{df_2/2} df_1^{df_1/2} x^{df_1 / 2-1}}
                            {(df_2+df_1 x)^{(df_1+df_2)/2}
                             B(df_1/2, df_2/2)}

for :math:`x > 0`.

`f` accepts shape parameters ``dfn`` and ``dfd`` for :math:`df_1`, the degrees of
freedom of the chi-squared distribution in the numerator, and :math:`df_2`, the
degrees of freedom of the chi-squared distribution in the denominator, respectively.

%(after_notes)s

%(example)s

c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      pW.# )dfnFdfdr4  rj   )rD   idfnidfds   &  r5   rm   f_gen._shape_info
  s:    %BFF^D%BFF^D|r7   Nc                &    VP                  WV4      # rO   )r  )rD   r  r  r   r   s   &&&&&r5   r   
f_gen._rvs
  s    ~~c--r7   c                N    \         P                  ! V P                  WV4      4      # rO   r.  rD   rt   r  r  s   &&&&r5   ru   
f_gen._pdf	
  s     vvdll13/00r7   c                   R V,          pR V,          pV^,          \         P                  ! V4      ,          V^,          \         P                  ! V4      ,          ,           \        P                  ! V^,          ^,
          V4      ,           WE,           ^,          \         P                  ! WTV,          ,           4      ,          \        P                  ! V^,          V^,          4      ,           ,
          pV# r8  )rQ   r  r|   r  r  )rD   rt   r  r  rc   r  r  s   &&&&   r5   r   f_gen._logpdf
  s    #I#IsRVVAY1rvvay0288AaC!GQ3GGC7bffQ1Wo-		!A#qs0CCE
r7   c                0    \         P                  ! W#V4      # rO   )r|   fdtrr  s   &&&&r5   ry   
f_gen._cdf
  s    wws##r7   c                0    \         P                  ! W#V4      # rO   )r|   fdtrcr  s   &&&&r5   r~   	f_gen._sf
      xx!$$r7   c                0    \         P                  ! W#V4      # rO   )r|   fdtri)rD   r   r  r  s   &&&&r5   r   
f_gen._ppf
  r  r7   c                0   R V,          R V,          rCVR,
          VR,
          VR,
          VR,
          3w  rVrx\         P                  ! V^8  WE3R \        P                  R7      p	\         P                  ! V^8  W4WV3R \        P                  R7      p
\         P                  ! V^8  W5Wg3R \        P                  R7      pV\        P
                  ! R4      ,          p\         P                  ! V^8  WV3R	 \        P                  R7      pVR
,          pWW3# )r   r   r  rJ         @c                     W,          # rO   r   )v2v2_2s   &&r5   r  f_gen._stats.<locals>.<lambda>%
  s    RYr7   r  c                 r    ^V,          V,          W,           ,          W^,          ,          V,          ,          # rD  r   )v1r   r  v2_4s   &&&&r5   r  r  *
  s$    FRK29%Ag)<=r7   c                     ^V ,          V,           V,          \         P                  ! W W,           ,          ,          4      ,          # rD  r  )r  r  r  v2_6s   &&&&r5   r  r  0
  s*    Vd]d"RWWT295E-F%GGr7   c                 <    ^W ,          V,          ,           V,          # )   r   )r{  r  v2_8s   &&&r5   r  r  7
  s    A$$6$#>r7   rS  )r  r  rQ   rk   rF  r'  )rD   r  r  r  r   r  r  r  r
  ry  rz  r{  r|  s   &&&          r5   r   f_gen._stats
  s    c28B!#b"r'27BG!CD__FRJ&vv
 ooFRT(>vv	 __FRt*Hvv	
 	bggbk__FRt$>vv 	gr7   c                   R V,          pR V,          pR W,           ,          p\         P                  ! V4      \         P                  ! V4      ,
          \        P                  ! W44      ,           ^V,
          \        P                  ! V4      ,          ,           ^V,           \        P                  ! V4      ,          ,
          V\        P                  ! V4      ,          ,           # r  )rQ   r  r|   r  r  )rD   r  r  half_dfnhalf_dfdhalf_sums   &&&   r5   r  f_gen._entropy=
  s     99#)$sbffSk)BIIh,IIX!11256\x 5!!#+bffX.>#>? 	@r7   r   r.  )r   r   r   r   r   rm   r   ru   r   ry   r~   r   r   r  r   r   r   s   @r5   r  r  	  s?     #H
.1$%%<
@ 
@r7   r  r  c                   R   a  ] tR tRt o RtR tR tRR ltR tR t	R	 t
R
 tRtV tR# )foldnorm_geniU
  aN  A folded normal continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `foldnorm` is:

.. math::

    f(x, c) = \sqrt{2/\pi} cosh(c x) \exp(-\frac{x^2+c^2}{2})

for :math:`x \ge 0` and :math:`c \ge 0`.

`foldnorm` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

%(example)s

c                    V^ 8  # r  r   r  s   &&r5   rd   foldnorm_gen._argcheckk
  r  r7   c                @    \        R R^ \        P                  3R4      .# r  rj   rl   s   &r5   rm   foldnorm_gen._shape_infon
  r  r7   Nc                D    \        VP                  V4      V,           4      # rO   r	  r   r  s   &&&&r5   r   foldnorm_gen._rvsq
  s    <//59::r7   c                P    \        W,           4      \        W,
          4      ,           # rO   r   r`  s   &&&r5   ru   foldnorm_gen._pdft
  s    )AC.00r7   c                    \         P                  ! ^4      pR\        P                  ! W,
          V,          4      \        P                  ! W,           V,          4      ,           ,          # rI  )rQ   r'  r|   erf)rD   rt   r\  sqrt_twos   &&& r5   ry   foldnorm_gen._cdfx
  s?    771:bffaeX-.8H1IIJJr7   c                P    \        W,
          4      \        W,           4      ,           # rO   r  r`  s   &&&r5   r~   foldnorm_gen._sf|
  s    !%00r7   c                   W,          p\         P                  ! RV,          4      \         P                  ! R\         P                  ,          4      ,          pRV,          V\        P
                  ! V\         P                  ! ^4      ,          4      ,          ,           pV^,           WD,          ,
          pRWD,          V,          W$,          ,
          V,
          ,          pV\         P                  ! VR4      ,          pW"R,           ,          ^,           RV,          V,          ,           pVRVR,
          ,          RV^,          ,          ,
          V^,          ,          ,          pWuR,          ,          R,
          pWEWg3# )r   r   rS  rJ  r  r        )rQ   r   r'  r  r|   r  rU  )rD   r\  r  expfacry  rz  r{  r|  s   &&      r5   r   foldnorm_gen._stats
  s     SR2772bee8#44YRVVAbggajL1111frun258be#f,-
bhhsC  7^a"V)B,.
rR"W~RU
*b!e33s(]Rr7   r   r.  r  r   s   @r5   r  r  U
  s4     *D;1K1 r7   r  foldnormc                      a a ] tR tRt oRtR tR tR tR tR t	R t
R	 tR
 tR tR t]! ]RR7      V 3R l4       tRtVtV ;t# )weibull_min_geni
  a  Weibull minimum continuous random variable.

The Weibull Minimum Extreme Value distribution, from extreme value theory
(Fisher-Gnedenko theorem), is also often simply called the Weibull
distribution. It arises as the limiting distribution of the rescaled
minimum of iid random variables.

%(before_notes)s

See Also
--------
weibull_max, numpy.random.Generator.weibull, exponweib

Notes
-----
The probability density function for `weibull_min` is:

.. math::

    f(x, c) = c x^{c-1} \exp(-x^c)

for :math:`x > 0`, :math:`c > 0`.

`weibull_min` takes ``c`` as a shape parameter for :math:`c`.
(named :math:`k` in Wikipedia article and :math:`a` in
``numpy.random.weibull``).  Special shape values are :math:`c=1` and
:math:`c=2` where Weibull distribution reduces to the `expon` and
`rayleigh` distributions respectively.

Suppose ``X`` is an exponentially distributed random variable with
scale ``s``. Then ``Y = X**k`` is `weibull_min` distributed with shape
``c = 1/k`` and scale ``s**k``.

%(after_notes)s

References
----------
https://en.wikipedia.org/wiki/Weibull_distribution

https://en.wikipedia.org/wiki/Fisher-Tippett-Gnedenko_theorem

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   weibull_min_gen._shape_info
  r6  r7   c                ~    V\        W^,
          4      ,          \        P                  ! \        W4      ) 4      ,          # r_   r  rQ   r   r`  s   &&&r5   ru   weibull_min_gen._pdf
  s(    Q!}RVVSYJ///r7   c                    \         P                  ! V4      \        P                  ! V^,
          V4      ,           \	        W4      ,
          # r_   rQ   r  r|   r  r  r`  s   &&&r5   r   weibull_min_gen._logpdf
  s-    vvay288AE1--A	99r7   c                D    \         P                  ! \        W4      ) 4      ) # rO   r|   rf  r  r`  s   &&&r5   ry   weibull_min_gen._cdf
  s    #a)$$$r7   c                T    \        \        P                  ! V) 4      ) R V,          4      # r8  r  rg  s   &&&r5   r   weibull_min_gen._ppf
  s    BHHaRL=#a%((r7   c                L    \         P                  ! V P                  W4      4      # rO   r  r`  s   &&&r5   r~   weibull_min_gen._sf
      vvdkk!'((r7   c                    \        W4      ) # rO   r  r`  s   &&&r5   r
  weibull_min_gen._logsf
  s    A	zr7   c                L    \         P                  ! V4      ) ^V,          ,          # r_   rc  rg  s   &&&r5   r   weibull_min_gen._isf
  s    
ac""r7   c                X    \         P                  ! R VR ,          V,          ,           4      # r8  r'  r  s   &&&r5   r,  weibull_min_gen._munp
  s    xxAcE!G$$r7   c                x    \         ) V,          \        P                  ! V4      ,
          \         ,           ^,           # r_   r#   rQ   r  r  s   &&r5   r  weibull_min_gen._entropy
  %    w{RVVAY&/!33r7   a          If ``method='mm'``, parameters fixed by the user are respected, and the
        remaining parameters are used to match distribution and sample moments
        where possible. For example, if the user fixes the location with
        ``floc``, the parameters will only match the distribution skewness and
        variance to the sample skewness and variance; no attempt will be made
        to match the means or minimize a norm of the errors.
        

r  c           	     
  <aa \        V\        4      '       d;   VP                  4       ^ 8X  d   VP                  4       pM\        SV `  ! V.VO5/ VB # VP                  RR4      '       d   \        SV `  ! V.VO5/ VB # \        WW#4      w  rrVVP                  RR4      P                  4       pR o\        P                  ! V4      oRpS! V4      p	SV	8  d(   VR8w  d!   Vf   V'       g   \        SV `  ! V.VO5/ VB # VR8X  d   RRRrp
M@\        V4      '       d
   V^ ,          MRp
VP                  R	R4      pVP                  R
R4      pVf%   V
f!   \        VV3R lRV.RR7      P                  p
MVe   Tp
Vf   Vf   \        P                   ! V4      p\        P"                  ! V\$        P&                  ! ^^V
,          ,           4      \$        P&                  ! ^^V
,          ,           4      ^,          ,
          ,          4      pMVe   TpVfM   VfI   \        P(                  ! V4      pW\$        P&                  ! ^^V
,          ,           4      ,          ,
          pMVe   TpVR8X  d   WV3# \        SV `  ! W3R	VR
V/VB # )r   superfitFr0   r:   c                 n   \         P                  ! ^^V ,          ,           4      p\         P                  ! ^^V ,          ,           4      p\         P                  ! ^^V ,          ,           4      p^V^,          ,          ^V,          V,          ,
          V,           pW!^,          ,
          R,          pWE,          # rM   rS  r'  )r\  gamma1gamma2gamma3numr  s   &     r5   skew!weibull_min_gen.fit.<locals>.skew
  sx    XXa!e_FXXa!e_FXXa!e_Ffai-!F(6/1F:CAI%-C7Nr7   g     @r;   Nr-   r.   c                 "   < S! V 4      S,
          # rO   r   )r\  rj  rL  s   &r5   r  %weibull_min_gen.fit.<locals>.<lambda>  s    d1gkr7   g{Gz?bisect)bracketr0   )r>   r)   r?   r  r@   rB   r2   _check_fit_input_parametersr<   r=   rF  rL  r  r*   rootrQ   r  r'  r|   r(  r&  )rD   rE   rF   r4   fcr  r  r0   max_cs_minr\  r-   r.   r  r  rj  rL  r  s   &&*,           @@r5   rB   weibull_min_gen.fit
  s;    dL))  "a'~~'w{47$7$7788J&&7;t3d3d33 "=T=A"I$(E*002	 JJtUu94BJt7;t3d3d33 T> $EAEt99Q$A((5$'CHHWd+E:!) 1D%=#+--1T ^A>emtAGGA!AaC%288AacE?A3E!EFGEE<CKABHHQ1W---CCT>5=  7;tECEuEEEr7   r   )r   r   r   r   r   rm   ru   r   ry   r   r~   r
  r   r,  r  r	   r   rB   r   r   r  r   s   @@r5   r(  r(  
  si     +XE0:%))#%4 } 5 JFJF JFr7   r(  r  c                   ~   a a ] tR tRt oRtR tR tV 3R ltR tR t	R t
R	 tR
 tR tR tR tR tR tRtVtV ;t# )truncweibull_min_geni:  a  A doubly truncated Weibull minimum continuous random variable.

%(before_notes)s

See Also
--------
weibull_min, truncexpon

Notes
-----
The probability density function for `truncweibull_min` is:

.. math::

    f(x, a, b, c) = \frac{c x^{c-1} \exp(-x^c)}{\exp(-a^c) - \exp(-b^c)}

for :math:`a < x <= b`, :math:`0 \le a < b` and :math:`c > 0`.

`truncweibull_min` takes :math:`a`, :math:`b`, and :math:`c` as shape
parameters.

Notice that the truncation values, :math:`a` and :math:`b`, are defined in
standardized form:

.. math::

    a = (u_l - loc)/scale
    b = (u_r - loc)/scale

where :math:`u_l` and :math:`u_r` are the specific left and right
truncation values, respectively. In other words, the support of the
distribution becomes :math:`(a*scale + loc) < x <= (b*scale + loc)` when
:math:`loc` and/or :math:`scale` are provided.

%(after_notes)s

References
----------

.. [1] Rinne, H. "The Weibull Distribution: A Handbook". CRC Press (2009).

%(example)s

c                2    VR 8  W28  ,          VR 8  ,          # r   r   rD   r\  r   r   s   &&&&r5   rd   truncweibull_min_gen._argcheckg  s    RAE"a"f--r7   c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      p\        RR^ \        P                  3R4      pWV.# )r\  Fr   r   r4  ri   rj   )rD   ry  r  r  s   &   r5   rm    truncweibull_min_gen._shape_infoj  sT    UQK@UQK?UQK@|r7   c                &   < \         SV `  VRR7      # )rM   r  )rM   r   rM   r@   r  rD   rE   r  s   &&r5   r  truncweibull_min_gen._fitstartp  s    w I 66r7   c                    W#3# rO   r   r\  s   &&&&r5   r   !truncweibull_min_gen._get_supportt  	    tr7   c                   \         P                  ! \        W24      ) 4      \         P                  ! \        WB4      ) 4      ,
          pV\        W^,
          4      ,          \         P                  ! \        W4      ) 4      ,          V,          # r_   rQ   r   r  )rD   rt   r\  r   r   denums   &&&&& r5   ru   truncweibull_min_gen._pdfw  sU    Q
#bffc!iZ&88CQ3K"&&#a)"44==r7   c           	     T   \         P                  ! \         P                  ! \        W24      ) 4      \         P                  ! \        WB4      ) 4      ,
          4      p\         P                  ! V4      \        P
                  ! V^,
          V4      ,           \        W4      ,
          V,
          # r_   )rQ   r  r   r  r|   r  )rD   rt   r\  r   r   logdenums   &&&&& r5   r   truncweibull_min_gen._logpdf{  sc    66"&&#a),rvvs1yj/AABvvay288AE1--A	9HDDr7   c                &   \         P                  ! \        W24      ) 4      \         P                  ! \        W4      ) 4      ,
          p\         P                  ! \        W24      ) 4      \         P                  ! \        WB4      ) 4      ,
          pWV,          # rO   rh  rD   rt   r\  r   r   rK  ri  s   &&&&&  r5   ry   truncweibull_min_gen._cdf  Z    vvs1yj!BFFCI:$66Q
#bffc!iZ&88{r7   c           	     v   \         P                  ! \         P                  ! \        W24      ) 4      \         P                  ! \        W4      ) 4      ,
          4      p\         P                  ! \         P                  ! \        W24      ) 4      \         P                  ! \        WB4      ) 4      ,
          4      pWV,
          # rO   rQ   r  r   r  rD   rt   r\  r   r   lognumrl  s   &&&&&  r5   r  truncweibull_min_gen._logcdf  m    A	z*RVVSYJ-??@66"&&#a),rvvs1yj/AAB  r7   c                &   \         P                  ! \        W4      ) 4      \         P                  ! \        WB4      ) 4      ,
          p\         P                  ! \        W24      ) 4      \         P                  ! \        WB4      ) 4      ,
          pWV,          # rO   rh  ro  s   &&&&&  r5   r~   truncweibull_min_gen._sf  rq  r7   c           	     v   \         P                  ! \         P                  ! \        W4      ) 4      \         P                  ! \        WB4      ) 4      ,
          4      p\         P                  ! \         P                  ! \        W24      ) 4      \         P                  ! \        WB4      ) 4      ,
          4      pWV,
          # rO   rs  rt  s   &&&&&  r5   r
  truncweibull_min_gen._logsf  rw  r7   c                   \        \        P                  ! ^V,
          \        P                  ! \        WB4      ) 4      ,          V\        P                  ! \        W24      ) 4      ,          ,           4      ) ^V,          4      # r_   r  rQ   r  r   rD   r   r\  r   r   s   &&&&&r5   r   truncweibull_min_gen._isf  U    VVQUbffc!iZ001rvvs1yj7I3IIJJAaC 	r7   c                   \        \        P                  ! ^V,
          \        P                  ! \        W24      ) 4      ,          V\        P                  ! \        WB4      ) 4      ,          ,           4      ) ^V,          4      # r_   r}  r~  s   &&&&&r5   r   truncweibull_min_gen._ppf  r  r7   c           	        \         P                  ! W,          R ,           4      \         P                  ! W,          R ,           \        WB4      4      \         P                  ! W,          R ,           \        W24      4      ,
          ,          p\        P
                  ! \        W24      ) 4      \        P
                  ! \        WB4      ) 4      ,
          pWV,          # r8  )r|   r(  rB  r  rQ   r   )rD   rc   r\  r   r   	gamma_funri  s   &&&&&  r5   r,  truncweibull_min_gen._munp  s    HHQS2X&KKb#a),r{{138SY/OO	 Q
#bffc!iZ&88  r7   r   )r   r   r   r   r   rd   rm   r  r   ru   r   ry   r  r~   r
  r   r   r,  r   r   r  r   s   @@r5   rY  rY  :  sR     +X.7>E
!

!


! !r7   rY  truncweibull_minc                   Z   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tRtV tR# )weibull_max_geni  a  Weibull maximum continuous random variable.

The Weibull Maximum Extreme Value distribution, from extreme value theory
(Fisher-Gnedenko theorem), is the limiting distribution of rescaled
maximum of iid random variables. This is the distribution of -X
if X is from the `weibull_min` function.

%(before_notes)s

See Also
--------
weibull_min

Notes
-----
The probability density function for `weibull_max` is:

.. math::

    f(x, c) = c (-x)^{c-1} \exp(-(-x)^c)

for :math:`x < 0`, :math:`c > 0`.

`weibull_max` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

References
----------
https://en.wikipedia.org/wiki/Weibull_distribution

https://en.wikipedia.org/wiki/Fisher-Tippett-Gnedenko_theorem

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   weibull_max_gen._shape_info  r6  r7   c                    V\        V) V^,
          4      ,          \        P                  ! \        V) V4      ) 4      ,          # r_   r,  r`  s   &&&r5   ru   weibull_max_gen._pdf  s0    aR1~bffc1"aj[111r7   c                    \         P                  ! V4      \        P                  ! V^,
          V) 4      ,           \	        V) V4      ,
          # r_   r/  r`  s   &&&r5   r   weibull_max_gen._logpdf  s3    vvay288AaC!,,sA2qz99r7   c                F    \         P                  ! \        V) V4      ) 4      # rO   rh  r`  s   &&&r5   ry   weibull_max_gen._cdf  s    vvsA2qzk""r7   c                    \        V) V4      ) # rO   r:  r`  s   &&&r5   r  weibull_max_gen._logcdf  s    QB
{r7   c                H    \         P                  ! \        V) V4      ) 4      ) # rO   r2  r`  s   &&&r5   r~   weibull_max_gen._sf  s    #qb!*%%%r7   c                T    \        \        P                  ! V4      ) R V,          4      ) # r8  )r  rQ   r  rg  s   &&&r5   r   weibull_max_gen._ppf  s     RVVAYJA&&&r7   c                    \         P                  ! R VR ,          V,          ,           4      p\        V4      ^,          '       d   RpWC,          # ^pWC,          # )r   r  )r|   r(  r+  )rD   rc   r\  valsgns   &&&  r5   r,  weibull_max_gen._munp  sG    hhs1S57{#q6A::C y Cyr7   c                x    \         ) V,          \        P                  ! V4      ,
          \         ,           ^,           # r_   rA  r  s   &&r5   r  weibull_max_gen._entropy  rC  r7   r   N)r   r   r   r   r   rm   ru   r   ry   r  r~   r   r,  r  r   r   r   s   @r5   r  r    s>     #HE2:#&'4 4r7   r  weibull_max)r   r   c                   `   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tRtV tR# )genlogistic_geni  a1  A generalized logistic continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `genlogistic` is:

.. math::

    f(x, c) = c \frac{\exp(-x)}
                     {(1 + \exp(-x))^{c+1}}

for real :math:`x` and :math:`c > 0`. In literature, different
generalizations of the logistic distribution can be found. This is the type 1
generalized logistic distribution according to [1]_. It is also referred to
as the skew-logistic distribution [2]_.

`genlogistic` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

References
----------
.. [1] Johnson et al. "Continuous Univariate Distributions", Volume 2,
       Wiley. 1995.
.. [2] "Generalized Logistic Distribution", Wikipedia,
       https://en.wikipedia.org/wiki/Generalized_logistic_distribution

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   genlogistic_gen._shape_info  r6  r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  r`  s   &&&r5   ru   genlogistic_gen._pdf  r  r7   c                &   V^,
          ) V^ 8  ,          ^,
          p\         P                  ! V4      p\         P                  ! V4      W4,          ,           V^,           \        P                  ! \         P
                  ! V) 4      4      ,          ,
          # r_   )rQ   r	  r  r|   r  r   )rD   rt   r\  multr  s   &&&  r5   r   genlogistic_gen._logpdf  s`     Qx1q5!A%vvayvvay49$!rxxu/F'FFFr7   c                R    ^\         P                  ! V) 4      ,           V) ,          pV# r_   r7  )rD   rt   r\  Cxs   &&& r5   ry   genlogistic_gen._cdf#  s!    r
lqb!	r7   c                h    V) \         P                  ! \         P                  ! V) 4      4      ,          # rO   )rQ   r  r   r`  s   &&&r5   r  genlogistic_gen._logcdf'  s"    rBHHRVVQBZ(((r7   c                h    \         P                  ! \        P                  ! VRV,          4      4      ) # r  )rQ   r  r|   powm1rg  s   &&&r5   r   genlogistic_gen._ppf*  s#    rxx46*+++r7   c                N    \         P                  ! V P                  W4      4      ) # rO   r|   rf  r  r`  s   &&&r5   r~   genlogistic_gen._sf-      a+,,,r7   c                4    V P                  ^V,
          V4      # r_   r   rg  s   &&&r5   r   genlogistic_gen._isf0  s    yyQ""r7   c                   \         \        P                  ! V4      ,           p\        P                  \        P                  ,          R ,          \        P
                  ! ^V4      ,           pR\        P
                  ! ^V4      ,          ^\        ,          ,           pV\        P                  ! VR4      ,          p\        P                  ^,          R,          ^\        P
                  ! ^V4      ,          ,           pWSR,          ,          pW#WE3# )rJ  rS        .@r   r<  )r#   r|   r  rQ   r  zetar$   rU  rD   r\  ry  rz  r{  r|  s   &&    r5   r   genlogistic_gen._stats3  s    bffQieeBEEk#o1-1&(
bhhsC  UUAXd]Qrwwq!}_,
3hr7   c                >    \         P                  ! VR 8  VR R 4      # )g    ^Ac                     \         P                  ! V 4      ) \        P                  ! V ^,           4      ,           \        ,           ^,           # r_   )rQ   r  r|   r  r#   r  s   &r5   r  *genlogistic_gen._entropy.<locals>.<lambda>?  s)    rvvayj266!a%=069A=r7   c                 F    ^^V ,          ,          \         ,           ^,           # r_   r#   r  s   &r5   r  r  E  s    a1q5kF*Q.r7   r=  r  s   &&r5   r  genlogistic_gen._entropy<  s$    GQ= /0 	0r7   r   N)r   r   r   r   r   rm   ru   r   ry   r  r   r~   r   r   r  r   r   r   s   @r5   r  r    sD     @E*G),-#	0 	0r7   r  genlogisticc                   v   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tRR ltR tR tRtV tR# )genpareto_geniK  a=  A generalized Pareto continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `genpareto` is:

.. math::

    f(x, c) = (1 + c x)^{-1 - 1/c}

defined for :math:`x \ge 0` if :math:`c \ge 0`, and for
:math:`0 \le x \le -1/c` if :math:`c < 0`.

`genpareto` takes ``c`` as a shape parameter for :math:`c`.

For :math:`c=0`, `genpareto` reduces to the exponential
distribution, `expon`:

.. math::

    f(x, 0) = \exp(-x)

For :math:`c=-1`, `genpareto` is uniform on ``[0, 1]``:

.. math::

    f(x, -1) = 1

%(after_notes)s

%(example)s

c                .    \         P                  ! V4      # rO   rQ   r$  r  s   &&r5   rd   genpareto_gen._argchecko      {{1~r7   c                ^    \        R R\        P                  ) \        P                  3R4      .# r[  rj   rl   s   &r5   rm   genpareto_gen._shape_infor  %    3'8.IJJr7   c                    \         P                  ! V4      p\         P                  ! V P                  V4      ^ ,          P	                  4       p\
        P                  ! V^ 8  VR \         P                  R7      pW#3# )r   c                     RV ,          # r  r   r  s   &r5   r  ,genpareto_gen._get_support.<locals>.<lambda>x  s    ar7   r  )rQ   r#  rE  r   copyr  r  rk   r\  s   &&  r5   r   genpareto_gen._get_supportu  sZ    JJqM*1-224OOAE1&7')vv/tr7   c                L    \         P                  ! V P                  W4      4      # rO   r.  r`  s   &&&r5   ru   genpareto_gen._pdf|  r  r7   c                T    \         P                  ! W8H  V^ 8g  ,          W3R V) R7      # )r   c                 Z    \         P                  ! VR ,           W,          4      ) V,          # r8  r  rt   r\  s   &&r5   r  'genpareto_gen._logpdf.<locals>.<lambda>  s    RZZB-D,Dq,Hr7   r  r=  r`  s   &&&r5   r   genpareto_gen._logpdf  s,    162QFH+,". 	.r7   c                6    \         P                  ! V) V) 4      ) # rO   )r|   inv_boxcox1pr`  s   &&&r5   ry   genpareto_gen._cdf  s    QB'''r7   c                4    \         P                  ! V) V) 4      # rO   )r|   
inv_boxcoxr`  s   &&&r5   r~   genpareto_gen._sf  s    }}aR!$$r7   c                T    \         P                  ! W8H  V^ 8g  ,          W3R V) R7      # )r   c                 J    \         P                  ! W,          4      ) V,          # rO   r_  r  s   &&r5   r  &genpareto_gen._logsf.<locals>.<lambda>  s    RXXac]NQ,>r7   r  r=  r`  s   &&&r5   r
  genpareto_gen._logsf  s,    162QF>+,". 	.r7   c                6    \         P                  ! V) V) 4      ) # rO   )r|   boxcox1prg  s   &&&r5   r   genpareto_gen._ppf  s    QB###r7   c                2    \         P                  ! W) 4      ) # rO   )r|   boxcoxrg  s   &&&r5   r   genpareto_gen._isf  s    		!R   r7   c                   R
w  r4rVRV9   d-   \         P                  ! V^8  VR \        P                  R7      pRV9   d-   \         P                  ! VR8  VR \        P                  R7      pRV9   d-   \         P                  ! VR8  VR \        P                  R7      pRV9   d-   \         P                  ! VR8  VR	 \        P                  R7      pW4WV3# )Nr  c                 "    ^^V ,
          ,          # r_   r   xis   &r5   r  &genpareto_gen._stats.<locals>.<lambda>  s    1B<r7   r  r  c                 Z    ^^V ,
          ^,          ,          ^^V ,          ,
          ,          # r_   r   r  s   &r5   r  r    s    1B{?a!b&j+Ir7   rj  c                     ^^V ,           ,          \         P                  ! ^^V ,          ,
          4      ,          ^^V ,          ,
          ,          # rD  r  r  s   &r5   r  r    s/    1B<"''!ad(*;;q1R4xHr7   rk  c                     ^^^V ,          ,
          ,          ^V ^,          ,          V ,           ^,           ,          ^^V ,          ,
          ,          ^^V ,          ,
          ,          ^,
          # r  r   r  s   &r5   r  r    sN    1AbD>Qr1uWr\A-=>!B$h(+,qt85789r7   NNNNr   gUUUUUU?r  r  r  rQ   rk   rF  )rD   r\  rl  r  r  rj  rk  s   &&&    r5   r   genpareto_gen._stats  s    +
a'>Aq 7+-663A '>C I+-663A '>CH66#A
 '>C966	#A Qzr7   c           	     ~   a V3R  lp\         P                  ! V^ 8g  W#\        P                  ! S^,           4      R7      # )c                 v  < R p\         P                  ! ^ S^,           4      p\        V\        P                  ! SV4      4       F/  w  r4WRV,          ,          RW,          ,
          ,          ,           pK1  	  \         P
                  ! V S,          ^8  VRV ,          S,          ,          \         P                  4      # )r   r   r  r  )rQ   r  zipr|   combr  rk   )r\  r  rk  kicnkrc   s   &    r5   r  #genpareto_gen._munp.<locals>.__munp  s    C		!QU#Aq"''!Q-02"*,af== 188AEAIsdQh1_'<bffEEr7   r  )r  r  r|   r(  )rD   rc   r\  _genpareto_gen__munps   &f& r5   r,  genpareto_gen._munp  s.    	F qAvqRXXa!e_MMr7   c                    R V,           # r8  r   r  s   &&r5   r  genpareto_gen._entropy  s    Avr7   r   Nrq  )r   r   r   r   r   rd   rm   r   ru   r   ry   r~   r
  r   r   r   r,  r  r   r   r   s   @r5   r  r  K  sS     "FK*.
(%.
$!8N r7   r  	genparetoc                   N   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
tV tR# )genexpon_geni  a  A generalized exponential continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `genexpon` is:

.. math::

    f(x, a, b, c) = (a + b (1 - \exp(-c x)))
                    \exp(-a x - b x + \frac{b}{c}  (1-\exp(-c x)))

for :math:`x \ge 0`, :math:`a, b, c > 0`.

`genexpon` takes :math:`a`, :math:`b` and :math:`c` as shape parameters.

%(after_notes)s

References
----------
H.K. Ryu, "An Extension of Marshall and Olkin's Bivariate Exponential
Distribution", Journal of the American Statistical Association, 1993.

N. Balakrishnan, Asit P. Basu (editors), *The Exponential Distribution:
Theory, Methods and Applications*, Gordon and Breach, 1995.
ISBN 10: 2884491929

%(example)s

c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      p\        RR^ \        P                  3R4      pWV.# )r   Fr   r\  r4  rj   )rD   r  r  ry  s   &   r5   rm   genexpon_gen._shape_info  sT    UQK@UQK@UQK@|r7   c           	        W#\         P                  ! V) V,          4      ) ,          ,           \        P                  ! V) V,
          V,          V\         P                  ! V) V,          4      ) ,          V,          ,           4      ,          # rO   r|   rf  rQ   r   rD   rt   r   r   r\  s   &&&&&r5   ru   genexpon_gen._pdf  sf     !A''!Aq01BHHaRTN?0CA0E1F *G G 	Gr7   c                   \         P                  ! W#\        P                  ! V) V,          4      ) ,          ,           4      V) V,
          V,          ,           V\        P                  ! V) V,          4      ) ,          V,          ,           # rO   rQ   r  r|   rf  r  s   &&&&&r5   r   genexpon_gen._logpdf  sW    vvaBHHaRTN?++,1ax7BHHaRTN?8KA8MMMr7   c                    \         P                  ! V) V,
          V,          V\         P                  ! V) V,          4      ) ,          V,          ,           4      ) # rO   r=  r  s   &&&&&r5   ry   genexpon_gen._cdf  s=    1"Q$A!A$7$99:::r7   c                   W#,           pW4\         P                  ! V) 4      ,          ,
          V,          pV\        P                  ! V) V,          \         P                  ! V) 4      ,          4      P
                  ,           V,          # rO   )rQ   r  r|   lambertwr   realrD   rH  r   r   r\  rj  r  s   &&&&&  r5   r   genexpon_gen._ppf  sX    E288QB<"BKK1rvvqbz 12777::r7   c                    \         P                  ! V) V,
          V,          V\        P                  ! V) V,          4      ) ,          V,          ,           4      # rO   r  r  s   &&&&&r5   r~   genexpon_gen._sf  s:    vvr!tQhRXXqbd^O!4Q!6677r7   c                
   W#,           pW4\         P                  ! V4      ,          ,
          V,          pV\        P                  ! V) V,          \         P                  ! V) 4      ,          4      P
                  ,           V,          # rO   )rQ   r  r|   r  r   r  r  s   &&&&&  r5   r   genexpon_gen._isf  sU    E266!9_aBKK1rvvqbz 12777::r7   r   Nr  r   s   @r5   r  r    s4     >GN;;
8; ;r7   r  genexponc                      a a ] tR tRt oRtR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tV 3R ltR tR tRtVtV ;t# )genextreme_geni  a  A generalized extreme value continuous random variable.

%(before_notes)s

See Also
--------
gumbel_r

Notes
-----
For :math:`c=0`, `genextreme` is equal to `gumbel_r` with
probability density function

.. math::

    f(x) = \exp(-\exp(-x)) \exp(-x),

where :math:`-\infty < x < \infty`.

For :math:`c \ne 0`, the probability density function for `genextreme` is:

.. math::

    f(x, c) = \exp(-(1-c x)^{1/c}) (1-c x)^{1/c-1},

where :math:`-\infty < x \le 1/c` if :math:`c > 0` and
:math:`1/c \le x < \infty` if :math:`c < 0`.

Note that several sources and software packages use the opposite
convention for the sign of the shape parameter :math:`c`.

`genextreme` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

%(example)s

c                .    \         P                  ! V4      # rO   r  r  s   &&r5   rd   genextreme_gen._argcheck-  r  r7   c                ^    \        R R\        P                  ) \        P                  3R4      .# r[  rj   rl   s   &r5   rm   genextreme_gen._shape_info0  r  r7   c                0   \         P                  ! V^ 8  R\         P                  ! V\        4      ,          \         P                  4      p\         P                  ! V^ 8  R\         P
                  ! V\        ) 4      ,          \         P                  ) 4      pW23# r   r   )rQ   r  maximumr!   rk   minimum)rD   r\  _b_as   &&  r5   r   genextreme_gen._get_support3  sa    XXa!eS2::a#77@XXa!eS2::a%#88266'Bvr7   c                T    \         P                  ! W8H  V^ 8g  ,          W3R V) R7      # )r   c                 L    \         P                  ! V) V ,          4      V,          # rO   r_  r  s   &&r5   r  +genextreme_gen._loglogcdf.<locals>.<lambda><  s    1"Q$)r7   r  r=  r`  s   &&&r5   
_loglogcdfgenextreme_gen._loglogcdf8  s-    VQ!)r 	r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  r`  s   &&&r5   ru   genextreme_gen._pdf?  s     vvdll1())r7   c                ,   \         P                  ! W8H  V^ 8g  ,          W!3\        P                  RR7      p\        P
                  ! V) 4      pV P                  W4      p\        P                  ! V4      p\        P                  ! WR^ 8H  V\        P                  ) 8H  ,          R4       \         P                  ! V^8H  V\        P                  ) 8H  ,          ( WeV3R \        P                  ) R7      p\        P                  ! Wr^8H  V^8H  ,          R4       V# )r   r   r  c                 $    V ) V,           V,
          # rO   r   )pex2lpex2lex2s   &&&r5   r  (genextreme_gen._logpdf.<locals>.<lambda>Q  s    teemd&:r7   )r  r  operatormulr|   r  r%  rQ   r   putmaskrk   )rD   rt   r\  cxlogex2logpex2r+  logpdfs   &&&     r5   r   genextreme_gen._logpdfE  s    __afa01&%\\c;2#//!'vvg


7!VbffW5s;Qw2"&&=)*F#:w	 
 	

6FqAv.4r7   c                N    \         P                  ! V P                  W4      4      ) # rO   )rQ   r   r%  r`  s   &&&r5   r  genextreme_gen._logcdfV  s    tq,---r7   c                L    \         P                  ! V P                  W4      4      # rO   r  r`  s   &&&r5   ry   genextreme_gen._cdfY  r`  r7   c                N    \         P                  ! V P                  W4      4      ) # rO   r  r`  s   &&&r5   r~   genextreme_gen._sf\  r  r7   c                    \         P                  ! \         P                  ! V4      ) 4      ) p\        P                  ! W38H  V^ 8g  ,          W23R VR7      # )r   c                 N    \         P                  ! V) V ,          4      ) V,          # rO   r=  r  s   &&r5   r  %genextreme_gen._ppf.<locals>.<lambda>c      "((A26**Q.r7   r  )rQ   r  r  r  rD   r   r\  rt   s   &&& r5   r   genextreme_gen._ppf_  sF    VVRVVAYJVQ!. 	r7   c                    \         P                  ! \        P                  ! V) 4      ) 4      ) p\        P
                  ! W38H  V^ 8g  ,          W23R VR7      # )r   c                 N    \         P                  ! V) V ,          4      ) V,          # rO   r=  r  s   &&r5   r  %genextreme_gen._isf.<locals>.<lambda>j  r@  r7   r  )rQ   r  r|   r  r  r  rA  s   &&& r5   r   genextreme_gen._isff  sH    VVRXXqb\M""VQ!. 	r7   c                  a V3R  lpV! ^4      pV! ^4      pV! ^4      pV! ^4      p\         P                  ! \        S4      R8  S\         P                  ,          R,          R,          WCR,          ,
          4      pR p\        P
                  ! \        S4      R8  SV\         P                  R,          R,          R7      p	Rp
R p\        P
                  ! \        S4      V
8  SV\        ) R7      p\         P                  ! SR8  \         P                  V) 4      p\         P                  ! SR8  \         P                  VR,          V	,          4      pR p^\         P                  ! ^4      ,          \        ,          \         P                  ^,          ,          pW4WW3p\        P
                  ! \        S4      V
R	,          8  S.VO5VVR7      pR
 pW4WVV3p\        P
                  ! \        S4      V
R,          8  S.VO5VRR7      pWVV3# )c                 L   < \         P                  ! V S,          ^,           4      # r_   r'  )rc   r\  s   &r5   g genextreme_gen._stats.<locals>.gn  s    88AEAI&&r7   gHz>r   rJ  c                     \         P                  ! \         P                  ! R V ,          R,           4      ^\         P                  ! V R,           4      ,          ,
          4      V R ,          ,          # r  r|   rf  r  r  s   &r5   gam2k_f&genextreme_gen._stats.<locals>.gam2k_fu  sB    88BJJs1uSy1!BJJq3w4G2GGHCOOr7   r  +=c                 r    \         P                  ! \         P                  ! V ^,           4      4      V ,          # r_   rL  r  s   &r5   gamk_f%genextreme_gen._stats.<locals>.gamk_fy  s#    88BJJq1u-.q00r7   c                 f    R  p\         P                  ! V R8  V .VO5V\        P                  R7      # )c                     \         P                  ! V 4      V) V^V,          ,           V,          ,           ,          VR,          ,          # r   rS  rP   )r\  r{  r|  g3g2mg12s   &&&&&r5   
sk1_eval_f;genextreme_gen._stats.<locals>.sk1_eval.<locals>.sk1_eval_f  s2    wwqzB3"qx-);#;<VS[HHr7   r  r  r  )r\  rF   rX  s   &* r5   sk1_eval'genextreme_gen._stats.<locals>.sk1_eval  s2    I??1:zDz#-"&&B Br7   g(\?c                 \    R  p\         P                  ! V R8  W\        P                  R7      # )c                     VRV,          ^W,           ,          V ,          ,           V ,          ,           V^,          ,          ^,
          # )rU  r`  r   )r{  r|  rV  g4rW  s   &&&&&r5   
ku1_eval_f;genextreme_gen._stats.<locals>.ku1_eval.<locals>.ku1_eval_f  s4    beaob&88"<<faiG!KKr7   r  g      пr  )r\  rF   r_  s   &* r5   ku1_eval'genextreme_gen._stats.<locals>.ku1_eval  s#    L??1:tBFFSSr7   gq=
ףp?r  r#  333333@)
rQ   r  r	  r  r  r  r#   rF  r'  r$   )rD   r\  rI  r{  r|  rV  r^  rW  rM  gam2kepsrQ  gamkr  r  rZ  sk_fillrF   r  ra  r  s   &f                   r5   r   genextreme_gen._statsm  s   	'qTqTqTqT#a&4-!BEE'C);RCZH	PA$7ruuczRU~V	1s1v}aVGL HHQXrvvu- HHQXrvvr3wu}5	B RWWQZ-&ruuax/#__SVc4i/!d%';	T
 '__SVc4i/!d%(< R|r7   c                   < \        V\        4      '       d   VP                  4       p\        V4      pV^ 8  d   RpMRp\        SV `  W3R7      # )r   r   r  r#  r>   r)   r  r   r@   r  )rD   rE   rI  r   r  s   &&  r5   r  genextreme_gen._fitstart  sK    dL))>>#D$Kq5AAw D 11r7   c                   \         P                  ! ^ V^,           4      pRW!,          ,          \         P                  ! \        P                  ! W4      RV,          ,          \        P
                  ! W#,          ^,           4      ,          ^ R7      ,          p\         P                  ! W!,          R8  V\         P                  4      # )r   r   rO  r  )rQ   r  r  r|   r  r(  r  rk   )rD   rc   r\  rk  valss   &&&  r5   r,  genextreme_gen._munp  s{    IIa114x"&&GGAMR!G#bhhqsQw&77  xxb$//r7   c                8    \         ^V,
          ,          ^,           # r_   r  r  s   &&r5   r  genextreme_gen._entropy  s    q1u~!!r7   r   )r   r   r   r   r   rd   rm   r   r%  ru   r   r  ry   r~   r   r   r   r  r,  r  r   r   r  r   s   @@r5   r  r    s]     %LK
*".*-,\	20" "r7   r  
genextremec                  a  RpV 3R lpS R8  d@   \         P                  ! S 4      R,           pS ^
8  d   \        P                  ! W#RR7      pV# M=S R8  d&   \         P                  ! S R,          4      R,           pMRS ) V,
          ,          p\        P                  ! W#R	R
R7      w  rErgV^8w  d   \        RS : 24      hV^ ,          # )a2  Inverse of the digamma function (real positive arguments only).

This function is used in the `fit` method of `gamma_gen`.
The function uses either optimize.fsolve or optimize.newton
to solve `sc.digamma(x) - y = 0`.  There is probably room for
improvement, but currently it works over a wide range of y:

>>> import numpy as np
>>> rng = np.random.default_rng()
>>> y = 64*rng.standard_normal(1000000)
>>> y.min(), y.max()
(-311.43592651416662, 351.77388222276869)
>>> x = [_digammainv(t) for t in y]
>>> np.abs(sc.digamma(x) - y).max()
1.1368683772161603e-13

gox?c                 >   < \         P                  ! V 4      S,
          # rO   )r|   rZ  ru  s   &r5   r  _digammainv.<locals>.func  s    zz!}q  r7   r   绽|=)tolg-@g뭁,?r   dy=T)xtolr  z _digammainv: fsolve failed, y = g      r_  )rQ   r   r   newtonr  RuntimeError)rv  _emr  x0valuer  r  r  s   f       r5   _digammainvr~    s    $ &C! 	6zVVAY_r6 OOD%8EL  
RVVAeG_w&QBH%__TE9=?E
ax=aUCDD8Or7   c                      a a ] tR tRt oRtR tRR ltR tR tR t	R t
R	 tR
 tR tR tR tV 3R lt]! ]RR7      V 3R l4       tRtVtV ;t# )	gamma_geni  a3  A gamma continuous random variable.

%(before_notes)s

See Also
--------
erlang, expon

Notes
-----
The probability density function for `gamma` is:

.. math::

    f(x, a) = \frac{x^{a-1} e^{-x}}{\Gamma(a)}

for :math:`x \ge 0`, :math:`a > 0`. Here :math:`\Gamma(a)` refers to the
gamma function.

`gamma` takes ``a`` as a shape parameter for :math:`a`.

When :math:`a` is an integer, `gamma` reduces to the Erlang
distribution, and when :math:`a=1` to the exponential distribution.

Gamma distributions are sometimes parameterized with two variables,
with a probability density function of:

.. math::

    f(x, \alpha, \beta) =
    \frac{\beta^\alpha x^{\alpha - 1} e^{-\beta x }}{\Gamma(\alpha)}

Note that this parameterization is equivalent to the above, with
``scale = 1 / beta``.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r3  rj   rl   s   &r5   rm   gamma_gen._shape_info  r6  r7   c                $    VP                  W4      # rO   standard_gamma)rD   r   r   r   s   &&&&r5   r   gamma_gen._rvs  s    **133r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  r9  s   &&&r5   ru   gamma_gen._pdf  r  r7   c                    \         P                  ! VR ,
          V4      V,
          \         P                  ! V4      ,
          # r8  )r|   r  r  r9  s   &&&r5   r   gamma_gen._logpdf  s)    xx#q!A%

155r7   c                .    \         P                  ! W!4      # rO   rA  r9  s   &&&r5   ry   gamma_gen._cdf  r   r7   c                .    \         P                  ! W!4      # rO   rE  r9  s   &&&r5   r~   gamma_gen._sf  s    ||A!!r7   c                .    \         P                  ! W!4      # rO   r~  rA  s   &&&r5   r   gamma_gen._ppf"  s    ~~a##r7   c                .    \         P                  ! W!4      # rO   r|   rP  rA  s   &&&r5   r   gamma_gen._isf%  s    q$$r7   c                P    WR \         P                  ! V4      ,          RV,          3# )r   rJ  r  rG  s   &&r5   r   gamma_gen._stats(  s    S^SU**r7   c                .    \         P                  ! W!4      # rO   r|   rT  rD   rc   r   s   &&&r5   r,  gamma_gen._munp+  s    wwq}r7   c                D    R  pR p\         P                  ! V^8  WV4      # )c                     \         P                  ! V 4      ^V ,
          ,          V ,           \         P                  ! V 4      ,           # r_   r|   r  r  r   s   &r5   r\  +gamma_gen._entropy.<locals>.regular_formula0  s+    66!9!$q(2::a=88r7   c                 R   R R\         P                  ! ^\         P                  ,          4      ,           \         P                  ! V 4      ,           ,          ^^V ,          ,          ,
          V R,          ^,          ,
          V R,          ^Z,          ,
          V R,          ^x,          ,           # )r   r   r  r  r  r  r  s   &r5   ra  .gamma_gen._entropy.<locals>.asymptotic_formula3  sq    
 2qw/"&&);<q!a%yH#vrk"%&VRK034c63,? @r7   r=  )rD   r   r\  ra  s   &&  r5   r  gamma_gen._entropy.  s'    	9	@ q3w<NOOr7   c                   < \        V\        4      '       d   VP                  4       p\        V4      p^RV^,          ,           ,          p\        SV `  W3R7      # )rU  :0yE>r  rj  )rD   rE   r  r   r  s   &&  r5   r  gamma_gen._fitstart=  sN     dL))>>#D4[Aw D 11r7   a<          When the location is fixed by using the argument `floc`
        and `method='MLE'`, this
        function uses explicit formulas or solves a simpler numerical
        problem than the full ML optimization problem.  So in that case,
        the `optimizer`, `loc` and `scale` arguments are ignored.
        

r  c                ,  <a VP                  R R4      pVP                  RR4      p\        V\        4      '       g   Vf*   VP                  4       R8w  d   \        SV `  ! V.VO5/ VB # VP                  R R4       \        V. RO4      pVP                  RR4      p\        V4       Ve   Ve   Ve   \        R4      h\        P                  ! V4      p\        P                  ! V4      P                  4       '       g   \        R4      hVP                  4       R8X  d   \        P                  ! V4      p\        P                  ! V4      p	\        P                  ! W,
          ^,          4      p
YdTrpVf   Vf   Vf   V
^V	,          ,          pVf!   Vf   \        P                   ! W,          4      pVf   Vf   WV,
          ,          pVf   Vf   W^,          ,          pVf   W,
          V,          pVf   WV,          ,
          pVf   W,
          V,          pWV3# \        P"                  ! W8*  4      '       d   \%        RV\        P&                  R	7      hV^ 8w  d	   W,
          pVP                  4       pVf   Ve   TpM\        P(                  ! V4      \        P(                  ! V4      P                  4       ,
          o^S,
          \        P                   ! S^,
          ^,          ^S,          ,           4      ,           ^S,          ,          pVR,          pVR,          p\*        P,                  ! V3R
 lVV^ R7      pW,          pML\        P(                  ! V4      P                  4       \        P(                  ! V4      ,
          p\/        V4      pTpWV3# )r  Nr0   r:   r;   r  r   r!  r(  r  c                 t   < \         P                  ! V 4      \        P                  ! V 4      ,
          S,
          # rO   )rQ   r  r|   rZ  )r   rj  s   &r5   r  gamma_gen.fit.<locals>.<lambda>  s    bffQi"**Q-.G!.Kr7   )dispr  g333333?gffffff?)r<   r>   r)   r=   r@   rB   r2   r   r6   r"  rQ   r#  r$  r%  r&  r  r'  r  r  rk   r  r   brentqr~  )rD   rE   rF   r4   r  r0   r  r  m1m2m3r   r-   r.   r  aestxar  r\  rj  r  s   &&*,               @r5   rB   gamma_gen.fitI  s    xx%(E*t\**4!7 7;t3d3d33 	!$(=>(D)$T*>d.63E  ) * * zz${{4 $$&&CDD <<>T!BB$))*BfEAyS[U]a"f{u}yU]3hyS[1*%yX&{u9n}Q5= 
 66$,wd"&&AA19 ;Dyy{ >~ FF4L266$<#4#4#66!bggqsQhAo662a4@5\5\OO$K$&4
 HE
 t!!#bffVn4AAAE~r7   r   r.  )r   r   r   r   r   rm   r   ru   r   ry   r~   r   r   r   r,  r  r  r	   r   rB   r   r   r  r   s   @@r5   r  r    sq     'PE4*6!"$%+P
2 } 5 ee er7   r  r(  c                   h   a a ] tR tRt oRtR tR tV 3R lt]! ]	RR7      V 3R l4       t
R	tVtV ;t# )

erlang_geni  a  An Erlang continuous random variable.

%(before_notes)s

See Also
--------
gamma

Notes
-----
The Erlang distribution is a special case of the Gamma distribution, with
the shape parameter `a` an integer.  Note that this restriction is not
enforced by `erlang`. It will, however, generate a warning the first time
a non-integer value is used for the shape parameter.

Refer to `gamma` for examples.

c                    \         P                  ! \         P                  ! V4      V8H  4      pV'       g%   R V: R2p\        P                  ! V\
        ^R7       V^ 8  # )zRThe shape parameter of the erlang distribution has been given a non-integer value r1   
stacklevel)rQ   r%  r  warningswarnRuntimeWarning)rD   r   allintmessages   &&  r5   rd   erlang_gen._argcheck  sM    q()==>EDGMM'>a@1ur7   c                @    \        R R^\        P                  3R4      .# )r   Tri   rj   rl   s   &r5   rm   erlang_gen._shape_info  ro   r7   c                   < \        V\        4      '       d   VP                  4       p\        R R\	        V4      ^,          ,           ,          4      p\
        \        V `  W3R7      # )r  r  r  )r>   r)   r  r+  r   r@   r  r  )rD   rE   r   r  s   && r5   r  erlang_gen._fitstart  sQ     dL))>>#DteDk1n,-.Y/4/@@r7   a          The Erlang distribution is generally defined to have integer values
        for the shape parameter.  This is not enforced by the `erlang` class.
        When fitting the distribution, it will generally return a non-integer
        value for the shape parameter.  By using the keyword argument
        `f0=<integer>`, the fit method can be constrained to fit the data to
        a specific integer shape parameter.r  c                ,   < \         SV `  ! V.VO5/ VB # rO   )r@   rB   rD   rE   rF   r4   r  s   &&*,r5   rB   erlang_gen.fit  s     w{4/$/$//r7   r   )r   r   r   r   r   rd   rm   r  r	   r   rB   r   r   r  r   s   @@r5   r  r    s@     &CA } 5/ 0000 0r7   r  erlangc                   j   a  ] tR tRt o RtR tR tR tR tR t	RR	 lt
R
 tR tR tR tR tRtV tR# )gengamma_geni  aq  A generalized gamma continuous random variable.

%(before_notes)s

See Also
--------
gamma, invgamma, weibull_min

Notes
-----
The probability density function for `gengamma` is ([1]_):

.. math::

    f(x, a, c) = \frac{|c| x^{c a-1} \exp(-x^c)}{\Gamma(a)}

for :math:`x \ge 0`, :math:`a > 0`, and :math:`c \ne 0`.
:math:`\Gamma` is the gamma function (`scipy.special.gamma`).

`gengamma` takes :math:`a` and :math:`c` as shape parameters.

%(after_notes)s

References
----------
.. [1] E.W. Stacy, "A Generalization of the Gamma Distribution",
   Annals of Mathematical Statistics, Vol 33(3), pp. 1187--1192.

%(example)s

c                     V^ 8  V^ 8g  ,          # r  r   )rD   r   r\  s   &&&r5   rd   gengamma_gen._argcheck  s    A!q&!!r7   c                    \        R R^ \        P                  3R4      p\        RR\        P                  ) \        P                  3R4      pW.# r{  rj   r|  s   &  r5   rm   gengamma_gen._shape_info  @    UQK@UbffWbff$5~Fxr7   c                N    \         P                  ! V P                  WV4      4      # rO   r.  r  s   &&&&r5   ru   gengamma_gen._pdf      vvdll1+,,r7   c                t    \         P                  ! V^ 8g  V^ 8  ,          WV3R \        P                  ) R7      # )r   c                     \         P                  ! \        V4      4      \        P                  ! W,          ^,
          V 4      ,           W,          ,
          \        P
                  ! V4      ,
          # r_   )rQ   r  r	  r|   r  r  )rt   r\  r   s   &&&r5   r  &gengamma_gen._logpdf.<locals>.<lambda>#  s@    RVVCF^bhhqsQw.BB t$&(jjm4r7   r  rU  r  s   &&&&r5   r   gengamma_gen._logpdf   s7    !VAq	5w	  	 r7   c                    W,          p\         P                  ! W$4      p\         P                  ! W$4      p\        P                  ! V^ 8  WV4      # r  r|   rB  rF  rQ   r  rD   rt   r   r\  xcval1val2s   &&&&   r5   ry   gengamma_gen._cdf'  :    T{{1!||A"xxAt**r7   Nc                F    VP                  WR 7      pVRV,          ,          # )r  r   r  )rD   r   r\  r   r   rI  s   &&&&& r5   r   gengamma_gen._rvs-  s#    '''52a4yr7   c                    W,          p\         P                  ! W$4      p\         P                  ! W$4      p\        P                  ! V^ 8  We4      # r  r  r  s   &&&&   r5   r~   gengamma_gen._sf1  r  r7   c                    \         P                  ! W!4      p\         P                  ! W!4      p\        P                  ! V^ 8  WE4      RV,          ,          # r  r|   rK  rP  rQ   r  rD   r   r   r\  r  r  s   &&&&  r5   r   gengamma_gen._ppf7  <    ~~a#q$xxAt*SU33r7   c                    \         P                  ! W!4      p\         P                  ! W!4      p\        P                  ! V^ 8  WT4      RV,          ,          # r  r  r  s   &&&&  r5   r   gengamma_gen._isf<  r  r7   c                J    \         P                  ! W!R ,          V,          4      # r8  r  )rD   rc   r   r\  s   &&&&r5   r,  gengamma_gen._munpA  s    wwqC%'""r7   c                F    R  pR p\         P                  ! V^8  W3WC4      # )c                     \         P                  ! V 4      pV ^V,
          ,          W!,          ,           p\         P                  ! V 4      \        P                  ! \        V4      4      ,
          pW4,           pV# r_   )r|   r  r  rQ   r  r	  )r   r\  r  ABr  s   &&    r5   r  &gengamma_gen._entropy.<locals>.regularF  sM    &&)CQW'A

1s1v.AAHr7   c                    \         P                  4       \        P                  ! V 4      ^,          ,
          \        P                  ! \        P                  ! V4      4      ,
          V R,          ^,          ,           V R,          ^Z,          ,
          \        P                  ! V 4      V R,          ^,          ,
          V R,          ^,          ,
          V R,          ^x,          ,           V,          ,           # )r   r  r  r  r  )r/  r  rQ   r  r	  )r   r\  s   &&r5   
asymptotic)gengamma_gen._entropy.<locals>.asymptoticM  s    MMObffQik1ffRVVAY'(+,c61*5893{CvvayAsFA:-C;q#vslJAMN Or7   r=  )rD   r   r\  r  r  s   &&&  r5   r  gengamma_gen._entropyE  s(    		O qCx!EEr7   r   r.  )r   r   r   r   r   rd   rm   ru   r   ry   r   r~   r   r   r,  r  r   r   r   s   @r5   r  r    sH     >"
- ++4
4
#F Fr7   r  gengammac                   H   a  ] tR tRt o RtR tR tR tR tR t	R t
R	tV tR
# )genhalflogistic_geniY  au  A generalized half-logistic continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `genhalflogistic` is:

.. math::

    f(x, c) = \frac{2 (1 - c x)^{1/(c-1)}}{[1 + (1 - c x)^{1/c}]^2}

for :math:`0 \le x \le 1/c`, and :math:`c > 0`.

`genhalflogistic` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   genhalflogistic_gen._shape_infoo  r6  r7   c                ,    V P                   R V,          3# r8  r  r  s   &&r5   r    genhalflogistic_gen._get_supportr  s    vvs1u}r7   c                    R V,          p\         P                  ! ^W!,          ,
          4      pWC^,
          ,          pWT,          p^V,          ^V,           ^,          ,          # r8  rQ   r#  )rD   rt   r\  limitr  tmp0tmp2s   &&&    r5   ru   genhalflogistic_gen._pdfu  sJ     Ajj131W~xv4!##r7   c                    R V,          p\         P                  ! ^W!,          ,
          4      pWC,          pR V,
          ^V,           ,          # r8  r  )rD   rt   r\  r  r  r  s   &&&   r5   ry   genhalflogistic_gen._cdf~  s9    Ajj13|DQtV$$r7   c                h    R V,          ^R V,
          R V,           ,          V,          ,
          ,          # r8  r   rg  s   &&&r5   r   genhalflogistic_gen._ppf  s'    1ua#a%#a%1,,--r7   c                f    ^^V,          ^,           \         P                  ! ^4      ,          ,
          # rD  rc  r  s   &&r5   r  genhalflogistic_gen._entropy  s"    AaCE266!9$$$r7   r   N)r   r   r   r   r   rm   r   ru   ry   r   r  r   r   r   s   @r5   r  r  Y  s.     *E$%.% %r7   r  genhalflogisticc                      a a ] tR tRt oRtR tR tV 3R ltR tR t	R ]
R	 4       4       tR
 tR tRR ltR tRtVtV ;t# )genhyperbolic_geni  u	  A generalized hyperbolic continuous random variable.

%(before_notes)s

See Also
--------
t, norminvgauss, geninvgauss, laplace, cauchy

Notes
-----
The probability density function for `genhyperbolic` is:

.. math::

    f(x, p, a, b) =
        \frac{(a^2 - b^2)^{p/2}}
        {\sqrt{2\pi}a^{p-1/2}
        K_p\Big(\sqrt{a^2 - b^2}\Big)}
        e^{bx} \times \frac{K_{p - 1/2}
        (a \sqrt{1 + x^2})}
        {(\sqrt{1 + x^2})^{1/2 - p}}

for :math:`x, p \in ( - \infty; \infty)`,
:math:`|b| < a` if :math:`p \ge 0`,
:math:`|b| \le a` if :math:`p < 0`.
:math:`K_{p}(.)` denotes the modified Bessel function of the second
kind and order :math:`p` (`scipy.special.kv`)

`genhyperbolic` takes ``p`` as a tail parameter,
``a`` as a shape parameter,
``b`` as a skewness parameter.

%(after_notes)s

The original parameterization of the Generalized Hyperbolic Distribution
is found in [1]_ as follows

.. math::

    f(x, \lambda, \alpha, \beta, \delta, \mu) =
       \frac{(\gamma/\delta)^\lambda}{\sqrt{2\pi}K_\lambda(\delta \gamma)}
       e^{\beta (x - \mu)} \times \frac{K_{\lambda - 1/2}
       (\alpha \sqrt{\delta^2 + (x - \mu)^2})}
       {(\sqrt{\delta^2 + (x - \mu)^2} / \alpha)^{1/2 - \lambda}}

for :math:`x \in ( - \infty; \infty)`,
:math:`\gamma := \sqrt{\alpha^2 - \beta^2}`,
:math:`\lambda, \mu \in ( - \infty; \infty)`,
:math:`\delta \ge 0, |\beta| < \alpha` if :math:`\lambda \ge 0`,
:math:`\delta > 0, |\beta| \le \alpha` if :math:`\lambda < 0`.

The location-scale-based parameterization implemented in
SciPy is based on [2]_, where :math:`a = \alpha\delta`,
:math:`b = \beta\delta`, :math:`p = \lambda`,
:math:`scale=\delta` and :math:`loc=\mu`

Moments are implemented based on [3]_ and [4]_.

For the distributions that are a special case such as Student's t,
it is not recommended to rely on the implementation of genhyperbolic.
To avoid potential numerical problems and for performance reasons,
the methods of the specific distributions should be used.

References
----------
.. [1] O. Barndorff-Nielsen, "Hyperbolic Distributions and Distributions
   on Hyperbolae", Scandinavian Journal of Statistics, Vol. 5(3),
   pp. 151-157, 1978. https://www.jstor.org/stable/4615705

.. [2] Eberlein E., Prause K. (2002) The Generalized Hyperbolic Model:
    Financial Derivatives and Risk Measures. In: Geman H., Madan D.,
    Pliska S.R., Vorst T. (eds) Mathematical Finance - Bachelier
    Congress 2000. Springer Finance. Springer, Berlin, Heidelberg.
    :doi:`10.1007/978-3-662-12429-1_12`

.. [3] Scott, David J, Würtz, Diethelm, Dong, Christine and Tran,
   Thanh Tam, (2009), Moments of the generalized hyperbolic
   distribution, MPRA Paper, University Library of Munich, Germany,
   https://EconPapers.repec.org/RePEc:pra:mprapa:19081.

.. [4] E. Eberlein and E. A. von Hammerstein. Generalized hyperbolic
   and inverse Gaussian distributions: Limiting cases and approximation
   of processes. FDM Preprint 80, April 2003. University of Freiburg.
   https://freidok.uni-freiburg.de/fedora/objects/freidok:7974/datastreams/FILE1/content

%(example)s

c                    \         P                  ! \         P                  ! V4      V8  V^ 8  4      \         P                  ! \         P                  ! V4      V8*  V^ 8  4      ,          # r  )rQ   logical_andr	  )rD   rH  r   r   s   &&&&r5   rd   genhyperbolic_gen._argcheck  sH    rvvay1}a1f5..aQ78 	9r7   c                    \        R R\        P                  ) \        P                  3R4      p\        RR^ \        P                  3R4      p\        RR\        P                  ) \        P                  3R4      pWV.# )rH  Fr   r   r4  ri   rj   )rD   ipr  r  s   &   r5   rm   genhyperbolic_gen._shape_info  sb    UbffWbff$5~FUQK?UbffWbff$5~F|r7   c                &   < \         SV `  VRR7      # )rM   r  )rM   rM   r   ra  rb  s   &&r5   r  genhyperbolic_gen._fitstart  s     w K 88r7   c                @    \         P                  R  4       pV! WW44      # )c                 0    \         P                  ! WW#4      # rO   )r   genhyperbolic_logpdfrt   rH  r   r   s   &&&&r5   _logpdf_single1genhyperbolic_gen._logpdf.<locals>._logpdf_single  s    ..qQ::r7   rQ   	vectorize)rD   rt   rH  r   r   r  s   &&&&& r5   r   genhyperbolic_gen._logpdf  s)     
	; 
	; aA))r7   c                @    \         P                  R  4       pV! WW44      # )c                 0    \         P                  ! WW#4      # rO   )r   genhyperbolic_pdfr  s   &&&&r5   _pdf_single+genhyperbolic_gen._pdf.<locals>._pdf_single  s    ++A!77r7   r  )rD   rt   rH  r   r   r  s   &&&&& r5   ru   genhyperbolic_gen._pdf   s)     
	8 
	8 1&&r7   c                P    \         P                  ! V \         P                  .R 7      # )otypesrQ   r  float64)r  s   &r5   r  genhyperbolic_gen.<lambda>  s    ",,tRZZL9r7   c           	     8   \         P                  ! W#V.\        4      P                  P	                  \        P
                  4      p\        P                  ! \        RV4      p\         P                  ! W4,           W4,
          ,          4      pWG,          \        P                  ! V^,           V4      ,          \        P                  ! W'4      ,          pRp	^ p
Yu;8  d   V8  dJ   M MF\        P                  ! W`VWR7      ^ ,          \        P                  ! WhVWR7      ^ ,          ,           pM \        P                  ! W`VWR7      ^ ,          p\         P                  ! V4      '       d    Rp\        P                   ! V\"        ^R7       \%        R\'        RV4      4      # )z
Integrate the pdf of the genhyberbolic distribution from x0 to x1.
This is a private function used by _cdf() and _sf() only; either x0
will be -inf or x1 will be inf.
_genhyperbolic_pdfru  )epsrelepsabszdInfinite values encountered in scipy.special.kve. Values replaced by NaN to avoid incorrect results.r  r   r   )rQ   arrayr  ctypesdata_asc_void_pr   from_cythonr   r'  r|   kvr   quadisnanr  r  r  maxrR  )r|  r  rH  r   r   	user_datallcr  r&  r$  r%  intgrlrZ   s   &&&&&        r5   _integrate_pdf genhyperbolic_gen._integrate_pdf  s5    HHaAY.55==fooN	**63G+46GGQUQUO$sRUU1q5!_$ruuQ{2>r>  nnSd,2CCDF!s".4EEFHHF
 ^^CR+1BBCEF88FHCMM#~!<3C())r7   c                F    V P                  \        P                  ) WW44      # rO   r2  rQ   rk   rD   rt   rH  r   r   s   &&&&&r5   ry   genhyperbolic_gen._cdf.  s    ""BFF7A!77r7   c                F    V P                  V\        P                  W#V4      # rO   r5  r6  s   &&&&&r5   r~   genhyperbolic_gen._sf1  s    ""1bffaA66r7   c                x   \         P                  ! V^4      \         P                  ! V^4      ,
          p\         P                  ! VR4      p\         P                  ! VR4      p\        P                  VVVVVR7      p	\        P                  WER7      p
W9,          \         P
                  ! V	4      V
,          ,           # )r   r   )rH  r   r.   r   r   r'  r#  )rQ   float_powergeninvgaussr)  r/  r'  )rD   rH  r   r   r   r   r  r  r  gignormsts   &&&&&&     r5   r   genhyperbolic_gen._rvs4  s    
 ^^Aq!BNN1a$88^^B$^^B&oo%   t?w...r7   c                  a \         P                  ! WV4      w  rp\         P                  ! V^4      \         P                  ! V^4      ,
          p\         P                  ! VR4      p\         P                  ! ^^4      \         P                  ! VR4      ,          p\         P                  ! ^ ^^4      pVP	                  VP
                  RVP                  ,          ,           4      p\        P                  ! W,           V4      w  orxrV3R lWxW3 4       w  rrW5,          V,          pW[,          \         P                  ! V^4      \         P                  ! V^4      ,          V\         P                  ! V^4      ,
          ,          ,           p\         P                  ! V^4      \         P                  ! V^4      ,          V^V,          V,          \         P                  ! SR4      ,          ,
          ^\         P                  ! V^4      ,          ,           ,          ^V,          \         P                  ! V^4      ,          V\         P                  ! V^4      ,
          ,          ,           pV\         P                  ! VR4      ,          p\         P                  ! V^4      \         P                  ! V^4      ,          V^V	,          V,          \         P                  ! SR4      ,          ,
          ^V,          \         P                  ! V^4      ,          \         P                  ! SR4      ,          ,           ^\         P                  ! V^4      ,          ,
          ,          \         P                  ! V^4      \         P                  ! V^4      ,          ^V,          ^V,          V,          \         P                  ! SR4      ,          ,
          ^\         P                  ! V^4      ,          ,           ,          ,           ^\         P                  ! V^4      ,          V,          ,           pV\         P                  ! VR4      ,          ^,
          pVVVV3# )r   r   c              3   4   <"   T F  qS,          x  K  	  R # 5irO   r   ).0r   b0s   & r5   	<genexpr>+genhyperbolic_gen._stats.<locals>.<genexpr>U  s     ;*:Qb&&*:s   r  r_   r<  r_  rw  )	rQ   rE  r;  linspacer  shaper  r|   r+  )rD   rH  r   r   r  r  integersb1b2b3b4r1r2r3r4r  r  m3erj  m4erk  rC  s   &&&&                 @r5   r   genhyperbolic_gen._statsI  s    %%aA.a^^Aq!BNN1a$88^^B$^^Aq!BNN2s$;;;;q!Q'##HNNTAFF]$BCUU1<4BB;22*:;FRKGbnnQ*R^^B-BB"..Q'') ) 	

 NN1a 2>>"a#88!b&2+r2 666A&&'( EBNN2q))"..Q'')) 	 "..G,,NN1a 2>>"a#88!b&2+r3 777VbnnR++bnnR.EEFA&&'( NN1a 2>>"a#88Vb2glR^^B%<<<A&&'(	( r1%%*+ 	 "..B''!+!Qzr7   r   r.  )r   r   r   r   r   rd   rm   r  r   ru   staticmethodr2  ry   r~   r   r   r   r   r  r   s   @@r5   r  r    s[     Wr99
*' :*  :*@87/*' 'r7   r  genhyperbolicc                   T   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tRtV tR# )gompertz_geniv  aE  A Gompertz (or truncated Gumbel) continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `gompertz` is:

.. math::

    f(x, c) = c \exp(x) \exp(-c (e^x-1))

for :math:`x \ge 0`, :math:`c > 0`.

`gompertz` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   gompertz_gen._shape_info  r6  r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  r`  s   &&&r5   ru   gompertz_gen._pdf  r  r7   c                    \         P                  ! V4      V,           V\        P                  ! V4      ,          ,
          # rO   r  r`  s   &&&r5   r   gompertz_gen._logpdf  s%    vvay1}q288A;..r7   c                h    \         P                  ! V) \         P                  ! V4      ,          4      ) # rO   r=  r`  s   &&&r5   ry   gompertz_gen._cdf  s#    !bhhqk)***r7   c                t    \         P                  ! RV,          \         P                  ! V) 4      ,          4      # r  r_  rg  s   &&&r5   r   gompertz_gen._ppf  s$    xxq288QB</00r7   c                f    \         P                  ! V) \        P                  ! V4      ,          4      # rO   r  r`  s   &&&r5   r~   gompertz_gen._sf  s     vvqb288A;&''r7   c                f    \         P                  ! \        P                  ! V4      ) V,          4      # rO   r  rD   rH  r\  s   &&&r5   r   gompertz_gen._isf  s    xx
1%%r7   c                    R \         P                  ! V4      ,
          \        P                  P	                  V4      V,          ,
          # r8  )rQ   r  r|   _ufuncs_scaled_exp1r  s   &&r5   r  gompertz_gen._entropy  s-    RVVAY!8!8!;A!===r7   r   Nr   r   r   r   r   rm   ru   r   ry   r   r~   r   r  r   r   r   s   @r5   rW  rW  v  s8     *E*/+1(&> >r7   rW  gompertzc                     \         P                  ! V 4      p \         P                  ! V4      pVP                  4       p\         P                  ! W,
          4      p\         P                  ! WR 7      # ))weights)rQ   r#  r.  r   average)rt   
logweightsmaxlogwrn  s   &&  r5   _average_with_log_weightsrr    sI    


1AJ'JnnGffZ)*G::a))r7   c                      a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR t]]! ]4      R 4       4       tRtV tR# )gumbel_r_geni  a  A right-skewed Gumbel continuous random variable.

%(before_notes)s

See Also
--------
gumbel_l, gompertz, genextreme

Notes
-----
The probability density function for `gumbel_r` is:

.. math::

    f(x) = \exp(-(x + e^{-x}))

for real :math:`x`.

The Gumbel distribution is sometimes referred to as a type I Fisher-Tippett
distribution.  It is also related to the extreme value distribution,
log-Weibull and Gompertz distributions.

%(after_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   gumbel_r_gen._shape_info  r   r7   c                L    \         P                  ! V P                  V4      4      # rO   r.  r   s   &&r5   ru   gumbel_r_gen._pdf      vvdll1o&&r7   c                @    V) \         P                  ! V) 4      ,
          # rO   r7  r   s   &&r5   r   gumbel_r_gen._logpdf  s    rBFFA2Jr7   c                Z    \         P                  ! \         P                  ! V) 4      ) 4      # rO   r7  r   s   &&r5   ry   gumbel_r_gen._cdf  s    vvrvvqbzk""r7   c                2    \         P                  ! V) 4      ) # rO   r7  r   s   &&r5   r  gumbel_r_gen._logcdf  s    r
{r7   c                Z    \         P                  ! \         P                  ! V4      ) 4      ) # rO   rc  r   s   &&r5   r   gumbel_r_gen._ppf  s    q	z"""r7   c                \    \         P                  ! \        P                  ! V) 4      ) 4      ) # rO   r  r   s   &&r5   r~   gumbel_r_gen._sf  s     "&&!*%%%r7   c                \    \         P                  ! \         P                  ! V) 4      ) 4      ) # rO   rQ   r  r  r  s   &&r5   r   gumbel_r_gen._isf  s     !}%%%r7   c                    \         \        P                  \        P                  ,          R ,          ^\        P                  ! ^4      ,          \        P                  ^,          ,          \        ,          R3# )rJ  rc  r#   rQ   r  r'  r$   rl   s   &r5   r   gumbel_r_gen._stats  s?    ruuRUU{32771:beeQh(>(GOOr7   c                    \         R ,           # r8  r  rl   s   &r5   r  gumbel_r_gen._entropy  s    {r7   c                  aaa \        V SW#4      w  orEV3R  lpVe   TpV! V4      oSV3# Ve   VoVV3R loMV3R loVP                  R^4      pV^,          V^,          rV3R lpV! W4      '       g1   V	^ 8  g   V
\        P                  8  d   V	^,          p	V
^,          p
K>  \        P
                  ! SW3RRR7      pVP                  pVe   TMV! V4      oSV3# )c                    < V ) \         P                  ! S) V ,          4      \        P                  ! \	        S4      4      ,
          ,          # rO   )r|   r  rQ   r  r  )r.   rE   s   &r5   get_loc_from_scale,gumbel_r_gen.fit.<locals>.get_loc_from_scale  s1    6R\\4%%-8266#d);LLMMr7   c                    < SS,
          \         P                  ! SS,
          V ,          4      ,          S,           p\        S4      SV ,           ,          pVP                  4       V,
          # rO   )rQ   r   r  r  )r.   term1term2rE   r-   s   &  r5   r  gumbel_r_gen.fit.<locals>.func  sK     4Z2663:2F+GG$NEIu5E 99;..r7   c                 n   < S) V ,          p\        SVR 7      pSP                  4       V,
          V ,
          # ))rp  )rr  r&  )r.   sdatawavgrE   s   &  r5   r  r    s0    !EEME4TeLD99;-55r7   r.   c                 v   < \         P                  ! S! V 4      4      \         P                  ! S! V4      4      8g  # rO   rP   )rS   rT   r  s   &&r5   rU   0gumbel_r_gen.fit.<locals>.interval_contains_root"  s-    V-V-. /r7   rO  )rQ  rtolrx  )rR  r<   rQ   rk   r   r*   rS  )rD   rE   rF   r4   r  r  r  r.   brack_startrS   rT   rU   resr  r-   s   &f*,         @@r5   rB   gumbel_r_gen.fit  s     9t9=Ed	N  E$U+C\ EzU /6 ((7A.K(1_kAoF
/ .f==
frvvo!!&&tf5E,1?CHHE*$0B50ICEzr7   r   N)r   r   r   r   r   rm   ru   r   ry   r  r   r~   r   r   r  rK   r   r   rB   r   r   r   s   @r5   rt  rt    s`     6'##&&P M*@ + @r7   rt  gumbel_rc                      a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR t]]! ]4      R 4       4       tRtV tR# )gumbel_l_geni5  a  A left-skewed Gumbel continuous random variable.

%(before_notes)s

See Also
--------
gumbel_r, gompertz, genextreme

Notes
-----
The probability density function for `gumbel_l` is:

.. math::

    f(x) = \exp(x - e^x)

for real :math:`x`.

The Gumbel distribution is sometimes referred to as a type I Fisher-Tippett
distribution.  It is also related to the extreme value distribution,
log-Weibull and Gompertz distributions.

%(after_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   gumbel_l_gen._shape_infoR  r   r7   c                L    \         P                  ! V P                  V4      4      # rO   r.  r   s   &&r5   ru   gumbel_l_gen._pdfU  ry  r7   c                <    V\         P                  ! V4      ,
          # rO   r7  r   s   &&r5   r   gumbel_l_gen._logpdfY  r  r7   c                Z    \         P                  ! \        P                  ! V4      ) 4      ) # rO   r  r   s   &&r5   ry   gumbel_l_gen._cdf\  s    "&&)$$$r7   c                Z    \         P                  ! \        P                  ! V) 4      ) 4      # rO   rQ   r  r|   r  r   s   &&r5   r   gumbel_l_gen._ppf_  s    vvrxx|m$$r7   c                0    \         P                  ! V4      ) # rO   r7  r   s   &&r5   r
  gumbel_l_gen._logsfb  rH  r7   c                X    \         P                  ! \         P                  ! V4      ) 4      # rO   r7  r   s   &&r5   r~   gumbel_l_gen._sfe      vvrvvayj!!r7   c                X    \         P                  ! \         P                  ! V4      ) 4      # rO   rc  r   s   &&r5   r   gumbel_l_gen._isfh  r  r7   c                    \         ) \        P                  \        P                  ,          R ,          R\        P                  ! ^4      ,          \        P                  ^,          ,          \        ,          R3# )rJ  rc  r  rl   s   &r5   r   gumbel_l_gen._statsk  sF    wbeeC2771:~beeQh&/8 	8r7   c                    \         R ,           # r8  r  rl   s   &r5   r  gumbel_l_gen._entropyo  s    {r7   c                    VP                  R 4      e   VR ,          ) VR &   \        P                  ! \        P                  ! V4      ) .VO5/ VB w  rEV) V3# )r  )r<   r  rB   rQ   r#  )rD   rE   rF   r4   loc_rscale_rs   &&*,  r5   rB   gumbel_l_gen.fitr  sT     88F' L=DL",,

4(8'8H4H4Hvwr7   r   N)r   r   r   r   r   rm   ru   r   ry   r   r
  r~   r   r   r  rK   r   r   rB   r   r   r   s   @r5   r  r  5  s]     8'%%""8 M* + r7   r  gumbel_lc                      a a ] tR tRt oRtR tR tR tR tR t	R t
R	 tR
 tR t]]! ]4      V 3R l4       4       tRtVtV ;t# )halfcauchy_geni  zA Half-Cauchy continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `halfcauchy` is:

.. math::

    f(x) = \frac{2}{\pi (1 + x^2)}

for :math:`x \ge 0`.

%(after_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   halfcauchy_gen._shape_info  r   r7   c                X    R \         P                  ,          RW,          ,           ,          # r  r`  r   s   &&r5   ru   halfcauchy_gen._pdf  s    255y#ac'""r7   c                    \         P                  ! R \         P                  ,          4      \        P                  ! W,          4      ,
          # rr  rQ   r  r  r|   r  r   s   &&r5   r   halfcauchy_gen._logpdf  s(    vvc"%%i 288AC=00r7   c                f    R \         P                  ,          \         P                  ! V4      ,          # rr  r  r   s   &&r5   ry   halfcauchy_gen._cdf  s    255y1%%r7   c                f    \         P                  ! \         P                  ^,          V,          4      # rD  rQ   tanr  r   s   &&r5   r   halfcauchy_gen._ppf  s    vvbeeAgai  r7   c                h    R \         P                  ,          \         P                  ! ^V4      ,          # rr  )rQ   r  r  r   s   &&r5   r~   halfcauchy_gen._sf  s     255y2::a+++r7   c                t    R \         P                  ! \         P                  V,          ^,          4      ,          # r8  r  r  s   &&r5   r   halfcauchy_gen._isf  s"    266"%%'!)$$$r7   c                ~    \         P                  \         P                  \         P                  \         P                  3# rO   rE  rl   s   &r5   r   halfcauchy_gen._stats  r  r7   c                X    \         P                  ! ^\         P                  ,          4      # rD  r  rl   s   &r5   r  halfcauchy_gen._entropy  r  r7   c                *  < VP                  R R4      '       d   \        S
V `  ! V.VO5/ VB # \        WW#4      w  rp\        P
                  ! V4      pVe&   Wd8  d   \        RV\        P                  R7      hTpMTpR pVe   Tp	Wy3# V! Wq4      p	Wy3# )rE  F
halfcauchyr  c                   aa W,
          pVP                   o\        P                  ! V4      oVV3R  lp\        P                  ! R4      P                  R,          p\        W4\        P                  ! V4      3R7      pVP                  # )c                 z   < V ^,          S,           p^\         P                  ! SV,          4      ,          S,
          # rD  rQ   r  )r.   denominatorrc   shifted_data_squareds   & r5   fun_to_solve<halfcauchy_gen.fit.<locals>.find_scale.<locals>.fun_to_solve  s1    #Qh)==266"6{"BCCaGGr7   r   r   rQ  )r   rQ   squarefinfotinyr*   r.  rS  )r-   rE   shifted_datar  smallr  rc   r  s   &&    @@r5   
find_scale&halfcauchy_gen.fit.<locals>.find_scale  sc    :L		A#%99\#: H HHSM&&+ElBFF<<P4QRC88Or7   r2   r@   rB   rR  rQ   rR  r  rk   )rD   rE   rF   r4   r  r  rS  r-   r  r.   r  s   &&*,      r5   rB   halfcauchy_gen.fit  s     88J&&7;t3d3d3389=EF 66$<"<t266JJC C	 E z s)Ezr7   r   )r   r   r   r   r   rm   ru   r   ry   r   r~   r   r   r  rK   r   r   rB   r   r   r  r   s   @@r5   r  r    s]     &#1&!,%. M*% + % %r7   r  r  c                      a a ] tR tRt oRtR tR tR tR tR t	R t
R	 tR
 tR t]]! ]4      V 3R l4       4       tRtVtV ;t# )halflogistic_geni  a  A half-logistic continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `halflogistic` is:

.. math::

    f(x) = \frac{ 2 e^{-x} }{ (1+e^{-x})^2 }
         = \frac{1}{2} \text{sech}(x/2)^2

for :math:`x \ge 0`.

%(after_notes)s

References
----------
.. [1] Asgharzadeh et al (2011). "Comparisons of Methods of Estimation for the
       Half-Logistic Distribution". Selcuk J. Appl. Math. 93-108.

%(example)s

c                    . # rO   r   rl   s   &r5   rm   halflogistic_gen._shape_info  r   r7   c                L    \         P                  ! V P                  V4      4      # rO   r.  r   s   &&r5   ru   halflogistic_gen._pdf   s     vvdll1o&&r7   c                    \         P                  ! ^4      V,
          R\        P                  ! \         P                  ! V) 4      4      ,          ,
          # r   )rQ   r  r|   r  r   r   s   &&r5   r   halflogistic_gen._logpdf  s1    vvay1}rBHHRVVQBZ$8888r7   c                <    \         P                  ! VR ,          4      # rr  )rQ   tanhr   s   &&r5   ry   halflogistic_gen._cdf  s    wwqu~r7   c                <    ^\         P                  ! V4      ,          # rD  rQ   arctanhr   s   &&r5   r   halflogistic_gen._ppf  s    Ar7   c                >    ^\         P                  ! V) 4      ,          # rD  r|   expitr   s   &&r5   r~   halflogistic_gen._sf  s    288QB<r7   c                >    \         P                  ! VR 8  VR R 4      # )r   c                 >    \         P                  ! R V ,          4      ) # r  r|   logitr   s   &r5   r  'halflogistic_gen._isf.<locals>.<lambda>  s    "((37*;);r7   c                 J    ^\         P                  ! ^V ,
          4      ,          # rD  r  r   s   &r5   r  r    s    2::a!e+<)<r7   r=  r   s   &&r5   r   halflogistic_gen._isf  s!    q3w;<> 	>r7   c                    V^ 8X  d   ^# V^8X  d   ^\         P                  ! ^4      ,          # V^8X  d-   \         P                  \         P                  ,          R,          # V^8X  d   ^	\        ,          # V^8X  d&   ^\         P                  ^,          ,          R,          # ^^\	        R^V,
          4      ,
          ,          \
        P                  ! V^,           4      ,          \
        P                  ! V^4      ,          # )r   r  r  r   )rQ   r  r  r$   r  r|   r(  r  rb   s   &&r5   r,  halflogistic_gen._munp  s    66RVVAY;655;s?"6V8O6RUUAX:$$!CQqSM/"288AaC=0A>>r7   c                <    ^\         P                  ! ^4      ,
          # rD  rc  rl   s   &r5   r  halflogistic_gen._entropy#  re  r7   c                $  < VP                  R R4      '       d   \        S
V `  ! V.VO5/ VB # \        WW#4      w  rpR p\        P
                  ! V4      pVe&   Wt8  d   \        RV\        P                  R7      hTpMTpVe   TMV! W4      p	W3# )rE  Fc                    V P                   ^ ,          p\        P                  ! V ^ R7      p\        P                  ! ^V^,           4      V^,           ,          p^V,
          p^V,           pVRV,          V,          \        P                  ! We,          4      ,          ,
          pRV,          V,          pW1,
          p^\        P
                  ! VR,          VR,          ,          4      ,          p	^\        P
                  ! VR,          VR,          ^,          ,          4      ,          p
V	\        P                  ! V	^,          ^V,          V
,          ,           4      ,           ^V,          ,          pRp^pVP                  4       pW8  dh   V\        P                  ! V) V,          4      ,          pV^V,          VP                  4       ,          ,
          p\        VV,
          V,          4      pTpKm  V# )r   rO  r   rM   NNr  )rG  rQ   sortr  r  r  r'  r&  r|   r  r	  )rE   r-   n_observationssorted_datarH  r   pp1rK  r  r  Cr.   r  relative_residualshifted_meansum_term	scale_news   &&               r5   r  (halflogistic_gen.fit.<locals>.find_scale/  sv    "ZZ]N''$Q/K		!^a/0.12DEAAAa%Ca#sw77E7S=D%+KBFF59{2677ABFF48k"oq&8899A"''!Q$^);a)?"?@@.(*E D !&++-L $*&;,u2D)EE(1^+;hlln+LL	$'):E(A$B!!Lr7   halflogisticr  r  )rD   rE   rF   r4   r  r  r  rS  r-   r.   r  s   &&*,      r5   rB   halflogistic_gen.fit&  s     88J&&7;t3d3d3389=EF	D 66$<">RVVLLC C !,*T2Gzr7   r   )r   r   r   r   r   rm   ru   r   ry   r   r~   r   r,  r  rK   r   r   rB   r   r   r  r   s   @@r5   r  r    s]     2'
9 >
? M*6 + 6 6r7   r  r  c                      a a ] tR tRt oRtR tRR ltR tR tR t	R t
R	 tR
 tR tR t]]! ]4      V 3R l4       4       tRtVtV ;t# )halfnorm_genid  a  A half-normal continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `halfnorm` is:

.. math::

    f(x) = \sqrt{2/\pi} \exp(-x^2 / 2)

for :math:`x >= 0`.

`halfnorm` is a special case of `chi` with ``df=1``.

%(after_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   halfnorm_gen._shape_infoz  r   r7   c                8    \        VP                  VR 7      4      # r  r  r   s   &&&r5   r   halfnorm_gen._rvs}  s    <//T/:;;r7   c                    \         P                  ! R \         P                  ,          4      \         P                  ! V) V,          R ,          4      ,          # rr  rQ   r'  r  r   r   s   &&r5   ru   halfnorm_gen._pdf  s1    wws255y!"&&!Ac"222r7   c                    R \         P                  ! R\         P                  ,          4      ,          W,          R,          ,
          # r   r   r  r   s   &&r5   r   halfnorm_gen._logpdf  s)    RVVCI&&S00r7   c                d    \         P                  ! V\        P                  ! ^4      ,          4      # rD  r|   r  rQ   r'  r   s   &&r5   ry   halfnorm_gen._cdf  s    vva"''!*n%%r7   c                4    \        ^V,           R,          4      # ro  r   r   s   &&r5   r   halfnorm_gen._ppf  s    !A#s##r7   c                &    ^\        V4      ,          # rD  r  r   s   &&r5   r~   halfnorm_gen._sf  s    8A;r7   c                &    \        V^,          4      # rD  r  r  s   &&r5   r   halfnorm_gen._isf  s    1~r7   c                   \         P                  ! R \         P                  ,          4      ^R \         P                  ,          ,
          \         P                  ! ^4      ^\         P                  ,
          ,          \         P                  ^,
          R,          ,          ^\         P                  ^,
          ,          \         P                  ^,
          ^,          ,          3# )r   rS  rQ   r'  r  rl   s   &r5   r   halfnorm_gen._stats  sx    BEE	"#bee)
AbeeG$beeAg^32557RUU1WqL(* 	*r7   c                t    R \         P                  ! \         P                  R,          4      ,          R ,           # r  r  rl   s   &r5   r  halfnorm_gen._entropy  s#    266"%%)$$S((r7   c                T  < VP                  R R4      '       d   \        S	V `  ! V.VO5/ VB # \        WW#4      w  rp\        P
                  ! V4      pVe&   Wd8  d   \        RV\        P                  R7      hTpMTpVe   TpWx3# \        P                  ! V^VR7      R,          pWx3# )rE  Fhalfnormr  )ordercenterr   )
r2   r@   rB   rR  rQ   rR  r  rk   rF  moment)
rD   rE   rF   r4   r  r  rS  r-   r.   r  s
   &&*,     r5   rB   halfnorm_gen.fit  s     88J&&7;t3d3d3389=EF 66$<":THHCCE z LLQs;S@Ezr7   r   r.  )r   r   r   r   r   rm   r   ru   r   ry   r   r~   r   r   r  rK   r   r   rB   r   r   r  r   s   @@r5   r  r  d  sb     *<31&$*) M* +  r7   r  r.  c                   T   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tRtV tR# )hypsecant_geni  zA hyperbolic secant continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `hypsecant` is:

.. math::

    f(x) = \frac{1}{\pi} \text{sech}(x)

for a real number :math:`x`.

%(after_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   hypsecant_gen._shape_info  r   r7   c                f    R \         P                  \         P                  ! V4      ,          ,          # r8  )rQ   r  coshr   s   &&r5   ru   hypsecant_gen._pdf  s    BEE"''!*$%%r7   c                    R \         P                  ,          \         P                  ! \         P                  ! V4      4      ,          # rr  rQ   r  r  r   r   s   &&r5   ry   hypsecant_gen._cdf  s&    255y266!9---r7   c                    \         P                  ! \         P                  ! \         P                  V,          R ,          4      4      # rr  rQ   r  r  r  r   s   &&r5   r   hypsecant_gen._ppf  s&    vvbffRUU1WS[)**r7   c                    R \         P                  ,          \         P                  ! \         P                  ! V) 4      4      ,          # rr  r;  r   s   &&r5   r~   hypsecant_gen._sf  s(    255y2661":...r7   c                    \         P                  ! \         P                  ! \         P                  V,          R ,          4      4      ) # rr  r>  r   s   &&r5   r   hypsecant_gen._isf  s)    rvvbeeAgck*+++r7   c                b    ^ \         P                  \         P                  ,          ^,          ^ ^3# r  r`  rl   s   &r5   r   hypsecant_gen._stats  s!    "%%+a-A%%r7   c                X    \         P                  ! ^\         P                  ,          4      # rD  r  rl   s   &r5   r  hypsecant_gen._entropy  r  r7   r   N)r   r   r   r   r   rm   ru   ry   r   r~   r   r   r  r   r   r   s   @r5   r4  r4    s7     &&.+/,& r7   r4  	hypsecantc                   <   a  ] tR tRt o RtR tR tR tR tRt	V t
R# )	gausshyper_geni  a  A Gauss hypergeometric continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `gausshyper` is:

.. math::

    f(x, a, b, c, z) = C x^{a-1} (1-x)^{b-1} (1+zx)^{-c}

for :math:`0 \le x \le 1`, :math:`a,b > 0`, :math:`c` a real number,
:math:`z > -1`, and :math:`C = \frac{1}{B(a, b) F[2, 1](c, a; a+b; -z)}`.
:math:`F[2, 1]` is the Gauss hypergeometric function
`scipy.special.hyp2f1`.

`gausshyper` takes :math:`a`, :math:`b`, :math:`c` and :math:`z` as shape
parameters.

%(after_notes)s

References
----------
.. [1] Armero, C., and M. J. Bayarri. "Prior Assessments for Prediction in
       Queues." *Journal of the Royal Statistical Society*. Series D (The
       Statistician) 43, no. 1 (1994): 139-53. doi:10.2307/2348939

%(example)s

c                F    V^ 8  V^ 8  ,          W38H  ,          VR8  ,          # )r   r  r   )rD   r   r   r\  r  s   &&&&&r5   rd   gausshyper_gen._argcheck  s%    A!a% AF+q2v66r7   c                   \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      p\        RR\        P                  ) \        P                  3R4      p\        RRR\        P                  3R4      pWW4.# )r   Fr   r\  r  r4  r  rj   )rD   r  r  ry  izs   &    r5   rm   gausshyper_gen._shape_info  st    UQK@UQK@UbffWbff$5~FURL.Ar7   c                   \         P                  ! W#4      \         P                  ! WBW#,           V) 4      ,          pR V,          WR ,
          ,          ,          R V,
          VR ,
          ,          ,          R WQ,          ,           V,          ,          # r8  r|   r  hyp2f1)rD   rt   r   r   r\  r  normalization_constants   &&&&&& r5   ru   gausshyper_gen._pdf  sc    !#11K!K))ABK726QW:MM9q.! 	"r7   c                (   \         P                  ! W,           V4      \         P                  ! W#4      ,          p\         P                  ! WBV,           W#,           V,           V) 4      p\         P                  ! WBW#,           V) 4      pWg,          V,          # rO   rQ  )	rD   rc   r   r   r\  r  r  rK  r  s	   &&&&&&   r5   r,  gausshyper_gen._munp  s`    ggac1o-iiQ3Ar*iiacA2&w}r7   r   N)r   r   r   r   r   rd   rm   ru   r,  r   r   r   s   @r5   rJ  rJ    s$     @7 "
 r7   rJ  
gausshyperc                   v   a  ] tR tRt o Rt]P                  tR tR t	R t
R tR tR tR	 tRR
 ltR tRtV tR# )invgamma_geni&  a  An inverted gamma continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `invgamma` is:

.. math::

    f(x, a) = \frac{x^{-a-1}}{\Gamma(a)} \exp(-\frac{1}{x})

for :math:`x >= 0`, :math:`a > 0`. :math:`\Gamma` is the gamma function
(`scipy.special.gamma`).

`invgamma` takes ``a`` as a shape parameter for :math:`a`.

`invgamma` is a special case of `gengamma` with ``c=-1``, and it is a
different parameterization of the scaled inverse chi-squared distribution.
Specifically, if the scaled inverse chi-squared distribution is
parameterized with degrees of freedom :math:`\nu` and scaling parameter
:math:`\tau^2`, then it can be modeled using `invgamma` with
``a=`` :math:`\nu/2` and ``scale=`` :math:`\nu \tau^2/2`.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r3  rj   rl   s   &r5   rm   invgamma_gen._shape_infoF  r6  r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  r9  s   &&&r5   ru   invgamma_gen._pdfI  r  r7   c                    V^,           ) \         P                  ! V4      ,          \        P                  ! V4      ,
          RV,          ,
          # r&  rQ   r  r|   r  r9  s   &&&r5   r   invgamma_gen._logpdfM  s1    1vq	!BJJqM1CE99r7   c                >    \         P                  ! VR V,          4      # r8  rE  r9  s   &&&r5   ry   invgamma_gen._cdfP  s    ||AsQw''r7   c                <    R \         P                  ! W!4      ,          # r8  r  rA  s   &&&r5   r   invgamma_gen._ppfS  s    R__Q***r7   c                >    \         P                  ! VR V,          4      # r8  rA  r9  s   &&&r5   r~   invgamma_gen._sfV  s    {{1cAg&&r7   c                <    R \         P                  ! W!4      ,          # r8  r~  rA  s   &&&r5   r   invgamma_gen._isfY  s    R^^A)))r7   c                   \         P                  ! V^8  VR \        P                  R7      p\         P                  ! V^8  VR \        P                  R7      pRRreRV9   d-   \         P                  ! V^8  VR \        P                  R7      pRV9   d-   \         P                  ! V^8  VR \        P                  R7      pW4WV3# )	rM   c                 "    R V R ,
          ,          # r8  r   r   s   &r5   r  %invgamma_gen._stats.<locals>.<lambda>^  s    rQV}r7   r  c                 L    R V R ,
          ^,          ,          V R,
          ,          # r   r   r   r   s   &r5   r  rk  a  s    rQVaK'71r6'Br7   Nrj  c                 f    R \         P                  ! V R,
          4      ,          V R,
          ,          # )r  r   r  r  r   s   &r5   r  rk  g  s    2B+?1r6+Jr7   rk  c                 h    R RV ,          R,
          ,          V R,
          ,          V R,
          ,          # )rJ  r  g      &@r  r  r   r   s   &r5   r  rk  k  s$    2a#+>!b&+IQQSV+Tr7   r  )rD   r   rl  r  r  r{  r|  s   &&&    r5   r   invgamma_gen._stats\  s    __QUA4(*0 __QUAB(*0 tB'>Q!J,.FF4B '>Q!T,.FF4B r~r7   c                H    R  pR p\         P                  ! V^8  WV4      pV# )c                     W R ,           \         P                  ! V 4      ,          ,
          \         P                  ! V 4      ,           pV# r8  r  r   r  s   & r5   r  &invgamma_gen._entropy.<locals>.regularq  s-    Wq	))BJJqM9AHr7   c                    ^^\         P                  ! V 4      ,          ,
          \         P                  ! ^4      ,           \         P                  ! \         P                  4      ,           ^,          RV R,          ,          ,           V R,          ^,          ,           V R,          ^Z,          ,
          V R,          ^x,          ,
          pV# )rM   UUUUUU?r  r  r  r  r  rs  s   & r5   r  )invgamma_gen._entropy.<locals>.asymptoticu  s     aq	k/BFF1I-ruu=q@q#v: !3r	*,-sF2I6893s
CAHr7   r=  )rD   r   r  r  r  s   &&   r5   r  invgamma_gen._entropyp  s)    		 OOAHaW=r7   r   Nmvsk)r   r   r   r   r   r   rI  rJ  rm   ru   r   ry   r   r~   r   r   r  r   r   r   s   @r5   rY  rY  &  sJ     : "44ME*:(+'*( r7   rY  invgammac                      a a ] tR tRt oRt]P                  tR tRR lt	R t
R tR tR tR	 tR
 tV 3R ltV 3R ltR t]! ]4      V 3R l4       tR tRtVtV ;t# )invgauss_geni  a  An inverse Gaussian continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `invgauss` is:

.. math::

    f(x; \mu) = \frac{1}{\sqrt{2 \pi x^3}}
                \exp\left(-\frac{(x-\mu)^2}{2 \mu^2 x}\right)

for :math:`x \ge 0` and :math:`\mu > 0`.

`invgauss` takes ``mu`` as a shape parameter for :math:`\mu`.

%(after_notes)s

A common shape-scale parameterization of the inverse Gaussian distribution
has density

.. math::

    f(x; \nu, \lambda) = \sqrt{\frac{\lambda}{2 \pi x^3}}
                \exp\left( -\frac{\lambda(x-\nu)^2}{2 \nu^2 x}\right)

Using ``nu`` for :math:`\nu` and ``lam`` for :math:`\lambda`, this
parameterization is equivalent to the one above with ``mu = nu/lam``,
``loc = 0``, and ``scale = lam``.

This distribution uses routines from the Boost Math C++ library for
the computation of the ``ppf`` and ``isf`` methods. [1]_

References
----------
.. [1] The Boost Developers. "Boost C++ Libraries". https://www.boost.org/.

%(example)s

c                @    \        R R^ \        P                  3R4      .# ry  Fr4  rj   rl   s   &r5   rm   invgauss_gen._shape_info  r5  r7   c                *    VP                  VR VR7      # r   r  waldrD   ry  r   r   s   &&&&r5   r   invgauss_gen._rvs  s      St 44r7   c                
   R \         P                  ! ^\         P                  ,          VR,          ,          4      ,          \         P                  ! R^V,          ,          W,          ^,
          ^,          ,          4      ,          # )r   r  r  r  rD   rt   ry  s   &&&r5   ru   invgauss_gen._pdf  sM     2771RUU71c6>**266$!*adQh]2J+KKKr7   c                    R\         P                  ! ^\         P                  ,          4      ,          R\         P                  ! V4      ,          ,
          W,          ^,
          ^,          ^V,          ,          ,
          # )r   rS  r#  r  r  s   &&&r5   r   invgauss_gen._logpdf  sF    BFF1RUU7O#c"&&)m3qtax!mQqS6IIIr7   c                D   ^\         P                  ! V4      ,          p\        W1V,          ^,
          ,          4      p^V,          \        V) W,          ^,           ,          4      ,           pV\         P                  ! \         P                  ! WT,
          4      4      ,           # r_   )rQ   r'  r   r  r   rD   rt   ry  r  r   r   s   &&&   r5   r  invgauss_gen._logcdf  sf    "''!*n"q)*F\3$!$("344288BFF15M***r7   c                F   ^\         P                  ! V4      ,          p\        W1V,          ^,
          ,          4      p^V,          \        V) W,          ^,           ,          4      ,           pV\         P                  ! \         P
                  ! WT,
          4      ) 4      ,           # r_   )rQ   r'  r   r   r  r   r  s   &&&   r5   r
  invgauss_gen._logsf  sh    "''!*ntax()F\3$!$("344288RVVAE]N+++r7   c                L    \         P                  ! V P                  W4      4      # rO   r  r  s   &&&r5   r~   invgauss_gen._sf  s    vvdkk!())r7   c                L    \         P                  ! V P                  W4      4      # rO   r  r  s   &&&r5   ry   invgauss_gen._cdf      vvdll1)**r7   c           	       < \         P                  ! R R R R7      ;_uu_ 4        \         P                  ! W4      w  r\         P                  ! \        P
                  ! W^4      4      pVR8  p\        P                  ! ^W,          ,
          W$,          ^4      W4&   \         P                  ! V4      p\        SV `%  W,          W%,          4      W5&   RRR4       V#   + '       g   i     X# ; irl  )rn  r  r  r   N)
rQ   ro  rE  r#  rq   _invgauss_ppf_invgauss_isfr-  r@   r   )rD   rt   ry  ppfi_wti_nanr  s   &&&   r5   r   invgauss_gen._ppf  s    [[xJJ''.EA**S..qa89Cs7D))!AG)RXqACIHHSMEah	:CJ K 
 KJ 
s   B*CC(	c                  < \         P                  ! R R R R7      ;_uu_ 4        \         P                  ! W4      w  r\        P                  ! W^4      pVR8  p\        P
                  ! ^W,          ,
          W$,          ^4      W4&   \         P                  ! V4      p\        SV `!  W,          W%,          4      W5&   RRR4       V#   + '       g   i     X# ; ir  )	rQ   ro  rE  rq   r  r  r-  r@   r   )rD   rt   ry  isfr  r  r  s   &&&   r5   r   invgauss_gen._isf  s    [[xJJ''.EA##A1-Cs7D))!AG)RXqACIHHSMEah	:CJ K 
 KJ 
s   BCC	c                ^    WR ,          ^\         P                  ! V4      ,          ^V,          3# )r  r  )rD   ry  s   &&r5   r   invgauss_gen._stats  s#    s7AbggbkM2b500r7   c                ~  < VP                  R R4      p\        V\        4      '       g,   \        V \        4      '       g   VP	                  4       R8X  d   \
        S	V `  ! V.VO5/ VB # \        WW#4      w  rrg Ve   Ve   \
        S	V `  ! V.VO5/ VB # \        P                  ! W,
          ^ 8  4      '       d   \        R^ \        P                  R7      hW,
          p\        P                  ! V4      pVf<   \        V4      \        P                  ! VR,          VR,          ,
          4      ,          pW,          pWVV3# )r0   r:   r;   invgaussr  r  )r<   r>   r)   wald_genr=   r@   rB   rR  rQ   r  r  rk   r&  r  r  )
rD   rE   rF   r4   r0   fshape_sr  r  fshape_nr  s
   &&*,     r5   rB   invgauss_gen.fit  s
   (E*t\**jx.H.H<<>T)7;t3d3d33'B4CG(O$	 <8/7;t3d3d33VVDK!O$$z"&&AA;Dwwt}H~TbffTRZ(b.-H&IJ(Hv%%r7   c                6   R\         P                  ! ^\         P                  ,          4      ,           ^\         P                  ! V4      ,          ,           p^V,          p\        P                  P                  V4      V,          pRV,          RV,          ,
          # )zF
Ref.: https://moser-isi.ethz.ch/docs/papers/smos-2012-10.pdf (eq. 9)
r   r   rS  )rQ   r  r  r|   rh  ri  )rD   ry  r   rI  r   s   &&   r5   r  invgauss_gen._entropy  sg     BEE	""Q^3 bDJJ##A&q(Qwq  r7   r   r.  )r   r   r   r   r   r   rI  rJ  rm   r   ru   r   r  r
  r~   ry   r   r   r   r   rB   r  r   r   r  r   s   @@r5   r}  r}    sv     (R "44MF5L
J+,*+1 M*& +&B! !r7   r}  r  c                   d   a  ] tR tRt o RtR tR tR tR tR t	R t
RR
 ltR tR tR tRtV tR	# )geninvgauss_geni  a  A Generalized Inverse Gaussian continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `geninvgauss` is:

.. math::

    f(x, p, b) = x^{p-1} \exp(-b (x + 1/x) / 2) / (2 K_p(b))

where ``x > 0``, `p` is a real number and ``b > 0``\([1]_).
:math:`K_p` is the modified Bessel function of second kind of order `p`
(`scipy.special.kv`).

%(after_notes)s

The inverse Gaussian distribution `stats.invgauss(mu)` is a special case of
`geninvgauss` with ``p = -1/2``, ``b = 1 / mu`` and ``scale = mu``.

Generating random variates is challenging for this distribution. The
implementation is based on [2]_.

References
----------
.. [1] O. Barndorff-Nielsen, P. Blaesild, C. Halgreen, "First hitting time
   models for the generalized inverse gaussian distribution",
   Stochastic Processes and their Applications 7, pp. 49--54, 1978.

.. [2] W. Hoermann and J. Leydold, "Generating generalized inverse Gaussian
   random variates", Statistics and Computing, 24(4), p. 547--557, 2014.

%(example)s

c                    W8H  V^ 8  ,          # r  r   rD   rH  r   s   &&&r5   rd   geninvgauss_gen._argcheckB  s    1q5!!r7   c                    \        R R\        P                  ) \        P                  3R4      p\        RR^ \        P                  3R4      pW.# )rH  Fr   r4  rj   )rD   r	  r  s   &  r5   rm   geninvgauss_gen._shape_infoE  @    UbffWbff$5~FUQK@xr7   c                    R  p\         P                  ! V\         P                  .R7      pV! WV4      p\         P                  ! V4      P	                  4       '       d    Rp\
        P                  ! V\        ^R7       V# )c                 0    \         P                  ! WV4      # rO   )r   geninvgauss_logpdfrt   rH  r   s   &&&r5   logpdf_single.geninvgauss_gen._logpdf.<locals>.logpdf_singleN  s    ,,Q155r7   r  zjInfinite values encountered in scipy.special.kve(p, b). Values replaced by NaN to avoid incorrect results.r  )rQ   r  r   r-  r  r  r  r  )rD   rt   rH  r   r  r  rZ   s   &&&&   r5   r   geninvgauss_gen._logpdfJ  s]    	6 ]BJJ<H!"88A;??HCMM#~!<r7   c                N    \         P                  ! V P                  WV4      4      # rO   r.  rD   rt   rH  r   s   &&&&r5   ru   geninvgauss_gen._pdfZ  r0  r7   c                   a V P                  W#4      w  opV3R  lp\        P                  ! V\        P                  .R7      pV! WV4      # )c                    < \         P                  ! W.\        4      P                  P	                  \        P
                  4      p\        P                  ! \        R V4      p\        P                  ! VSV 4      ^ ,          # )_geninvgauss_pdf)rQ   r&  r  r'  r(  r)  r   r*  r   r   r,  )rt   rH  r   r/  r0  r   s   &&&  r5   _cdf_single)geninvgauss_gen._cdf.<locals>._cdf_singlea  s\    !/66>>vOI"..v7I/8:C >>#r1-a00r7   r  )r   rQ   r  r   )rD   rt   rH  r   r  r  r   s   &&&&  @r5   ry   geninvgauss_gen._cdf^  sA    ""1(B	1 ll;

|D1##r7   c                `    \         P                  ! V^ 8  WV3R \        P                  ) R7      # )r   c                     V^,
          \         P                  ! V 4      ,          W ^V ,          ,           ,          ^,          ,
          # r_   rc  r  s   &&&r5   r  .geninvgauss_gen._logquasipdf.<locals>.<lambda>o  s(    Arvvay/@1!A#g;q=/Pr7   r  rU  r  s   &&&&r5   _logquasipdfgeninvgauss_gen._logquasipdfl  s+    q1uqQiP+-66'3 	3r7   Nc                  a	a
 \         P                  ! V4      '       d1   \         P                  ! V4      '       d   V P                  WW44      pEMVP                  ^8X  dC   VP                  ^8X  d2   V P                  VP	                  4       VP	                  4       W44      pEM8\         P
                  ! W4      w  r\        VP                  V4      w  po	\        \         P                  ! V4      4      p\         P                  ! V4      p\         P                  ! W.R.R.R..R7      o
S
P                  '       g   \        ;QJ d,    . V	V
3R l\        \        V4      ) ^ 4       4       F  NK  	  5M%! V	V
3R l\        \        V4      ) ^ 4       4       4      pV P                  S
^ ,          S
^,          VV4      P!                  V4      WX&   S
P#                  4        K  VR8X  d   VP	                  4       pV# )rM   multi_indexreadonlyflagsop_flagsc              3   ~   <"   T F2  pSV,          '       g   SP                   V,          M
\        R 4      x  K4  	  R # 5irO   r  slicerB  r  bcits   & r5   rD  'geninvgauss_gen._rvs.<locals>.<genexpr>  2      ;%9 79eeR^^A.tL%9   =&=r   )rQ   rG  _rvs_scalarr   r  rE  r   rG  r+  rQ  emptynditerfinishedtuplerR  r  r  iternext)rD   rH  r   r   r   rJ  shp
numsamplesidxr  r  s   &&&&&    @@r5   r   geninvgauss_gen._rvsr  sv    ;;q>>bkk!nn""1<CVVq[QVVq[""1668QVVXtJC &&q,DA #177D1GC RWWS\*J ((4.CA6"/&0\J<$@BB kkk e ;%*CI:q%9;ee ;%*CI:q%9; ;++BqE2a5*,8::A'#, 2:((*C
r7   c           	       a aaa3 R pV'       g   ^pS^ 8  d   S) oRpS P                  SS4      pRpS^8  g   S^8  d   RpM?S\        R^\        P                  ! ^S,
          4      ,          ^,          4      8  d   R pMR p\	        \        P
                  ! V4      4      p	\        P                  ! V	4      p
\        P                  ! V
4      p^ pV'       Ed   X'       Ed$   RS^,           ,          S,          V,
          p^V,          S^,
          ,          S,          ^,
          pW^,          ^,          ,
          p^V^,          ,          ^,          W,          ^,          ,
          V,           p\        P                  ! V) \        P                  ! RV^,          ,          4      ,          ^,          4      p\        P                  ! RV,          ^,          4      ) pV\        P                  ! V^,          \        P                  ^,          ,           4      ,          V^,          ,
          pV) \        P                  ! V^,          4      ,          V^,          ,
          pS P                  VSS4      o3S P                  VSS4      S3,
          pS P                  VSS4      S3,
          pVV,
          \        P                  ! RV,          4      ,          pVV,
          \        P                  ! RV,          4      ,          p^pVV3VV 3R lpTpM\        P                  ! RS P                  VSS4      ,          4      p^S,           \        P                  ! ^S,           ^,          S^,          ,           4      ,           S,          p^ pV\        P                  ! RS P                  VSS4      ,          4      ,          p^ pVVV 3R lpVV8  d   \        R4      hV^ 8:  d   \        R4      h^pW8  d   W,
          pVVP                  VR7      ,          pVP                  VR7      p VVV,
          V ,          ,           p V V,          V,           p!^\        P                  ! V4      ,          V! V!4      8*  p"\        P                   ! V"4      p#V#^ 8  d   V!V",          WVV#,           % VV#,          pV^ 8X  d'   VV
,          R8  d   R	VV
,           R
2p$\#        V$4      hV^,          pK  EMS^S,
          ,          p%\        P$                  ! V%^S,          34      p&\        P                  ! S P                  VSS4      4      p'V'V%,          p(V%^S,          8  dx   \        P                  ! S) 4      p)S^ 8  d.   V)^S,          S,          V%S,          ,
          ,          S,          p*M0V)\        P                  ! ^S^,          ,          4      ,          p*M^ ^ p*p)V&S^,
          ,          p+^V+,          \        P                  ! V&) S,          ^,          4      ,          S,          p,V(V*,           V,,           p-W8  Ed   W,
          p\        P                  ! V4      \        P                  ! V4      p!p.VP                  VR7      pV-VP                  VR7      ,          p V V(8*  p/\        P&                  ! V/4      V V(V*,           8*  ,          p0\        P&                  ! V/V0,          4      p1V%V V/,          ,          V(,          V!V/&   V'V.V/&   S^ 8  d?   V%S,          V V0,          V(,
          S,          V),          ,           ^S,          ,          V!V0&   MIS\        P                  ! V V0,          V(,
          \        P                  ! S4      ,          4      ,          V!V0&   V)V!V0,          S^,
          ,          ,          V.V0&   \        P                  ! V&) S,          ^,          4      SV V1,          V(,
          V*,
          ,          ^V+,          ,          ,
          p2RS,          \        P                  ! V24      ,          V!V1&   V+\        P                  ! V!V1,          ) S,          ^,          4      ,          V.V1&   \        P                  ! VV.,          4      S P                  V!SS4      8*  p"\!        V"4      p#V#^ 8  g   EKv  V!V",          WVV#,           % VV#,          pEK  \        P(                  ! W4      p!V'       d
   ^V!,          p!V!# )FTr   c                 8   < SP                  V SS4      S,
          # rO   r  )rt   r   lmrH  rD   s   &r5   logqpdf,geninvgauss_gen._rvs_scalar.<locals>.logqpdf  s    ,,Q15::r7   c                 *   < SP                  V SS4      # rO   r  )rt   r   rH  rD   s   &r5   r  r    s    ,,Q155r7   zvmin must be smaller than vmax.zumax must be positive.r  iP  z2Not a single random variate could be generated in zH attempts. Sampling does not appear to work for the provided parameters.r<  ir`  )_moderR  rQ   r'  r  
atleast_1drQ  zerosarccosrQ  r  r  r   r"  r  r  r  rz  r.  logical_notr  )4rD   rH  r   r  r   
invert_resr  
ratio_unif
mode_shiftsize1dNrt   	simulateda2a1p1q1phir  root1root2d1d2vminvmaxumaxr  r\  xplusrS  rk  r  r  r)  accept
num_acceptrZ   r|  xsk1A1k2A2k3A3r  r  cond1cond2cond3r  r  s4   fff&&                                              @r5   r  geninvgauss_gen._rvs_scalar  s    
Jq5AJJJq! 
6QUJ#c1rwwq1u~-122J J r}}Z01GGFOHHQK	:z1q5\A%)Ua!e_q(1,a%!)^QY^bgk1A5iibggcBEk&: :Q >?ggb2gk**RVVC!Gbeeai$78826AbffS1Wo-Q6 &&q!Q/&&ua3b8&&ua3b8 	RVVC"H%55	RVVC"H%55; ;  vvc$"3"3Aq!"<<=a%277AEA:1+<#==q@rvvcD,=,=eQ,J&JKK6 t| !BCCqy !9::A-M<//Q/77 ((a(0D4K1,,!eaiBFF1I+5VVF^
><?KAZ!79+IN1!!"1 &??C 's++Q'  , a!eBQU$B))!Q23BbBAEzVVQBZq5AzBE12Q6BbffQAX..BABa!eBR"&&"q1--1BR"A -M!bhhqk3 ((a(0,,!,44Ru-b2g>uu}5!E(]R/E
%q5"$a%1U8b=A*=*B"Ba!e!LCJ!"RVVQuX]bffQi,G%H!HCJE
QU 33%FFB37Q;'!qx"}r/A*Ba"f*MM!VbffQi/E
E
{Q': ;;%&&Q-4+<+<S!Q+GG [
><?KAZ!79+Ijj#c'C
r7   c                ,   V^8  dH   V\         P                  ! V^,
          ^,          V^,          ,           4      ^,           V,
          ,          # \         P                  ! ^V,
          ^,          V^,          ,           4      ^V,
          ,
          V,          # r_   r  r  s   &&&r5   r  geninvgauss_gen._modeB  sf    q5Q
QT 12Q6:;;GGQUQJA-.!a%8A==r7   c                   \         P                  ! W!,           V4      p\         P                  ! W#4      p\        P                  ! V4      \        P                  ! V4      ,          pVP	                  4       '       dq   R p\
        P                  ! V\        ^R7       \        P                  ! V\        P                  \        P                  R7      pWF( ,          WV( ,          ,          W( &   V# WE,          pV# )zInfinite values encountered in the moment calculation involving scipy.special.kve. Values replaced by NaN to avoid incorrect results.r  dtype)r|   kverQ   rW   r  r  r  r  	full_likerF  r   )	rD   rc   rH  r   rK  denominf_valsrZ   r  s	   &&&&     r5   r,  geninvgauss_gen._munpI  s    ffQUAq88C=288E?2<<>>.C MM#~!<S"&&

;Ay>E),<<AiL  Ar7   r   r.  )r   r   r   r   r   rd   rm   r   ru   ry   r  r   r  r  r,  r   r   r   s   @r5   r  r    sE     #H"
 -$35nWr> r7   r  r<  c                   |   a a ] tR tRt oRt]P                  tR tR t	V 3R lt
R tR tR tRR	 ltR
 tRtVtV ;t# )norminvgauss_geni\  a  A Normal Inverse Gaussian continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `norminvgauss` is:

.. math::

    f(x, a, b) = \frac{a \, K_1(a \sqrt{1 + x^2})}{\pi \sqrt{1 + x^2}} \,
                 \exp(\sqrt{a^2 - b^2} + b x)

where :math:`x` is a real number, the parameter :math:`a` is the tail
heaviness and :math:`b` is the asymmetry parameter satisfying
:math:`a > 0` and :math:`|b| <= a`.
:math:`K_1` is the modified Bessel function of second kind
(`scipy.special.k1`).

%(after_notes)s

A normal inverse Gaussian random variable `Y` with parameters `a` and `b`
can be expressed as a normal mean-variance mixture:
``Y = b * V + sqrt(V) * X`` where `X` is ``norm(0,1)`` and `V` is
``invgauss(mu=1/sqrt(a**2 - b**2))``. This representation is used
to generate random variates.

Another common parametrization of the distribution (see Equation 2.1 in
[2]_) is given by the following expression of the pdf:

.. math::

    g(x, \alpha, \beta, \delta, \mu) =
    \frac{\alpha\delta K_1\left(\alpha\sqrt{\delta^2 + (x - \mu)^2}\right)}
    {\pi \sqrt{\delta^2 + (x - \mu)^2}} \,
    e^{\delta \sqrt{\alpha^2 - \beta^2} + \beta (x - \mu)}

In SciPy, this corresponds to
:math:`a=\alpha \delta, b=\beta \delta, \text{loc}=\mu, \text{scale}=\delta`.

References
----------
.. [1] O. Barndorff-Nielsen, "Hyperbolic Distributions and Distributions on
       Hyperbolae", Scandinavian Journal of Statistics, Vol. 5(3),
       pp. 151-157, 1978.

.. [2] O. Barndorff-Nielsen, "Normal Inverse Gaussian Distributions and
       Stochastic Volatility Modelling", Scandinavian Journal of
       Statistics, Vol. 24, pp. 1-13, 1997.

%(example)s

c                H    V^ 8  \         P                  ! V4      V8  ,          # r  )rQ   absoluterD   r   r   s   &&&r5   rd   norminvgauss_gen._argcheck  s    A"++a.1,--r7   c                    \        R R^ \        P                  3R4      p\        RR\        P                  ) \        P                  3R4      pW.# r  rj   r  s   &  r5   rm   norminvgauss_gen._shape_info  r  r7   c                &   < \         SV `  VRR7      # )rM   r  rM   r   ra  rb  s   &&r5   r  norminvgauss_gen._fitstart  s     w H 55r7   c                r   \         P                  ! V^,          V^,          ,
          4      pV\         P                  ,          p\         P                  ! ^V4      pV\        P
                  ! W&,          4      ,          \         P                  ! W1,          W&,          ,
          V,           4      ,          V,          # rD  )rQ   r'  r  hypotr|   k1er   )rD   rt   r   r   r(  fac1sqs   &&&&   r5   ru   norminvgauss_gen._pdf  sm    1q!t$255yXXa^bffQVn$rvvacADj5.@'AABFFr7   c           
        \         P                  ! V4      '       d;   \        P                  ! V P                  V\         P
                  W#3R 7      ^ ,          # \         P                  ! V4      p\         P                  ! V4      p. p\        WV4       FO  w  rVpVP                  \        P                  ! V P                  V\         P
                  Wg3R 7      ^ ,          4       KQ  	  \         P                  ! V4      # r  )
rQ   rG  r   r,  ru   rk   r  r  appendr&  )rD   rt   r   r   resultr|  a0rC  s   &&&&    r5   r~   norminvgauss_gen._sf  s    ;;q>>>>$))QaVDQGGa Aa AF #A!innTYYBFF35(<<=? @ !- 88F##r7   c                   a  V 3R  lp\         P                  ! V4      '       d
   V! WV4      # . p\        WV4       F  w  rgpVP                  V! WgV4      4       K   	  \         P                  ! V4      # )c                 h  < V
3R  lpS
P                  W4      pV! WAW 4      pV^ 8X  d   V# V^ 8  d/   ^pTpWF,           pV! WW 4      ^ 8  d   ^V,          pWF,           pK!  M-^pTpWF,
          pV! WqW 4      ^ 8  d   ^V,          pWF,
          pK!  \        P                  ! W7WW 3S
P                  R7      p	V	# )c                 6   < SP                  WV4      V,
          # rO   r~   )rt   r   r   r   rD   s   &&&&r5   eq6norminvgauss_gen._isf.<locals>._isf_scalar.<locals>.eq  s    xxa(1,,r7   )rF   rx  )r&  r   r  rx  )r   r   r   r2	  xmemdeltaleftrightr+	  rD   s   &&&       r5   _isf_scalar*norminvgauss_gen._isf.<locals>._isf_scalar  s    - 1BB1BQw	Av
1(1,eGEJE -
 z!'!+eGE:D__Ruq9*.))5FMr7   )rQ   rG  r  r*	  r&  )	rD   r   r   r   r9	  r+	  q0r,	  rC  s	   f&&&     r5   r   norminvgauss_gen._isf  s`    	B ;;q>>qQ''F #A!k""56 !-88F##r7   c                   \         P                  ! V^,          V^,          ,
          4      p\        P                  ^V,          W4R7      pW&,          \         P                  ! V4      \        P                  VVR7      ,          ,           # )r   )ry  r   r   r'  )rQ   r'  r  r)  r/  )rD   r   r   r   r   r(  igs   &&&&&  r5   r   norminvgauss_gen._rvs  sk     1q!t$\\QuW4\KvdhhD<H '/ 'J J J 	Jr7   c                Z   \         P                  ! V^,          V^,          ,
          4      pW#,          pV^,          V^,          ,          pRV,          V\         P                  ! V4      ,          ,          pR^^V^,          ,          V^,          ,          ,           ,          V,          pWEWg3# )r   r  r  )rD   r   r   r(  r&  varianceskewnesskurtosiss   &&&     r5   r   norminvgauss_gen._stats  s~    1q!t$ya4%(?7a"''%.01!a!Q$hAo-.6x11r7   r   r.  )r   r   r   r   r   r   rI  rJ  rd   rm   r  ru   r~   r   r   r   r   r   r  r   s   @@r5   r	  r	  \  sH     4j "44M.
6
G$($TJ2 2r7   r	  norminvgaussc                      a a ] tR tRt oRt]P                  tR tR t	R t
R tR tR tR	 tR
 tRV 3R lltRtVtV ;t# )invweibull_geni  uD  An inverted Weibull continuous random variable.

This distribution is also known as the Fréchet distribution or the
type II extreme value distribution.

%(before_notes)s

Notes
-----
The probability density function for `invweibull` is:

.. math::

    f(x, c) = c x^{-c-1} \exp(-x^{-c})

for :math:`x > 0`, :math:`c > 0`.

`invweibull` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

References
----------
F.R.S. de Gusmao, E.M.M Ortega and G.M. Cordeiro, "The generalized inverse
Weibull distribution", Stat. Papers, vol. 52, pp. 591-619, 2011.

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   invweibull_gen._shape_info  r6  r7   c                    \         P                  ! W) R ,
          4      p\         P                  ! W) 4      p\         P                  ! V) 4      pW#,          V,          # r8  rQ   rU  r   )rD   rt   r\  xc1xc2s   &&&  r5   ru   invweibull_gen._pdf  s@    hhq"s(#hhq"offcTlw}r7   c                ^    \         P                  ! W) 4      p\         P                  ! V) 4      # rO   rK	  )rD   rt   r\  rL	  s   &&& r5   ry   invweibull_gen._cdf  s!    hhq"ovvsd|r7   c                @    \         P                  ! W) ,          ) 4      ) # rO   )rQ   rf  r`  s   &&&r5   r~   invweibull_gen._sf   s    !R%   r7   c                h    \         P                  ! \         P                  ! V4      ) RV,          4      # r  )rQ   rU  r  rg  s   &&&r5   r   invweibull_gen._ppf#  s!    xx
DF++r7   c                N    \         P                  ! V) 4      ) RV,          ,          # r  r  re  s   &&&r5   r   invweibull_gen._isf&  s    1"A&&r7   c                H    \         P                  ! ^W,          ,
          4      # r_   r'  r  s   &&&r5   r,  invweibull_gen._munp)  s    xxAE	""r7   c                v    ^\         ,           \         V,          ,           \        P                  ! V4      ,
          # r_   rA  r  s   &&r5   r  invweibull_gen._entropy,  s"    x&1*$rvvay00r7   c                4   < Vf   RMTp\         SV `  WR7      # )Nr  rr  ra  rD   rE   rF   r  s   &&&r5   r  invweibull_gen._fitstart/  s!    v4w  11r7   r   rO   )r   r   r   r   r   r   rI  rJ  rm   ru   ry   r~   r   r   r,  r  r  r   r   r  r   s   @@r5   rG	  rG	    sJ     : "44ME!,'#12 2r7   rG	  
invweibullc                   R   a  ] tR tRt o RtR tR tRR ltR tR t	R	 t
R
 tRtV tR# )jf_skew_t_geni8  a   Jones and Faddy skew-t distribution.

%(before_notes)s

Notes
-----
The probability density function for `jf_skew_t` is:

.. math::

    f(x; a, b) = C_{a,b}^{-1}
                \left(1+\frac{x}{\left(a+b+x^2\right)^{1/2}}\right)^{a+1/2}
                \left(1-\frac{x}{\left(a+b+x^2\right)^{1/2}}\right)^{b+1/2}

for real numbers :math:`a>0` and :math:`b>0`, where
:math:`C_{a,b} = 2^{a+b-1}B(a,b)(a+b)^{1/2}`, and :math:`B` denotes the
beta function (`scipy.special.beta`).

When :math:`a<b`, the distribution is negatively skewed, and when
:math:`a>b`, the distribution is positively skewed. If :math:`a=b`, then
we recover the `t` distribution with :math:`2a` degrees of freedom.

`jf_skew_t` takes :math:`a` and :math:`b` as shape parameters.

%(after_notes)s

References
----------
.. [1] M.C. Jones and M.J. Faddy. "A skew extension of the t distribution,
       with applications" *Journal of the Royal Statistical Society*.
       Series B (Statistical Methodology) 65, no. 1 (2003): 159-174.
       :doi:`10.1111/1467-9868.00378`

%(example)s

c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      pW.# r  rj   r  s   &  r5   rm   jf_skew_t_gen._shape_info]  r  r7   c                   ^W#,           ^,
          ,          \         P                  ! W#4      ,          \        P                  ! W#,           4      ,          p^V\        P                  ! W#,           V^,          ,           4      ,          ,           VR,           ,          p^V\        P                  ! W#,           V^,          ,           4      ,          ,
          VR,           ,          pWV,          V,          # rI  )r|   r  rQ   r'  )rD   rt   r   r   r\  r  r  s   &&&&   r5   ru   jf_skew_t_gen._pdfb  s    !%!)rwwq},rwwqu~=!bggaea1fn---1s7;!bggaea1fn---1s7;w{r7   Nc                    VP                  WV4      p^V,          ^,
          \        P                  ! W,           4      ,          p^\        P                  ! V^V,
          ,          4      ,          pWg,          # rD  )r  rQ   r'  )rD   r   r   r   r   r  r  d3s   &&&&&   r5   r   jf_skew_t_gen._rvsh  sR    qT*"fqjBGGAEN*q2v''wr7   c                    ^V\         P                  ! W#,           V^,          ,           4      ,          ,           R,          p\        P                  ! W#V4      # r 	  )rQ   r'  r|   r  rD   rt   r   r   rv  s   &&&& r5   ry   jf_skew_t_gen._cdfn  s:    RWWQUQ!V^,,,3zz!""r7   c                    ^V\         P                  ! W#,           V^,          ,           4      ,          ,           R,          p\        P                  ! W#V4      # r 	  )rQ   r'  r|   r  ri	  s   &&&& r5   r~   jf_skew_t_gen._sfr  s:    RWWQUQ!V^,,,3{{1##r7   c                    \         P                  WV4      p^V,          ^,
          \        P                  ! W#,           4      ,          p^\        P                  ! V^V,
          ,          4      ,          pWV,          # rD  )r  r  rQ   r'  )rD   r   r   r   r  r  rf	  s   &&&&   r5   r   jf_skew_t_gen._ppfv  sP    XXaA"fqjBGGAEN*q2v''wr7   c           	         R pVRV,          8  VRV,          8  ,          V^ 8  ,          p\         P                  ! VWV3\        P                  ! V\        P                  .R7      \        P
                  R7      # )zReturns the n-th moment(s) where all the following hold:

- n >= 0
- a > n / 2
- b > n / 2

The result is np.nan in all other cases.
c                   W,           RV ,          ,          p^V ,          \         P                  ! W4      ,          p\        P                  ! V ^,           4      p\        P                  ! V^,          ^ 8  R^4      p\         P                  ! VRV ,          ,           V,
          VRV ,          ,
          V,           4      p\         P
                  ! W4      V,          V,          pW4,          VP                  4       ,          # )zOComputes E[T^(n_k)] where T is skew-t distributed with
parameters a_k and b_k.
r   r  )r|   r  rQ   r  r  r  r  )	n_ka_kb_krK  r	  indicesr  r  	sum_termss	   &&&      r5   
nth_moment'jf_skew_t_gen._munp.<locals>.nth_moment  s     9#),CHrwws00Eiia(G((7Q;?B2CcCi'13s?W3LMA-3a7I;00r7   r   r  r  r  r  rQ   r  r   rF  )rD   rc   r   r   rv	  nth_moment_valids   &&&&  r5   r,  jf_skew_t_gen._munp|  sc    	1 aKAaK8AFC1ILLRZZL9vv	
 	
r7   r   r.  )r   r   r   r   r   rm   ru   r   ry   r~   r   r,  r   r   r   s   @r5   r`	  r`	  8  s3     #H
#$
 
r7   r`	  	jf_skew_tc                   f   a  ] tR tRt o Rt]P                  tR tR t	R t
R tR tR tR	 tR
tV tR# )johnsonsb_geni  a  A Johnson SB continuous random variable.

%(before_notes)s

See Also
--------
johnsonsu

Notes
-----
The probability density function for `johnsonsb` is:

.. math::

    f(x, a, b) = \frac{b}{x(1-x)}  \phi(a + b \log \frac{x}{1-x} )

where :math:`x`, :math:`a`, and :math:`b` are real scalars; :math:`b > 0`
and :math:`x \in [0,1]`.  :math:`\phi` is the pdf of the normal
distribution.

`johnsonsb` takes :math:`a` and :math:`b` as shape parameters.

%(after_notes)s

%(example)s

c                    V^ 8  W8H  ,          # r  r   r	  s   &&&r5   rd   johnsonsb_gen._argcheck      A!&!!r7   c                    \        R R\        P                  ) \        P                  3R4      p\        RR^ \        P                  3R4      pW.# r  rj   r  s   &  r5   rm   johnsonsb_gen._shape_info  r  r7   c                    \        W#\        P                  ! V4      ,          ,           4      pVR ,          V^V,
          ,          ,          V,          # r8  )r   r|   r  )rD   rt   r   r   trms   &&&& r5   ru   johnsonsb_gen._pdf  s6    bhhqkM)*ua1gs""r7   c                Z    \        W#\        P                  ! V4      ,          ,           4      # rO   )r   r|   r  r  s   &&&&r5   ry   johnsonsb_gen._cdf  s    rxx{]*++r7   c                j    \         P                  ! R V,          \        V4      V,
          ,          4      # r8  )r|   r  r   r  s   &&&&r5   r   johnsonsb_gen._ppf  #    xxa9Q<!#3455r7   c                Z    \        W#\        P                  ! V4      ,          ,           4      # rO   )r   r|   r  r  s   &&&&r5   r~   johnsonsb_gen._sf  s    bhhqkM)**r7   c                j    \         P                  ! R V,          \        V4      V,
          ,          4      # r8  )r|   r  r   r  s   &&&&r5   r   johnsonsb_gen._isf  r	  r7   r   N)r   r   r   r   r   r   rI  rJ  rd   rm   ru   ry   r   r~   r   r   r   r   s   @r5   r}	  r}	    s?     6 "44M"
#
,6+6 6r7   r}	  	johnsonsbc                   X   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tRR
 ltRtV tR# )johnsonsu_geni  a  A Johnson SU continuous random variable.

%(before_notes)s

See Also
--------
johnsonsb

Notes
-----
The probability density function for `johnsonsu` is:

.. math::

    f(x, a, b) = \frac{b}{\sqrt{x^2 + 1}}
                 \phi(a + b \log(x + \sqrt{x^2 + 1}))

where :math:`x`, :math:`a`, and :math:`b` are real scalars; :math:`b > 0`.
:math:`\phi` is the pdf of the normal distribution.

`johnsonsu` takes :math:`a` and :math:`b` as shape parameters.

The first four central moments are calculated according to the formulas
in [1]_.

%(after_notes)s

References
----------
.. [1] Taylor Enterprises. "Johnson Family of Distributions".
   https://variation.com/wp-content/distribution_analyzer_help/hs126.htm

%(example)s

c                    V^ 8  W8H  ,          # r  r   r	  s   &&&r5   rd   johnsonsu_gen._argcheck  r	  r7   c                    \        R R\        P                  ) \        P                  3R4      p\        RR^ \        P                  3R4      pW.# r  rj   r  s   &  r5   rm   johnsonsu_gen._shape_info  r  r7   c                    W,          p\        W#\        P                  ! V4      ,          ,           4      pVR ,          \        P                  ! VR ,           4      ,          V,          # r8  )r   rQ   arcsinhr'  )rD   rt   r   r   r  r	  s   &&&&  r5   ru   johnsonsu_gen._pdf  sE     S

1--.uRWWRV_$S((r7   c                Z    \        W#\        P                  ! V4      ,          ,           4      # rO   )r   rQ   r	  r  s   &&&&r5   ry   johnsonsu_gen._cdf  s    A..//r7   c                \    \         P                  ! \        V4      V,
          V,          4      # rO   )rQ   sinhr   r  s   &&&&r5   r   johnsonsu_gen._ppf      ww	!q(A-..r7   c                Z    \        W#\        P                  ! V4      ,          ,           4      # rO   )r   rQ   r	  r  s   &&&&r5   r~   johnsonsu_gen._sf  s    

1--..r7   c                \    \         P                  ! \        V4      V,
          V,          4      # rO   )rQ   r	  r   r  s   &&&&r5   r   johnsonsu_gen._isf  r	  r7   c                \   Rw  rErgVR,          p\         P                  ! V4      p	W,          p
RV9   d&   V	R,          ) \         P                  ! V
4      ,          pRV9   dN   R\        P                  ! V4      ,          V	\         P
                  ! ^V
,          4      ,          ^,           ,          pRV9   d   V	R,          \        P                  ! V4      R,          ,          p^\         P                  ! V
4      ,          pW^,           ,          \         P                  ! ^V
,          4      ,          p\         P                  ! ^4      ^V	\         P
                  ! ^V
,          4      ,          ,           R,          ,          pV) W,           ,          V,          pRV9   Ed   ^^V	,          ,           p^V	^,          ,          V	^,           ,          \         P
                  ! ^V
,          4      ,          pV	^,          \         P
                  ! ^V
,          4      ,          pR	^V	^,          ,          ,           ^V	^,          ,          ,           V	^,          ,           p^^V	\         P
                  ! ^V
,          4      ,          ,           ^,          ,          pW,           W,          ,           V,          ^,
          pWEWg3# )
Nr  r   r  rj  rk  r  r  rS  r_  )rQ   r   r	  r|   rf  r8  r'  )rD   r   r   rl  ry  rz  r{  r|  bn2expbn2a_br  r  r  r	  r  s   &&&&            r5   r   johnsonsu_gen._stats  s    1fe'>#+,B'>bhhsm#VBGGAcEN%:Q%>?C'>bhhsmS00B2773<BA:&37BGGAJ!frwwqu~&="=!EEE5(B'>QvXB619
+bggaen<BRWWQsU^+Ba	k!AfaiK/&!);Bq6"''!C%.00144E'BE/U*Q.Br7   r   Nrq  )r   r   r   r   r   rd   rm   ru   ry   r   r~   r   r   r   r   r   s   @r5   r	  r	    s8     "F"
)0/// r7   r	  	johnsonsuc                   n   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tRR ltRR ltRtV tR# )
landau_geni:  a  A Landau continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `landau` ([1]_, [2]_) is:

.. math::

    f(x) = \frac{1}{\pi}\int_0^\infty \exp(-t \log t - xt)\sin(\pi t) dt

for a real number :math:`x`.

%(after_notes)s

Often (e.g. [2]_), the Landau distribution is parameterized in terms of a
location parameter :math:`\mu` and scale parameter :math:`c`, the latter of
which *also* introduces a location shift. If ``mu`` and ``c`` are used to
represent these parameters, this corresponds with SciPy's parameterization
with ``loc = mu + 2*c / np.pi * np.log(c)`` and ``scale = c``.

This distribution uses routines from the Boost Math C++ library for
the computation of the ``pdf``, ``cdf``, ``ppf``, ``sf`` and ``isf``
methods. [1]_

References
----------
.. [1] Landau, L. (1944). "On the energy loss of fast particles by
       ionization". J. Phys. (USSR). 8: 201.
.. [2] "Landau Distribution", Wikipedia,
       https://en.wikipedia.org/wiki/Landau_distribution
.. [3] Chambers, J. M., Mallows, C. L., & Stuck, B. (1976).
       "A method for simulating stable random variables."
       Journal of the American Statistical Association, 71(354), 340-344.
.. [4] The Boost Developers. "Boost C++ Libraries". https://www.boost.org/.
.. [5] Yoshimura, T. "Numerical Evaluation and High Precision Approximation
       Formula for Landau Distribution".
       :doi:`10.36227/techrxiv.171822215.53612870/v2`

%(example)s

c                    . # rO   r   rl   s   &r5   rm   landau_gen._shape_infof  r   r7   c                    R # )gX(@r   rl   s   &r5   r  landau_gen._entropyi  s    "r7   c                2    \         P                  ! V^ ^4      # r  )rq   _landau_pdfr   s   &&r5   ru   landau_gen._pdfm  r  r7   c                2    \         P                  ! V^ ^4      # r  )rq   _landau_cdfr   s   &&r5   ry   landau_gen._cdfp  r  r7   c                2    \         P                  ! V^ ^4      # r  )rq   
_landau_sfr   s   &&r5   r~   landau_gen._sfs  s    ~~aA&&r7   c                2    \         P                  ! V^ ^4      # r  )rq   _landau_ppfr  s   &&r5   r   landau_gen._ppfv  r  r7   c                2    \         P                  ! V^ ^4      # r  )rq   _landau_isfr  s   &&r5   r   landau_gen._isfy  r  r7   c                ~    \         P                  \         P                  \         P                  \         P                  3# rO   r  rl   s   &r5   r   landau_gen._stats|  r  r7   c                4    V^ 8  d   \         P                  # ^# r  r  rb   s   &&r5   r,  landau_gen._munp  s    Qrvv%A%r7   Nc                    \        V\        4      '       d   VP                  4       p\        P                  ! V. RO4      w  r4pWEV,
          ^,          3# r!  r&  r(  s   &&&   r5   r  landau_gen._fitstart  r-  r7   c                   \         P                  ^,          pVP                  \         P                  ) ^,          \         P                  ^,          VR7      pVP                  VR7      p^\         P                  ,          W4,           \         P                  ! V4      ,          \         P
                  ! W5,          \         P                  ! V4      ,          W4,           ,          4      ,
          ,          pV# )r   r  )rQ   r  r  r  r  r  rQ  )rD   r   r   pi_2UWSs   &&&    r5   r   landau_gen._rvs  s    uuqy  "%%!RUUQYT B--4-8I$(bffQi/6648bffQi#7DH"EFG Hr7   r   rO   r.  )r   r   r   r   r   rm   r  ru   ry   r~   r   r   r   r,  r  r   r   r   r   s   @r5   r	  r	  :  sG     *V#(('((.&" r7   r	  landauc                      a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 tR tR t]]! ]RR7      R 4       4       tRtV tR# )laplace_geni  zA Laplace continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `laplace` is

.. math::

    f(x) = \frac{1}{2} \exp(-|x|)

for a real number :math:`x`.

%(after_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   laplace_gen._shape_info  r   r7   Nc                *    VP                  ^ ^VR7      # )r   r  )laplacer   s   &&&r5   r   laplace_gen._rvs  s    ##Aqt#44r7   c                P    R \         P                  ! \        V4      ) 4      ,          # r  )rQ   r   r	  r   s   &&r5   ru   laplace_gen._pdf  s    2663q6'?""r7   c           
     0   \         P                  ! R R7      ;_uu_ 4        \         P                  ! V^ 8  RR\         P                  ! V) 4      ,          ,
          R\         P                  ! V4      ,          4      uuRRR4       #   + '       g   i     R# ; i)rl  r  r   r   N)rQ   ro  r  r   r   s   &&r5   ry   laplace_gen._cdf  sS    [[h''88AE3RVVQBZ#7RVVAYG ('''s   ABB	c                &    V P                  V) 4      # rO   ry   r   s   &&r5   r~   laplace_gen._sf  s    yy!}r7   c                    \         P                  ! VR 8  \         P                  ! ^^V,
          ,          4      ) \         P                  ! ^V,          4      4      # r  rQ   r  r  r   s   &&r5   r   laplace_gen._ppf  s8    xxC"&&AaC/!1266!A#;??r7   c                &    V P                  V4      ) # rO   r  r   s   &&r5   r   laplace_gen._isf  s    		!}r7   c                    R# )r   )r   r   r   r  r   rl   s   &r5   r   laplace_gen._stats  s    r7   c                <    \         P                  ! ^4      ^,           # rD  rc  rl   s   &r5   r  laplace_gen._entropy  s    vvay{r7   z        This function uses explicit formulas for the maximum likelihood
        estimation of the Laplace distribution parameters, so the keyword
        arguments `loc`, `scale`, and `optimizer` are ignored.

r  c                    \        WW#4      w  rpVf   \        P                  ! V4      pVfA   \        P                  ! \        P                  ! W,
          4      4      \        V4      ,          pWE3# rO   )rR  rQ   medianr  r	  r  )rD   rE   rF   r4   r  r  s   &&*,  r5   rB   laplace_gen.fit  s\     99=EF <99T?D>ffRVVDK01SY>F|r7   r   r.  )r   r   r   r   r   rm   r   ru   ry   r~   r   r   r   r  rK   r
   r   rB   r   r   r   s   @r5   r	  r	    sd     &5#H@  6F G	G 
r7   r	  r	  c                   Z   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tRtV tR# )laplace_asymmetric_geni  u}  An asymmetric Laplace continuous random variable.

%(before_notes)s

See Also
--------
laplace : Laplace distribution

Notes
-----
The probability density function for `laplace_asymmetric` is

.. math::

   f(x, \kappa) &= \frac{1}{\kappa+\kappa^{-1}}\exp(-x\kappa),\quad x\ge0\\
                &= \frac{1}{\kappa+\kappa^{-1}}\exp(x/\kappa),\quad x<0\\

for :math:`-\infty < x < \infty`, :math:`\kappa > 0`.

`laplace_asymmetric` takes ``kappa`` as a shape parameter for
:math:`\kappa`. For :math:`\kappa = 1`, it is identical to a
Laplace distribution.

%(after_notes)s

Note that the scale parameter of some references is the reciprocal of
SciPy's ``scale``. For example, :math:`\lambda = 1/2` in the
parameterization of [1]_ is equivalent to ``scale = 2`` with
`laplace_asymmetric`.

References
----------
.. [1] "Asymmetric Laplace distribution", Wikipedia
        https://en.wikipedia.org/wiki/Asymmetric_Laplace_distribution

.. [2] Kozubowski TJ and Podgórski K. A Multivariate and
       Asymmetric Generalization of Laplace Distribution,
       Computational Statistics 15, 531--540 (2000).
       :doi:`10.1007/PL00022717`

%(example)s

c                @    \        R R^ \        P                  3R4      .# )kappaFr4  rj   rl   s   &r5   rm   "laplace_asymmetric_gen._shape_info  s    7EArvv;GHHr7   c                L    \         P                  ! V P                  W4      4      # rO   r.  rD   rt   r	  s   &&&r5   ru   laplace_asymmetric_gen._pdf  s    vvdll1,--r7   c                    ^V,          pV\         P                  ! V^ 8  V) V4      ,          pV\         P                  ! W#,           4      ,          pV# r_   r	  )rD   rt   r	  kapinvr  s   &&&  r5   r   laplace_asymmetric_gen._logpdf  sB    5"((16E6622rvvel##
r7   c                   ^V,          pW#,           p\         P                  ! V^ 8  ^\         P                  ! V) V,          4      W4,          ,          ,
          \         P                  ! W,          4      W$,          ,          4      # r_   rQ   r  r   rD   rt   r	  r	  
kappkapinvs   &&&  r5   ry   laplace_asymmetric_gen._cdf  s^    5\
xxQBFFA2e8,f.?@@qx(%*:;= 	=r7   c           	        ^V,          pW#,           p\         P                  ! V^ 8  \         P                  ! V) V,          4      W4,          ,          ^\         P                  ! W,          4      W$,          ,          ,
          4      # r_   r	  r	  s   &&&  r5   r~   laplace_asymmetric_gen._sf   s`    5\
xxQr%x(&*;<BFF18,e.>??A 	Ar7   c                   ^V,          pW#,           p\         P                  ! WV,          8  \         P                  ! ^V,
          V,          V,          4      ) V,          \         P                  ! W,          V,          4      V,          4      # r_   r	  rD   r   r	  r	  r	  s   &&&  r5   r   laplace_asymmetric_gen._ppf'  sg    5\
xx:--Q
 25 899&@q|E1258: 	:r7   c                   ^V,          pW#,           p\         P                  ! WV,          8*  \         P                  ! W,          V,          4      ) V,          \         P                  ! ^V,
          V,          V,          4      V,          4      # r_   r	  r	  s   &&&  r5   r   laplace_asymmetric_gen._isf.  si    5\
xxJ..U 233F:Az1%78>@ 	@r7   c                   ^V,          pW!,
          pW",          W,          ,           pR^\         P                  ! V^4      ,
          ,          \         P                  ! ^\         P                  ! V^4      ,           R4      ,          pR^\         P                  ! V^4      ,           ,          \         P                  ! ^\         P                  ! V^4      ,           ^4      ,          pW4WV3# )rM   r   rS  rJ  r  )rD   r	  r	  mnr  r{  r|  s   &&     r5   r   laplace_asymmetric_gen._stats5  s    5^mek)!BHHUA&&'288E13E1Es(KK!BHHUA&&'288E13E1Eq(IIr7   c                X    ^\         P                  ! V^V,          ,           4      ,           # r_   rc  rD   r	  s   &&r5   r  laplace_asymmetric_gen._entropy=  s    266%%-(((r7   r   Nr  r   s   @r5   r	  r	    s@     *VI.=A:@) )r7   r	  laplace_asymmetricc                    \        V\        4      '       g   \        P                  ! V4      pVP	                  R R4      pVP	                  RR4      pV P
                  '       d%   \        V P
                  P                  R4      4      M^ p. p. pV P
                  '       d   V P
                  P                  RR4      P                  4       p	\        V	4       Fa  w  rR\        V
4      ,           pVRV,           RV,           .p\        W=4      pVP                  V4       VP                  V4       Vf   K]  WV&   Kc  	  0 RmVmp\        V4      P                  V4      pV'       d   \        RV R24      h\        V4      V8  d   \        R	4      hRWE0Vm9  d   \!        R
4      h\        V\        4      '       d   VP#                  4       MTp\        P$                  ! V4      P'                  4       '       g   \)        R4      hV.VOVNVN5# )r  Nr  , r  fix_zUnknown keyword arguments: r1   zToo many positional arguments.r   r!  >   r-   r  r.   r  r0   r/   )r>   r)   rQ   r#  r<   shapesr  splitr  	enumeratestrr   r*	  set
differencer3   rz  r  r$  r%  r"  )distrE   rF   r4   r  r  
num_shapesfshape_keysfshapesr
  r  rj  keynamesr  
known_keysunknown_keys
uncensoreds   &&&&              r5   rR  rR  D  s   dL))zz$88FD!DXXh%F04T[[&&s+,JKG
 {{{$$S#.446f%DAA,C#'6A:.E&t3Cs#NN3S	 &2%02Jt9''
3L5l^1EFF
4y:899D+7++  ' ( 	( &0l%C%C!J;;z"&&((?@@)7)D)&))r7   c                   f   a  ] tR tRt o Rt]P                  tR tR t	R t
R tR tR tR	 tR
tV tR# )levy_geniu  a  A Levy continuous random variable.

%(before_notes)s

See Also
--------
levy_stable, levy_l

Notes
-----
The probability density function for `levy` is:

.. math::

    f(x) = \frac{1}{\sqrt{2\pi x^3}} \exp\left(-\frac{1}{2x}\right)

for :math:`x > 0`.

This is the same as the Levy-stable distribution with :math:`a=1/2` and
:math:`b=1`.

%(after_notes)s

Examples
--------
>>> import numpy as np
>>> from scipy.stats import levy
>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots(1, 1)

Calculate the first four moments:

>>> mean, var, skew, kurt = levy.stats(moments='mvsk')

Display the probability density function (``pdf``):

>>> # `levy` is very heavy-tailed.
>>> # To show a nice plot, let's cut off the upper 40 percent.
>>> a, b = levy.ppf(0), levy.ppf(0.6)
>>> x = np.linspace(a, b, 100)
>>> ax.plot(x, levy.pdf(x),
...        'r-', lw=5, alpha=0.6, label='levy pdf')

Alternatively, the distribution object can be called (as a function)
to fix the shape, location and scale parameters. This returns a "frozen"
RV object holding the given parameters fixed.

Freeze the distribution and display the frozen ``pdf``:

>>> rv = levy()
>>> ax.plot(x, rv.pdf(x), 'k-', lw=2, label='frozen pdf')

Check accuracy of ``cdf`` and ``ppf``:

>>> vals = levy.ppf([0.001, 0.5, 0.999])
>>> np.allclose([0.001, 0.5, 0.999], levy.cdf(vals))
True

Generate random numbers:

>>> r = levy.rvs(size=1000)

And compare the histogram:

>>> # manual binning to ignore the tail
>>> bins = np.concatenate((np.linspace(a, b, 20), [np.max(r)]))
>>> ax.hist(r, bins=bins, density=True, histtype='stepfilled', alpha=0.2)
>>> ax.set_xlim([x[0], x[-1]])
>>> ax.legend(loc='best', frameon=False)
>>> plt.show()

c                    . # rO   r   rl   s   &r5   rm   levy_gen._shape_info  r   r7   c                    ^\         P                  ! ^\         P                  ,          V,          4      ,          V,          \         P                  ! R^V,          ,          4      ,          # r  r  r   s   &&r5   ru   levy_gen._pdf  s=    2771RUU719%%)BFF2qs8,<<<r7   c                d    \         P                  ! \        P                  ! R V,          4      4      # r  )r|   erfcrQ   r'  r   s   &&r5   ry   levy_gen._cdf  s    wwrwwsQw'((r7   c                d    \         P                  ! \        P                  ! R V,          4      4      # r  r   r   s   &&r5   r~   levy_gen._sf  s    vvbggcAg&''r7   c                D    \        V^,          4      pRW",          ,          # r   r   r  rD   r   r  s   && r5   r   levy_gen._ppf  s    !nci  r7   c                X    ^^\         P                  ! V4      ^,          ,          ,          # r_   )r|   erfinvr  s   &&r5   r   levy_gen._isf  s    !BIIaL!O#$$r7   c                ~    \         P                  \         P                  \         P                  \         P                  3# rO   rE  rl   s   &r5   r   levy_gen._stats  r  r7   r   Nr   r   r   r   r   r   rI  rJ  rm   ru   ry   r~   r   r   r   r   r   r   s   @r5   r
  r
  u  sA     GP "44M=)(!
%. .r7   r
  levyc                   f   a  ] tR tRt o Rt]P                  tR tR t	R t
R tR tR tR	 tR
tV tR# )
levy_l_geni  a  A left-skewed Levy continuous random variable.

%(before_notes)s

See Also
--------
levy, levy_stable

Notes
-----
The probability density function for `levy_l` is:

.. math::
    f(x) = \frac{1}{|x| \sqrt{2\pi |x|}} \exp{ \left(-\frac{1}{2|x|} \right)}

for :math:`x < 0`.

This is the same as the Levy-stable distribution with :math:`a=1/2` and
:math:`b=-1`.

%(after_notes)s

Examples
--------
>>> import numpy as np
>>> from scipy.stats import levy_l
>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots(1, 1)

Calculate the first four moments:

>>> mean, var, skew, kurt = levy_l.stats(moments='mvsk')

Display the probability density function (``pdf``):

>>> # `levy_l` is very heavy-tailed.
>>> # To show a nice plot, let's cut off the lower 40 percent.
>>> a, b = levy_l.ppf(0.4), levy_l.ppf(1)
>>> x = np.linspace(a, b, 100)
>>> ax.plot(x, levy_l.pdf(x),
...        'r-', lw=5, alpha=0.6, label='levy_l pdf')

Alternatively, the distribution object can be called (as a function)
to fix the shape, location and scale parameters. This returns a "frozen"
RV object holding the given parameters fixed.

Freeze the distribution and display the frozen ``pdf``:

>>> rv = levy_l()
>>> ax.plot(x, rv.pdf(x), 'k-', lw=2, label='frozen pdf')

Check accuracy of ``cdf`` and ``ppf``:

>>> vals = levy_l.ppf([0.001, 0.5, 0.999])
>>> np.allclose([0.001, 0.5, 0.999], levy_l.cdf(vals))
True

Generate random numbers:

>>> r = levy_l.rvs(size=1000)

And compare the histogram:

>>> # manual binning to ignore the tail
>>> bins = np.concatenate(([np.min(r)], np.linspace(a, b, 20)))
>>> ax.hist(r, bins=bins, density=True, histtype='stepfilled', alpha=0.2)
>>> ax.set_xlim([x[0], x[-1]])
>>> ax.legend(loc='best', frameon=False)
>>> plt.show()

c                    . # rO   r   rl   s   &r5   rm   levy_l_gen._shape_info'  r   r7   c                    \        V4      p^\        P                  ! ^\        P                  ,          V,          4      ,          V,          \        P                  ! R^V,          ,          4      ,          # r  )r	  rQ   r'  r  r   rD   rt   r  s   && r5   ru   levy_l_gen._pdf*  sF    V255$$R'r1R4y(999r7   c                    \        V4      p^\        ^\        P                  ! V4      ,          4      ,          ^,
          # rD  )r	  r   rQ   r'  r1
  s   && r5   ry   levy_l_gen._cdf/  s,    V9Q_--11r7   c                r    \        V4      p^\        ^\        P                  ! V4      ,          4      ,          # rD  )r	  r   rQ   r'  r1
  s   && r5   r~   levy_l_gen._sf3  s'    V8AO,,,r7   c                R    \        VR ,           ^,          4      pRW",          ,          # r  r   r#
  s   && r5   r   levy_l_gen._ppf7  s!    SA&sy!!r7   c                B    R\        V^,          4      ^,          ,          # r  r  r  s   &&r5   r   levy_l_gen._isf;  s    )AaC.!###r7   c                ~    \         P                  \         P                  \         P                  \         P                  3# rO   rE  rl   s   &r5   r   levy_l_gen._stats>  r  r7   r   Nr*
  r   s   @r5   r-
  r-
    sA     FN "44M:
2-"$. .r7   r-
  levy_lc                      a a ] tR tRt oRtR tRR ltR tR tR t	R t
R	 tR
 tR tR tR tR t]]! ]4      V 3R l4       4       tRtVtV ;t# )logistic_geniE  a  A logistic (or Sech-squared) continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `logistic` is:

.. math::

    f(x) = \frac{\exp(-x)}
                {(1+\exp(-x))^2}

`logistic` is a special case of `genlogistic` with ``c=1``.

Remark that the survival function (``logistic.sf``) is equal to the
Fermi-Dirac distribution describing fermionic statistics.

%(after_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   logistic_gen._shape_info]  r   r7   c                &    VP                  VR 7      # r  )logisticr   s   &&&r5   r   logistic_gen._rvs`  s    $$$$//r7   c                L    \         P                  ! V P                  V4      4      # rO   r.  r   s   &&r5   ru   logistic_gen._pdfc  ry  r7   c                    \         P                  ! V4      ) pVR \        P                  ! \         P                  ! V4      4      ,          ,
          # rr  )rQ   r	  r|   r  r   )rD   rt   rv  s   && r5   r   logistic_gen._logpdfg  s2    VVAYJ2++++r7   c                .    \         P                  ! V4      # rO   r  r   s   &&r5   ry   logistic_gen._cdfk      xx{r7   c                .    \         P                  ! V4      # rO   r|   	log_expitr   s   &&r5   r  logistic_gen._logcdfn  s    ||Ar7   c                .    \         P                  ! V4      # rO   r  r   s   &&r5   r   logistic_gen._ppfq  rK
  r7   c                0    \         P                  ! V) 4      # rO   r  r   s   &&r5   r~   logistic_gen._sft  s    xx|r7   c                0    \         P                  ! V) 4      # rO   rM
  r   s   &&r5   r
  logistic_gen._logsfw  s    ||QBr7   c                0    \         P                  ! V4      ) # rO   r  r   s   &&r5   r   logistic_gen._isfz  s    |r7   c                b    ^ \         P                  \         P                  ,          R,          ^ R3# )r   r  g333333?r`  rl   s   &r5   r   logistic_gen._stats}  s!    "%%+c/1g--r7   c                    R # rr  r   rl   s   &r5   r  logistic_gen._entropy  s    r7   c                  <aa
aa VP                  R R4      '       d   \        SV `  ! S.VO5/ VB # \        V SW#4      w  orE\	        S4      oV P                  S4      w  rgVP                  RV4      VP                  RV4      rvV3VV3R llo
V3VV3R lloV
V3R lpVe3   Vf/   \        P                  ! S
V34      p	V	P                  ^ ,          pTpM\Ve3   Vf/   \        P                  ! SV34      p	V	P                  ^ ,          pTpM&\        P                  ! WV34      p	V	P                  w  rg\        V4      pV	P                  '       d   Wg3# \        SV `  ! S.VO5/ VB # )rE  Fr-   r.   c                    < SV ,
          V,          p\         P                  ! \        P                  ! V4      4      S^,          ,
          # rD  )rQ   r  r|   r  )r-   r.   r\  rE   rc   s   && r5   dl_dloc!logistic_gen.fit.<locals>.dl_dloc  s1    u$A66"((1+&1,,r7   c                    < SV,
          V ,          p\         P                  ! V\         P                  ! V^,          4      ,          4      S,
          # rD  )rQ   r  r  )r.   r-   r\  rE   rc   s   && r5   	dl_dscale#logistic_gen.fit.<locals>.dl_dscale  s5    u$A66!BGGAaCL.)A--r7   c                 ,   < V w  rS! W4      S! W!4      3# rO   r   )paramsr-   r.   r^
  ra
  s   &  r5   r  logistic_gen.fit.<locals>.func  s    JC3&	%(===r7   )r2   r@   rB   rR  r  r  r<   r   rS  rt   r	  success)rD   rE   rF   r4   r  r  r-   r.   r  r  r^
  ra
  rc   r  s   &f*,      @@@r5   rB   logistic_gen.fit  sT    88J&&7;t3d3d338t9=EdI ^^D)
XXeS)488GU+CU  & 	- 	- "& 	. 	.	> $,--#0C%%(CE&.--	E84CEE!HEC--El3CJC E
 # 	7W[555	7r7   r   r.  )r   r   r   r   r   rm   r   ru   r   ry   r  r   r~   r
  r   r   r  rK   r   r   rB   r   r   r  r   s   @@r5   r?
  r?
  E  sl     .0', . M*07 + 07 07r7   r?
  rC
  c                   d   a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 tR tR tR tRtV tR# )loggamma_geni  a  A log gamma continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `loggamma` is:

.. math::

    f(x, c) = \frac{\exp(c x - \exp(x))}
                   {\Gamma(c)}

for all :math:`x, c > 0`. Here, :math:`\Gamma` is the
gamma function (`scipy.special.gamma`).

`loggamma` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   loggamma_gen._shape_info  r6  r7   Nc                    \         P                  ! VP                  V^,           VR7      4      \         P                  ! VP                  VR7      4      V,          ,           # )rM   r  )rQ   r  r(  r  r  s   &&&&r5   r   loggamma_gen._rvs  sM     |))!a%d);<&&--4-89!;< 	=r7   c                    \         P                  ! W!,          \         P                  ! V4      ,
          \        P                  ! V4      ,
          4      # rO   rQ   r   r|   r  r`  s   &&&r5   ru   loggamma_gen._pdf  s,    vvac"&&)mBJJqM122r7   c                ~    W!,          \         P                  ! V4      ,
          \        P                  ! V4      ,
          # rO   ro
  r`  s   &&&r5   r   loggamma_gen._logpdf  s#    sRVVAYA..r7   c                H    \         P                  ! V\        8  W3R  R 4      # )c                 ~    \         P                  ! W,          \        P                  ! V^,           4      ,
          4      # r_   ro
  r  s   &&r5   r  #loggamma_gen._cdf.<locals>.<lambda>  s     bjj1o 56r7   c                 X    \         P                  ! V\        P                  ! V 4      4      # rO   )r|   rB  rQ   r   r  s   &&r5   r  ru
    s    Qq	2r7   r  r  r"   r`  s   &&&r5   ry   loggamma_gen._cdf  s&     L1&624 	4r7   c                v    \         P                  ! W!4      p\        P                  ! V\        8  W1V3R  R 4      # )c                     \         P                  ! V4      \        P                  ! V^,           4      ,           V,          # r_   r_  rI  r   r\  s   &&&r5   r  #loggamma_gen._ppf.<locals>.<lambda>  s"    RVVAYAaC8!;r7   c                 .    \         P                  ! V 4      # rO   rc  r{
  s   &&&r5   r  r|
        BFF1Ir7   )r|   rK  r  r  r!   rD   r   r\  rI  s   &&& r5   r   loggamma_gen._ppf  s6     NN1 Iay;%' 	'r7   c                H    \         P                  ! V\        8  W3R  R 4      # )c                     \         P                  ! W,          \        P                  ! V^,           4      ,
          4      ) # r_   )rQ   rf  r|   r  r  s   &&r5   r  "loggamma_gen._sf.<locals>.<lambda>  s#    "((13AaC#899r7   c                 X    \         P                  ! V\        P                  ! V 4      4      # rO   )r|   rF  rQ   r   r  s   &&r5   r  r
    s    a3r7   rw
  r`  s   &&&r5   r~   loggamma_gen._sf
  s$    L1&935 	5r7   c                v    \         P                  ! W!4      p\        P                  ! V\        8  W1V3R  R 4      # )c                     \         P                  ! V) 4      \        P                  ! V^,           4      ,           V,          # r_   )rQ   r  r|   r  r{
  s   &&&r5   r  #loggamma_gen._isf.<locals>.<lambda>  s$    RXXqb\BJJqsO;Q>r7   c                 .    \         P                  ! V 4      # rO   rc  r{
  s   &&&r5   r  r
    r~
  r7   )r|   rP  r  r  r!   r
  s   &&& r5   r   loggamma_gen._isf  s6     OOA!Iay>%' 	'r7   c                   \         P                  ! V4      p\         P                  ! ^V4      p\         P                  ! ^V4      \        P                  ! VR4      ,          p\         P                  ! ^V4      W3,          ,          pW#WE3# rG  )r|   rZ  	polygammarQ   rU  )rD   r\  r&  r  rB	  excess_kurtosiss   &&    r5   r   loggamma_gen._stats  sc     zz!}ll1a <<1%c(::,,q!,8(33r7   c                D    R  pR p\         P                  ! V^-8  WV4      # )c                     \         P                  ! V 4      V \         P                  ! V 4      ,          ,
          V ,           pV# rO   )r|   r  rZ  )r\  r  s   & r5   r  &loggamma_gen._entropy.<locals>.regular$  s+    

1BJJqM 11A5AHr7   c                     R\         P                  ! V 4      ,          V R,          ^,          ,           V R,          ^Z,          ,
          V R,          ^,          ,           p\        P                  4       V,           pV# )r   r#  r  r  r  )rQ   r  r/  r  )r\  termr  s   &  r5   r  )loggamma_gen._entropy.<locals>.asymptotic(  sO    q	>AsF1H,q#vby81c6#:ED$&AHr7   r=  )rD   r\  r  r  s   &&  r5   r  loggamma_gen._entropy#  s%    		 qBww??r7   r   r.  r   r   r   r   r   rm   r   ru   r   ry   r   r~   r   r   r  r   r   r   s   @r5   ri
  ri
    sD     0E=3/4('5'4@ @r7   ri
  loggammac                      a a ] tR tRt oRtR tR tR tR tR t	R t
R	 tR
 t]]! ]4      V 3R l4       4       tRtVtV ;t# )loglaplace_geni4  a  A log-Laplace continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `loglaplace` is:

.. math::

    f(x, c) = \begin{cases}\frac{c}{2} x^{ c-1}  &\text{for } 0 < x < 1\\
                           \frac{c}{2} x^{-c-1}  &\text{for } x \ge 1
              \end{cases}

for :math:`c > 0`.

`loglaplace` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

Suppose a random variable ``X`` follows the Laplace distribution with
location ``a`` and scale ``b``.  Then ``Y = exp(X)`` follows the
log-Laplace distribution with ``c = 1 / b`` and ``scale = exp(a)``.

References
----------
T.J. Kozubowski and K. Podgorski, "A log-Laplace growth rate model",
The Mathematical Scientist, vol. 28, pp. 49-60, 2003.

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   loglaplace_gen._shape_infoU  r6  r7   c                v    VR ,          p\         P                  ! V^8  W") 4      pW1V^,
          ,          ,          # rr  rQ   r  )rD   rt   r\  cd2s   &&& r5   ru   loglaplace_gen._pdfX  s3     eHHQUAr"qs8|r7   c                |    \         P                  ! V^8  RW,          ,          ^RW) ,          ,          ,
          4      # r 	  r
  r`  s   &&&r5   ry   loglaplace_gen._cdf_  s+    xxAs14x3q2w;77r7   c                |    \         P                  ! V^8  ^RW,          ,          ,
          RW) ,          ,          4      # r 	  r
  r`  s   &&&r5   r~   loglaplace_gen._sfb  s+    xxAq3qt8|SR[99r7   c                    \         P                  ! VR 8  RV,          RV,          ,          ^RV,
          ,          RV,          ,          4      # r   r   r   r  r
  rg  s   &&&r5   r   loglaplace_gen._ppfe  s7    xxC#a%3q5!1As1uIa3HIIr7   c                    \         P                  ! VR 8  RRV,
          ,          RV,          ,          ^V,          RV,          ,          4      # r
  r
  rg  s   &&&r5   r   loglaplace_gen._isfh  s6    xxC#sQw-3q5!9AaC46?KKr7   c                
   \         P                  ! R R7      ;_uu_ 4        V^,          V^,          rC\         P                  ! WC8  W3V,
          ,          \         P                  4      uuRRR4       #   + '       g   i     R# ; irl  rm  N)rQ   ro  r  rk   )rD   rc   r\  r  n2s   &&&  r5   r,  loglaplace_gen._munpk  sK    [[))T1a488BGR7^RVV< *)))s   AA11B	c                J    \         P                  ! R V,          4      R,           # r  rc  r  s   &&r5   r  loglaplace_gen._entropyp  s    vvc!e}s""r7   c                  < \        WW#4      w  rrVVf   \        \        V 4      V `  ! V.VO5/ VB # \        P
                  ! W8*  4      '       d   \        RV\        P                  R7      hV^ 8w  d	   W,
          p\        P                  \        P                  ! V4      Ve   \        P                  ! V4      MR Ve
   ^V,          MR RR7      w  rxTp	Vf   \        P                  ! V4      MTp
Vf
   ^V,          MTpWV
3# )N
loglaplacer  r:   )r  r  r0   )rR  r@   rA   rB   rQ   r  r  rk   r	  r  r   )rD   rE   rF   r4   rT  r  r  r   r   r-   r.   r\  r  s   &&*,        r5   rB   loglaplace_gen.fits  s     "=T=A"I$ <dT.tCdCdCC 66$,|4rvvFF 19;D {{266$<282Dv$*,.!B$d"'  ) #^q	ZAERu}r7   r   )r   r   r   r   r   rm   ru   ry   r~   r   r   r,  r  rK   r   r   rB   r   r   r  r   s   @@r5   r
  r
  4  s\     @E8:JL=
# M* +  r7   r
  r
  c                 ^    \         P                  ! V ^ 8g  W3R \        P                  ) R7      # )r   c                 
   \         P                  ! V 4      ^,          ) ^V^,          ,          ,          \         P                  ! W,          \         P                  ! ^\         P                  ,          4      ,          4      ,
          # rD  )rQ   r  r'  r  rt   rj  s   &&r5   r  !_lognorm_logpdf.<locals>.<lambda>  sH    rvvay!|mq1a4x0qurwwq255y'99:;r7   r  rU  r
  s   &&r5   _lognorm_logpdfr
    s,    ??	Q	<FF7	 r7   c                      a a ] tR tRt oRt]P                  tR tRR lt	R t
R tR tR tR	 tR
 tR tR tR tR t]]! ]RR7      V 3R l4       4       tRtVtV ;t# )lognorm_geni  a9  A lognormal continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `lognorm` is:

.. math::

    f(x, s) = \frac{1}{s x \sqrt{2\pi}}
              \exp\left(-\frac{\log^2(x)}{2s^2}\right)

for :math:`x > 0`, :math:`s > 0`.

`lognorm` takes ``s`` as a shape parameter for :math:`s`.

%(after_notes)s

Suppose a normally distributed random variable ``X`` has  mean ``mu`` and
standard deviation ``sigma``. Then ``Y = exp(X)`` is lognormally
distributed with ``s = sigma`` and ``scale = exp(mu)``.

%(example)s

The logarithm of a log-normally distributed random variable is
normally distributed:

>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> from scipy import stats
>>> fig, ax = plt.subplots(1, 1)
>>> mu, sigma = 2, 0.5
>>> X = stats.norm(loc=mu, scale=sigma)
>>> Y = stats.lognorm(s=sigma, scale=np.exp(mu))
>>> x = np.linspace(*X.interval(0.999))
>>> y = Y.rvs(size=10000)
>>> ax.plot(x, X.pdf(x), label='X (pdf)')
>>> ax.hist(np.log(y), density=True, bins=x, label='log(Y) (histogram)')
>>> ax.legend()
>>> plt.show()

c                @    \        R R^ \        P                  3R4      .# )rj  Fr4  rj   rl   s   &r5   rm   lognorm_gen._shape_info  r6  r7   c                X    \         P                  ! WP                  V4      ,          4      # rO   rQ   r   r   )rD   rj  r   r   s   &&&&r5   r   lognorm_gen._rvs  s    vva66t<<==r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  rD   rt   rj  s   &&&r5   ru   lognorm_gen._pdf  r  r7   c                    \        W4      # rO   r
  r
  s   &&&r5   r   lognorm_gen._logpdf  s    q$$r7   c                N    \        \        P                  ! V4      V,          4      # rO   r   rQ   r  r
  s   &&&r5   ry   lognorm_gen._cdf  s    Q''r7   c                N    \        \        P                  ! V4      V,          4      # rO   rb  r
  s   &&&r5   r  lognorm_gen._logcdf  s    BFF1IM**r7   c                N    \         P                  ! V\        V4      ,          4      # rO   rQ   r   r   rD   r   rj  s   &&&r5   r   lognorm_gen._ppf      vva)A,&''r7   c                N    \        \        P                  ! V4      V,          4      # rO   r   rQ   r  r
  s   &&&r5   r~   lognorm_gen._sf  s    q	A&&r7   c                N    \        \        P                  ! V4      V,          4      # rO   )r   rQ   r  r
  s   &&&r5   r
  lognorm_gen._logsf  s    266!9q=))r7   c                N    \         P                  ! V\        V4      ,          4      # rO   rQ   r   r   r
  s   &&&r5   r   lognorm_gen._isf  r
  r7   c                   \         P                  ! W,          4      p\         P                  ! V4      pW"^,
          ,          p\         P                  ! V^,
          4      ^V,           ,          p\         P                  ! . ROV4      pW4WV3# rM   )rM   r   r  r   r  )rQ   r   r'  polyval)rD   rj  rH  ry  rz  r{  r|  s   &&     r5   r   lognorm_gen._stats  s^    FF13KWWQZ1gWWQqS\1Q3ZZ*A.r7   c                    R ^\         P                  ! ^\         P                  ,          4      ,           ^\         P                  ! V4      ,          ,           ,          # r  r  )rD   rj  s   &&r5   r  lognorm_gen._entropy  s3    a"&&255/)Aq	M9::r7   aF          When `method='MLE'` and
        the location parameter is fixed by using the `floc` argument,
        this function uses explicit formulas for the maximum likelihood
        estimation of the log-normal shape and scale parameters, so the
        `optimizer`, `loc` and `scale` keyword arguments are ignored.
        If the location is free, a likelihood maximum is found by
        setting its partial derivative wrt to location to 0, and
        solving by substituting the analytical expressions of shape
        and scale (or provided parameters).
        See, e.g., equation 3.1 in
        A. Clifford Cohen & Betty Jones Whitten (1980)
        Estimation in the Three-Parameter Lognormal Distribution,
        Journal of the American Statistical Association, 75:370, 399-404
        https://doi.org/10.2307/2287466
        

r  c                  <a aaaa VP                  R R4      '       d   \        SS `  ! S.VO5/ VB # \        S SW#4      pVw  oopo\        P
                  ! S4      pVVV3R loVV3R lpVVV 3R lpVEf/   \        P                  ! V4      p	Wi,
          p
V! V
4      pV! V
4      p^V	,          pVR	8  d   Wm,
          p
V! V
4      pV^,          pK"  \        P                  ! V
4      '       d   \        P                  ! V4      '       g   \        SS `  ! S.VO5/ VB # \        P                  ! \        P                  ! V
\        P                  ) 4      V
^,
          4      pV! V4      p^W,
          ,          p\        P                  ! V4      '       dg   \        P                  ! V4      '       dK   \        P                  ! V4      \        P                  ! V4      8X  d   W,
          pV! V4      pV^,          pK  \        P                  ! V4      '       d   \        P                  ! V4      '       g   \        SS `  ! S.VO5/ VB # \        W~V
3R7      pVP                  '       g   \        SS `  ! S.VO5/ VB # V! VP                  4      pVV8  d   VP                  MWi,
          pM$WV8  d   \        RR\        P                  R7      hTpS! V4      w  ppS P!                  V4      '       d   V^ 8  g   \        SS `  ! S.VO5/ VB # VVV3# )
rE  Fc                 \  < Se   Sf   \         P                  ! SV ,
          4      pS;'       g%    \         P                  ! XP                  4       4      pS;'       gM    \         P                  ! \         P                  ! X\         P                  ! V4      ,
          ^,          4      4      pW23# rO   )rQ   r  r   r&  r'  )r-   lndatar.   rG  rE   r  fshapes   &   r5   get_shape_scale(lognorm_gen.fit.<locals>.get_shape_scale  su     ~s
+33bffV[[]3EKKbggbggvu/E.I&JKE<r7   c                    < S! V 4      w  rSV ,
          p\         P                  ! ^\         P                  ! W2,          4      V^,          ,          ,           V,          4      # r_   rQ   r  r  )r-   rG  r.   shiftedrE   r
  s   &   r5   dL_dLoc lognorm_gen.fit.<locals>.dL_dLoc  sE    *3/LESjG661rvvgm4UAX==wFGGr7   c                 B   < S! V 4      w  rSP                  WV3S4      ) # rO   )nnlf)r-   rG  r.   rE   r
  rD   s   &  r5   lllognorm_gen.fit.<locals>.ll  s(    *3/LEIIu514888r7   r  lognormr   r  gư)r2   r@   rB   rR  rQ   rR  spacingr$  r  	nextafterrk   rR   r*   	convergedrS  r  rd   )rD   rE   rF   r4   
parametersr  rS  r
  r
  r
  rT   dL_dLoc_rbrack	ll_rbrackr6	  rS   dL_dLoc_lbrackr  ll_rootr-   rG  r.   r  r
  r
  r  s   ff*,                 @@@r5   rB   lognorm_gen.fit  s   $ 88J&&7;t3d3d330tTH
%/"fdF66$<	 	H	9
 < jj*G'F %V_N6
IKE E)!)!(
;;v&&bkk..I.I w{47$7$77
 ZZVbffW =vaxHF$V_N)E;;v&&2;;~+F+Fww~."''.2II!(
 ;;v&&bkk..I.Iw{47$7$77 g/?@C===w{47$7$77
 lG%	1#((x7GC "9BbffEEC&s+uu%%%!)7;t3d3d33c5  r7   r   r.  )r   r   r   r   r   r   rI  rJ  rm   r   ru   r   ry   r  r   r~   r
  r   r   r  rK   r	   rB   r   r   r  r   s   @@r5   r
  r
    s     *V "44ME>*%(+('*(; } 5  Z!! "Z! Z!r7   r
  r
  c                   |   a  ] tR tRt o Rt]P                  tR tRR lt	R t
R tR tR	 tR
 tR tR tR tRtV tR# )
gibrat_genih  a/  A Gibrat continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `gibrat` is:

.. math::

    f(x) = \frac{1}{x \sqrt{2\pi}} \exp(-\frac{1}{2} (\log(x))^2)

for :math:`x >= 0`.

`gibrat` is a special case of `lognorm` with ``s=1``.

%(after_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   gibrat_gen._shape_info  r   r7   Nc                L    \         P                  ! VP                  V4      4      # rO   r
  r   s   &&&r5   r   gibrat_gen._rvs  s    vvl224899r7   c                L    \         P                  ! V P                  V4      4      # rO   r.  r   s   &&r5   ru   gibrat_gen._pdf  ry  r7   c                    \        VR 4      # r8  r
  r   s   &&r5   r   gibrat_gen._logpdf  s    q#&&r7   c                @    \        \        P                  ! V4      4      # rO   r
  r   s   &&r5   ry   gibrat_gen._cdf  s    ##r7   c                @    \         P                  ! \        V4      4      # rO   r
  r   s   &&r5   r   gibrat_gen._ppf      vvil##r7   c                @    \        \        P                  ! V4      4      # rO   r
  r   s   &&r5   r~   gibrat_gen._sf  s    q	""r7   c                @    \         P                  ! \        V4      4      # rO   r
  r  s   &&r5   r   gibrat_gen._isf  r  r7   c                    \         P                  p\         P                  ! V4      pW^,
          ,          p\         P                  ! V^,
          4      ^V,           ,          p\         P                  ! . ROV4      pW#WE3# r
  )rQ   er'  r
  )rD   rH  ry  rz  r{  r|  s   &     r5   r   gibrat_gen._stats  sX    DDWWQZq5kWWQU^q1u%ZZ*A.r7   c                t    R \         P                  ! ^\         P                  ,          4      ,          R ,           # r  r  rl   s   &r5   r  gibrat_gen._entropy  s#    RVVAI&&,,r7   r   r.  )r   r   r   r   r   r   rI  rJ  rm   r   ru   r   ry   r   r~   r   r   r  r   r   r   s   @r5   r
  r
  h  sN     * "44M:''$$#$- -r7   r
  gibratc                   d   a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 tR tR tR tRtV tR# )maxwell_geni  a  A Maxwell continuous random variable.

%(before_notes)s

Notes
-----
A special case of a `chi` distribution,  with ``df=3``, ``loc=0.0``,
and given ``scale = a``, where ``a`` is the parameter used in the
Mathworld description [1]_.

The probability density function for `maxwell` is:

.. math::

    f(x) = \sqrt{2/\pi}x^2 \exp(-x^2/2)

for :math:`x >= 0`.

%(after_notes)s

References
----------
.. [1] http://mathworld.wolfram.com/MaxwellDistribution.html

%(example)s
c                    . # rO   r   rl   s   &r5   rm   maxwell_gen._shape_info  r   r7   Nc                0    \         P                  R WR7      # )r  r'  re  r)  r   s   &&&r5   r   maxwell_gen._rvs  s    wwswAAr7   c                ~    \         V,          V,          \        P                  ! V) V,          R ,          4      ,          # rr  )r&   rQ   r   r   s   &&r5   ru   maxwell_gen._pdf  s*    q "2661"Q$s(#333r7   c                    \         P                  ! R R7      ;_uu_ 4        \        ^\         P                  ! V4      ,          ,           RV,          V,          ,
          uuRRR4       #   + '       g   i     R# ; i)rl  rm  r   N)rQ   ro  r(   r  r   s   &&r5   r   maxwell_gen._logpdf  sA    [[))&266!94s1uQw> *)))s   =A((A9	c                J    \         P                  ! R W,          R,          4      # rS  r   rA  r   s   &&r5   ry   maxwell_gen._cdf  s    {{3C((r7   c                f    \         P                  ! ^\        P                  ! RV4      ,          4      # rU  rJ  r   s   &&r5   r   maxwell_gen._ppf  s!    wwqQ//00r7   c                J    \         P                  ! R W,          R,          4      # r  rE  r   s   &&r5   r~   maxwell_gen._sf  s    ||CS))r7   c                f    \         P                  ! ^\        P                  ! RV4      ,          4      # rU  rO  r   s   &&r5   r   maxwell_gen._isf  s!    wwqa0011r7   c                "   ^\         P                  ,          ^,
          p^\         P                  ! R\         P                  ,          4      ,          ^^\         P                  ,          ,
          \         P                  ! ^4      ^ ^
\         P                  ,          ,
          ,          VR,          ,          R\         P                  ,          \         P                  ,          ^\         P                  ,          ,           R,
          VR,          ,          3# )r  r   rS  i  r  rQ   r  r'  rD   r  s   & r5   r   maxwell_gen._stats  s    gai"''#bee)$$!BEE'	
Br"%%xK(c1RUU2553ruu9,s2c3h>@ 	@r7   c                    \         R \        P                  ! ^\        P                  ,          4      ,          ,           R ,
          # r  )r#   rQ   r  r  rl   s   &r5   r  maxwell_gen._entropy  s'    BFF1RUU7O++C//r7   r   r.  r
  r   s   @r5   r  r    sC     4B4?
)1*2@0 0r7   r  maxwellc                   H   a  ] tR tRt o RtR tR tR tR tR t	R t
R	tV tR
# )
mielke_geni  a  A Mielke Beta-Kappa / Dagum continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `mielke` is:

.. math::

    f(x, k, s) = \frac{k x^{k-1}}{(1+x^s)^{1+k/s}}

for :math:`x > 0` and :math:`k, s > 0`. The distribution is sometimes
called Dagum distribution ([2]_). It was already defined in [3]_, called
a Burr Type III distribution (`burr` with parameters ``c=s`` and
``d=k/s``).

`mielke` takes ``k`` and ``s`` as shape parameters.

%(after_notes)s

References
----------
.. [1] Mielke, P.W., 1973 "Another Family of Distributions for Describing
       and Analyzing Precipitation Data." J. Appl. Meteor., 12, 275-280
.. [2] Dagum, C., 1977 "A new model for personal income distribution."
       Economie Appliquee, 33, 327-367.
.. [3] Burr, I. W. "Cumulative frequency functions", Annals of
       Mathematical Statistics, 13(2), pp 215-232 (1942).

%(example)s

c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      pW.# )rk  Frj  r4  rj   )rD   iki_ss   &  r5   rm   mielke_gen._shape_info  :    UQK@ea[.Ayr7   c                    W!VR ,
          ,          ,          R W,          ,           R VR ,          V,          ,           ,          ,          # r8  r   rD   rt   rk  rj  s   &&&&r5   ru   mielke_gen._pdf  s.    QsU|s14x3quQw;777r7   c                f   \         P                  ! R R7      ;_uu_ 4        \         P                  ! V4      \         P                  ! V4      V^,
          ,          ,           \         P                  ! W,          4      ^W#,          ,           ,          ,
          uuRRR4       #   + '       g   i     R# ; ir
  )rQ   ro  r  r  r1  s   &&&&r5   r   mielke_gen._logpdf  s[    [[))66!9rvvay!a%00288AD>1qs73KK *)))s   A4BB0	c                d    W,          R W,          ,           VR ,          V,          ,          ,          # r8  r   r1  s   &&&&r5   ry   mielke_gen._cdf  s"    ts14x1S57+++r7   c                v    \        WR ,          V,          4      p\        VR V,
          ,          R V,          4      # r8  r:  )rD   r   rk  rj  qsks   &&&& r5   r   mielke_gen._ppf  s,    !sU1Wo3C=#a%((r7   c                `    R  p\         P                  ! W8  WV3V\        P                  R7      # )c                     \         P                  ! W,           V,          4      \         P                  ! ^W,          ,
          4      ,          \         P                  ! W,          4      ,          # r_   r'  )rc   rk  rj  s   &&&r5   rv	  $mielke_gen._munp.<locals>.nth_moment#  s9    88QS!G$RXXae_4RXXac]BBr7   r  rU  )rD   rc   rk  rj  rv	  s   &&&& r5   r,  mielke_gen._munp"  s)    	C quqQiOOr7   r   N)r   r   r   r   r   rm   ru   r   ry   r   r,  r   r   r   s   @r5   r*  r*    s1      B
8L
,)P Pr7   r*  mielkec                   f   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tR tRtV tR# )
kappa4_geni-  a  Kappa 4 parameter distribution.

%(before_notes)s

Notes
-----
The probability density function for kappa4 is:

.. math::

    f(x, h, k) = (1 - k x)^{1/k - 1} (1 - h (1 - k x)^{1/k})^{1/h-1}

if :math:`h` and :math:`k` are not equal to 0.

If :math:`h` or :math:`k` are zero then the pdf can be simplified:

:math:`h = 0` and :math:`k \neq 0`::

    kappa4.pdf(x, h, k) = (1.0 - k*x)**(1.0/k - 1.0)*
                          exp(-(1.0 - k*x)**(1.0/k))

:math:`h \neq 0` and :math:`k = 0`::

    kappa4.pdf(x, h, k) = exp(-x)*(1.0 - h*exp(-x))**(1.0/h - 1.0)

:math:`h = 0` and :math:`k = 0`::

    kappa4.pdf(x, h, k) = exp(-x)*exp(-exp(-x))

kappa4 takes :math:`h` and :math:`k` as shape parameters.

The kappa4 distribution returns other distributions when certain
:math:`h` and :math:`k` values are used.

+------+-------------+----------------+------------------+
| h    | k=0.0       | k=1.0          | -inf<=k<=inf     |
+======+=============+================+==================+
| -1.0 | Logistic    |                | Generalized      |
|      |             |                | Logistic(1)      |
|      |             |                |                  |
|      | logistic(x) |                |                  |
+------+-------------+----------------+------------------+
|  0.0 | Gumbel      | Reverse        | Generalized      |
|      |             | Exponential(2) | Extreme Value    |
|      |             |                |                  |
|      | gumbel_r(x) |                | genextreme(x, k) |
+------+-------------+----------------+------------------+
|  1.0 | Exponential | Uniform        | Generalized      |
|      |             |                | Pareto           |
|      |             |                |                  |
|      | expon(x)    | uniform(x)     | genpareto(x, -k) |
+------+-------------+----------------+------------------+

(1) There are at least five generalized logistic distributions.
    Four are described here:
    https://en.wikipedia.org/wiki/Generalized_logistic_distribution
    The "fifth" one is the one kappa4 should match which currently
    isn't implemented in scipy:
    https://en.wikipedia.org/wiki/Talk:Generalized_logistic_distribution
    https://www.mathwave.com/help/easyfit/html/analyses/distributions/gen_logistic.html
(2) This distribution is currently not in scipy.

References
----------
J.C. Finney, "Optimization of a Skewed Logistic Distribution With Respect
to the Kolmogorov-Smirnov Test", A Dissertation Submitted to the Graduate
Faculty of the Louisiana State University and Agricultural and Mechanical
College, (August, 2004),
https://digitalcommons.lsu.edu/gradschool_dissertations/3672

J.R.M. Hosking, "The four-parameter kappa distribution". IBM J. Res.
Develop. 38 (3), 25 1-258 (1994).

B. Kumphon, A. Kaew-Man, P. Seenoi, "A Rainfall Distribution for the Lampao
Site in the Chi River Basin, Thailand", Journal of Water Resource and
Protection, vol. 4, 866-869, (2012).
:doi:`10.4236/jwarp.2012.410101`

C. Winchester, "On Estimation of the Four-Parameter Kappa Distribution", A
Thesis Submitted to Dalhousie University, Halifax, Nova Scotia, (March
2000).
http://www.nlc-bnc.ca/obj/s4/f2/dsk2/ftp01/MQ57336.pdf

%(after_notes)s

%(example)s

c                    \         P                  ! W4      ^ ,          P                  p\         P                  ! VRR7      # )r   Tr  )rQ   rE  rG  full)rD   r  rk  rG  s   &&& r5   rd   kappa4_gen._argcheck  s.    ##A)!,22wwu..r7   c                    \        R R\        P                  ) \        P                  3R4      p\        RR\        P                  ) \        P                  3R4      pW.# )r  Frk  r4  rj   )rD   ihr,  s   &  r5   rm   kappa4_gen._shape_info  sG    UbffWbff$5~FUbffWbff$5~Fxr7   c           
        \         P                  ! V^ 8  V^ 8  4      \         P                  ! V^ 8  V^ 8H  4      \         P                  ! V^ 8  V^ 8  4      \         P                  ! V^ 8*  V^ 8  4      \         P                  ! V^ 8*  V^ 8H  4      \         P                  ! V^ 8*  V^ 8  4      .pR pR pR pR p\        VWEWFWg.W.\         P                  R7      pR pR p\        VWEWTWU.W.\         P                  R7      p	W3# )r   c                 L    R \         P                  ! W) 4      ,
          V,          # r8  )rQ   r;  r  rk  s   &&r5   r  #kappa4_gen._get_support.<locals>.f0  s    "..B//22r7   c                 .    \         P                  ! V 4      # rO   rc  rI  s   &&r5   r  #kappa4_gen._get_support.<locals>.f1  s    66!9r7   c                     \         P                  ! \         P                  ! V 4      4      p\         P                  ) VR &   V# NNNrQ   r  rG  rk   r  rk  r   s   && r5   f3#kappa4_gen._get_support.<locals>.f3  s,    !%AFF7AaDHr7   c                     R V,          # r8  r   rI  s   &&r5   f5#kappa4_gen._get_support.<locals>.f5      q5Lr7   defaultc                     R V,          # r8  r   rI  s   &&r5   r  rJ    rW  r7   c                     \         P                  ! \         P                  ! V 4      4      p\         P                  VR &   V# rN  rP  rQ  s   && r5   r  rL    s*    !%A66AaDHr7   rQ   r  r   rF  )
rD   r  rk  condlistr  r  rR  rU  r   r  s
   &&&       r5   r   kappa4_gen._get_support  s    NN1q5!a%0NN1q5!q&1NN1q5!a%0NN161q51NN16162NN161q513	3		
	 ""1!#)
		
 ""1!#) vr7   c                N    \         P                  ! V P                  WV4      4      # rO   r.  rD   rt   r  rk  s   &&&&r5   ru   kappa4_gen._pdf  r  r7   c                @   \         P                  ! V^ 8g  V^ 8g  4      \         P                  ! V^ 8H  V^ 8g  4      \         P                  ! V^ 8g  V^ 8H  4      \         P                  ! V^ 8H  V^ 8H  4      .pR pR pR pR p\        VWVWx.WV.\         P                  R7      # )r   c                    \         P                  ! RV,          R,
          V) V ,          4      \         P                  ! RV,          R,
          V) RW ,          ,
          RV,          ,          ,          4      ,           # )zbpdf = (1.0 - k*x)**(1.0/k - 1.0)*(
       1.0 - h*(1.0 - k*x)**(1.0/k))**(1.0/h-1.0)
logpdf = ...
r   r  rt   r  rk  s   &&&r5   r  kappa4_gen._logpdf.<locals>.f0  sX    
 JJs1us{QBqD1JJs1us{QBac	SU/C,CDE Fr7   c                    \         P                  ! RV,          R,
          V) V ,          4      RW ,          ,
          RV,          ,          ,
          # )zTpdf = (1.0 - k*x)**(1.0/k - 1.0)*np.exp(-(
       1.0 - k*x)**(1.0/k))
logpdf = ...
r   r  rd  s   &&&r5   r  kappa4_gen._logpdf.<locals>.f1  s7    
 ::c!eckA2a40C!#IQ3GGGr7   c                    V ) \         P                  ! RV,          R,
          V) \        P                  ! V ) 4      ,          4      ,           # )zBpdf = np.exp(-x)*(1.0 - h*np.exp(-x))**(1.0/h - 1.0)
logpdf = ...
r   )r|   r  rQ   r   rd  s   &&&r5   f2kappa4_gen._logpdf.<locals>.f2  s4     2

3q53;2661":>>>r7   c                @    V ) \         P                  ! V ) 4      ,
          # )z)pdf = np.exp(-x-np.exp(-x))
logpdf = ...
r7  rd  s   &&&r5   rR  kappa4_gen._logpdf.<locals>.f3  s     2r
?"r7   rX  r\  	rD   rt   r  rk  r]  r  r  ri  rR  s	   &&&&     r5   r   kappa4_gen._logpdf  s    NN16162NN16162NN16162NN161624
	F	H	?	# 8B+!9#%66+ 	+r7   c                N    \         P                  ! V P                  WV4      4      # rO   r  r`  s   &&&&r5   ry   kappa4_gen._cdf  r  r7   c                @   \         P                  ! V^ 8g  V^ 8g  4      \         P                  ! V^ 8H  V^ 8g  4      \         P                  ! V^ 8g  V^ 8H  4      \         P                  ! V^ 8H  V^ 8H  4      .pR pR pR pR p\        VWVWx.WV.\         P                  R7      # )r   c                    RV,          \         P                  ! V) RW ,          ,
          RV,          ,          ,          4      ,          # )z;cdf = (1.0 - h*(1.0 - k*x)**(1.0/k))**(1.0/h)
logcdf = ...
r   r_  rd  s   &&&r5   r  kappa4_gen._logcdf.<locals>.f0  s2     E288QBac	SU';$;<<<r7   c                >    RW ,          ,
          RV,          ,          ) # )z1cdf = np.exp(-(1.0 - k*x)**(1.0/k))
logcdf = ...
r   r   rd  s   &&&r5   r  kappa4_gen._logcdf.<locals>.f1  s     13Y#a%(((r7   c                    RV,          \         P                  ! V) \        P                  ! V ) 4      ,          4      ,          # )z1cdf = (1.0 - h*np.exp(-x))**(1.0/h)
logcdf = ...
r   )r|   r  rQ   r   rd  s   &&&r5   ri  kappa4_gen._logcdf.<locals>.f2  s,     E288QBrvvqbzM222r7   c                2    \         P                  ! V ) 4      ) # )z'cdf = np.exp(-np.exp(-x))
logcdf = ...
r7  rd  s   &&&r5   rR  kappa4_gen._logcdf.<locals>.f3  s     FFA2J;r7   rX  r\  rm  s	   &&&&     r5   r  kappa4_gen._logcdf  s    NN16162NN16162NN16162NN161624
	=	)	3	 8B+!9#%66+ 	+r7   c                @   \         P                  ! V^ 8g  V^ 8g  4      \         P                  ! V^ 8H  V^ 8g  4      \         P                  ! V^ 8g  V^ 8H  4      \         P                  ! V^ 8H  V^ 8H  4      .pR pR pR pR p\        VWVWx.WV.\         P                  R7      # )r   c                 f    R V,          R R W,          ,
          V,          V,          ,
          ,          # r8  r   r   r  rk  s   &&&r5   r  kappa4_gen._ppf.<locals>.f0  s&    q5##,!1A 5566r7   c                 h    R V,          R \         P                  ! V 4      ) V,          ,
          ,          # r8  rc  r}  s   &&&r5   r  kappa4_gen._ppf.<locals>.f1  s$    q5#"&&)a/00r7   c                t    \         P                  ! W,          ) 4      ) \        P                  ! V4      ,           # )z,ppf = -np.log((1.0 - (q**h))/h)
            r  r}  s   &&&r5   ri  kappa4_gen._ppf.<locals>.f2  s'     HHqtW%%q	11r7   c                 Z    \         P                  ! \         P                  ! V 4      ) 4      ) # rO   rc  r}  s   &&&r5   rR  kappa4_gen._ppf.<locals>.f3  s    FFBFF1I:&&&r7   rX  r\  )	rD   r   r  rk  r]  r  r  ri  rR  s	   &&&&     r5   r   kappa4_gen._ppf	  s    NN16162NN16162NN16162NN161624
	7	1	2
	' 8B+!9#%66+ 	+r7   c                t    \         P                  ! V^ 8  V^ 8  4      V^ 8  .pR pR p\        W4V.W.^R7      # )r   c                 H    RV ,          V,          P                  \        4      # r  astyper+  rI  s   &&r5   r  &kappa4_gen._get_stats_info.<locals>.f0(  s    F1H$$S))r7   c                 :    RV,          P                  \        4      # r  r  rI  s   &&r5   r  &kappa4_gen._get_stats_info.<locals>.f1+  s    F??3''r7   rX  )rQ   r  r   )rD   r  rk  r]  r  r  s   &&&   r5   _get_stats_infokappa4_gen._get_stats_info"  sG    NN1q5!q&)E

	*	( 8"XvqAAr7   c                    V P                  W4      p\        ^^4       Uu. uF3  p\        P                  ! WC8  4      '       d   RM\        P                  NK5  	  ppVR,          # u upi rM   NrO  )r  rR  rQ   r  rF  )rD   r  rk  maxrrI  outputss   &&&   r5   r   kappa4_gen._stats0  sU    ##A)AFq!MA266!(++47Mqz Ns   9A$c                    V P                  V^ ,          V^,          4      pW8  d   \        P                  # \        P                  ! V P
                  ^ ^V3V,           R7      ^ ,          # r   r  )r  rQ   rF  r   r,  _mom_integ1)rD   r  rF   r  s   &&* r5   _mom1_sckappa4_gen._mom1_sc5  sP    ##DGT!W5966M~~d..1A49EaHHr7   r   N)r   r   r   r   r   rd   rm   r   ru   r   ry   r  r   r  r   r  r   r   r   s   @r5   r@  r@  -  sN     Wp/
'R-
$+L-!+F+2B
I Ir7   r@  kappa4c                   `   a a ] tR tRt oRtR tR tR tV 3R ltR t	R t
R	 tR
 tRtVtV ;t# )
kappa3_geni?  a  Kappa 3 parameter distribution.

%(before_notes)s

Notes
-----
The probability density function for `kappa3` is:

.. math::

    f(x, a) = a (a + x^a)^{-(a + 1)/a}

for :math:`x > 0` and :math:`a > 0`.

`kappa3` takes ``a`` as a shape parameter for :math:`a`.

References
----------
P.W. Mielke and E.S. Johnson, "Three-Parameter Kappa Distribution Maximum
Likelihood and Likelihood Ratio Tests", Methods in Weather Research,
701-707, (September, 1973),
:doi:`10.1175/1520-0493(1973)101<0701:TKDMLE>2.3.CO;2`

B. Kumphon, "Maximum Entropy and Maximum Likelihood Estimation for the
Three-Parameter Kappa Distribution", Open Journal of Statistics, vol 2,
415-419 (2012), :doi:`10.4236/ojs.2012.24050`

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r3  rj   rl   s   &r5   rm   kappa3_gen._shape_info`  r6  r7   c                V    W"W,          ,           RV,          ^,
          ,          ,          # r  r   r9  s   &&&r5   ru   kappa3_gen._pdfc  s    ad(d1fQh'''r7   c                H    WW,          ,           RV,          ,          ,          # r  r   r9  s   &&&r5   ry   kappa3_gen._cdfg  s    ad(d1f%%%r7   c           	     H  < \         P                  ! W4      w  r\        SV `  W4      pR pW48  p\        P
                  ! \        P                  ! RW%,          ,          W%,          W,          W%,          ) ,          ,          4      4      ) pWd8  pW5,          V,          Wg&   WcV&   V# )g{Gz?r  )rQ   rE  r@   r~   r|   rf  r  )	rD   rt   r   sfcutoffrS  sf2i2r  s	   &&&     r5   r~   kappa3_gen._sfj  s    ""1(W[
 Kxx

4!$;qtadU{0BCDD\%)1	r7   c                L    W!V) ,          R ,
          ,          R V,          ,          # r8  r   rA  s   &&&r5   r   kappa3_gen._ppfz  s    qb53;3q5))r7   c                    \         P                  ! V) V) 4      p\         P                  ! V4      pW$,          R V,          ,          # r8  r  )rD   r   r   lgr	  s   &&&  r5   r   kappa3_gen._isf}  s4    ZZQB	S1W%%r7   c                    \        ^^4       Uu. uF3  p\        P                  ! W!8  4      '       d   RM\        P                  NK5  	  ppVR,          # u upi r  )rR  rQ   r  rF  )rD   r   rS  r  s   &&  r5   r   kappa3_gen._stats  sC    >CAqkJk266!%==4bff4kJqz Ks   9Ac                    \         P                  ! W^ ,          8  4      '       d   \         P                  # \        P                  ! V P
                  ^ ^V3V,           R7      ^ ,          # r  )rQ   r  rF  r   r,  r  )rD   r  rF   s   &&*r5   r  kappa3_gen._mom1_sc  sF    66!Aw,66M~~d..1A49EaHHr7   r   )r   r   r   r   r   rm   ru   ry   r~   r   r   r   r  r   r   r  r   s   @@r5   r  r  ?  s;     @E(& *&
I Ir7   r  kappa3c                   X   a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 tR tRtV tR# )	moyal_geni  aS  A Moyal continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `moyal` is:

.. math::

    f(x) = \exp(-(x + \exp(-x))/2) / \sqrt{2\pi}

for a real number :math:`x`.

%(after_notes)s

This distribution has utility in high-energy physics and radiation
detection. It describes the energy loss of a charged relativistic
particle due to ionization of the medium [1]_. It also provides an
approximation for the Landau distribution. For an in depth description
see [2]_. For additional description, see [3]_.

References
----------
.. [1] J.E. Moyal, "XXX. Theory of ionization fluctuations",
       The London, Edinburgh, and Dublin Philosophical Magazine
       and Journal of Science, vol 46, 263-280, (1955).
       :doi:`10.1080/14786440308521076` (gated)
.. [2] G. Cordeiro et al., "The beta Moyal: A useful skew distribution",
       International Journal of Research and Reviews in Applied Sciences,
       vol 10, 171-192, (2012).
       https://www.arpapress.com/files/volumes/vol10issue2/ijrras_10_2_02.pdf
.. [3] C. Walck, "Handbook on Statistical Distributions for
       Experimentalists; International Report SUF-PFY/96-01", Chapter 26,
       University of Stockholm: Stockholm, Sweden, (2007).
       http://www.stat.rice.edu/~dobelman/textfiles/DistributionsHandbook.pdf

.. versionadded:: 1.1.0

%(example)s

c                    . # rO   r   rl   s   &r5   rm   moyal_gen._shape_info  r   r7   Nc                b    \         P                  R ^VVR7      p\        P                  ! V4      ) # )r   )r   r.   r   r   )r(  r)  rQ   r  )rD   r   r   r*  s   &&& r5   r   moyal_gen._rvs  s.    YYAD$0  2r
{r7   c                    \         P                  ! RV\         P                  ! V) 4      ,           ,          4      \         P                  ! ^\         P                  ,          4      ,          # r   r#  )rQ   r   r'  r  r   s   &&r5   ru   moyal_gen._pdf  s:    vvda"&&!*n-.2551AAAr7   c                    \         P                  ! \        P                  ! RV,          4      \        P                  ! ^4      ,          4      # r  )r|   r
  rQ   r   r'  r   s   &&r5   ry   moyal_gen._cdf  s+    wwrvvdQh'"''!*455r7   c                    \         P                  ! \        P                  ! RV,          4      \        P                  ! ^4      ,          4      # r  )r|   r  rQ   r   r'  r   s   &&r5   r~   moyal_gen._sf  s+    vvbffTAX&344r7   c                t    \         P                  ! ^\        P                  ! V4      ^,          ,          4      ) # rD  )rQ   r  r|   erfcinvr   s   &&r5   r   moyal_gen._ppf  s&    q2::a=!++,,,r7   c                H   \         P                  ! ^4      \         P                  ,           p\         P                  ^,          ^,          p^\         P                  ! ^4      ,          \
        P                  ! ^4      ,          \         P                  ^,          ,          pRpWW43# )r   r  )rQ   r  euler_gammar  r'  r|   r  rx  s   &    r5   r   moyal_gen._stats  sc    VVAY'eeQhl"''!*_rwwqz)BEE1H4r7   c                   VR 8X  d,   \         P                  ! ^4      \         P                  ,           # VR8X  dV   \         P                  ^,          ^,          \         P                  ! ^4      \         P                  ,           ^,          ,           # VR8X  d   R\         P                  ^,          ,          \         P                  ! ^4      \         P                  ,           ,          p\         P                  ! ^4      \         P                  ,           ^,          p^\        P
                  ! ^4      ,          pW#,           V,           # VR8X  Ed   ^8\        P
                  ! ^4      ,          \         P                  ! ^4      \         P                  ,           ,          p^\         P                  ^,          ,          \         P                  ! ^4      \         P                  ,           ^,          ,          p\         P                  ! ^4      \         P                  ,           ^,          p^\         P                  ^,          ,          ^,          pW#,           V,           V,           # V P                  V4      # )r   r   r  rS  r  )rQ   r  r  r  r|   r  r  )rD   rc   tmp1r  tmp3tmp4s   &&    r5   r,  moyal_gen._munp  sj   866!9r~~--#X55!8a<266!9r~~#="AAA#X>RVVAYr~~%=>DFF1Ibnn,q0D
?D;%%#XBGGAJ&"&&)bnn*DEDruuax<266!9r~~#="AADFF1I.2Druuax<!#D;%,, ==##r7   r   r.  )r   r   r   r   r   rm   r   ru   ry   r~   r   r   r,  r   r   r   s   @r5   r  r    s9     )T
B65-$ $r7   r  moyalc                   t   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tRR ltRR ltRtV tR# )nakagami_geni  a  A Nakagami continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `nakagami` is:

.. math::

    f(x, \nu) = \frac{2 \nu^\nu}{\Gamma(\nu)} x^{2\nu-1} \exp(-\nu x^2)

for :math:`x >= 0`, :math:`\nu > 0`. The distribution was introduced in
[2]_, see also [1]_ for further information.

`nakagami` takes ``nu`` as a shape parameter for :math:`\nu`.

%(after_notes)s

References
----------
.. [1] "Nakagami distribution", Wikipedia
       https://en.wikipedia.org/wiki/Nakagami_distribution
.. [2] M. Nakagami, "The m-distribution - A general formula of intensity
       distribution of rapid fading", Statistical methods in radio wave
       propagation, Pergamon Press, 1960, 3-36.
       :doi:`10.1016/B978-0-08-009306-2.50005-4`

%(example)s

c                    V^ 8  # r  r   )rD   nus   &&r5   rd   nakagami_gen._argcheck  s    Avr7   c                @    \        R R^ \        P                  3R4      .# )r  Fr4  rj   rl   s   &r5   rm   nakagami_gen._shape_info  r5  r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  rD   rt   r  s   &&&r5   ru   nakagami_gen._pdf  r  r7   c                   \         P                  ! ^4      \        P                  ! W"4      ,           \        P                  ! V4      ,
          \        P                  ! ^V,          ^,
          V4      ,           W!^,          ,          ,
          # rD  )rQ   r  r|   r  r  r  s   &&&r5   r   nakagami_gen._logpdf  sX     q	BHHR,,rzz"~=21%&(*a40 	1r7   c                J    \         P                  ! W"V,          V,          4      # rO   rA  r  s   &&&r5   ry   nakagami_gen._cdf  s    {{2!tAv&&r7   c                r    \         P                  ! R V,          \        P                  ! W!4      ,          4      # r8  rJ  )rD   r   r  s   &&&r5   r   nakagami_gen._ppf   s#    wws2vbnnR3344r7   c                J    \         P                  ! W"V,          V,          4      # rO   rE  r  s   &&&r5   r~   nakagami_gen._sf#  s    ||B1Q''r7   c                r    \         P                  ! ^V,          \        P                  ! W!4      ,          4      # r_   rO  )rD   rH  r  s   &&&r5   r   nakagami_gen._isf&  s#    wwqtboob4455r7   c                   \         P                  ! VR 4      \        P                  ! V4      ,          pRW",          ,
          pV^^V,          V,          ,
          ,          R,          V,          \        P                  ! VR4      ,          pRV^,          ,          V,          ^V,          ^,
          V^,          ,          ,           ^V,          ,
          ^,           pWQVR,          ,          ,          pW#WE3# )r   r   r   rS  )r|   rT  rQ   r'  rU  )rD   r  ry  rz  r{  r|  s   &&    r5   r   nakagami_gen._stats)  s    WWRbggbk)"%i1qtCx< 3&+bhhsC.@@AXb[AbDFBE>)!B$.2
ckr7   c                6   \         P                  ! V4      p\         P                  ! V4      p\        P                  ! V4      pWR ,
          \        P
                  ! V4      ,          ,
          pR\         P                  ! V4      ,          \         P                  ! ^4      ,
          pW4,           V,           p\        P                  P                  4       pVR8  pWX,          V,           ^^W,          ,          ,          ,
          Wh&   VP                  V4      R,          # )r   g     j@r#  r   )rQ   rG  r  r|   r  rZ  r  rF  r/  r  r  )	rD   r  rG  r  r  r  r  norm_entropyrS  s	   &&       r5   r  nakagami_gen._entropy1  s    ]]2JJrNs(bjjn,,266":q	)EAIzz**, Htl"Q25\1yy##r7   Nc                \    \         P                  ! VP                  WR 7      V,          4      # r  )rQ   r'  r  )rD   r  r   r   s   &&&&r5   r   nakagami_gen._rvsB  s$    ww|2222ABFGGr7   c                J   \        V\        4      '       d   VP                  4       pVf   RV P                  ,          p\        P
                  ! V4      p\        P                  ! \        P                  ! W,
          ^,          4      \        V4      ,          4      pW#V3,           # )Nr8  )	r>   r)   r  numargsrQ   rR  r'  r  r  )rD   rE   rF   r-   r.   s   &&&  r5   r  nakagami_gen._fitstartF  sp    dL))>>#D<DLL(D ffTl
Q/#d);<El""r7   r   r.  rO   )r   r   r   r   r   rd   rm   ru   r   ry   r   r~   r   r   r  r   r  r   r   r   s   @r5   r  r    sM     >F+1'5(6$"H	# 	#r7   r  nakagamic                    VR ,          R,
          p\         P                  ! V 4      \         P                  ! V4      rT\        P                  ! VR ,          W,          4      RWE,
          ^,          ,          ,
          p\        P                  ! W4V,          4      R ,          p\
        P                  ! V^ 8  Wg3R \         P                  ) R7      # )r   r   r   c                 <    V \         P                  ! V4      ,           # rO   rc  )rI  r\  s   &&r5   r  _ncx2_log_pdf.<locals>.<lambda>b  s    Q]r7   r  )rQ   r'  r|   r  iver  r  rk   )rt   r3  r  df2r	  nsr  corrs   &&&     r5   _ncx2_log_pdfr  V  s     S&3,CWWQZ
((3s7AD
!C1$4
4C66#"u#D??q	"FF7	 r7   c                   d   a  ] tR tRt o RtR tR tRR ltR tR t	R	 t
R
 tR tR tR tRtV tR# )ncx2_genif  a  A non-central chi-squared continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `ncx2` is:

.. math::

    f(x, k, \lambda) = \frac{1}{2} \exp(-(\lambda+x)/2)
        (x/\lambda)^{(k-2)/4}  I_{(k-2)/2}(\sqrt{\lambda x})

for :math:`x >= 0`, :math:`k > 0` and :math:`\lambda \ge 0`.
:math:`k` specifies the degrees of freedom (denoted ``df`` in the
implementation) and :math:`\lambda` is the non-centrality parameter
(denoted ``nc`` in the implementation). :math:`I_\nu` denotes the
modified Bessel function of first order of degree :math:`\nu`
(`scipy.special.iv`).

`ncx2` takes ``df`` and ``nc`` as shape parameters.

This distribution uses routines from the Boost Math C++ library for
the computation of the ``pdf``, ``cdf``, ``ppf``, ``sf`` and ``isf``
methods. [1]_

%(after_notes)s

References
----------
.. [1] The Boost Developers. "Boost C++ Libraries". https://www.boost.org/.

%(example)s

c                V    V^ 8  \         P                  ! V4      ,          V^ 8  ,          # r  r  rD   r3  r  s   &&&r5   rd   ncx2_gen._argcheck  s"    Q"++b/)R1W55r7   c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      pW.# )r3  Fr  r4  ri   rj   rD   idfincs   &  r5   rm   ncx2_gen._shape_info  s:    uq"&&k>Buq"&&k=Azr7   Nc                &    VP                  WV4      # rO   )noncentral_chisquare)rD   r3  r  r   r   s   &&&&&r5   r   ncx2_gen._rvs  s    00>>r7   c                H    \         P                  ! V^ 8g  WV3\        R 4      # )r   c                 ,    \         P                  W4      # rO   )r7  r   rt   r3  _s   &&&r5   r  "ncx2_gen._logpdf.<locals>.<lambda>  s    Q0Cr7   )r  r  r  rD   rt   r3  r  s   &&&&r5   r   ncx2_gen._logpdf  s&    rQw]CE 	Er7   c                    \         P                  ! R R7      ;_uu_ 4        \        P                  ! V^ 8g  WV3\        P
                  R 4      uuRRR4       #   + '       g   i     R# ; i)rl  r  c                 ,    \         P                  W4      # rO   )r7  ru   r  s   &&&r5   r  ncx2_gen._pdf.<locals>.<lambda>      DIIa4Dr7   N)rQ   ro  r  r  rq   	_ncx2_pdfr  s   &&&&r5   ru   ncx2_gen._pdf  B    [[h''??27QBK#DF ('''   -AA)	c                    \         P                  ! R R7      ;_uu_ 4        \        P                  ! V^ 8g  WV3\        P
                  R 4      uuRRR4       #   + '       g   i     R# ; i)rl  r  c                 ,    \         P                  W4      # rO   )r7  ry   r  s   &&&r5   r  ncx2_gen._cdf.<locals>.<lambda>  r
  r7   N)rQ   ro  r  r  r|   chndtrr  s   &&&&r5   ry   ncx2_gen._cdf  sB    [[h''??27QBK#DF ('''r  c                    \         P                  ! R R7      ;_uu_ 4        \        P                  ! V^ 8g  WV3\        P
                  R 4      uuRRR4       #   + '       g   i     R# ; i)rl  r  c                 ,    \         P                  W4      # rO   )r7  r   r  s   &&&r5   r  ncx2_gen._ppf.<locals>.<lambda>  r
  r7   N)rQ   ro  r  r  r|   chndtrixrD   r   r3  r  s   &&&&r5   r   ncx2_gen._ppf  sB    [[h''??27QBK#DF ('''r  c                    \         P                  ! R R7      ;_uu_ 4        \        P                  ! V^ 8g  WV3\        P
                  R 4      uuRRR4       #   + '       g   i     R# ; i)rl  r  c                 ,    \         P                  W4      # rO   )r7  r~   r  s   &&&r5   r  ncx2_gen._sf.<locals>.<lambda>  s    DHHQOr7   N)rQ   ro  r  r  rq   _ncx2_sfr  s   &&&&r5   r~   ncx2_gen._sf  sB    [[h''??27QBK#CE ('''r  c                    \         P                  ! R R7      ;_uu_ 4        \        P                  ! V^ 8g  WV3\        P
                  R 4      uuRRR4       #   + '       g   i     R# ; i)rl  r  c                 ,    \         P                  W4      # rO   )r7  r   r  s   &&&r5   r  ncx2_gen._isf.<locals>.<lambda>  r
  r7   N)rQ   ro  r  r  rq   	_ncx2_isfr  s   &&&&r5   r   ncx2_gen._isf  r  r  c                (   W,           pR  pRV! WR4      ,          p\         P                  ! R4      V! W^4      ,          \         P                  ! V! WR4      ^,          4      ,          pRV! WR4      ,          V! WR4      ^,          ,          pVVVV3# )c                      WV,          ,           # rO   r   )rk  r>  r\  s   &&&r5   	k_plus_cl"ncx2_gen._stats.<locals>.k_plus_cl  s    s7Nr7   r   r  r  r  r  )rD   r3  r  
_ncx2_meanr&  _ncx2_variance_ncx2_skewness_ncx2_kurtosis_excesss   &&&     r5   r   ncx2_gen._stats  s    W
		"# 66''#,21)=='')BC"8!";<=!%	"#(>!>!*23!7!:"; !	
 	
r7   r   r.  )r   r   r   r   r   rd   rm   r   r   ru   ry   r   r~   r   r   r   r   r   s   @r5   r  r  f  sH     "F6
?EF
F
F
E
F

 
r7   r  ncx2c                   b   a  ] tR tRt o RtR tR tRR ltR tR t	R	 t
R
 tR tRR ltRtV tR# )ncf_geni  a  A non-central F distribution continuous random variable.

%(before_notes)s

See Also
--------
scipy.stats.f : Fisher distribution

Notes
-----
The probability density function for `ncf` is:

.. math::

    f(x, n_1, n_2, \lambda) =
        \exp\left(\frac{\lambda}{2} +
                  \lambda n_1 \frac{x}{2(n_1 x + n_2)}
            \right)
        n_1^{n_1/2} n_2^{n_2/2} x^{n_1/2 - 1} \\
        (n_2 + n_1 x)^{-(n_1 + n_2)/2}
        \gamma(n_1/2) \gamma(1 + n_2/2) \\
        \frac{L^{\frac{n_1}{2}-1}_{n_2/2}
            \left(-\lambda n_1 \frac{x}{2(n_1 x + n_2)}\right)}
        {B(n_1/2, n_2/2)
            \gamma\left(\frac{n_1 + n_2}{2}\right)}

for :math:`n_1, n_2 > 0`, :math:`\lambda \ge 0`.  Here :math:`n_1` is the
degrees of freedom in the numerator, :math:`n_2` the degrees of freedom in
the denominator, :math:`\lambda` the non-centrality parameter,
:math:`\gamma` is the logarithm of the Gamma function, :math:`L_n^k` is a
generalized Laguerre polynomial and :math:`B` is the beta function.

`ncf` takes ``dfn``, ``dfd`` and ``nc`` as shape parameters. If ``nc=0``,
the distribution becomes equivalent to the Fisher distribution.

This distribution uses routines from the Boost Math C++ library for
the computation of the ``pdf``, ``cdf``, ``ppf``, ``stats``, ``sf`` and
``isf`` methods. [1]_

%(after_notes)s

References
----------
.. [1] The Boost Developers. "Boost C++ Libraries". https://www.boost.org/.

%(example)s

c                4    V^ 8  V^ 8  ,          V^ 8  ,          # r  r   )rD   r  r  r  s   &&&&r5   rd   ncf_gen._argcheck  s    aC!G$a00r7   c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      p\        RR^ \        P                  3R4      pWV.# )r  Fr  r  r4  ri   rj   )rD   idf1idf2r  s   &   r5   rm   ncf_gen._shape_info  sU    %BFF^D%BFF^Duq"&&k=AC  r7   Nc                &    VP                  WW44      # rO   )noncentral_f)rD   r  r  r  r   r   s   &&&&&&r5   r   ncf_gen._rvs   s    ((2<<r7   c                0    \         P                  ! WW44      # rO   )rq   _ncf_pdfrD   rt   r  r  r  s   &&&&&r5   ru   ncf_gen._pdf  s    ||AC,,r7   c                0    \         P                  ! W#WA4      # rO   )r|   ncfdtrr;  s   &&&&&r5   ry   ncf_gen._cdf  s    yy2))r7   c                    \         P                  ! R R7      ;_uu_ 4        \        P                  ! W#WA4      uuRRR4       #   + '       g   i     R# ; ir  )rQ   ro  r|   ncfdtri)rD   r   r  r  r  s   &&&&&r5   r   ncf_gen._ppf	  s.    [[h''::c. ('''r  c                0    \         P                  ! WW44      # rO   )rq   _ncf_sfr;  s   &&&&&r5   r~   ncf_gen._sf  s    {{13++r7   c                    \         P                  ! R R7      ;_uu_ 4        \        P                  ! WW44      uuRRR4       #   + '       g   i     R# ; ir  )rQ   ro  rq   _ncf_isfr;  s   &&&&&r5   r   ncf_gen._isf  s.    [[h''<<0 ('''r  c                    \         P                  ! WV4      p\         P                  ! WV4      pR V9   d   \         P                  ! WV4      MRpRV9   d   \         P                  ! WV4      ^,
          MRpWVWx3# rj  Nrk  )rq   	_ncf_mean_ncf_variance_ncf_skewness_ncf_kurtosis_excess)	rD   r  r  r  rl  ry  rz  r{  r|  s	   &&&&&    r5   r   ncf_gen._stats  sv    ]]3R("-03wSs,D!$ %%b59 	 r7   r   r.  rq  r   r   r   r   r   rd   rm   r   ru   ry   r   r~   r   r   r   r   r   s   @r5   r/  r/    s=     /`1!=-*/,1 r7   r/  ncfc                   d   a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 tR tR tR tRtV tR# )t_geni)  a?  A Student's t continuous random variable.

For the noncentral t distribution, see `nct`.

%(before_notes)s

See Also
--------
nct

Notes
-----
The probability density function for `t` is:

.. math::

    f(x, \nu) = \frac{\Gamma((\nu+1)/2)}
                    {\sqrt{\pi \nu} \Gamma(\nu/2)}
                (1+x^2/\nu)^{-(\nu+1)/2}

where :math:`x` is a real number and the degrees of freedom parameter
:math:`\nu` (denoted ``df`` in the implementation) satisfies
:math:`\nu > 0`. :math:`\Gamma` is the gamma function
(`scipy.special.gamma`).

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r2  rj   rl   s   &r5   rm   t_gen._shape_infoH  r5  r7   Nc                &    VP                  WR 7      # r  )
standard_tr8  s   &&&&r5   r   
t_gen._rvsK  s    &&r&55r7   c                d   a  \         P                  ! V\        P                  8H  W3R  V 3R l4      # )c                 ,    \         P                  V 4      # rO   )r/  ru   rt   r3  s   &&r5   r  t_gen._pdf.<locals>.<lambda>Q  s    $))A,r7   c                 N   < \         P                  ! SP                  W4      4      # rO   r.  )rt   r3  rD   s   &&r5   r  r\  R  s    "&&a!45r7   rU  r;  s   f&&r5   ru   
t_gen._pdfN  s)    "&&L1'&57 	7r7   c                b    R  pR p\         P                  ! V\        P                  8H  W3WC4      # )c                 v   \         P                  ! \        P                  ! R V,          R 4      4      R \         P                  ! V4      \         P                  ! \         P                  4      ,           ,          ,
          V^,           ^,          \         P
                  ! W ,          V,          4      ,          ,
          # r  )rQ   r  r|   rT  r  r  r[  s   &&r5   t_logpdft_gen._logpdf.<locals>.t_logpdfV  sl    FF27738S12RVVBZ"&&-789Avqj!%(!334 5r7   c                 ,    \         P                  V 4      # rO   )r/  r   r[  s   &&r5   norm_logpdf"t_gen._logpdf.<locals>.norm_logpdf[  s    <<?"r7   rU  )rD   rt   r3  ra  rd  s   &&&  r5   r   t_gen._logpdfT  s+    	5
	# rRVV|aWkLLr7   c                .    \         P                  ! W!4      # rO   r|   stdtrr;  s   &&&r5   ry   
t_gen._cdf`  rt  r7   c                0    \         P                  ! W!) 4      # rO   rh  r;  s   &&&r5   r~   	t_gen._sfc  s    xxBr7   c                .    \         P                  ! W!4      # rO   r|   stdtritrL  s   &&&r5   r   
t_gen._ppff  s    zz"  r7   c                0    \         P                  ! W!4      ) # rO   rn  rL  s   &&&r5   r   
t_gen._isfi  s    

2!!!r7   c                *   \         P                  ! V4      p\         P                  ! V^8  R\         P                  4      pV^8  V^8*  ,          V^8  \         P                  ! V4      ,          V3pR R R 3p\        WEV3\         P                  4      p\         P                  ! V^8  R\         P                  4      pV^8  V^8*  ,          V^8  \         P                  ! V4      ,          V3pR R R 3p\        WEV3\         P                  4      pW6Wx3# )rM   r   c                 `    \         P                  ! \         P                  V P                  4      # rO   rQ   broadcast_tork   rG  r[  s   &r5   r  t_gen._stats.<locals>.<lambda>u      !Br7   c                      W R ,
          ,          # rr  r   r[  s   &r5   r  rw  v  s
    #vr7   c                 D    \         P                  ! ^V P                  4      # r_   rQ   rv  rG  r[  s   &r5   r  rw  w      BHH!=r7   c                 `    \         P                  ! \         P                  V P                  4      # rO   ru  r[  s   &r5   r  rw    rx  r7   c                 "    R V R,
          ,          # )rJ  r  r   r[  s   &r5   r  rw    s    3r7   c                 D    \         P                  ! ^ V P                  4      # r  r{  r[  s   &r5   r  rw    r|  r7   )rQ   isposinfr  rk   r$  r   rF  )	rD   r3  infinite_dfry  r]  
choicelistrz  r{  r|  s	   &&       r5   r   t_gen._statsl  s    kk"oXXb1fc266*!Va(!Vr{{2.! C.=?
 (rvv>XXb1fc266*!Va(!Vr{{2.! C/=?
 ubff=r7   c                    V\         P                  8X  d   \        P                  4       # R  pR p\        P
                  ! V^d8  WV4      # )c                 :   V ^,          pV ^,           ^,          pV\         P                  ! V4      \         P                  ! V4      ,
          ,          \        P                  ! \        P                  ! V 4      \         P
                  ! VR4      ,          4      ,           # rI  )r|   rZ  rQ   r  r'  r  )r3  halfhalf1s   &  r5   r  t_gen._entropy.<locals>.regular  se    a4D!VQJE2::e,rzz$/??@ffRWWR[s);;<= >r7   c                    \         P                  4       ^V ,          ,           V R,          ^,          ,           V R,          ^,          ,
          V R,          ^,          ,
          RV R,          ,          ,           V R,          ^,          ,           pV# )rM   r  r  r  g333333?r  r  )r/  r  )r3  r  s   & r5   r  "t_gen._entropy.<locals>.asymptotic  sg     1R4'2s7A+5S!CGQ;!%r3w035s7A+>AHr7   )rQ   rk   r/  r  r  r  )rD   r3  r  r  s   &&  r5   r  t_gen._entropy  s<    <==?"	>	 rSy"'BBr7   r   r.  rd  r   s   @r5   rS  rS  )  sE     <F67
M !"4C Cr7   rS  r  c                   b   a  ] tR tRt o RtR tR tRR ltR tR t	R	 t
R
 tR tRR ltRtV tR# )nct_geni  aE  A non-central Student's t continuous random variable.

%(before_notes)s

Notes
-----
If :math:`Y` is a standard normal random variable and :math:`V` is
an independent chi-square random variable (`chi2`) with :math:`k` degrees
of freedom, then

.. math::

    X = \frac{Y + c}{\sqrt{V/k}}

has a non-central Student's t distribution on the real line.
The degrees of freedom parameter :math:`k` (denoted ``df`` in the
implementation) satisfies :math:`k > 0` and the noncentrality parameter
:math:`c` (denoted ``nc`` in the implementation) is a real number.

This distribution uses routines from the Boost Math C++ library for
the computation of the ``pdf``, ``cdf``, ``ppf``, ``sf`` and ``isf``
methods. [1]_

%(after_notes)s

References
----------
.. [1] The Boost Developers. "Boost C++ Libraries". https://www.boost.org/.

%(example)s

c                    V^ 8  W"8H  ,          # r  r   r  s   &&&r5   rd   nct_gen._argcheck  s    Q28$$r7   c                    \        R R^ \        P                  3R4      p\        RR\        P                  ) \        P                  3R4      pW.# )r3  Fr  r4  rj   r  s   &  r5   rm   nct_gen._shape_info  sA    uq"&&k>Buw&7Hzr7   Nc                    \         P                  W#VR 7      p\        P                  WVR7      pV\        P                  ! V4      ,          \        P                  ! V4      ,          # )r  r'  )r/  r)  r7  rQ   r'  )rD   r3  r  r   r   rc   r  s   &&&&&  r5   r   nct_gen._rvs  sE    HH\HBXXb,X?2772;,,r7   c                0    \         P                  ! WV4      # rO   )rq   _nct_pdfr  s   &&&&r5   ru   nct_gen._pdf  s    ||A2&&r7   c                0    \         P                  ! W#V4      # rO   )r|   nctdtrr  s   &&&&r5   ry   nct_gen._cdf  s    yy##r7   c                0    \         P                  ! W#V4      # rO   )r|   nctdtritr  s   &&&&r5   r   nct_gen._ppf  s    {{21%%r7   c           	         \         P                  ! R R7      ;_uu_ 4        \         P                  ! \        P                  ! WV4      ^ ^4      uuRRR4       #   + '       g   i     R# ; ir  )rQ   ro  cliprq   _nct_sfr  s   &&&&r5   r~   nct_gen._sf  s;    [[h''773;;qb11a8 ('''r  c                    \         P                  ! R R7      ;_uu_ 4        \        P                  ! WV4      uuRRR4       #   + '       g   i     R# ; ir  )rQ   ro  rq   _nct_isfr  s   &&&&r5   r   nct_gen._isf  s.    [[h''<<r* ('''r  c                    \         P                  ! W4      p\         P                  ! W4      pR V9   d   \         P                  ! W4      MRpRV9   d   \         P                  ! W4      MRpWEWg3# rJ  )rq   	_nct_mean_nct_variance_nct_skewness_nct_kurtosis_excess)rD   r3  r  rl  ry  rz  r{  r|  s   &&&&    r5   r   nct_gen._stats  sZ    ]]2"'*-.Sr&d14S%%b-Tr7   r   r.  rq  rP  r   s   @r5   r  r    s=     @%
-
'$&9+ r7   r  nctc                      a a ] tR tRt oRtR tR tR tR tR t	R t
RR	 ltR
 t]]! ]4      V 3R l4       4       tRtVtV ;t# )
pareto_geni  a   A Pareto continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `pareto` is:

.. math::

    f(x, b) = \frac{b}{x^{b+1}}

for :math:`x \ge 1`, :math:`b > 0`.

`pareto` takes ``b`` as a shape parameter for :math:`b`.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r  rj   rl   s   &r5   rm   pareto_gen._shape_info  r6  r7   c                0    W!V) ^,
          ,          ,          # r_   r   r  s   &&&r5   ru   pareto_gen._pdf   s    r!t9}r7   c                "    ^W) ,          ,
          # r_   r   r  s   &&&r5   ry   pareto_gen._cdf   s    1r7{r7   c                6    \        ^V,
          RV,          4      # )rM   r  r:  r  s   &&&r5   r   pareto_gen._ppf   s    1Q3Qr7   c                    W) ,          # rO   r   r  s   &&&r5   r~   pareto_gen._sf   s    2wr7   c                >    \         P                  ! VRV,          4      # r  r  r  s   &&&r5   r   pareto_gen._isf   s    xx4!8$$r7   c                <   R
w  r4rVRV9   dz   V^8  p\         P                  ! Wq4      p\         P                  ! \         P                  ! V4      \         P                  R7      p\         P
                  ! W7WR,
          ,          4       RV9   d   V^8  p\         P                  ! Wq4      p\         P                  ! \         P                  ! V4      \         P                  R7      p\         P
                  ! WGWR,
          ,          VR,
          ^,          ,          4       RV9   d   V^8  p\         P                  ! Wq4      p\         P                  ! \         P                  ! V4      \         P                  R7      p^VR,           ,          \         P                  ! VR,
          4      ,          VR,
          \         P                  ! V4      ,          ,          p	\         P
                  ! WWV	4       RV9   d   V^8  p\         P                  ! Wq4      p\         P                  ! \         P                  ! V4      \         P                  R7      pR	\         P                  ! . ROV4      ,          \         P                  ! . ROV4      ,          p	\         P
                  ! WgV	4       W4WV3# )Nr  r  r   r  r   rj  r  rk  rJ  r  )r   r   r  r<  )r   g      r  r   )	rQ   extractrB  rG  rk   placerF  r'  r
  )
rD   r   rl  ry  rz  r{  r|  maskbtrm  s
   &&&       r5   r   pareto_gen._stats   s   0'>q5DD$B!8BHHRrV}-'>q5DD$B''"((1+"&&9CHHSfC! ;<'>q5DD$B!8BS>BGGBH$55"s(bggbk9QRDHHRt$'>q5DD$B!8B

#5r::JJ5r:;DHHRt$r7   c                X    ^RV,          ,           \         P                  ! V4      ,
          # r&  rc  rD   r   s   &&r5   r  pareto_gen._entropy,       3q5y266!9$$r7   c                z  <aaaaaaa \        V SW#4      pVw  oorVVeI   \        P                  ! S4      V,
          T;'       g    ^ 8  d   \        R^\        P                  R7      hSP
                  ^ ,          oVV3R loYVu;J d   EfP   M EMKV3R loV3R loVVVVV3R loV3R lp\        VP                  R^4      4      pV^,          V^,          rV! W4      '       g1   V	^ 8  g   V
\        P                  8  d   V	^,          p	V
^,          p
K>  \        SW.R	7      pVP                  '       d   VP                  p\        P                  ! S4      V,
          pS;'       g	    S! W4      pW,           \        P                  ! S4      8  g5   \        P                  ! S4      V,
          p\        P                  ! V^ 4      pWV3# \        SV `4  ! S3/ VB # Vf   \        P                  ! S4      V,
          pMTpT;'       g    \        P                  ! S4      V,
          pS;'       g	    S! W4      pWV3# )
Nparetor  c                    < S\         P                  ! \         P                  ! SV,
          V ,          4      4      ,          # rO   r
  )r.   locationrE   ndatas   &&r5   	get_shape!pareto_gen.fit.<locals>.get_shape<   s+     266"&&$/U)B"CDDDr7   c                 $   < SV ,          V,          # rO   r   )rG  r.   r  s   &&r5   	dL_dScale!pareto_gen.fit.<locals>.dL_dScaleG   s     u}u,,r7   c                 h   < V ^,           \         P                  ! ^SV,
          ,          4      ,          # r_   r  )rG  r  rE   s   &&r5   dL_dLocation$pareto_gen.fit.<locals>.dL_dLocationL   s&     	RVVA,A%BBBr7   c                    < \         P                  ! S4      V ,
          pS;'       g	    S! W4      pS! W!4      S! W 4      ,
          # rO   )rQ   rR  )r.   r  rG  r  r  rE   r
  r  s   &  r5   r  $pareto_gen.fit.<locals>.fun_to_solveQ   s>     66$<%/<<)E"<#E4y7NNNr7   c                 v   < \         P                  ! S! V 4      4      \         P                  ! S! V4      4      8g  # rO   rP   rS   rT   r  s   &&r5   rU   .pareto_gen.fit.<locals>.interval_contains_rootX   s/    V 45V 456 7r7   r.   r  )rR  rQ   rR  r  rk   rG  r  r<   r*   r
  rS  r
  r@   rB   )rD   rE   rF   r4   r
  r  r  rU   r  rS   rT   r  r.   r-   rG  r  r  r
  r  r  r  r  s   &f*,           @@@@@@r5   rB   pareto_gen.fit/   s    1tTH
%/"fd tt 3v{{ Cxq??

1	E
 !!-
C
O O7  ! 45K(1_kAoF .f==
frvvo!!lV4DEC}}}ffTlU*77)E"7 rvvd|3FF4L3.ELL2E5((w{40400\&&,'CC ,,"&&,,//)E/5  r7   r   rq  )r   r   r   r   r   rm   ru   ry   r   r~   r   r   r  rK   r   r   rB   r   r   r  r   s   @@r5   r  r    s\     *E %6% M*R! + R! R!r7   r  r  c                   `   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tRtV tR# )	lomax_geni   aw  A Lomax (Pareto of the second kind) continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `lomax` is:

.. math::

    f(x, c) = \frac{c}{(1+x)^{c+1}}

for :math:`x \ge 0`, :math:`c > 0`.

`lomax` takes ``c`` as a shape parameter for :math:`c`.

`lomax` is a special case of `pareto` with ``loc=-1.0``.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   lomax_gen._shape_info   r6  r7   c                L    VR ,          R V,           VR ,           ,          ,          # r8  r   r`  s   &&&r5   ru   lomax_gen._pdf   s    uc!equ%%%r7   c                    \         P                  ! V4      V^,           \        P                  ! V4      ,          ,
          # r_   r  r`  s   &&&r5   r   lomax_gen._logpdf   s&    vvayAaC!,,,r7   c                h    \         P                  ! V) \         P                  ! V4      ,          4      ) # rO   re  r`  s   &&&r5   ry   lomax_gen._cdf   s"    !BHHQK(((r7   c                f    \         P                  ! V) \        P                  ! V4      ,          4      # rO   )rQ   r   r|   r  r`  s   &&&r5   r~   lomax_gen._sf   s    vvqb!n%%r7   c                >    V) \         P                  ! V4      ,          # rO   r_  r`  s   &&&r5   r
  lomax_gen._logsf   s    r"((1+~r7   c                h    \         P                  ! \         P                  ! V) 4      ) V,          4      # rO   re  rg  s   &&&r5   r   lomax_gen._ppf   s!    xx1"a((r7   c                0    VRV,          ,          ^,
          # r  r   rg  s   &&&r5   r   lomax_gen._isf   s    4!8}q  r7   c                @    \         P                  VRRR7      w  r#rEW#WE3# )r   rz  )r-   rl  r  )r  rF  r  s   &&    r5   r   lomax_gen._stats   s$     ,,qdF,Cr7   c                X    ^RV,          ,           \         P                  ! V4      ,
          # r&  rc  r  s   &&r5   r  lomax_gen._entropy   s    Qwrvvay  r7   r   N)r   r   r   r   r   rm   ru   r   ry   r~   r
  r   r   r   r  r   r   r   s   @r5   r  r     sB     .E&-)&)!! !r7   r  lomaxc                      a a ] tR tRt oRtR tR tR tR tR t	R t
R	 tR
 tRR ltR t]]! ]RR7      V 3R l4       4       tRtVtV ;t# )pearson3_geni   a  A pearson type III continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `pearson3` is:

.. math::

    f(x, \kappa) = \frac{|\beta|}{\Gamma(\alpha)}
                   (\beta (x - \zeta))^{\alpha - 1}
                   \exp(-\beta (x - \zeta))

where:

.. math::

        \beta = \frac{2}{\kappa}

        \alpha = \beta^2 = \frac{4}{\kappa^2}

        \zeta = -\frac{\alpha}{\beta} = -\beta

:math:`\Gamma` is the gamma function (`scipy.special.gamma`).
Pass the skew :math:`\kappa` into `pearson3` as the shape parameter
``skew``.

%(after_notes)s

%(example)s

References
----------
R.W. Vogel and D.E. McMartin, "Probability Plot Goodness-of-Fit and
Skewness Estimation Procedures for the Pearson Type 3 Distribution", Water
Resources Research, Vol.27, 3149-3158 (1991).

L.R. Salvosa, "Tables of Pearson's Type III Function", Ann. Math. Statist.,
Vol.1, 191-198 (1930).

"Using Modern Computing Tools to Fit the Pearson Type III Distribution to
Aviation Loads Data", Office of Aviation Research (2003).

c                :   R pRpRp\         P                  ! RW4      w  rapVP                  4       p\         P                  ! V4      V8  pV( pRW(,          V,          ,          p	WI,          ^,          p
W:V	,          ,
          pWV,          V,
          ,          pWaWWW3# )r   r   g>r   )rQ   rE  r  r	  )rD   rt   rL  r-   r.   norm2pearson_transitionansr  invmaskr  rK  r  transxs   &&&          r5   _preprocesspearson3_gen._preprocess   s    
  #+**38hhj {{4 #::%dme+,!T\!7d*+vWE??r7   c                .    \         P                  ! V4      # rO   r  )rD   rL  s   &&r5   rd   pearson3_gen._argcheck!  s    
 {{4  r7   c                ^    \        R R\        P                  ) \        P                  3R4      .# )rL  Fr4  rj   rl   s   &r5   rm   pearson3_gen._shape_info!  s%    65BFF7BFF*;^LMMr7   c                6    R pRpTpRV^,          ,          pW#WE3# )r   r   rS  r   )rD   rL  r  r  rj  rk  s   &&    r5   r   pearson3_gen._stats!  s(    aKQzr7   c                    \         P                  ! V P                  W4      4      pVP                  ^ 8X  d!   \         P                  ! V4      '       d   R# V# RV\         P                  ! V4      &   V# )r   r   )rQ   r   r   r  r-  )rD   rt   rL  r  s   &&& r5   ru   pearson3_gen._pdf !  sR    
 ffT\\!*+88q=xx}}J BHHSM
r7   c                    V P                  W4      w  r1rErgr\        P                  ! \        W,          4      4      W5&   \        P                  ! \	        V4      4      \
        P                  WH4      ,           W6&   V# rO   )r  rQ   r  r   r	  r(  r5  )
rD   rt   rL  r  r  r  r  r  rK  r  s
   &&&       r5   r   pearson3_gen._logpdf-!  sa     Q% 	6gU FF9QW-.	 vvc$i(5<<+FF
r7   c                   V P                  W4      w  r1rErgr\        W,          4      W5&   \        P                  ! W&P                  4      p\        P
                  ! Wb^ 8  4      p	W&,          ^ 8  p
\        P                  WJ,          W,          4      W9&   \        P
                  ! Wb^ 8  4      pW&,          ^ 8  p\        P                  WL,          W,          4      W;&   V# r  )	r  r   rQ   rv  rG  r  r(  r   r  rD   rt   rL  r  r  r  r  r  rK  	invmask1a	invmask1b	invmask2a	invmask2bs   &&&          r5   ry   pearson3_gen._cdf<!  s    Q% 	3g% ag&	t]]3NN71H5	MA%	 6#4e6FG NN71H5	MA%	&"3U5EF
r7   c                   V P                  W4      w  r1rErgr\        W,          4      W5&   \        P                  ! W&P                  4      p\        P
                  ! Wb^ 8  4      p	W&,          ^ 8  p
\        P                  WJ,          W,          4      W9&   \        P
                  ! Wb^ 8  4      pW&,          ^ 8  p\        P                  WL,          W,          4      W;&   V# r  )	r  r   rQ   rv  rG  r  r(  r  r   r  s   &&&          r5   r~   pearson3_gen._sfT!  s    Q% 	3g% QW%	t]]3NN71H5	MA%	&"3U5EFNN71H5	MA%	6#4e6FG
r7   c                2   \         P                  ! W4      pV P                  ^ .V4      w  p rVrxrVP                  4       pVP                  V,
          pVP                  V4      WF&   VP                  W4      V,          V
,           WG&   VR8X  d
   V^ ,          pV# )r   r   )rQ   rv  r  r  r   r   r  )rD   rL  r   r   r  r  r  r  r  rK  r  nsmallnbigs   &&&&         r5   r   pearson3_gen._rvse!  s    t*aS$' 	4Q yy6! 008	#225?DtK2:a&C
r7   c                    V P                  W4      w  r1rErgr\        W,          4      W5&   W,          p^W^ 8  ,          ,
          W^ 8  &   \        P                  ! W4      V,          V	,           W6&   V# r_   )r  r   r|   rK  )
rD   r   rL  r  r  r  r  r  rK  r  s
   &&&       r5   r   pearson3_gen._ppfs!  sf    Q% 	4ag&	J!1H+o(~~e/4t;
r7   ze        Note that method of moments (`method='MM'`) is not
        available for this distribution.

r  c                   < VP                  R R4      R8X  d   \        R4      h\        \        V 4      V `  ! V.VO5/ VB # )r0   NMMzhFit `method='MM'` is not available for the Pearson3 distribution. Please try the default `method='MLE'`.)r<   NotImplementedErrorr@   rA   rB   r  s   &&*,r5   rB   pearson3_gen.fit|!  sO    
 88Hd#t+% 'D E E dT.tCdCdCCr7   r   r.  )r   r   r   r   r   r  rd   rm   r   ru   r   ry   r~   r   r   rK   r	   r   rB   r   r   r  r   s   @@r5   r  r     so     ,Z@8!N0" } 50 1D1 D Dr7   r  pearson3c                      a a ] tR tRt oRtR tR tR tR tR t	R t
R	 tR
 tR tR tV 3R lt]]! ]RR7      V 3R l4       4       tRtVtV ;t# )powerlaw_geni!  a  A power-function continuous random variable.

%(before_notes)s

See Also
--------
pareto

Notes
-----
The probability density function for `powerlaw` is:

.. math::

    f(x, a) = a x^{a-1}

for :math:`0 \le x \le 1`, :math:`a > 0`.

`powerlaw` takes ``a`` as a shape parameter for :math:`a`.

%(after_notes)s

For example, the support of `powerlaw` can be adjusted from the default
interval ``[0, 1]`` to the interval ``[c, c+d]`` by setting ``loc=c`` and
``scale=d``. For a power-law distribution with infinite support, see
`pareto`. For a power-law distribution described by PDF:

.. math::

    f(x; a, l, h) = \frac{a}{h^a - l^2} x^{a-1}

with :math:`a \neq 0` and :math:`0 < l < x < h`, see `truncpareto`.

`powerlaw` is a special case of `beta` with ``b=1``.

%(example)s

c                @    \        R R^ \        P                  3R4      .# r3  rj   rl   s   &r5   rm   powerlaw_gen._shape_info!  r6  r7   c                .    W!VR ,
          ,          ,          # r8  r   r9  s   &&&r5   ru   powerlaw_gen._pdf!  s    QsU|r7   c                t    \         P                  ! V4      \        P                  ! V^,
          V4      ,           # r_   )rQ   r  r|   r  r9  s   &&&r5   r   powerlaw_gen._logpdf!  s$    vvay288AE1---r7   c                     WR ,          ,          # r8  r   r9  s   &&&r5   ry   powerlaw_gen._cdf!  s    S5zr7   c                <    V\         P                  ! V4      ,          # rO   rc  r9  s   &&&r5   r  powerlaw_gen._logcdf!  re  r7   c                (    \        VR V,          4      # r8  r:  rA  s   &&&r5   r   powerlaw_gen._ppf!  s    1c!e}r7   c                0    \         P                  ! W4      ) # rO   )r|   r  )rD   rH  r   s   &&&r5   r~   powerlaw_gen._sf!  s    r7   c                     W"V,           ,          # rO   r   r  s   &&&r5   r,  powerlaw_gen._munp!  s    E{r7   c                v   WR ,           ,          WR,           ,          VR ,           ^,          ,          RVR ,
          VR,           ,          ,          \         P                  ! VR,           V,          4      ,          ^\         P                  ! . ROV4      ,          WR,           ,          V^,           ,          ,          3# )r   r   r  r  )rM   r  r  r   )rQ   r'  r
  rG  s   &&r5   r   powerlaw_gen._stats!  s    WWSQ.SQW-.!c'Q1GGBJJ~q11Qc']a!e5LMO 	Or7   c                X    ^RV,          ,
          \         P                  ! V4      ,
          # r&  rc  rG  s   &&r5   r  powerlaw_gen._entropy!  r  r7   c                J   < \         SV `  W4      V^ 8g  V^8  ,          ,          # r  )r@   rJ  )rD   rt   r   r  s   &&&r5   rJ  powerlaw_gen._support_mask!  s*    %a+FqAv&( 	)r7   a:          Notes specifically for ``powerlaw.fit``: If the location is a free
        parameter and the value returned for the shape parameter is less than
        one, the true maximum likelihood approaches infinity. This causes
        numerical difficulties, and the resulting estimates are approximate.
        

r  c                  <aaaaaaaa VP                  R R4      '       d   \        SV `  ! S.VO5/ VB # \        \        P
                  ! S4      4      ^8X  d   \        SV `  ! S.VO5/ VB # \        V SW#4      w  oorESV P                  S4      3.pV P                  V/ 4      ^,          pVeO   SP                  4       V8  g   \        R^ ^4      hVe)   SP                  4       WE,           8:  g   \        R^ ^4      hVe;   V^ 8:  d   \        R4      hV\        P                  ! S4      8:  d   Rp\        V4      hR oR oVe   Ve   S! SWE4      WE3# Ve   \        P                  ! SP                  4       \        P                  ) 4      p	S;'       g
    S! SW4      p
V! WV3S4      p\        P                  ! SP                  4       V,
          \        P                  4      pS;'       g
    S! SW4      pV! WV3S4      pW8  d   WV3# WV3# Ve!   S! SV4      pS;'       g
    S! SWO4      pVWO3# VVVV3R lpR oR	 oVVVVV3R
 loVVVVVV3R loVVVVVV3R lpSe   S^8:  d   V! 4       # Se   S^8  d   V! 4       # V! 4       pV P!                  VS4      pV! 4       pV P!                  VS4      pW8:  d   V^ ,          ^8:  d   V# W8  d   V^ ,          ^8  d   V# \        SV `  ! S.VO5/ VB # )rE  FpowerlawzKNegative or zero `fscale` is outside the range allowed by the distribution.z0`fscale` must be greater than the range of data.c                     \        V 4      pV) \        P                  ! \        P                  ! W,
          4      4      V\        P                  ! V4      ,          ,
          ,          # rO   )r  rQ   r  r  )rE   r-   r.   r  s   &&& r5   r  #powerlaw_gen.fit.<locals>.get_shape"  s?     D	A3"&&
!34qFGGr7   c                 0    V P                  4       V,
          # rO   )r.  )rE   r-   s   &&r5   	get_scale#powerlaw_gen.fit.<locals>.get_scale%"  s     88:##r7   c                    < \         P                  ! SP                  4       \         P                  ) 4      p \         P                  ! V 4      \         P
                  ! V P                  4      P                  8  dF   \         P                  ! V 4      \         P
                  ! V P                  4      P                  ,          p \         P                  ! S! SV 4      \         P                  4      pS;'       g
    S! SW4      pW V3# rO   )	rQ   r
  rR  rk   r	  r  r	  r  rR   )r-   r.   rG  rE   r
  r1  r  s      r5   fit_loc_scale_w_shape_lt_14powerlaw_gen.fit.<locals>.fit_loc_scale_w_shape_lt_1L"  s    ,,txxzBFF73Cvvc{RXXcii0555ggclRXXcii%8%=%==LL4!5rvv>E99ic9Eu$$r7   c                 F    V P                   ^ ,          ) V,          V,          # r  )rG  )rE   rG  r.   s   &&&r5   r  #powerlaw_gen.fit.<locals>.dL_dScale["  s     JJqM>E)E11r7   c                 d    V^,
          \         P                  ! ^W ,
          ,          4      ,          # r_   r  )rE   rG  r-   s   &&&r5   r  &powerlaw_gen.fit.<locals>.dL_dLocation`"  s#     AISZ(8!999r7   c                    < \         P                  ! S! SV 4      \         P                  ) 4      pS;'       g
    S! SW4      pS! SW 4      # rO   rQ   r
  rk   )r-   r.   rG  r  rE   r
  r1  r  s   &  r5   dL_dLocation_star+powerlaw_gen.fit.<locals>.dL_dLocation_stare"  sC     LL4!5w?E99ic9Ee11r7   c                    < \         P                  ! S! SV 4      \         P                  ) 4      pS;'       g
    S! SW4      pS! SW!4      S! SW 4      ,
          # rO   r;  )	r-   r.   rG  r  r  rE   r
  r1  r  s	   &  r5   r  &powerlaw_gen.fit.<locals>.fun_to_solvel"  sT     LL4!5w?E99ic9EdE1"445 6r7   c                    < \         P                  ! S
P                  4       \         P                  ) 4      p S
P                  4       V ,
          pS	! V 4      ^ 8  d#   S
P                  4       V,
          p V^,          pK/  V3R lpV ^,
          pRpV! W04      '       g9   V\         P                  ) 8w  d#   S
P                  4       V,
          pV^,          pKF  \        P
                  ! SW03R7      p\         P                  ! VP                  \         P                  ) 4      p\         P                  ! S! S
V4      \         P                  4      pS;'       g
    S! S
Wg4      pWV3# )r   c                 v   < \         P                  ! S! V 4      4      \         P                  ! S! V4      4      8g  # rO   rP   r  s   &&r5   rU   Tpowerlaw_gen.fit.<locals>.fit_loc_scale_w_shape_gt_1.<locals>.interval_contains_root"  s/    V 4577<#789 :r7   r   r  )rQ   r
  rR  rk   r   r*   rS  )rT   r6	  rU   rS   rS  rS  r-   r.   rG  r<  rE   r
  r  r1  r  s            r5   fit_loc_scale_w_shape_gt_14powerlaw_gen.fit.<locals>.fit_loc_scale_w_shape_gt_1t"  s
    \\$((*rvvg6F XXZ&(E#F+a/e+
:
 aZF
 A-f=="&&(((*q.Q''v>NOD,,tyy266'2CLL4!5rvv>E99ic9Eu$$r7   )r2   r@   rB   r  rQ   uniquerR  r  _reduce_funcrR  r  r.  r"  ptpr
  rk   r
  )rD   rE   rF   r4   r  r  penalized_nllf_argspenalized_nllfrZ   loc_lt1	shape_lt1ll_lt1loc_gt1	shape_gt1ll_gt1r.   rG  r4  rC  fit_shape_lt1fit_shape_gt1r  r<  r  r
  r  r1  r  r  s   &f*,                 @@@@@@@r5   rB   powerlaw_gen.fit!  s   P 88J&&7;t3d3d33ryy1$7;t3d3d33%@tAE&M"fd#dnnT&:%<=**+>CAF
 88:$":q!44!$((**E":q!44{  "F G G%H o%	H	$ $"2T40$>> ll488:w7GBB)D'"BI#Y$@$GF ll488:#6?GBB)D'"BI#Y$@$GF 611 611 dD)E::id:E$%%
	% 	%	2
	:
	2 	2	6 	6!	% !	%H &A+-//FQJ-// 34=$/24=$/a 0A 5  _q!1A!5  7;t3d3d33r7   r   )r   r   r   r   r   rm   ru   r   ry   r  r   r~   r,  r   r  rJ  rK   r	   r   rB   r   r   r  r   s   @@r5   r  r  !  st     %LE.O%) } 5 H4 H4 H4r7   r  r-  c                   l   a  ] tR tRt o Rt]P                  tR tR t	R t
R tR tR tR	 tR
 tRtV tR# )powerlognorm_geni"  a  A power log-normal continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `powerlognorm` is:

.. math::

    f(x, c, s) = \frac{c}{x s} \phi(\log(x)/s)
                 (\Phi(-\log(x)/s))^{c-1}

where :math:`\phi` is the normal pdf, and :math:`\Phi` is the normal cdf,
and :math:`x > 0`, :math:`s, c > 0`.

`powerlognorm` takes :math:`c` and :math:`s` as shape parameters.

%(after_notes)s

%(example)s

c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      pW.# )r\  Frj  r4  rj   )rD   ry  r-  s   &  r5   rm   powerlognorm_gen._shape_info"  r/  r7   c                N    \         P                  ! V P                  WV4      4      # rO   r.  rD   rt   r\  rj  s   &&&&r5   ru   powerlognorm_gen._pdf"  r  r7   c                d   \         P                  ! V4      \         P                  ! V4      ,
          \         P                  ! V4      ,
          \        \         P                  ! V4      V,          4      ,           \        \         P                  ! V4      ) V,          4      VR ,
          ,          ,           # r8  rQ   r  r   r   rX  s   &&&&r5   r   powerlognorm_gen._logpdf"  si    q	BFF1I%q	1RVVAY]+,bffQiZ!^,B78 	9r7   c                P    \         P                  ! V P                  WV4      4      ) # rO   r  rX  s   &&&&r5   ry   powerlognorm_gen._cdf"  r  r7   c                4    V P                  ^V,
          W#4      # r_   )r   rD   r   r\  rj  s   &&&&r5   r   powerlognorm_gen._ppf"  s    yyQ%%r7   c                N    \         P                  ! V P                  WV4      4      # rO   r  rX  s   &&&&r5   r~   powerlognorm_gen._sf"  r  r7   c                ^    \        \        P                  ! V4      ) V,          4      V,          # rO   rb  rX  s   &&&&r5   r
  powerlognorm_gen._logsf"  s     RVVAYJN+a//r7   c                l    \         P                  ! \        V^V,          ,          4      ) V,          4      # r_   r
  r`  s   &&&&r5   r   powerlognorm_gen._isf"  s&    vvyQqS**Q.//r7   r   N)r   r   r   r   r   r   rI  rJ  rm   ru   r   ry   r   r~   r
  r   r   r   r   s   @r5   rT  rT  "  sD     . "44M
-9
/&,00 0r7   rT  powerlognormc                   T   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tRtV tR# )powernorm_geni"  a(  A power normal continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `powernorm` is:

.. math::

    f(x, c) = c \phi(x) (\Phi(-x))^{c-1}

where :math:`\phi` is the normal pdf, :math:`\Phi` is the normal cdf,
:math:`x` is any real, and :math:`c > 0` [1]_.

`powernorm` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

References
----------
.. [1] NIST Engineering Statistics Handbook, Section 1.3.6.6.13,
       https://www.itl.nist.gov/div898/handbook//eda/section3/eda366d.htm

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   powernorm_gen._shape_info#  r6  r7   c                d    V\        V4      ,          \        V) 4      VR ,
          ,          ,          # r8  r   r   r`  s   &&&r5   ru   powernorm_gen._pdf#  s$    1~A23!788r7   c                    \         P                  ! V4      \        V4      ,           V^,
          \        V) 4      ,          ,           # r_   r[  r`  s   &&&r5   r   powernorm_gen._logpdf#  s.    vvay<?*ac<3C-CCCr7   c                N    \         P                  ! V P                  W4      4      ) # rO   r  r`  s   &&&r5   ry   powernorm_gen._cdf#  s    Q*+++r7   c                J    \        \        R V,
          R V,          4      4      ) # r8  )r   r  rg  s   &&&r5   r   powernorm_gen._ppf#  s    #cAgsQw/000r7   c                L    \         P                  ! V P                  W4      4      # rO   r  r`  s   &&&r5   r~   powernorm_gen._sf#  r8  r7   c                (    V\        V) 4      ,          # rO   r   r`  s   &&&r5   r
  powernorm_gen._logsf#  s    <###r7   c                x    \        \        P                  ! \        P                  ! V4      V,          4      4      ) # rO   )r   rQ   r   r  rg  s   &&&r5   r   powernorm_gen._isf#  s%    "&&Q/000r7   r   N)r   r   r   r   r   rm   ru   r   ry   r   r~   r
  r   r   r   r   s   @r5   rj  rj  "  s9     6E9D,1)$1 1r7   rj  	powernormc                   X   a  ] tR tRt o RtR tR tR tR tR t	R t
RR
 ltR tRtV tR	# )	rdist_geni"#  a  An R-distributed (symmetric beta) continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `rdist` is:

.. math::

    f(x, c) = \frac{(1-x^2)^{c/2-1}}{B(1/2, c/2)}

for :math:`-1 \le x \le 1`, :math:`c > 0`. `rdist` is also called the
symmetric beta distribution: if B has a `beta` distribution with
parameters (c/2, c/2), then X = 2*B - 1 follows a R-distribution with
parameter c.

`rdist` takes ``c`` as a shape parameter for :math:`c`.

This distribution includes the following distribution kernels as
special cases::

    c = 2:  uniform
    c = 3:  `semicircular`
    c = 4:  Epanechnikov (parabolic)
    c = 6:  quartic (biweight)
    c = 8:  triweight

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r[  rj   rl   s   &r5   rm   rdist_gen._shape_infoD#  r6  r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  r`  s   &&&r5   ru   rdist_gen._pdfH#  r`  r7   c                    \         P                  ! ^4      ) \        P                  V^,           ^,          V^,          V^,          4      ,           # rD  )rQ   r  r  r   r`  s   &&&r5   r   rdist_gen._logpdfK#  s4    q	zDLL!a%AaC1===r7   c                h    \         P                  V^,           ^,          V^,          V^,          4      # r_   r<  r`  s   &&&r5   ry   rdist_gen._cdfN#  s%    yy!a%AaC1--r7   c                h    \         P                  V^,           ^,          V^,          V^,          4      # r_   r5  r`  s   &&&r5   r~   rdist_gen._sfQ#  s%    xxQ	1Q3!,,r7   c                f    ^\         P                  W^,          V^,          4      ,          ^,
          # rD  )r  r   rg  s   &&&r5   r   rdist_gen._ppfT#  s%    1c1Q3''!++r7   Nc                `    ^VP                  V^,          V^,          V4      ,          ^,
          # rD  r  r  s   &&&&r5   r   rdist_gen._rvsW#  s)    <$$QqS!A#t44q88r7   c                    ^V^,          ,
          \         P                  ! VR,           ^,          VR,          4      ,          pV\         P                  ! RVR,          4      ,          # )rM   r   r   r   r  )rD   rc   r\  	numerators   &&& r5   r,  rdist_gen._munpZ#  sE    !a%[BGGQWM1s7$CC	27761r6222r7   r   r.  )r   r   r   r   r   rm   ru   r   ry   r~   r   r   r,  r   r   r   s   @r5   r~  r~  "#  s9      BE*>.-,93 3r7   r~  rdistc                      a a ] tR tRt oRt]P                  tR tRR lt	R t
R tR tR tR	 tR
 tR tR tR t]]! ]RR7      V 3R l4       4       tRtVtV ;t# )rayleigh_genib#  a  A Rayleigh continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `rayleigh` is:

.. math::

    f(x) = x \exp(-x^2/2)

for :math:`x \ge 0`.

`rayleigh` is a special case of `chi` with ``df=2``.

%(after_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   rayleigh_gen._shape_infoz#  r   r7   c                0    \         P                  ^WR7      # )r   r'  r  r   s   &&&r5   r   rayleigh_gen._rvs}#  s    wwqtw??r7   c                L    \         P                  ! V P                  V4      4      # rO   r.  rD   rI  s   &&r5   ru   rayleigh_gen._pdf#  ry  r7   c                X    \         P                  ! V4      R V,          V,          ,
          # r  rc  r  s   &&r5   r   rayleigh_gen._logpdf#  s    vvay37Q;&&r7   c                L    \         P                  ! RV^,          ,          4      ) # r  r=  r  s   &&r5   ry   rayleigh_gen._cdf#  s    1%%%r7   c                f    \         P                  ! R\        P                  ! V) 4      ,          4      # r   r<  )rQ   r'  r|   r  r   s   &&r5   r   rayleigh_gen._ppf#  s     wwrBHHaRL())r7   c                L    \         P                  ! V P                  V4      4      # rO   r  r  s   &&r5   r~   rayleigh_gen._sf#  s    vvdkk!n%%r7   c                "    RV,          V,          # r  r   r  s   &&r5   r
  rayleigh_gen._logsf#  s    ax!|r7   c                d    \         P                  ! R\         P                  ! V4      ,          4      # r  )rQ   r'  r  r   s   &&r5   r   rayleigh_gen._isf#  s    wwrBFF1I~&&r7   c                   ^\         P                  ,
          p\         P                  ! \         P                  ^,          4      V^,          ^\         P                  ^,
          ,          \         P                  ! \         P                  4      ,          VR,          ,          ^\         P                  ,          V,          ^V^,          ,          ,
          3# rU  rS  r#  r$  s   & r5   r   rayleigh_gen._stats#  sy    "%%ia A2557BGGBEEN*383"%%BsAvI%' 	'r7   c                n    \         R ,          ^,           R\        P                  ! ^4      ,          ,
          # )r   r   rA  rl   s   &r5   r  rayleigh_gen._entropy#  s!    czA~BFF1I--r7   a          Notes specifically for ``rayleigh.fit``: If the location is fixed with
        the `floc` parameter, this method uses an analytical formula to find
        the scale.  Otherwise, this function uses a numerical root finder on
        the first order conditions of the log-likelihood function to find the
        MLE.  Only the (optional) `loc` parameter is used as the initial guess
        for the root finder; the `scale` parameter and any other parameters
        for the optimizer are ignored.

r  c                  <a VP                  R R4      '       d   \        SV `  ! S.VO5/ VB # \        V SW#4      w  orEV3R lpV3R lpV3V3R llpVeL   \        P
                  ! SV,
          ^ 8*  4      '       d   \        R^\        P                  R7      hWF! V4      3# VP                  R4      p	V	f   V P                  S4      ^ ,          p	Vf   TMTp
\        P                  ! \        P                  ! S4      \        P                  ) 4      p\        W4      p\        P                  ! WV3R7      pVP                  '       g   \!        VP"                  4      hVP$                  pT;'       g	    V! V4      pW3# )	rE  Fc                    < \         P                  ! SV ,
          ^,          4      ^\        S4      ,          ,          R,          # rI  )rQ   r  r  )r-   rE   s   &r5   	scale_mle#rayleigh_gen.fit.<locals>.scale_mle#  s/     FFD3J1,-SY?BFFr7   c                    < SV ,
          pVP                  4       pV^,          P                  4       p^V,          P                  4       pW#^\        S4      ,          ,          V,          ,
          # rD  )r  r  )r-   r4	  r  r  s3rE   s   &    r5   loc_mle!rayleigh_gen.fit.<locals>.loc_mle#  sR     BBa%BB$BAc$iK(+++r7   c                    < SV ,
          pVP                  4       V^,          ^V,          P                  4       ,          ,
          # rD  )r  )r-   r.   r4	  rE   s   && r5   loc_mle_scale_fixed-rayleigh_gen.fit.<locals>.loc_mle_scale_fixed#  s2     B668eQh!B$555r7   rayleighr  r-   r  )r2   r@   rB   rR  rQ   r  r  rk   r<   r  r
  rR  r[   r   r*   r
  rX   flagrS  )rD   rE   rF   r4   r  r  r  r  r  loc0rH   rT   rS   r  r-   r.   r  s   &f*,            r5   rB   rayleigh_gen.fit#  sG    88J&&7;t3d3d338t9=Ed	G
	, ,2 	6 vvdTkQ&''":QbffEEYt_,, xx<>>$'*Dg-@bffTlRVVG4"3/""30@A}}} **hh(()C.zr7   r   r.  )r   r   r   r   r   r   rI  rJ  rm   r   ru   r   ry   r   r~   r
  r   r   r  rK   r	   rB   r   r   r  r   s   @@r5   r  r  b#  s|     * "44M@''&*&''. } 5. /// / /r7   r  r  c                      a a ] tR tRt oRtR tR tV 3R ltR tR t	R t
R	 tR
 tR tR tRt]! ]]R7      V 3R l4       tRtVtV ;t# )reciprocal_geni#  a  A loguniform or reciprocal continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for this class is:

.. math::

    f(x, a, b) = \frac{1}{x \log(b/a)}

for :math:`a \le x \le b`, :math:`b > a > 0`. This class takes
:math:`a` and :math:`b` as shape parameters.

%(after_notes)s

%(example)s

This doesn't show the equal probability of ``0.01``, ``0.1`` and
``1``. This is best when the x-axis is log-scaled:

>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots(1, 1)
>>> ax.hist(np.log10(r))
>>> ax.set_ylabel("Frequency")
>>> ax.set_xlabel("Value of random variable")
>>> ax.xaxis.set_major_locator(plt.FixedLocator([-2, -1, 0]))
>>> ticks = ["$10^{{ {} }}$".format(i) for i in [-2, -1, 0]]
>>> ax.set_xticklabels(ticks)  # doctest: +SKIP
>>> plt.show()

This random variable will be log-uniform regardless of the base chosen for
``a`` and ``b``. Let's specify with base ``2`` instead:

>>> rvs = %(name)s(2**-2, 2**0).rvs(size=1000)

Values of ``1/4``, ``1/2`` and ``1`` are equally likely with this random
variable.  Here's the histogram:

>>> fig, ax = plt.subplots(1, 1)
>>> ax.hist(np.log2(rvs))
>>> ax.set_ylabel("Frequency")
>>> ax.set_xlabel("Value of random variable")
>>> ax.xaxis.set_major_locator(plt.FixedLocator([-2, -1, 0]))
>>> ticks = ["$2^{{ {} }}$".format(i) for i in [-2, -1, 0]]
>>> ax.set_xticklabels(ticks)  # doctest: +SKIP
>>> plt.show()

c                    V^ 8  W!8  ,          # r  r   r	  s   &&&r5   rd   reciprocal_gen._argcheck$  s    A!%  r7   c                    \        R R^ \        P                  3R4      p\        RR^ \        P                  3R4      pW.# r  rj   r  s   &  r5   rm   reciprocal_gen._shape_info$  r  r7   c                   < \        V\        4      '       d   VP                  4       p\        SV `  V\
        P                  ! V4      \
        P                  ! V4      3R 7      # r)	  r>   r)   r  r@   r  rQ   rR  r.  rb  s   &&r5   r  reciprocal_gen._fitstart$  sF    dL))>>#Dw RVVD\266$<,H IIr7   c                    W3# rO   r   r	  s   &&&r5   r   reciprocal_gen._get_support $  rf  r7   c                N    \         P                  ! V P                  WV4      4      # rO   r.  r  s   &&&&r5   ru   reciprocal_gen._pdf#$  r0  r7   c                    \         P                  ! V4      ) \         P                  ! \         P                  ! V4      \         P                  ! V4      ,
          4      ,
          # rO   rc  r  s   &&&&r5   r   reciprocal_gen._logpdf'$  s5    q	zBFF266!9rvvay#8999r7   c                    \         P                  ! V4      \         P                  ! V4      ,
          \         P                  ! V4      \         P                  ! V4      ,
          ,          # rO   rc  r  s   &&&&r5   ry   reciprocal_gen._cdf*$  s7    q	"&&)#q	BFF1I(=>>r7   c                    \         P                  ! \         P                  ! V4      V\         P                  ! V4      \         P                  ! V4      ,
          ,          ,           4      # rO   rQ   r   r  r  s   &&&&r5   r   reciprocal_gen._ppf-$  s8    vvbffQi!RVVAY%:";;<<r7   c                v   V^ 8X  d   R# ^\         P                  ! V4      \         P                  ! V4      ,
          ,          V,          p\         P                  ! \         P                  ! \	        V\         P                  ! V4      ,          V\         P                  ! V4      ,          4      4      4      pWE,          # r  )rQ   r  r  r   	_log_diff)rD   rc   r   r   r  r  s   &&&&  r5   r,  reciprocal_gen._munp0$  sm    6"&&)bffQi'(1,WWRVVIa"&&)mQrvvay[ABCwr7   c                   R \         P                  ! V4      \         P                  ! V4      ,           ,          \         P                  ! \         P                  ! V4      \         P                  ! V4      ,
          4      ,           # r  rc  r	  s   &&&r5   r  reciprocal_gen._entropy7$  sE    BFF1Iq	)*RVVBFF1Iq	4I-JJJr7   z        `loguniform`/`reciprocal` is over-parameterized. `fit` automatically
         fixes `scale` to 1 unless `fscale` is provided by the user.

r  c                T   < VP                  R ^4      p\        SV `  ! V.VO5R V/VB # )r  )r2   r@   rB   )rD   rE   rF   r4   r  r  s   &&*, r5   rB   reciprocal_gen.fit>$  s1    (A&w{4>$>v>>>r7   r   )r   r   r   r   r   rd   rm   r  r   ru   r   ry   r   r,  r  fit_noter	   r   rB   r   r   r  r   s   @@r5   r  r  #  sg     2f!
J-:?=KLH }H=? >? ?r7   r  
loguniform
reciprocalc                   R   a  ] tR tRt o RtR tR tRR ltR tR t	R	 t
R
 tRtV tR# )rice_geniN$  a  A Rice continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `rice` is:

.. math::

    f(x, b) = x \exp(- \frac{x^2 + b^2}{2}) I_0(x b)

for :math:`x >= 0`, :math:`b > 0`. :math:`I_0` is the modified Bessel
function of order zero (`scipy.special.i0`).

`rice` takes ``b`` as a shape parameter for :math:`b`.

%(after_notes)s

The Rice distribution describes the length, :math:`r`, of a 2-D vector with
components :math:`(U+u, V+v)`, where :math:`U, V` are constant, :math:`u,
v` are independent Gaussian random variables with standard deviation
:math:`s`.  Let :math:`R = \sqrt{U^2 + V^2}`. Then the pdf of :math:`r` is
``rice.pdf(x, R/s, scale=s)``.

%(example)s

c                    V^ 8  # r  r   r  s   &&r5   rd   rice_gen._argcheckk$  r  r7   c                @    \        R R^ \        P                  3R4      .# )r   Fri   rj   rl   s   &r5   rm   rice_gen._shape_infon$  r  r7   Nc                    V\         P                  ! ^4      ,          VP                  RV,           R7      ,           p\         P                  ! WD,          P                  ^ R7      4      # )r   r  rO  rD  )rQ   r'  r   r  )rD   r   r   r   r  s   &&&& r5   r   rice_gen._rvsq$  sF    bggajL<77TD[7IIwwyyay())r7   c                    \         P                  ! \        P                  ! V4      ^\        P                  ! V4      4      # rD  )r|   r  rQ   r  r  s   &&&r5   ry   rice_gen._cdfv$  s%    yy1q"))A,77r7   c           	         \         P                  ! \        P                  ! V^\         P                  ! V4      4      4      # rD  )rQ   r'  r|   r  r  r  s   &&&r5   r   rice_gen._ppfy$  s&    wwr{{1a1677r7   c                    V\         P                  ! W,
          ) W,
          ,          R ,          4      ,          \        P                  ! W,          4      ,          # rr  )rQ   r   r|   i0er  s   &&&r5   ru   rice_gen._pdf|$  s6     266AC&!#,s*++bffQSk99r7   c                    VR ,          p^V,           pW",          R ,          pR V,          \         P                  ! V) 4      ,          \        P                  ! V4      ,          \        P                  ! V^V4      ,          # rr  )rQ   r   r|   r(  hyp1f1)rD   rc   r   nd2n1rJ  s   &&&   r5   r,  rice_gen._munp$  s\    eWSWc
RVVRC[(288B<7		"a$% 	&r7   r   r.  )r   r   r   r   r   rd   rm   r   ry   r   ru   r,  r   r   r   s   @r5   r  r  N$  s3     8D*
88:& &r7   r  ricec                      a  ] tR tRt o Rt]! ]RR7      R 4       tR tR t	R t
R	 t]R
 4       tR tR tR tRR ltR tRtV tR# )irwinhall_geni$  a	  An Irwin-Hall (Uniform Sum) continuous random variable.

An `Irwin-Hall <https://en.wikipedia.org/wiki/Irwin-Hall_distribution/>`_
continuous random variable is the sum of :math:`n` independent
standard uniform random variables [1]_ [2]_.

%(before_notes)s

Notes
-----
Applications include `Rao's Spacing Test
<https://jammalam.faculty.pstat.ucsb.edu/html/favorite/test.htm>`_,
a more powerful alternative to the Rayleigh test
when the data are not unimodal, and radar [3]_.

Conveniently, the pdf and cdf are the :math:`n`-fold convolution of
the ones for the standard uniform distribution, which is also the
definition of the cardinal B-splines of degree :math:`n-1`
having knots evenly spaced from :math:`1` to :math:`n` [4]_ [5]_.

The Bates distribution, which represents the *mean* of statistically
independent, uniformly distributed random variables, is simply the
Irwin-Hall distribution scaled by :math:`1/n`. For example, the frozen
distribution ``bates = irwinhall(10, scale=1/10)`` represents the
distribution of the mean of 10 uniformly distributed random variables.

%(after_notes)s

References
----------
.. [1] P. Hall, "The distribution of means for samples of size N drawn
        from a population in which the variate takes values between 0 and 1,
        all such values being equally probable",
        Biometrika, Volume 19, Issue 3-4, December 1927, Pages 240-244,
        :doi:`10.1093/biomet/19.3-4.240`.
.. [2] J. O. Irwin, "On the frequency distribution of the means of samples
        from a population having any law of frequency with finite moments,
        with special reference to Pearson's Type II,
        Biometrika, Volume 19, Issue 3-4, December 1927, Pages 225-239,
        :doi:`0.1093/biomet/19.3-4.225`.
.. [3] K. Buchanan, T. Adeyemi, C. Flores-Molina, S. Wheeland and D. Overturf,
        "Sidelobe behavior and bandwidth characteristics
        of distributed antenna arrays,"
        2018 United States National Committee of
        URSI National Radio Science Meeting (USNC-URSI NRSM),
        Boulder, CO, USA, 2018, pp. 1-2.
        https://www.usnc-ursi-archive.org/nrsm/2018/papers/B15-9.pdf.
.. [4] Amos Ron, "Lecture 1: Cardinal B-splines and convolution operators", p. 1
        https://pages.cs.wisc.edu/~deboor/887/lec1new.pdf.
.. [5] Trefethen, N. (2012, July). B-splines and convolution. Chebfun.
        Retrieved April 30, 2024, from http://www.chebfun.org/examples/approx/BSplineConv.html.

%(example)s
z        Raises a ``NotImplementedError`` for the Irwin-Hall distribution because
        the generic `fit` implementation is unreliable and no custom implementation
        is available. Consider using `scipy.stats.fit`.

r  c                    R p\        V4      h)zThe generic `fit` implementation is unreliable for this distribution, and no custom implementation is available. Consider using `scipy.stats.fit`.)r  )rD   rE   rF   r4   	fit_notess   &&*, r5   rB   irwinhall_gen.fit$  s    
9	 "),,r7   c                b    V^ 8  \        V4      ,          \        P                  ! V4      ,          # r  )r   rQ   	isrealobjrb   s   &&r5   rd   irwinhall_gen._argcheck$  s"    AQ'",,q/99r7   c                
    ^ V3# r  r   rb   s   &&r5   r   irwinhall_gen._get_support$  s    !tr7   c                @    \        R R^\        P                  3R4      .# rh   rj   rl   s   &r5   rm   irwinhall_gen._shape_info$  ro   r7   c                b    R  p\         P                  ! V\         P                  .R7      ! W4      # )c                     \         P                  ! V\         P                  R 7      p\        P                  ! W,           VRR7      \        P
                  ! W,           VRR7      ,          # )r	  T)exact)rQ   r#  int64r|   	stirling2r  )r/  rc   s   &&r5   vmunp"irwinhall_gen._munp.<locals>.vmunp$  sD    

1BHH-ALL!48ggagq56 7r7   r  r  )rD   r/  rc   r  s   &&& r5   r,  irwinhall_gen._munp$  s%    	7 ||E2::,7AAr7   c                h    \         P                  ! V ^,           4      p\        P                  ! V4      # r_   )rQ   r  r   basis_element)rc   r  s   & r5   	_cardbsplirwinhall_gen._cardbspl$  s$    IIacN$$Q''r7   c                j   a  V 3R  lp\         P                  ! V\         P                  .R7      ! W4      # )c                 2   < SP                  V4      ! V 4      # rO   )r  rt   rc   rD   s   &&r5   vpdf irwinhall_gen._pdf.<locals>.vpdf$  s    >>!$Q''r7   r  r  )rD   rt   rc   r	  s   f&& r5   ru   irwinhall_gen._pdf$  s$    	(||D"**6q<<r7   c                j   a  V 3R  lp\         P                  ! V\         P                  .R7      ! W4      # )c                 N   < SP                  V4      P                  4       ! V 4      # rO   r  antiderivativer  s   &&r5   vcdf irwinhall_gen._cdf.<locals>.vcdf$  s     >>!$335a88r7   r  r  )rD   rt   rc   r  s   f&& r5   ry   irwinhall_gen._cdf$  s$    	9||D"**6q<<r7   c                j   a  V 3R  lp\         P                  ! V\         P                  .R7      ! W4      # )c                 Z   < SP                  V4      P                  4       ! W,
          4      # rO   r  r  s   &&r5   vsfirwinhall_gen._sf.<locals>.vsf$  s"    >>!$335ac::r7   r  r  )rD   rt   rc   r  s   f&& r5   r~   irwinhall_gen._sf$  s$    	;||C5a;;r7   Nc                2    \         RR l4       pV! WVR7      # )Nc                     \         P                  ! V 4      P                  \        4      p Vf   V 3MV .VO5pVP	                  VR7      P                  ^ R7      # )Nr  rO  )rQ   r  r  r+  r  r  )rc   r   r   usizes   &&& r5   _rvs1!irwinhall_gen._rvs.<locals>._rvs1$  sO    ""3'A LQDqj4jE''U'377Q7??r7   r'  r.  )r   )rD   rc   r   r   rF   r  s   &&&&* r5   r   irwinhall_gen._rvs$  s%    	#	@ 
$	@ Q==r7   c                F    V^,          V^,          ^ R^V,          ,          3# )r   r  r   rb   s   &&r5   r   irwinhall_gen._stats%  s#     sAbD!R1X%%r7   r   r.  )r   r   r   r   r   r
   r   rB   rd   r   rm   r,  rT  r  ru   ry   r~   r   r   r   r   r   s   @r5   r  r  $  su     5n   6? @-	@-:C	B ( (=
=
<
>& &r7   r  	irwinhallc                   L   a  ] tR tRt o RtR tR tR tR tR t	RR	 lt
R
tV tR# )recipinvgauss_geni%  a}  A reciprocal inverse Gaussian continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `recipinvgauss` is:

.. math::

    f(x, \mu) = \frac{1}{\sqrt{2\pi x}}
                \exp\left(\frac{-(1-\mu x)^2}{2\mu^2x}\right)

for :math:`x \ge 0`.

`recipinvgauss` takes ``mu`` as a shape parameter for :math:`\mu`.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r  rj   rl   s   &r5   rm   recipinvgauss_gen._shape_info*%  r5  r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  r  s   &&&r5   ru   recipinvgauss_gen._pdf-%  s     vvdll1)**r7   c                ^    \         P                  ! V^ 8  W3R \        P                  ) R7      # )r   c                     ^W,          ,
          R,          ) ^V ,          VR,          ,          ,          R\         P                  ! ^\         P                  ,          V ,          4      ,          ,
          # r  r  )rt   ry  s   &&r5   r  +recipinvgauss_gen._logpdf.<locals>.<lambda>5%  sD    QXO+qs2s7{; "%%	!223r7   r  rU  r  s   &&&r5   r   recipinvgauss_gen._logpdf2%  s,    EA74w	  	 r7   c                   R V,          V,
          pR V,          V,           pR \         P                  ! V4      ,          p\        V) V,          4      \         P                  ! RV,          4      \        V) V,          4      ,          ,
          # rm  rQ   r'  r   r   rD   rt   ry  trm1trm2isqxs   &&&   r5   ry   recipinvgauss_gen._cdf9%  s_    2vz2vz2771:~$t$rvvc"f~id
6K'KKKr7   c                   R V,          V,
          pR V,          V,           pR \         P                  ! V4      ,          p\        WS,          4      \         P                  ! RV,          4      \        V) V,          4      ,          ,           # rm  r,  r-  s   &&&   r5   r~   recipinvgauss_gen._sf?%  s[    2vz2vz2771:~#bffSVnYuTz5J&JJJr7   Nc                8    R VP                  VR VR7      ,          # r  r  r  s   &&&&r5   r   recipinvgauss_gen._rvsE%  s    <$$R4$888r7   r   r.  )r   r   r   r   r   rm   ru   r   ry   r~   r   r   r   r   s   @r5   r"  r"  %  s0     ,F+
 LK9 9r7   r"  recipinvgaussc                   X   a  ] tR tRt o RtR tR tR tR tR t	RR	 lt
R
 tR tRtV tR# )semicircular_geniL%  a  A semicircular continuous random variable.

%(before_notes)s

See Also
--------
rdist

Notes
-----
The probability density function for `semicircular` is:

.. math::

    f(x) = \frac{2}{\pi} \sqrt{1-x^2}

for :math:`-1 \le x \le 1`.

The distribution is a special case of `rdist` with ``c = 3``.

%(after_notes)s

References
----------
.. [1] "Wigner semicircle distribution",
       https://en.wikipedia.org/wiki/Wigner_semicircle_distribution

%(example)s

c                    . # rO   r   rl   s   &r5   rm   semicircular_gen._shape_infok%  r   r7   c                    R \         P                  ,          \         P                  ! ^W,          ,
          4      ,          # rr  r#  r   s   &&r5   ru   semicircular_gen._pdfn%  s#    255y13''r7   c                    \         P                  ! ^\         P                  ,          4      R\        P                  ! V) V,          4      ,          ,           # rI  r  r   s   &&r5   r   semicircular_gen._logpdfq%  s0    vvagRXXqbd^!333r7   c                    R R\         P                  ,          V\         P                  ! ^W,          ,
          4      ,          \         P                  ! V4      ,           ,          ,           # r   )rQ   r  r'  r]  r   s   &&r5   ry   semicircular_gen._cdft%  s:    3ruu9a!#.1=>>>r7   c                .    \         P                  V^4      # r  )r  r   r   s   &&r5   r   semicircular_gen._ppfw%  s    zz!Qr7   Nc                    \         P                  ! VP                  VR 7      4      p\         P                  ! \         P                  VP                  VR 7      ,          4      pW4,          # r  )rQ   r'  r  rQ  r  )rD   r   r   rI  r   s   &&&  r5   r   semicircular_gen._rvsz%  sL     GGL((d(34FF255<//T/::;ur7   c                    R# )r   )r   r  r   r  r   rl   s   &r5   r   semicircular_gen._stats%  r,  r7   c                    R # )gzCϑ?r   rl   s   &r5   r  semicircular_gen._entropy%  s    %r7   r   r.  )r   r   r   r   r   rm   ru   r   ry   r   r   r   r  r   r   r   s   @r5   r8  r8  L%  s7     <(4?  & &r7   r8  semicircularc                   R   a  ] tR tRt o RtR tR tR tR tR t	RR lt
R	 tR
tV tR# )skewcauchy_geni%  a  A skewed Cauchy random variable.

%(before_notes)s

See Also
--------
cauchy : Cauchy distribution

Notes
-----

The probability density function for `skewcauchy` is:

.. math::

    f(x) = \frac{1}{\pi \left(\frac{x^2}{\left(a\, \text{sign}(x) + 1
                                               \right)^2} + 1 \right)}

for a real number :math:`x` and skewness parameter :math:`-1 < a < 1`.

When :math:`a=0`, the distribution reduces to the usual Cauchy
distribution.

%(after_notes)s

References
----------
.. [1] "Skewed generalized *t* distribution", Wikipedia
   https://en.wikipedia.org/wiki/Skewed_generalized_t_distribution#Skewed_Cauchy_distribution

%(example)s

c                4    \         P                  ! V4      ^8  # r_   )rQ   r	  rG  s   &&r5   rd   skewcauchy_gen._argcheck%  s    vvay1}r7   c                     \        R RRR4      .# )r   F)r  r   r4  r   rl   s   &r5   rm   skewcauchy_gen._shape_info%  s    3{NCDDr7   c                    ^\         P                  V^,          V\         P                  ! V4      ,          ^,           ^,          ,          ^,           ,          ,          # r_   )rQ   r  rR   r9  s   &&&r5   ru   skewcauchy_gen._pdf%  s:    BEEQTQ^a%7!$;;a?@AAr7   c                   \         P                  ! V^ 8*  ^V,
          ^,          ^V,
          \         P                  ,          \         P                  ! V^V,
          ,          4      ,          ,           ^V,
          ^,          ^V,           \         P                  ,          \         P                  ! V^V,           ,          4      ,          ,           4      # r  )rQ   r  r  r  r9  s   &&&r5   ry   skewcauchy_gen._cdf%  s    xxQQ!q1uo		!q1u+8N&NNQ!q1uo		!q1u+8N&NNP 	Pr7   c           
        WP                  ^ V4      8  p\        P                  ! V\        P                  ! \        P                  ^V,
          ,          V^V,
          ^,          ,
          ,          4      ^V,
          ,          \        P                  ! \        P                  ^V,           ,          V^V,
          ^,          ,
          ,          4      ^V,           ,          4      # r  )ry   rQ   r  r  r  )rD   rt   r   rS  s   &&& r5   r   skewcauchy_gen._ppf%  s    		!QxxruuA!q1uk/BCq1uMruuA!q1uk/BCq1uMO 	Or7   c                ~    \         P                  \         P                  \         P                  \         P                  3# rO   r  )rD   r   rl  s   &&&r5   r   skewcauchy_gen._stats%  r  r7   c                    \        V\        4      '       d   VP                  4       p\        P                  ! V. RO4      w  r#pRW4V,
          ^,          3# )r"  r   r#  r&  )rD   rE   r)  r*  r+  s   &&   r5   r  skewcauchy_gen._fitstart%  sD     dL))>>#DdL9#C)Q&&r7   r   Nry  )r   r   r   r   r   rd   rm   ru   ry   r   r   r  r   r   r   s   @r5   rK  rK  %  s7      BEBP
O.' 'r7   rK  
skewcauchyc                      a a ] tR tRt oRtR tR tR tR tV 3R lt	R t
R	 tR
 tRR ltRR lt]R 4       tR t]! ]RR7      V 3R l4       tRtVtV ;t# )skewnorm_geni%  a  A skew-normal random variable.

%(before_notes)s

Notes
-----
The pdf is::

    skewnorm.pdf(x, a) = 2 * norm.pdf(x) * norm.cdf(a*x)

`skewnorm` takes a real number :math:`a` as a skewness parameter
When ``a = 0`` the distribution is identical to a normal distribution
(`norm`). `rvs` implements the method of [1]_.

This distribution uses routines from the Boost Math C++ library for
the computation of ``cdf``, ``ppf`` and ``isf`` methods. [2]_

%(after_notes)s

References
----------
.. [1] A. Azzalini and A. Capitanio (1999). Statistical applications of
    the multivariate skew-normal distribution. J. Roy. Statist. Soc.,
    B 61, 579-602. :arxiv:`0911.2093`
.. [2] The Boost Developers. "Boost C++ Libraries". https://www.boost.org/.

%(example)s

c                .    \         P                  ! V4      # rO   r  rG  s   &&r5   rd   skewnorm_gen._argcheck%  r  r7   c                ^    \        R R\        P                  ) \        P                  3R4      .# r3  rj   rl   s   &r5   rm   skewnorm_gen._shape_info%  r  r7   c                @    \         P                  ! V^ 8H  W3R R 4      # )r   c                     \        V 4      # rO   r   rt   r   s   &&r5   r  #skewnorm_gen._pdf.<locals>.<lambda>%  s    1r7   c                 R    R \        V 4      ,          \        W,          4      ,          # rr  rn  rd  s   &&r5   r  re  %  s    IaL137r7   r=  r9  s   &&&r5   ru   skewnorm_gen._pdf%  s$    FQF%79 	9r7   c                @    \         P                  ! V^ 8H  W3R R 4      # )r   c                     \        V 4      # rO   r   rd  s   &&r5   r  &skewnorm_gen._logpdf.<locals>.<lambda>%  s    ar7   c                 z    \         P                  ! ^4      \        V 4      ,           \        W,          4      ,           # rD  r[  rd  s   &&r5   r  rj  %  s!    <?2<3DDr7   r=  r9  s   &&&r5   r   skewnorm_gen._logpdf%  s&    FQF(DF 	Fr7   c                ,  < \         P                  ! V4      p\        P                  ! VR RV4      p\         P                  ! W#P
                  4      pVR8  V^ 8  ,          p\        SV `  W,          W$,          4      W4&   \         P                  ! V^ ^4      # )r   r   gư>)	rQ   r  rq   _skewnorm_cdfrv  rG  r@   ry   r  )rD   rt   r   r   i_small_cdfr  s   &&&  r5   ry   skewnorm_gen._cdf&  su    MM!3Q/OOAyy)Tza!e, 7<GwwsAq!!r7   c                4    \         P                  ! VR RV4      # r   r   )rq   _skewnorm_ppfr9  s   &&&r5   r   skewnorm_gen._ppf&        Ca00r7   c                *    V P                  V) V) 4      # rO   r	  r9  s   &&&r5   r~   skewnorm_gen._sf&  s     yy!aR  r7   c                4    \         P                  ! VR RV4      # rr  )rq   _skewnorm_isfr9  s   &&&r5   r   skewnorm_gen._isf&  ru  r7   c                F   VP                  VR 7      pVP                  VR 7      pV\        P                  ! ^V^,          ,           4      ,          pWd,          V\        P                  ! ^V^,          ,
          4      ,          ,           p\        P                  ! V^ 8  Ww) 4      # r  )r  rQ   r'  r  )rD   r   r   r   u0r  r  r*  s   &&&&    r5   r   skewnorm_gen._rvs&  s|      d +T*bgga!Q$hTAbgga!Q$h'''xxaS))r7   c                p   . ROp\         P                  ! ^\         P                  ,          4      V,          \         P                  ! ^V^,          ,           4      ,          pRV9   d   WC^ &   RV9   d   ^V^,          ,
          V^&   RV9   dY   ^\         P                  ,
          ^,          V\         P                  ! ^V^,          ,
          4      ,          ^,          ,          V^&   RV9   dL   ^\         P                  ^,
          ,          V^,          ^V^,          ,
          ^,          ,          ,          V^&   V# )Nr  r  rj  rk  r  r)  )rD   r   rl  r  consts   &&&  r5   r   skewnorm_gen._stats&  s    )"%% 1$RWWQAX%66'>1I'>E1HF1I'>bee)Q5UAX1F+F*JJF1I'>BEEAI5!8Q\A4E+EFF1Ir7   c                   ^\        ^.4      ^\        ^R.4      ^\        . RO4      ^\        . RO4      ^	\        . RO4      ^\        . RO4      ^\        . RO4      ^\        . RO4      ^\        . RO4      ^\        . R	O4      /
pV# )
rM   r  )   ir  )i   i?   i)i  iin  ir  )(  iSi6Q  ii  iO)i iBi/ iio ir  ) iԷi iYei{Hx ii i!)	i!iׅi쇀iiViX'ilir  )
is_'il   </1 ldy( l   J8D l.~ l   -Rx iWi[i0r   )rD   skewnorm_odd_momentss   & r5   _skewnorm_odd_moments"skewnorm_gen._skewnorm_odd_moments2&  s     z1#z1b'"z,'z./z78
EF
 # $
 8 9
 % & 
 2 3 
$ $#r7   c                   V^,          '       do   V^8  d   \        R4      hV\        P                  ! ^V^,          ,           4      ,          pW0P                  V,          ! V^,          4      ,          \        ,          # \
        P                  ! V^,           ^,          4      ^V^,          ,          ,          \        ,          # )r   zKskewnorm noncentral moments not implemented for odd orders greater than 19.)r  rQ   r'  r  r&   r|   r(  r%   )rD   r/  r   r6	  s   &&& r5   r,  skewnorm_gen._munpH&  s    199rz) +5 6 6
 bgga!Q$h''E66u=eQhGG%& ' 88UQYM*Qq\9HDDr7   a          If ``method='mm'``, parameters fixed by the user are respected, and the
        remaining parameters are used to match distribution and sample moments
        where possible. For example, if the user fixes the location with
        ``floc``, the parameters will only match the distribution skewness and
        variance to the sample skewness and variance; no attempt will be made
        to match the means or minimize a norm of the errors.
        Note that the maximum possible skewness magnitude of a
        `scipy.stats.skewnorm` distribution is approximately 0.9952717; if the
        magnitude of the data's sample skewness exceeds this, the returned
        shape parameter ``a`` will be infinite.
        

r  c           
     B  < VP                  R R4      '       d   \        SV `  ! V.VO5/ VB # \        V\        4      '       d;   VP                  4       ^ 8X  d   VP                  4       pM\        SV `  ! V.VO5/ VB # \        WW#4      w  rrVVP                  RR4      P                  4       pR pR p	VR8X  d   RRRrp
M@\        V4      '       d
   V^ ,          MRp
VP                  RR4      pVP                  R	R4      pVf   V
f   \        P                  ! V4      pVR8X  d   \        P                  ! VRR
4      pM V! ^4      p\        P                  ! W) V4      pV	! V4      p\        P                  ! RR7      ;_uu_ 4        \        P                   ! \        P"                  ! V^,          ^V^,          ,
          4      4      \        P$                  ! V4      ,          p
RRR4       M3Ve   TMT
p
V
\        P                   ! ^V
^,          ,           4      ,          pVfc   Vf_   \        P&                  ! V4      p\        P                   ! V^^V^,          ,          \        P(                  ,          ,
          ,          4      pMVe   TpVf[   VfW   \        P*                  ! V4      pVW,          \        P                   ! ^\        P(                  ,          4      ,          ,
          pMVe   TpVR8X  d   WV3# \        SV `  ! W3RVR	V/VB #   + '       g   i     EL; i)rE  Fr0   r:   c                 *   ^\         P                  ,
          ^,          V \         P                  ! ^\         P                  ,          4      ,          ^,          ^^V ^,          ,          \         P                  ,          ,
          R,          ,          ,          # r  r#  r  s   &r5   skew_d skewnorm_gen.fit.<locals>.skew_dy&  s]    beeGQ;1rwwq255y'9#9A"=%&1a4"%%%73$?#@ A Ar7   c                 8   \         P                  ! V 4      R,          p\         P                  ! V 4      \         P                  ! \         P                  ^,          V,          V^\         P                  ,
          ^,          R,          ,           ,          4      ,          # )r   rv  )rQ   r	  rR   r'  r  )rL  s_23s   & r5   d_skew skewnorm_gen.fit.<locals>.d_skew}&  s^    66$<#&D774=277a$$1ruu9a-3)?"?@$  r7   r;   Nr-   r.   gGz?rl  rm  gGz)r2   r@   rB   r>   r)   r?   r  rR  r<   r=   r  rF  rL  rQ   r  ro  r'  rn  rR   r  r  r&  )rD   rE   rF   r4   r  r  r  r0   r  r  r   r-   r.   rj  s_maxr  r  r  r  s   &&*,              r5   rB   skewnorm_gen.fit\&  s    88J&&7;t3d3d33dL))  "a'~~'w{47$7$77 "=T=A"I$(E*002	A	 T> $EAEt99Q$A((5$'CHHWd+E:!) 

4 A GGAud+q	GGAvu-q	AH--GGBIIadQq!tV56rwwqzA .- n!ABGGA1H%%A>emtAGGAQq!tVBEE\!123EE<CKAegbggag...CCT>5=  7;tECEuEEE/ .--s   ALL	r   r.  ry  )r   r   r   r   r   rd   rm   ru   r   ry   r   r~   r   r   r   r   r  r,  r	   r   rB   r   r   r  r   s   @@r5   r]  r]  %  s     :K9F"1!
1** $ $*E( } 5 GFGF GFr7   r]  skewnormc                   d   a a ] tR tRt oRtR tR tR tR tR t	R t
R	 tRV 3R
 lltRtVtV ;t# )trapezoid_geni&  a?  A trapezoidal continuous random variable.

%(before_notes)s

Notes
-----
The trapezoidal distribution can be represented with an up-sloping line
from ``loc`` to ``(loc + c*scale)``, then constant to ``(loc + d*scale)``
and then downsloping from ``(loc + d*scale)`` to ``(loc+scale)``.  This
defines the trapezoid base from ``loc`` to ``(loc+scale)`` and the flat
top from ``c`` to ``d`` proportional to the position along the base
with ``0 <= c <= d <= 1``.  When ``c=d``, this is equivalent to `triang`
with the same values for `loc`, `scale` and `c`.
The method of [1]_ is used for computing moments.

`trapezoid` takes :math:`c` and :math:`d` as shape parameters.

%(after_notes)s

The standard form is in the range [0, 1] with c the mode.
The location parameter shifts the start to `loc`.
The scale parameter changes the width from 1 to `scale`.

%(example)s

References
----------
.. [1] Kacker, R.N. and Lawrence, J.F. (2007). Trapezoidal and triangular
   distributions for Type B evaluation of standard uncertainty.
   Metrologia 44, 117-127. :doi:`10.1088/0026-1394/44/2/003`


c                Z    V^ 8  V^8*  ,          V^ 8  ,          V^8*  ,          W!8  ,          # r  r   rD   r\  r  s   &&&r5   rd   trapezoid_gen._argcheck&  s.    Q16"a1f-a8AFCCr7   c                @    \        R RRR4      p\        RRRR4      pW.# )r\  Fr  r  TTrO  rx  s   &  r5   rm   trapezoid_gen._shape_info&  s)    UHl;UHl;xr7   c                |    ^W2,
          ^,           ,          p\        W8  W!8*  W8*  ,          W8  .R R R .WW434      # )r   c                      W0,          V,          # rO   r   rt   r\  r  r  s   &&&&r5   r  $trapezoid_gen._pdf.<locals>.<lambda>&  s
    quqyr7   c                     V# rO   r   r  s   &&&&r5   r  r  &  s    qr7   c                 >    V^V ,
          ,          ^V,
          ,          # r_   r   r  s   &&&&r5   r  r  &  s    qAaCyAaC/@r7   r   )rD   rt   r\  r  r  s   &&&& r5   ru   trapezoid_gen._pdf&  sR    QKAEV/E# 90@B !<) 	)r7   c                P    \        W8  W!8*  W8*  ,          W8  .R  R R .WV34      # )c                 J    V ^,          V,          W!,
          ^,           ,          # rD  r   rt   r\  r  s   &&&r5   r  $trapezoid_gen._cdf.<locals>.<lambda>&  s    AqD1HA,>r7   c                 V    V^W,
          ,          ,           W!,
          ^,           ,          # rD  r   r  s   &&&r5   r  r  &  s    Qac]qs1u,Er7   c                 t    ^^V ,
          ^,          W!,
          ^,           ,          ^V,
          ,          ,
          # r_   r   r  s   &&&r5   r  r  &  s/    A!z23#a%09<=aC0A -Br7   r   r  s   &&&&r5   ry   trapezoid_gen._cdf&  sF    AEV/E# ?EBC !9& 	&r7   c                   V P                  W"V4      V P                  W2V4      rTW8  W8*  W8  .p\        P                  ! W,          ^V,           V,
          ,          4      RV,          ^V,           V,
          ,          RV,          ,           ^\        P                  ! ^V,
          W2,
          ^,           ,          ^V,
          ,          4      ,
          .p\        P                  ! Wg4      # r 	  )ry   rQ   r'  select)rD   r   r\  r  qcqdr]  r  s   &&&&    r5   r   trapezoid_gen._ppf&  s    1#TYYqQ%7BFAGQV,ggaeq1uqy12AgQ+cAg5"''1q5QUQY"71q5"ABBD
 yy..r7   c                  a VS^,           ,          p\        VR8H  RV8  VR8  ,          VR8H  .R V3R lV3R l.V.4      pRRV,           V,
          ,          WT,
          ,          S^,           S^,           ,          ,          pV# )rM   r   r   c                     R # r8  r   r  s   &r5   r  %trapezoid_gen._munp.<locals>.<lambda>'  s    sr7   c                    < \         P                  ! S^,           \         P                  ! V 4      ,          4      V R,
          ,          # r"
  )rQ   rf  r  r  rc   s   &r5   r  r  '  s(    rxx1q	 12ae<r7   c                    < S^,           # rD  r   r  s   &r5   r  r  '  s	    qsr7   r   r   )rD   rc   r\  r  ab_termdc_termr  s   &f&&   r5   r,  trapezoid_gen._munp&  s     ac(#XaAG,a3h7< C SU1Wo!23!!}E
r7   c                    R RV,
          V,           ,          RV,           V,
          ,          \         P                  ! R RV,           V,
          ,          4      ,           # r   rc  r  s   &&&r5   r  trapezoid_gen._entropy'  s=     c!eAg#a%'*RVVC3q57O-DDDr7   c                0   < Vf   Rp\         SV `  WR7      # )Nr  )gQ?gQ?ra  r\	  s   &&&r5   r  trapezoid_gen._fitstart'  s     <Dw  11r7   r   rO   )r   r   r   r   r   rd   rm   ru   ry   r   r,  r  r  r   r   r  r   s   @@r5   r  r  &  s:      BD
	)&/2E2 2r7   r  	trapezoidc                   X   a  ] tR tRt o RtRR ltR tR tR tR t	R	 t
R
 tR tRtV tR# )
triang_geni('  a  A triangular continuous random variable.

%(before_notes)s

Notes
-----
The triangular distribution can be represented with an up-sloping line from
``loc`` to ``(loc + c*scale)`` and then downsloping for ``(loc + c*scale)``
to ``(loc + scale)``.

`triang` takes ``c`` as a shape parameter for :math:`0 \le c \le 1`.

%(after_notes)s

The standard form is in the range [0, 1] with c the mode.
The location parameter shifts the start to `loc`.
The scale parameter changes the width from 1 to `scale`.

%(example)s

Nc                *    VP                  ^ V^V4      # r  )
triangularr  s   &&&&r5   r   triang_gen._rvs>'  s    &&q!Q55r7   c                     V^ 8  V^8*  ,          # r  r   r  s   &&r5   rd   triang_gen._argcheckA'  s    Q16""r7   c                     \        R RRR4      .# )r\  Fr  r  rO  rl   s   &r5   rm   triang_gen._shape_infoD'  s    3x>??r7   c                b    \        V^ 8H  W8  W8  V^8g  ,          V^8H  .R R R R .W34      pV# )r   c                 "    ^^V ,          ,
          # rD  r   r  s   &&r5   r  !triang_gen._pdf.<locals>.<lambda>Q'  s    a!a%ir7   c                 "    ^V ,          V,          # rD  r   r  s   &&r5   r  r  R'  s    a!eair7   c                 >    ^^V ,
          ,          ^V,
          ,          # rD  r   r  s   &&r5   r  r  S'  s    a1q5kQU&;r7   c                     ^V ,          # rD  r   r  s   &&r5   r  r  T'  s    a!er7   r   rD   rt   r\  rI  s   &&& r5   ru   triang_gen._pdfG'  sT     a&Q!V,a! 0/;+-   r7   c                b    \        V^ 8H  W8  W8  V^8g  ,          V^8H  .R R R R .W34      pV# )r   c                 .    ^V ,          W ,          ,
          # rD  r   r  s   &&r5   r  !triang_gen._cdf.<locals>.<lambda>]'  s    acACir7   c                      W ,          V,          # rO   r   r  s   &&r5   r  r  ^'  s
    aeair7   c                 X    W ,          ^V ,          ,
          V,           V^,
          ,          # rD  r   r  s   &&r5   r  r  _'  s    qsQqSy1}1&=r7   c                     W ,          # rO   r   r  s   &&r5   r  r  `'  s    aer7   r   r  s   &&& r5   ry   triang_gen._cdfX'  sR    a&Q!V,a! 0/=+-   r7   c           
         \         P                  ! W8  \         P                  ! W!,          4      ^\         P                  ! ^V,
          ^V,
          ,          4      ,
          4      # r_   )rQ   r  r'  rg  s   &&&r5   r   triang_gen._ppfd'  s;    xxrwwqu~q!A#!A#1G/GHHr7   c           	     X   VR ,           R,          R V,
          W,          ,           ^,          \         P                  ! ^4      ^V,          ^,
          ,          V^,           ,          V^,
          ,          ^\         P                  ! R V,
          W,          ,           R4      ,          ,          R3# )r   r  rS  g333333)rQ   r'  rU  r  s   &&r5   r   triang_gen._statsg'  st    3QqsB
AaCE"AaC(!A#.!BHHc!eACi#4N2NO 	r7   c                <    R \         P                  ! ^4      ,
          # r  rc  r  s   &&r5   r  triang_gen._entropym'  s    266!9}r7   r   r.  )r   r   r   r   r   r   rd   rm   ru   ry   r   r   r  r   r   r   s   @r5   r  r  ('  s9     *6#@"
I r7   r  triangc                   l   a a ] tR tRt oRtR tR tR tR tR t	R t
R	 tR
 tV 3R ltR tRtVtV ;t# )truncexpon_genit'  a8  A truncated exponential continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `truncexpon` is:

.. math::

    f(x, b) = \frac{\exp(-x)}{1 - \exp(-b)}

for :math:`0 <= x <= b`.

`truncexpon` takes ``b`` as a shape parameter for :math:`b`.

%(after_notes)s

%(example)s

c                @    \        R R^ \        P                  3R4      .# r  rj   rl   s   &r5   rm   truncexpon_gen._shape_info'  r6  r7   c                    V P                   V3# rO   r  r  s   &&r5   r   truncexpon_gen._get_support'      vvqyr7   c                j    \         P                  ! V) 4      \        P                  ! V) 4      ) ,          # rO   r  r  s   &&&r5   ru   truncexpon_gen._pdf'  s#    vvqbzBHHaRL=))r7   c                j    V) \         P                  ! \        P                  ! V) 4      ) 4      ,
          # rO   r  r  s   &&&r5   r   truncexpon_gen._logpdf'  s$    rBFFBHHaRL=)))r7   c                h    \         P                  ! V) 4      \         P                  ! V) 4      ,          # rO   r=  r  s   &&&r5   ry   truncexpon_gen._cdf'  s!    xx|BHHaRL((r7   c                h    \         P                  ! V\         P                  ! V) 4      ,          4      ) # rO   )r|   r  rf  r  s   &&&r5   r   truncexpon_gen._ppf'  s"    288QB<(((r7   c                    \         P                  ! V) 4      \         P                  ! V) 4      ,
          \        P                  ! V) 4      ,          # rO   r  r  s   &&&r5   r~   truncexpon_gen._sf'  s0    r
RVVQBZ'1"55r7   c                    \         P                  ! \         P                  ! V) 4      V\        P                  ! V) 4      ,          ,
          4      ) # rO   )rQ   r  r   r|   rf  r  s   &&&r5   r   truncexpon_gen._isf'  s2    rvvqbzA!$44555r7   c                  < V^8X  dJ   ^V^,           \         P                  ! V) 4      ,          ,
          \        P                  ! V) 4      ) ,          # V^8X  dl   ^^RW",          ^V,          ,           ^,           ,          \         P                  ! V) 4      ,          ,
          ,          \        P                  ! V) 4      ) ,          # \        SV `  W4      # r 	  )rQ   r   r|   rf  r@   r,  )rD   rc   r   r  s   &&&r5   r,  truncexpon_gen._munp'  s     6qsBFFA2J&&"((A2,77!VaQS1WQYr
223bhhrl]CC 7=&&r7   c                    \         P                  ! V4      p\         P                  ! V^,
          4      ^W!R,
          ,          ,           RV,
          ,          ,           # r&  r  )rD   r   eBs   && r5   r  truncexpon_gen._entropy'  s9    VVAYvvbd|QrS5z\CF333r7   r   )r   r   r   r   r   rm   r   ru   r   ry   r   r~   r   r,  r  r   r   r  r   s   @@r5   r  r  t'  sB     *E**))66	'4 4r7   r  
truncexponc                 4    \         P                  ! W.^ R7      # )r   rO  )r|   r  log_plog_qs   &&r5   _log_sumr  '  s    <<Q//r7   c                 l    \         P                  ! W\        P                  R ,          ,           .^ R7      # )              ?rO  )r|   r  rQ   r  r  s   &&r5   r  r  '  s"    <<beeBh/a88r7   c                "  a \         P                  ! W4      w  rV^ 8*  pV ^ 8  pW#,          ( pR oV3R lpR p\         P                  ! V \         P                  \         P                  R7      pW,          P
                  '       d   S! W,          W,          4      Wr&   W,          P
                  '       d   V! W,          W,          4      Ws&   W,          P
                  '       d   V! W,          W,          4      Wt&   \         P                  ! V4      # )z3Log of Gaussian probability mass within an intervalc                 >    \        \        V4      \        V 4      4      # rO   )r  r   r  s   &&r5   mass_case_left'_log_gauss_mass.<locals>.mass_case_left'  s    a,q/::r7   c                    < S! V) V ) 4      # rO   r   )r   r   r  s   &&r5   mass_case_right(_log_gauss_mass.<locals>.mass_case_right'  s    qb1"%%r7   c                 d    \         P                  ! \        V 4      ) \        V) 4      ,
          4      # rO   )r|   r  r   r  s   &&r5   mass_case_central*_log_gauss_mass.<locals>.mass_case_central'  s$     xx1	1"566r7   )r  r	  )rQ   rE  r	  rF  
complex128r   r  )	r   r   	case_left
case_rightcase_centralr  r  rJ  r  s	   &&      @r5   _log_gauss_massr  '  s    q$DA QIQJ+,L;&7 ,,qRVV2==
AC|'alC})!-G-aoqO773<r7   c                      a a ] tR tRt oRtR tR tV 3R ltR tR t	R t
R	 tR
 tR tR tR tR tR tR tRR ltRtVtV ;t# )truncnorm_geni'  a	  A truncated normal continuous random variable.

%(before_notes)s

Notes
-----
This distribution is the normal distribution centered on ``loc`` (default
0), with standard deviation ``scale`` (default 1), and truncated at ``a``
and ``b`` *standard deviations* from ``loc``. For arbitrary ``loc`` and
``scale``, ``a`` and ``b`` are *not* the abscissae at which the shifted
and scaled distribution is truncated.

.. note::
    If ``a_trunc`` and ``b_trunc`` are the abscissae at which we wish
    to truncate the distribution (as opposed to the number of standard
    deviations from ``loc``), then we can calculate the distribution
    parameters ``a`` and ``b`` as follows::

        a, b = (a_trunc - loc) / scale, (b_trunc - loc) / scale

    This is a common point of confusion. For additional clarification,
    please see the example below.

%(example)s

In the examples above, ``loc=0`` and ``scale=1``, so the plot is truncated
at ``a`` on the left and ``b`` on the right. However, suppose we were to
produce the same histogram with ``loc = 1`` and ``scale=0.5``.

>>> loc, scale = 1, 0.5
>>> rv = truncnorm(a, b, loc=loc, scale=scale)
>>> x = np.linspace(truncnorm.ppf(0.01, a, b),
...                 truncnorm.ppf(0.99, a, b), 100)
>>> r = rv.rvs(size=1000)

>>> fig, ax = plt.subplots(1, 1)
>>> ax.plot(x, rv.pdf(x), 'k-', lw=2, label='frozen pdf')
>>> ax.hist(r, density=True, bins='auto', histtype='stepfilled', alpha=0.2)
>>> ax.set_xlim(a, b)
>>> ax.legend(loc='best', frameon=False)
>>> plt.show()

Note that the distribution is no longer appears to be truncated at
abscissae ``a`` and ``b``. That is because the *standard* normal
distribution is first truncated at ``a`` and ``b``, *then* the resulting
distribution is scaled by ``scale`` and shifted by ``loc``. If we instead
want the shifted and scaled distribution to be truncated at ``a`` and
``b``, we need to transform these values before passing them as the
distribution parameters.

>>> a_transformed, b_transformed = (a - loc) / scale, (b - loc) / scale
>>> rv = truncnorm(a_transformed, b_transformed, loc=loc, scale=scale)
>>> x = np.linspace(truncnorm.ppf(0.01, a, b),
...                 truncnorm.ppf(0.99, a, b), 100)
>>> r = rv.rvs(size=10000)

>>> fig, ax = plt.subplots(1, 1)
>>> ax.plot(x, rv.pdf(x), 'k-', lw=2, label='frozen pdf')
>>> ax.hist(r, density=True, bins='auto', histtype='stepfilled', alpha=0.2)
>>> ax.set_xlim(a-0.1, b+0.1)
>>> ax.legend(loc='best', frameon=False)
>>> plt.show()
c                
    W8  # rO   r   r	  s   &&&r5   rd   truncnorm_gen._argcheck*(  s	    ur7   c                    \        R R\        P                  ) \        P                  3R4      p\        RR\        P                  ) \        P                  3R4      pW.# )r   Fr   ri   )FTrj   r  s   &  r5   rm   truncnorm_gen._shape_info-(  sG    UbffWbff$5}EUbffWbff$5}Exr7   c                   < \        V\        4      '       d   VP                  4       p\        SV `  V\
        P                  ! V4      \
        P                  ! V4      3R 7      # r)	  r  rb  s   &&r5   r  truncnorm_gen._fitstart2(  sF    dL))>>#Dw RVVD\266$<,H IIr7   c                    W3# rO   r   r	  s   &&&r5   r   truncnorm_gen._get_support8(  rf  r7   c                N    \         P                  ! V P                  WV4      4      # rO   r.  r  s   &&&&r5   ru   truncnorm_gen._pdf;(  r  r7   c                8    \        V4      \        W#4      ,
          # rO   )r   r  r  s   &&&&r5   r   truncnorm_gen._logpdf>(  s    A!666r7   c                N    \         P                  ! V P                  WV4      4      # rO   r  r  s   &&&&r5   ry   truncnorm_gen._cdfA(  r  r7   c           
     z   \         P                  ! WV4      w  rp\         P                  ! \        W!4      \        W#4      ,
          4      pVR8  p\         P                  ! V4      '       dQ   \         P
                  ! \         P                  ! V P                  W,          W%,          W5,          4      4      ) 4      WE&   V# 皙?g)rQ   rE  r#  r  r  r  r   r
  )rD   rt   r   r   logcdfrS  s   &&&&  r5   r  truncnorm_gen._logcdfD(  s    %%aA.aOA1OA4IIJTM66!99"&&QT14)F"G!GHFIr7   c                N    \         P                  ! V P                  WV4      4      # rO   r  r  s   &&&&r5   r~   truncnorm_gen._sfL(  r  r7   c           
     z   \         P                  ! WV4      w  rp\         P                  ! \        W4      \        W#4      ,
          4      pVR8  p\         P                  ! V4      '       dQ   \         P
                  ! \         P                  ! V P                  W,          W%,          W5,          4      4      ) 4      WE&   V# r   )rQ   rE  r#  r  r  r  r   r  )rD   rt   r   r   logsfrS  s   &&&&  r5   r
  truncnorm_gen._logsfO(  s    %%aA.a

?10?13HHIDL66!99xxQT14(F!G GHEHr7   c                v   \        V4      p\        V4      pWC,
          p\        P                  ! \        P                  ! ^\        P                  ,          \        P
                  ,          4      V,          4      pV\        V4      ,          V\        V4      ,          ,
          ^V,          ,          pWg,           pV# rD  )r   rQ   r  r'  r  r	  r   )	rD   r   r   r  r  r  r  Dr  s	   &&&      r5   r  truncnorm_gen._entropyW(  sy    aLaLEFF2771ruu9rtt+,q011IaL 00QU;Er7   c                J   \         P                  ! WV4      w  rpV^ 8  pV( pR pR p\         P                  ! V4      pW,          p	W,          p
V	P                  '       d   V! WV,          W4,          4      W&   V
P                  '       d   V! WV,          W5,          4      W&   V# )r   c                     \        \        V4      \        P                  ! V 4      \	        W4      ,           4      p\
        P                  ! V4      # rO   )r  r   rQ   r  r  r|   	ndtri_expr   r   r   	log_Phi_xs   &&& r5   ppf_left$truncnorm_gen._ppf.<locals>.ppf_leftf(  s7     a!#_Q-B!BDI<<	**r7   c                     \        \        V) 4      \        P                  ! V ) 4      \	        W4      ,           4      p\
        P                  ! V4      ) # rO   )r  r   rQ   r  r  r|   r.  r/  s   &&& r5   	ppf_right%truncnorm_gen._ppf.<locals>.ppf_rightk(  s?     qb!1!#1"0E!EGILL+++r7   rQ   rE  
empty_liker   )rD   r   r   r   r  r  r1  r4  rJ  q_leftq_rights   &&&&       r5   r   truncnorm_gen._ppf`(  s    %%aA.aE	Z
	+
	,
 mmA-;;;%f	lALICN<<<':NCO
r7   c                J   \         P                  ! WV4      w  rpV^ 8  pV( pR pR p\         P                  ! V4      pW,          p	W,          p
V	P                  '       d   V! WV,          W4,          4      W&   V
P                  '       d   V! WV,          W5,          4      W&   V# )r   c                     \        \        V4      \        P                  ! V 4      \	        W4      ,           4      p\
        P                  ! \        P                  ! V4      4      # rO   )r  r   rQ   r  r  r|   r.  r  r/  s   &&& r5   isf_left$truncnorm_gen._isf.<locals>.isf_left(  s@    !,q/"$&&)oa.C"CEI<<	 233r7   c                     \        \        V) 4      \        P                  ! V ) 4      \	        W4      ,           4      p\
        P                  ! \        P                  ! V4      4      ) # rO   )r  r   rQ   r  r  r|   r.  r  r/  s   &&& r5   	isf_right%truncnorm_gen._isf.<locals>.isf_right(  sH    !,r"2"$((A2,1F"FHILL!3444r7   r6  )rD   r   r   r   r  r  r=  r@  rJ  r8  r9  s   &&&&       r5   r   truncnorm_gen._isf|(  s    %%aA.aE	Z
	4
	5
 mmA-;;;%f	lALICN<<<':NCO
r7   c           	        a  V 3R  lp\         P                  ! V^ 8  W"8H  ,          W38H  ,          WV3\        P                  ! V\        P                  .R7      \        P
                  R7      # )c                  <a \         P                  ! W.4      pSP                  W1V4      w  rE\         P                  ! WE) .4      pV^ 8g  p^ ^.p\        ^V ^,           4       Fe  o\        P
                  ! WvV3V3R l^ R7      p	\         P                  ! V	4      S^,
          VR,          ,          ,           p
VP                  V
4       Kg  	  VR,          # )z_
Returns n-th moment. Defined only if n >= 0.
Function cannot broadcast due to the loop over n
c                 0   < WS^,
          ,          ,          # r_   r   )rt   rv  rk  s   &&r5   r  :truncnorm_gen._munp.<locals>.n_th_moment.<locals>.<lambda>(  s    AAaCLr7   r  r<  r  )rQ   r#  ru   rR  r  r  r  r*	  )rc   r   r   abpApBprobscondrl  rm  mkrk  rD   s   &&&        @r5   n_th_moment(truncnorm_gen._munp.<locals>.n_th_moment(  s    
 QF#BYYra(FBJJCy)EA:D!fG1ac]
 tR['@235 VVD\QqSGBK$77r" # 2;r7   r  r  rx	  )rD   rc   r   r   rM  s   f&&& r5   r,  truncnorm_gen._munp(  sP    	, Q162af=ay!||KM*,&&2 	2r7   c                    V P                  \        P                  ! W.4      W4      w  rER  p\        P                  ! V4      pV! WWE4      # )c                    \         P                  ! W.4      pW#,
          pTp\         P                  ! W#) .4      pV^ 8g  p\        P                  ! WV3R ^ R7      p	^\         P                  ! V	4      ,           p
\        P                  ! WWF,
          3R ^ R7      p	^\         P                  ! V	4      ,           p\        P                  ! WV3R ^ R7      p	^V,          \         P                  ! V	4      ,           p\        P                  ! WV3R ^ R7      p	^V
,          \         P                  ! V	4      ,           pWRV
,          ^V^,          ,          ,           ,          ,           pV\         P
                  ! VR4      ,          pWRV,          ^V,          ^V
,          V^,          ,
          ,          ,           ,          ,           pVV^,          ,          ^,
          pWkVV3# )	r   c                     W,          # rO   r   ru  s   &&r5   r  Gtruncnorm_gen._stats.<locals>._truncnorm_stats_scalar.<locals>.<lambda>(  s    13r7   r  c                     W,          # rO   r   ru  s   &&r5   r  rS  (  s    r7   c                      W^,          ,          # rD  r   ru  s   &&r5   r  rS  (  
    1T6r7   c                      W^,          ,          # r  r   ru  s   &&r5   r  rS  (  rV  r7   rS  r_  r`  )rQ   r#  r  r  r  rU  )r   r   rH  rI  rG  r  ry  rJ  rK  rm  r  rz  r  m4mu3r{  mu4r|  s   &&&&              r5   _truncnorm_stats_scalar5truncnorm_gen._stats.<locals>._truncnorm_stats_scalar(  sq   QF#BBBJJCy)EA:D??46F./1DRVVD\!B??4)9;K./1D bffTl"C??46I./1D2t$B??46I./1D2t$BRUQr1uW_--CrxxS))B2b51R42A#6677CsAv!BB?"r7   )pdfrQ   r&  r  )rD   r   r   rl  rH  rI  r[  _truncnorm_statss   &&&&    r5   r   truncnorm_gen._stats(  sC    "((A6*A1	#8 <<(?@b--r7   r   rq  )r   r   r   r   r   rd   rm   r  r   ru   r   ry   r  r~   r
  r  r   r   r,  r   r   r   r  r   s   @@r5   r  r  '  s\     >@
J-7-,8:26 .  .r7   r  	truncnorm)r   r   c                      a a ] tR tRt oRtR tR tR tR tV 3R lt	R t
R	 tV 3R
 ltR tR tR tV 3R ltR tR tR tR tR t]]! ]4      V 3R l4       4       tRtVtV ;t# )truncpareto_geni(  a'  An upper truncated Pareto continuous random variable.

%(before_notes)s

See Also
--------
pareto : Pareto distribution

Notes
-----
The probability density function for `truncpareto` is:

.. math::

    f(x, b, c) = \frac{b}{1 - c^{-b}} \frac{1}{x^{b+1}}

for :math:`b \neq 0`, :math:`c > 1` and :math:`1 \le x \le c`.

`truncpareto` takes `b` and `c` as shape parameters for :math:`b` and
:math:`c`.

Notice that the upper truncation value :math:`c` is defined in
standardized form so that random values of an unscaled, unshifted variable
are within the range ``[1, c]``.
If ``u_r`` is the upper bound to a scaled and/or shifted variable,
then ``c = (u_r - loc) / scale``. In other words, the support of the
distribution becomes ``(scale + loc) <= x <= (c*scale + loc)`` when
`scale` and/or `loc` are provided.

The ``fit`` method assumes that :math:`b` is positive; it does not produce
good results when the data is more consistent with negative :math:`b`.

`truncpareto` can also be used to model a general power law distribution
with PDF:

.. math::

    f(x; a, l, h) = \frac{a}{h^a - l^a} x^{a-1}

for :math:`a \neq 0` and :math:`0 < l < x < h`. Suppose :math:`a`,
:math:`l`, and :math:`h` are represented in code as ``a``, ``l``, and
``h``, respectively. In this case, use `truncpareto` with parameters
``b = -a``, ``c = h / l``, ``scale = l``, and ``loc = 0``.

%(after_notes)s

References
----------
.. [1] Burroughs, S. M., and Tebbens S. F.
    "Upper-truncated power laws in natural systems."
    Pure and Applied Geophysics 158.4 (2001): 741-757.

%(example)s

c                    \        R R\        P                  ) \        P                  3R4      p\        RRR\        P                  3R4      pW.# )r   Fr\  r   r4  rj   )rD   r  ry  s   &  r5   rm   truncpareto_gen._shape_info)  s@    UbffWbff$5~FUS"&&M>Bxr7   c                     VR 8g  VR8  ,          # rr  r   rD   r   r\  s   &&&r5   rd   truncpareto_gen._argcheck)  s    RAF##r7   c                    V P                   V3# rO   r  rf  s   &&&r5   r   truncpareto_gen._get_support)  r  r7   c                    \        WVR \        R7      w  rpW!V^,           ) ,          ,          ^^W2,          ,          ,
          ,          # Tforce_floatingxpr   rQ   rD   rt   r   r\  s   &&&&r5   ru   truncpareto_gen._pdf)  s7    Q1TbAa!f9}AadF
++r7   c                   < \        WVR \        R7      w  rp\        P                  ! V^ 8  WV3V P                  \
        SV `  4      # rk  )r   rQ   r  r  _logpdf_pos_br@   r   rD   rt   r   r\  r  s   &&&&r5   r   truncpareto_gen._logpdf$)  >    Q1TbAaq1uqQi1C1CUW_UUr7   c           	        \         P                  ! V4      \         P                  ! \         P                  ! V) \         P                  ! V4      ,          4      ) 4      ,
          V^,           \         P                  ! V4      ,          ,
          # r_   )rQ   r  rf  rp  s   &&&&r5   rs  truncpareto_gen._logpdf_pos_b()  sM    vvay266288QBrvvayL#9"9::ac266!9_LLr7   c                    \        WVR \        R7      w  rp^W) ,          ,
          ^^W2,          ,          ,
          ,          # rk  ro  rp  s   &&&&r5   ry   truncpareto_gen._cdf+)  s3    Q1TbAaArE	a!AD&j))r7   c                   < \        WVR \        R7      w  rp\        P                  ! V^ 8  WV3V P                  \
        SV `  4      # rk  )r   rQ   r  r  _logcdf_pos_br@   r  rt  s   &&&&r5   r  truncpareto_gen._logcdf/)  rv  r7   c                    \         P                  ! W) ,          ) 4      \         P                  ! RW2,          ,          4      ,
          # r  r  rp  s   &&&&r5   r|  truncpareto_gen._logcdf_pos_b3)  s+    xxB"((2ad7"333r7   c                    \        WVR \        R7      w  rp\        ^^^W2,          ,          ,
          V,          ,
          RV,          4      # Trl  r  r   rQ   r  rD   r   r   r\  s   &&&&r5   r   truncpareto_gen._ppf6)  s:    Q1TbAa1AadF
A~%r!t,,r7   c                    \        WVR \        R7      w  rpW) ,          ^W2,          ,          ,
          ^^W2,          ,          ,
          ,          # rk  ro  rp  s   &&&&r5   r~   truncpareto_gen._sf:)  s9    Q1TbAa2!$1qv:..r7   c                   < \        WVR \        R7      w  rp\        P                  ! V^ 8  WV3V P                  \
        SV `  4      # rk  )r   rQ   r  r  _logsf_pos_br@   r
  rt  s   &&&&r5   r
  truncpareto_gen._logsf>)  s>    Q1TbAaq1uqQi1B1BEGNSSr7   c                    \         P                  ! W) ,          ^W2,          ,          ,
          4      \         P                  ! RW2,          ,          4      ,
          # r  r  rp  s   &&&&r5   r  truncpareto_gen._logsf_pos_bB)  s3    vvaeafn%AD(999r7   c                    \        WVR \        R7      w  rp\        ^W2,          ,          ^^W2,          ,          ,
          V,          ,           RV,          4      # r  r  r  s   &&&&r5   r   truncpareto_gen._isfE)  s@    Q1TbAa1QT6Q14ZN*BqD11r7   c                    \         P                  ! V^^W!,          ,          ,
          ,          4      V^,           \         P                  ! V4      W!,          ^,
          ,          ^V,          ,
          ,          ,           ) # r_   rc  rf  s   &&&r5   r  truncpareto_gen._entropyI)  sS    1qv:'aC"&&)QTAX.1456 7 	7r7   c                H   \        WVR \        R7      w  rpW8H  P                  4       '       d9   V\        P                  ! V4      ,          ^^W2,          ,          ,
          ,          # W"V,
          ,          W2,          W1,          ,
          ,          W2,          ^,
          ,          # rk  )r   rQ   r%  r  )rD   rc   r   r\  s   &&&&r5   r,  truncpareto_gen._munpM)  sh    Q1TbAaF<<>>RVVAY;!af*--!9qt,q99r7   c                    \        V\        4      '       d   VP                  4       p\        P	                  V4      w  r#p\        V4      V,
          V,          pW%W43# rO   )r>   r)   r  r  rB   r.  )rD   rE   r   r-   r.   r\  s   &&    r5   r  truncpareto_gen._fitstartT)  sJ    dL))>>#D

4(Y_e#Sr7   c                &  <a aaa a!a"a#a$a% VP                  R R4      '       d   \        S&S `  ! S.VO5/ VB # R o#R o"VV"V#3R loV%3R lo V$V%3R lpV$3R lo!RVVV V!V"3R llpR	 pV&V 3R
 lp\        S SW#4      pVw  orrSP	                  4       SP                  4       uo$o%\        P                  ! S$\        P                  ) 4      pV	e   V
e   Ve   Ve   \        R4      hV
Ef   VEf   VEf   V	Ef$   VV V!V"3R lp\        P                  ! S$\        P                  ) 4      pTp^ pV^,
          pV\        P                  ) 8  dD   V! V4      V! V4      ,          ^ 8  d*   V^,          pV\        P                  ! RV4      ,
          pKY  V\        P                  ) 8  g   V! S.VO5/ VB # \        VVV3R7      pVP                  '       g   V! S.VO5/ VB # VP                  R,
          pV^,
          p^ pV\        P                  ) 8  dD   V! V4      V! V4      ,          ^ 8  d*   V^,          pV\        P                  ! RV4      ,
          pKY  V\        P                  ) 8  g   V! S.VO5/ VB # \        VVV3R7      pVP                  '       g   V! S.VO5/ VB # VP                  pS!! V4      pS ! VV4      pS! VVV4      pSV,
          V,          p\	        ^S#! V4      ,          ^S"! V4      ^,
          ,          4      pVV8  g   V! S.VO5/ VB # EM>TpV^,
          p^ pV\        P                  ) 8  d7   V! VV	4      V! W4      ,          ^ 8  d   V^,          pV^V,          ,
          pKL  V\        P                  ) 8  g   V! S.VO5/ VB # \        WY3VV3R7      pVP                  '       g   V! S.VO5/ VB # VP                  pS!! V4      pS ! VV4      pT	pEMtVe   TMV! W4      pT;'       g	    S!! V4      pT
;'       g
    S ! VV4      pVe+   SP	                  4       V,
          ^ 8  d   \        R^VR7      hV
'       dD   Ve@   V'       d8   SP                  4       W,          V,           8  d   \        R^S ! VV4      R7      hV	f   SV,
          V,          pS#! V4      p\        P                  ! V4      p^V,          V8  g   V! S.VO5/ VB # ^V,          ^VV,
          ,          ,           p\        P                  ! ^V,          ^ 4      p \        VVV3VV3R7      pVP                  '       g   V! S.VO5/ VB # VP                  pMT	pVV,           S$8  gO   V'       d(   \        P                  ! V\        P                  ) 4      pMS!! V4      p\        P                  ! V^ 4      pVV,          V,           S%8  g/   S ! VV4      p\        P                  ! V\        P                  4      p\        P                   ! S P#                  VV4      4      '       d   V^ 8  g   V! S.VO5/ VB # VVVV3pVf>   Vf:   V! S.VO5/ VB pS P%                  VS4      pS P%                  VS4      pVV8  d   V# V#   \         d    Tp EL7i ; i)rE  Fc                 V    \         P                  ! \         P                  ! V 4      4      # rO   )rQ   r&  r  r   s   &r5   log_mean%truncpareto_gen.fit.<locals>.log_meana)  s    77266!9%%r7   c                 J    ^\         P                  ! ^V ,          4      ,          # r_   )rQ   r&  r   s   &r5   	harm_mean&truncpareto_gen.fit.<locals>.harm_meand)  s    RWWQqS\>!r7   c                   < SV,
          V,          pS! V4      pS	! V4      pV^,
          V,          p^V^,
          V^^V ,          ,
          V,          \         P                  ! V 4      ,          ,
          ,          ,
          V,          # r_   rc  )
r\  r-   r.   r  harm_mlog_mquotrE   r  r  s
   &&&    r5   get_b"truncpareto_gen.fit.<locals>.get_bg)  si    c5 Aq\FQKE1He#DaDA!GV+;BFF1I+E$EFFMMr7   c                 $   < SV ,
          V,          # rO   r   )r-   r.   mxs   &&r5   get_c"truncpareto_gen.fit.<locals>.get_cn)  s    He##r7   c                 ~   < V'       d   SV,
          pV# V '       d!   V S,          S,
          V ^,
          ,          pV# R# )rM   Nr   )rT  r  r-   r	  r  s   && r5   get_loc$truncpareto_gen.fit.<locals>.get_locq)  s7    6k
"urzBF+
 r7   c                    < SV ,
          # rO   r   )r-   r	  s   &r5   r1  &truncpareto_gen.fit.<locals>.get_scaley)  s    8Or7   c                   < S	! V 4      pS! W4      pVf
   S! W0V4      MTpS
! SV ,
          V,          4      p^^V^,
          W4^,           ,          V,
          ,          ,           ^^V^,           ,          ,
          ,          V,          ,
          # rO   r   )r-   r9  r.   r\  r   r  rE   r  r  r1  r  s   &&    r5   r
  $truncpareto_gen.fit.<locals>.dL_dLoc)  sv     cNEc!A(*
ae$As
E12FQUQ1X\22q1ac7{CfLLLr7   c                 ~    V \         P                  ! W,          ^W,          ,
          ,          4      V,          ,
          # r_   r  )r   logclogms   &&&r5   dL_dB"truncpareto_gen.fit.<locals>.dL_dB)  s*     rxx!af* 56===r7   c                 4   < \         \        S`
  ! V .VO5/ VB # rO   )r@   rb  rB   )rE   rF   kwargsr  rD   s   &*,r5   fallback%truncpareto_gen.fit.<locals>.fallback)  s    $3DJ4J6JJr7   z2All parameters fixed.There is nothing to optimize.c                    < S! V 4      pS! W4      pS! SV ,
          V,          4      p^^V^,
          ,          ,           \         P                  ! V4      ,          V,          ^,
          # r_   rc  )r-   r.   r\  r  rE   r  r1  r  s   &   r5   cond_b#truncpareto_gen.fit.<locals>.cond_b)  sR    %cNEc)A&s
E'9:F1Q3K266!94v=AAr7   r   r  gMbP?truncparetor  rO   )r2   r@   rB   rR  rR  r.  rQ   r
  rk   r"  rU  r*   r
  rS  r  r  r%  rd   r
  )'rD   rE   rF   r4   r  r
  r  r  r
  r  rT  r  r  mn_infr  rT   rS  rS   r  r-   r.   r\  r   std_data
up_bound_br  r  params_overrideparams_supernllf_override
nllf_superr  r  r1  r  r  r	  r  r  s'   ff*,                           @@@@@@@r5   rB   truncpareto_gen.fit[)  s8    88J&&7;t3d3d33	&	"	N	$			M 	M	>	K 1tTH
%/"bdTXXZBb266'*NN$& = > >ZDLV^zB B b266'2!"&&("6N6&>9Q>FA#bhhr1o5F'#D848488!&662BC}}}#D848488 D!"&&(#FOGFO;q@FA#bhhr1o5F'#D848488!'FF3CD}}}#D848488hh!##u%!S%( 3J- 8H#5!5!"Ih$7$9!:<
J#D848488 '
  !'#FB/%f12567FA#ad]F'#D848488!'5+16*:<}}}#D848488hh!##u% *$0CC,,inE''eC'A DHHJ$5$9"=CC t'V88:	D 00&}A-23->@ @ z 3J-)vvay$#D8484884!TD[/1afa0%edD\/5v.>@C ==='<t<t<<A  c	Rll30!#UA.%r!c5!AQ'At~~a+,,%!)D040400QU*<FN
 $D84848L IIot<M<6JM)##E " As   /Y? 	Y? ?ZZr   )r   r   r   r   r   rm   rd   r   ru   r   rs  ry   r  r|  r   r~   r
  r  r   r  r,  r  rK   r   r   rB   r   r   r  r   s   @@r5   rb  rb  (  s     6p
$,
VM*V4-/T:27:  M*Z + Z Zr7   rb  r  c                   l   a  ] tR tRt o Rt]P                  tR tR t	R t
R tR tR tR	 tR
 tRtV tR# )tukeylambda_geni>*  a  A Tukey-Lamdba continuous random variable.

%(before_notes)s

Notes
-----
A flexible distribution, able to represent and interpolate between the
following distributions:

- Cauchy                (:math:`lambda = -1`)
- logistic              (:math:`lambda = 0`)
- approx Normal         (:math:`lambda = 0.14`)
- uniform from -1 to 1  (:math:`lambda = 1`)

`tukeylambda` takes a real number :math:`lambda` (denoted ``lam``
in the implementation) as a shape parameter.

%(after_notes)s

%(example)s

c                .    \         P                  ! V4      # rO   r  rD   lams   &&r5   rd   tukeylambda_gen._argcheckW*  s    {{3r7   c                ^    \        R R\        P                  ) \        P                  3R4      .# )r  Fr4  rj   rl   s   &r5   rm   tukeylambda_gen._shape_infoZ*  s%    5%266'266):NKLLr7   c                d    \         P                  ! V^ 8  VR \        P                  R7      pV) V3# )r   c                     ^V ,          # r_   r   )r  s   &r5   r  .tukeylambda_gen._get_support.<locals>.<lambda>_*  s    #r7   r  rU  )rD   r  r   s   && r5   r   tukeylambda_gen._get_support]*  s/    OOC!GS-')vv/ r1ur7   c           
        \         P                  ! \        P                  ! W4      4      pW2R ,
          ,          \         P                  ! ^V,
          4      VR ,
          ,          ,           p\         P                  ! RR7      ;_uu_ 4        R \         P                  ! V4      ,          p\         P
                  ! V^ 8*  \        V4      R \         P                  ! V4      ,          8  ,          VR4      uuRRR4       #   + '       g   i     R# ; i)r   rl  rm  r   N)rQ   r#  r|   tklmbdaro  r  r	  )rD   rt   r  Fxr  s   &&&  r5   ru   tukeylambda_gen._pdfc*  s    ZZ

1*+c']bjj2.#c'::[[))RZZ^#B88SAX#a&3rzz#3F*FGSQ *)))s   	A&C::D	c                .    \         P                  ! W4      # rO   )r|   r  )rD   rt   r  s   &&&r5   ry   tukeylambda_gen._cdfj*  s    zz!!!r7   c                h    \         P                  ! W4      \         P                  ! V) V4      ,
          # rO   )r|   r  r  )rD   r   r  s   &&&r5   r   tukeylambda_gen._ppfm*  s#    yy 2;;r3#777r7   c                2    ^ \        V4      ^ \        V4      3# r  )_tlvar_tlkurtr  s   &&r5   r   tukeylambda_gen._statsp*  s    &+q'#,..r7   c                N   a V3R  lp\         P                  ! V^ ^4      ^ ,          # )c                    < \         P                  ! \        V S^,
          4      \        ^V ,
          S^,
          4      ,           4      # r_   )rQ   r  r  )rH  r  s   &r5   integ'tukeylambda_gen._entropy.<locals>.integt*  s/    66#aQ-AaCQ788r7   )r   r,  )rD   r  r  s   &f r5   r  tukeylambda_gen._entropys*  s     	9~~eQ*1--r7   r   N)r   r   r   r   r   r   rI  rJ  rd   rm   r   ru   ry   r   r   r  r   r   r   s   @r5   r  r  >*  sF     , "44M MR"8/. .r7   r  tukeylambdac                   &   a  ] tR tRt o R tRtV tR# )FitUniformFixedScaleDataErrori|*  c                "    R V RV R2V n         R# )zInvalid values in `data`.  Maximum likelihood estimation with the uniform distribution and fixed scale requires that np.ptp(data) <= fscale, but np.ptp(data) = z and fscale = r1   Nr  )rD   rG  r  s   &&&r5   r  &FitUniformFixedScaleDataError.__init__}*  s$    ::= ?xq" 		r7   r  N)r   r   r   r   r  r   r   r   s   @r5   r  r  |*  s     
 
r7   r  c                   b   a  ] tR tRt o RtR tRR ltR tR tR t	R	 t
R
 t]R 4       tRtV tR# )uniform_geni*  zA uniform continuous random variable.

In the standard form, the distribution is uniform on ``[0, 1]``. Using
the parameters ``loc`` and ``scale``, one obtains the uniform distribution
on ``[loc, loc + scale]``.

%(before_notes)s

%(example)s

c                    . # rO   r   rl   s   &r5   rm   uniform_gen._shape_info*  r   r7   Nc                (    VP                  R RV4      # rr  )r  r   s   &&&r5   r   uniform_gen._rvs*  s    ##Cd33r7   c                    R W8H  ,          # r8  r   r   s   &&r5   ru   uniform_gen._pdf*  s    AF|r7   c                    V# rO   r   r   s   &&r5   ry   uniform_gen._cdf*      r7   c                    V# rO   r   r   s   &&r5   r   uniform_gen._ppf*  r  r7   c                    R# )r   )r   gUUUUUU?r   g333333r   rl   s   &r5   r   uniform_gen._stats*  s    ##r7   c                    R # r[  r   rl   s   &r5   r  uniform_gen._entropy*  rN  r7   c                   \        V4      ^ 8  d   \        R4      hVP                  RR4      pVP                  RR4      p\        V4       Ve   Ve   \	        R4      h\
        P                  ! V4      p\
        P                  ! V4      P                  4       '       g   \	        R4      hVfo   Vf(   VP                  4       p\
        P                  ! V4      pMTpVP                  4       V,
          pVP                  4       V8  d   \        RWfV,           R7      hMN\
        P                  ! V4      pW8  d   \        WR	7      hVP                  4       R
WX,
          ,          ,
          pTp\        V4      \        V4      3# )a  
Maximum likelihood estimate for the location and scale parameters.

`uniform.fit` uses only the following parameters.  Because exact
formulas are used, the parameters related to optimization that are
available in the `fit` method of other distributions are ignored
here.  The only positional argument accepted is `data`.

Parameters
----------
data : array_like
    Data to use in calculating the maximum likelihood estimate.
floc : float, optional
    Hold the location parameter fixed to the specified value.
fscale : float, optional
    Hold the scale parameter fixed to the specified value.

Returns
-------
loc, scale : float
    Maximum likelihood estimates for the location and scale.

Notes
-----
An error is raised if `floc` is given and any values in `data` are
less than `floc`, or if `fscale` is given and `fscale` is less
than ``data.max() - data.min()``.  An error is also raised if both
`floc` and `fscale` are given.

Examples
--------
>>> import numpy as np
>>> from scipy.stats import uniform

We'll fit the uniform distribution to `x`:

>>> x = np.array([2, 2.5, 3.1, 9.5, 13.0])

For a uniform distribution MLE, the location is the minimum of the
data, and the scale is the maximum minus the minimum.

>>> loc, scale = uniform.fit(x)
>>> loc
2.0
>>> scale
11.0

If we know the data comes from a uniform distribution where the support
starts at 0, we can use ``floc=0``:

>>> loc, scale = uniform.fit(x, floc=0)
>>> loc
0.0
>>> scale
13.0

Alternatively, if we know the length of the support is 12, we can use
``fscale=12``:

>>> loc, scale = uniform.fit(x, fscale=12)
>>> loc
1.5
>>> scale
12.0

In that last example, the support interval is [1.5, 13.5].  This
solution is not unique.  For example, the distribution with ``loc=2``
and ``scale=12`` has the same likelihood as the one above.  When
`fscale` is given and it is larger than ``data.max() - data.min()``,
the parameters returned by the `fit` method center the support over
the interval ``[data.min(), data.max()]``.

rP  r  Nr  r   r!  r  r  )rG  r  r   )r  r3   r2   r6   r"  rQ   r#  r$  r%  rR  rG  r.  r  r  r  )	rD   rE   rF   r4   r  r  r-   r.   rG  s	   &&*,     r5   rB   uniform_gen.fit*  sF   V t9q=122xx%(D)$T* 2 ) * * zz${{4 $$&&CDD> >|hhjt 
S(88:#&y;OO $ &&,C|3KK ((*sFL11CE Sz5<''r7   r   r.  )r   r   r   r   r   rm   r   ru   ry   r   r   r  rK   rB   r   r   r   s   @r5   r  r  *  sC     
4$ R( R(r7   r  r  c                      a a ] tR tRt oRtR tR tRR lt]! ]	4      V 3R l4       t
R tR tR	 tR
 tR t]! ]	RR7      RV 3R ll4       t]]! ]	RR7      V 3R l4       4       tRtVtV ;t# )vonmises_geni@+  aE  A Von Mises continuous random variable.

%(before_notes)s

See Also
--------
scipy.stats.vonmises_fisher : Von-Mises Fisher distribution on a
                              hypersphere

Notes
-----
The probability density function for `vonmises` and `vonmises_line` is:

.. math::

    f(x, \kappa) = \frac{ \exp(\kappa \cos(x)) }{ 2 \pi I_0(\kappa) }

for :math:`-\pi \le x \le \pi`, :math:`\kappa \ge 0`. :math:`I_0` is the
modified Bessel function of order zero (`scipy.special.i0`).

`vonmises` is a circular distribution which does not restrict the
distribution to a fixed interval. Currently, there is no circular
distribution framework in SciPy. The ``cdf`` is implemented such that
``cdf(x + 2*np.pi) == cdf(x) + 1``.

`vonmises_line` is the same distribution, defined on :math:`[-\pi, \pi]`
on the real line. This is a regular (i.e. non-circular) distribution.

Note about distribution parameters: `vonmises` and `vonmises_line` take
``kappa`` as a shape parameter (concentration) and ``loc`` as the location
(circular mean). A ``scale`` parameter is accepted but does not have any
effect.

Examples
--------
Import the necessary modules.

>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> from scipy.stats import vonmises

Define distribution parameters.

>>> loc = 0.5 * np.pi  # circular mean
>>> kappa = 1  # concentration

Compute the probability density at ``x=0`` via the ``pdf`` method.

>>> vonmises.pdf(0, loc=loc, kappa=kappa)
0.12570826359722018

Verify that the percentile function ``ppf`` inverts the cumulative
distribution function ``cdf`` up to floating point accuracy.

>>> x = 1
>>> cdf_value = vonmises.cdf(x, loc=loc, kappa=kappa)
>>> ppf_value = vonmises.ppf(cdf_value, loc=loc, kappa=kappa)
>>> x, cdf_value, ppf_value
(1, 0.31489339900904967, 1.0000000000000004)

Draw 1000 random variates by calling the ``rvs`` method.

>>> sample_size = 1000
>>> sample = vonmises(loc=loc, kappa=kappa).rvs(sample_size)

Plot the von Mises density on a Cartesian and polar grid to emphasize
that it is a circular distribution.

>>> fig = plt.figure(figsize=(12, 6))
>>> left = plt.subplot(121)
>>> right = plt.subplot(122, projection='polar')
>>> x = np.linspace(-np.pi, np.pi, 500)
>>> vonmises_pdf = vonmises.pdf(x, loc=loc, kappa=kappa)
>>> ticks = [0, 0.15, 0.3]

The left image contains the Cartesian plot.

>>> left.plot(x, vonmises_pdf)
>>> left.set_yticks(ticks)
>>> number_of_bins = int(np.sqrt(sample_size))
>>> left.hist(sample, density=True, bins=number_of_bins)
>>> left.set_title("Cartesian plot")
>>> left.set_xlim(-np.pi, np.pi)
>>> left.grid(True)

The right image contains the polar plot.

>>> right.plot(x, vonmises_pdf, label="PDF")
>>> right.set_yticks(ticks)
>>> right.hist(sample, density=True, bins=number_of_bins,
...            label="Histogram")
>>> right.set_title("Polar plot")
>>> right.legend(bbox_to_anchor=(0.15, 1.06))

c                @    \        R R^ \        P                  3R4      .# )r	  Fri   rj   rl   s   &r5   rm   vonmises_gen._shape_info+  s    7EArvv;FGGr7   c                    V^ 8  # r  r   r 
  s   &&r5   rd   vonmises_gen._argcheck+  s    zr7   c                (    VP                  R WR7      # )r   r  )vonmises)rD   r	  r   r   s   &&&&r5   r   vonmises_gen._rvs+  s    $$S%$;;r7   c                   < \         SV `  ! V/ VB p\        P                  ! V\        P                  ,           ^\        P                  ,          4      \        P                  ,
          # rD  r@   r)  rQ   modr  rD   rF   r4   r)  r  s   &*, r5   r)  vonmises_gen.rvs+  s@    gk4(4(vvcBEEk1RUU7+bee33r7   c                    \         P                  ! V\        P                  ! V4      ,          4      ^\         P                  ,          \        P
                  ! V4      ,          ,          # rD  )rQ   r   r|   cosm1r  r  r	  s   &&&r5   ru   vonmises_gen._pdf+  s:    
 vveBHHQK'(AbeeGBFF5M,ABBr7   c                    V\         P                  ! V4      ,          \        P                  ! ^\        P                  ,          4      ,
          \        P                  ! \         P
                  ! V4      4      ,
          # rD  )r|   r  rQ   r  r  r  r	  s   &&&r5   r   vonmises_gen._logpdf+  s@    rxx{"RVVAbeeG_4rvvbffUm7LLLr7   c                .    \         P                  ! W!4      # rO   )r   von_mises_cdfr	  s   &&&r5   ry   vonmises_gen._cdf+  s    ##E--r7   c                    R# r*  r   r 
  s   &&r5   _stats_skipvonmises_gen._stats_skip+  r,  r7   c                   V) \         P                  ! V4      ,          \         P                  ! V4      ,          \        P                  ! ^\        P
                  ,          \         P                  ! V4      ,          4      ,           V,           # rD  )r|   i1er  rQ   r  r  r 
  s   &&r5   r  vonmises_gen._entropy+  sV     &6q255y266%=01249: 	;r7   z        The default limits of integration are endpoints of the interval
        of width ``2*pi`` centered at `loc` (e.g. ``[-pi, pi]`` when
        ``loc=0``).

r  c           	        < \         P                  ) \         P                  rVf	   W9,           pVf	   W:,           p\        SV `  ! WVWEWg3/ VB # rO   )rQ   r  r@   expect)rD   r  rF   r-   r.   lbubconditionalr4   r   r  r  s   &&&&&&&&,  r5   r  vonmises_gen.expect+  sS     %%B:B:Bw~d##B<@B 	Br7   a          Fit data is assumed to represent angles and will be wrapped onto the
        unit circle. `f0` and `fscale` are ignored; the returned shape is
        always the maximum likelihood estimate and the scale is always
        1. Initial guesses are ignored.

c                2  < VP                  R R4      '       d   \        SV `  ! V.VO5/ VB # \        WW#4      w  rrVV P                  \
        P                  ) 8X  d   \        SV `  ! V.VO5/ VB # \
        P                  ! V^\
        P                  ,          4      pR pR pVe   TMV! V4      p	Ve   TMV! W4      p
\
        P                  ! V	\
        P                  ,           ^\
        P                  ,          4      \
        P                  ,
          p	W^3# )rE  Fc                 .    \         P                  ! V 4      # rO   )rF  circmean)rE   s   &r5   find_mu!vonmises_gen.fit.<locals>.find_mu+  s    >>$''r7   c                   a \         P                  ! \         P                  ! W,
          4      4      \        V 4      ,          oS^8X  d   R# S^ 8  dg   V3R lpS^S,
          ,          ^S,           ,          p^V,          pV! V4      ^ 8  d   V# V! V4      ^ 8:  d   V# \	        VRW43R7      pVP
                  # \         P                  ! \        4      P                  # )rM   g 7yACc                 t   < \         P                  ! V 4      \         P                  ! V 4      ,          S,
          # rO   )r|   r  r  )r	  rI  s   &r5   solve_for_kappa=vonmises_gen.fit.<locals>.find_kappa.<locals>.solve_for_kappa,  s#    66%=6::r7   r  )r0   rQ  )	rQ   r  rQ  r  r*   rS  r  r  r  )rE   r-   r  lower_boundupper_boundroot_resrI  s   &&    @r5   
find_kappa$vonmises_gen.fit.<locals>.find_kappa+  s     rvvcj)*3t94A Av Q;  1gqsmm #;/14&&$[1Q6&&*?84?3M OH#==( xx+++r7   )r2   r@   rB   rR  r   rQ   r  r  )rD   rE   rF   r4   r
  r  r  r  r$  r-   rG  r  s   &&*,       r5   rB   vonmises_gen.fit+  s     88J&&7;t3d3d33%@AE&M"d66beeV7;t3d3d33 vvdAI&	(6	,r &dGDM ,*T2GffS255[!bee),ruu41}r7   r   r.  )Nr   r   rM   NNF)r   r   r   r   r   rm   rd   r   r   r   r)  ru   r   ry   r  r  r	   r  rK   rB   r   r   r  r   s   @@r5   r  r  @+  s     ^~H< M*4 +4CM. 
; } 5 
B	
B } 5/ 0
N0 N Nr7   r  r  vonmises_linec                      a  ] tR tRt o Rt]P                  tR tRR lt	R t
R tR tR	 tR
 tR tR tR tR tR tRtV tR# )r  i6,  a,  A Wald continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `wald` is:

.. math::

    f(x) = \frac{1}{\sqrt{2\pi x^3}} \exp(- \frac{ (x-1)^2 }{ 2x })

for :math:`x >= 0`.

`wald` is a special case of `invgauss` with ``mu=1``.

%(after_notes)s

%(example)s
c                    . # rO   r   rl   s   &r5   rm   wald_gen._shape_infoM,  r   r7   Nc                *    VP                  R R VR7      # r  r  r   s   &&&r5   r   wald_gen._rvsP,  s      c 55r7   c                .    \         P                  VR 4      # r8  )r  ru   r   s   &&r5   ru   wald_gen._pdfS,  s    }}Q$$r7   c                .    \         P                  VR 4      # r8  )r  ry   r   s   &&r5   ry   wald_gen._cdfW,      }}Q$$r7   c                .    \         P                  VR 4      # r8  )r  r~   r   s   &&r5   r~   wald_gen._sfZ,  s    ||As##r7   c                .    \         P                  VR 4      # r8  )r  r   r   s   &&r5   r   wald_gen._ppf],  r1  r7   c                .    \         P                  VR 4      # r8  )r  r   r   s   &&r5   r   wald_gen._isf`,  r1  r7   c                .    \         P                  VR 4      # r8  )r  r   r   s   &&r5   r   wald_gen._logpdfc,      3''r7   c                .    \         P                  VR 4      # r8  )r  r  r   s   &&r5   r  wald_gen._logcdff,  r:  r7   c                .    \         P                  VR 4      # r8  )r  r
  r   s   &&r5   r
  wald_gen._logsfi,  s    q#&&r7   c                    R# )r   )r   r   r  r  r   rl   s   &r5   r   wald_gen._statsl,  s    ""r7   c                ,    \         P                  R 4      # r8  )r  r  rl   s   &r5   r  wald_gen._entropyo,  s      %%r7   r   r.  )r   r   r   r   r   r   rI  rJ  rm   r   ru   ry   r~   r   r   r   r  r
  r   r  r   r   r   s   @r5   r  r  6,  sX     ( "44M6%%$%%(('#& &r7   r  r  c                   v   a a ] tR tRt oRtR tR tR tR tR t	R t
R	 t]! ]4      V 3R
 l4       tRtVtV ;t# )wrapcauchy_geniv,  aS  A wrapped Cauchy continuous random variable.

%(before_notes)s

Notes
-----
The probability density function for `wrapcauchy` is:

.. math::

    f(x, c) = \frac{1-c^2}{2\pi (1+c^2 - 2c \cos(x))}

for :math:`0 \le x \le 2\pi`, :math:`0 < c < 1`.

`wrapcauchy` takes ``c`` as a shape parameter for :math:`c`.

%(after_notes)s

%(example)s

c                     V^ 8  V^8  ,          # r  r   r  s   &&r5   rd   wrapcauchy_gen._argcheck,  s    A!a%  r7   c                     \        R RRR4      .# )r\  F)r   rM   r4  rO  rl   s   &r5   rm   wrapcauchy_gen._shape_info,  s    3v~>??r7   c                    R W",          ,
          ^\         P                  ,          ^W",          ,           ^V,          \         P                  ! V4      ,          ,
          ,          ,          # r8  r  r`  s   &&&r5   ru   wrapcauchy_gen._pdf,  s;    AC!BEE'1QS51RVVAY#6788r7   c                    R  pR p^V,           ^V,
          ,          p\         P                  ! V\        P                  8  W3W44      # )c                     ^\         P                  ,          \         P                  ! V\         P                  ! V ^,          4      ,          4      ,          # r_   rQ   r  r  r  rt   crs   &&r5   r  wrapcauchy_gen._cdf.<locals>.f1,  s.    RUU7RYYr"&&1+~666r7   c           	          ^^\         P                  ,          \         P                  ! V\         P                  ! ^\         P                  ,          V ,
          ^,          4      ,          4      ,          ,
          # r_   rM  rN  s   &&r5   ri  wrapcauchy_gen._cdf.<locals>.f2,  sA    qw2bffagk1_.E+E!FFFFr7   )r  r  rQ   r  )rD   rt   r\  r  ri  rO  s   &&&   r5   ry   wrapcauchy_gen._cdf,  s=    	7	G !ea!e_q255y1'2::r7   c           
        R V,
          R V,           ,          p^\         P                  ! V\         P                  ! \         P                  V,          4      ,          4      ,          p^\         P                  ,          ^\         P                  ! V\         P                  ! \         P                  ^V,
          ,          4      ,          4      ,          ,
          p\         P                  ! VR8  WE4      # r  )rQ   r  r  r  r  )rD   r   r\  r  rcqrcmqs   &&&   r5   r   wrapcauchy_gen._ppf,  s    1us1uo		#bffRUU1Wo-..wq3rvvbeeQqSk':#:;;;xxE	3--r7   c                    \         P                  ! ^\         P                  ,          ^W,          ,
          ,          4      # rD  r  r  s   &&r5   r  wrapcauchy_gen._entropy,  s#    vvagquo&&r7   c                    \        V\        4      '       d   VP                  4       pR \        P                  ! V4      \        P
                  ! V4      ^\        P                  ,          ,          3# r  )r>   r)   r  rQ   rR  rG  r  )rD   rE   s   &&r5   r  wrapcauchy_gen._fitstart,  sG     dL))>>#DBFF4L"&&,"%%"888r7   c                |   < \         SV `  ! V/ VB p\        P                  ! V^\        P                  ,          4      # rD  r   r  s   &*, r5   r)  wrapcauchy_gen.rvs,  s/    gk4(4(vvc1RUU7##r7   r   )r   r   r   r   r   rd   rm   ru   ry   r   r  r  r   r   r)  r   r   r  r   s   @@r5   rD  rD  v,  sL     *!@9;.'9 M*$ +$ $r7   rD  
wrapcauchyc                   j   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tRR ltRtV tR# )gennorm_geni,  a  A generalized normal continuous random variable.

%(before_notes)s

See Also
--------
laplace : Laplace distribution
norm : normal distribution

Notes
-----
The probability density function for `gennorm` is [1]_:

.. math::

    f(x, \beta) = \frac{\beta}{2 \Gamma(1/\beta)} \exp(-|x|^\beta),

where :math:`x` is a real number, :math:`\beta > 0` and
:math:`\Gamma` is the gamma function (`scipy.special.gamma`).

`gennorm` takes ``beta`` as a shape parameter for :math:`\beta`.
For :math:`\beta = 1`, it is identical to a Laplace distribution.
For :math:`\beta = 2`, it is identical to a normal distribution
(with ``scale=1/sqrt(2)``).

References
----------

.. [1] "Generalized normal distribution, Version 1",
       https://en.wikipedia.org/wiki/Generalized_normal_distribution#Version_1

.. [2] Nardon, Martina, and Paolo Pianca. "Simulation techniques for
       generalized Gaussian densities." Journal of Statistical
       Computation and Simulation 79.11 (2009): 1317-1329

.. [3] Wicklin, Rick. "Simulate data from a generalized Gaussian
       distribution" in The DO Loop blog, September 21, 2016,
       https://blogs.sas.com/content/iml/2016/09/21/simulate-generalized-gaussian-sas.html

%(example)s

c                @    \        R R^ \        P                  3R4      .# r  Fr4  rj   rl   s   &r5   rm   gennorm_gen._shape_info,      651bff+~FGGr7   c                L    \         P                  ! V P                  W4      4      # rO   r.  rD   rt   r  s   &&&r5   ru   gennorm_gen._pdf,  s    vvdll1+,,r7   c                    \         P                  ! R V,          4      \        P                  ! RV,          4      ,
          \	        V4      V,          ,
          # r   )rQ   r  r|   r  r	  rf  s   &&&r5   r   gennorm_gen._logpdf,  s4    vvc$h"**SX"66QEEr7   c                    R \         P                  ! V4      ,          pR V,           V\        P                  ! RV,          \	        V4      V,          4      ,          ,
          # r   )rQ   rR   r|   rF  r	  rD   rt   r  r\  s   &&& r5   ry   gennorm_gen._cdf,  s?    "''!*a1r||CHc!fdlCCCCr7   c                    \         P                  ! VR ,
          4      pV\        P                  ! RV,          RV,           RV,          V,          ,
          4      RV,          ,          ,          # )r   r   r   )rQ   rR   r|   rP  rk  s   &&& r5   r   gennorm_gen._ppf,  sH    GGAG2??3t8cAgQq-@ACHMMMr7   c                (    V P                  V) V4      # rO   r	  rf  s   &&&r5   r~   gennorm_gen._sf,  s    yy!T""r7   c                &    V P                  W4      ) # rO   r  rf  s   &&&r5   r   gennorm_gen._isf,  s    		!"""r7   c                    V^ 8X  d   R# V^,          ^ 8X  dL   \         P                  ! RV,          VR,           V,          .4      w  r4\        P                  ! WC,
          4      # R# )r   r   r   r|   r  rQ   r   )rD   rc   r  c1cns   &&&  r5   r,  gennorm_gen._munp -  sK    6q5A:ZZTAGT> :;FB66"'?"r7   c                   \         P                  ! R V,          RV,          RV,          .4      w  r#pR\        P                  ! W2,
          4      R\        P                  ! WB,           RV,          ,
          4      R,
          3# )r   r  r  r   r   rt  )rD   r  ru  c3c5s   &&   r5   r   gennorm_gen._stats	-  sY    ZZT3t8SX >?
266"'?BrwR/?(@2(EEEr7   c                    R V,          \         P                  ! RV,          4      ,
          \        P                  ! R V,          4      ,           # r  r_  rD   r  s   &&r5   r  gennorm_gen._entropy-  s0    Dy266"t),,rzz"t)/DDDr7   Nc                    VP                  ^V,          VR7      pV^V,          ,          p\        P                  ! V4      pVP                  VP                  R7      R8  pWV,          ) WV&   V# )rM   r  r   )r(  rQ   r#  randomrG  )rD   r  r   r   r  rv  r  s   &&&&   r5   r   gennorm_gen._rvs-  sc     qvD1!D&MJJqM"""0367(r7   r   r.  )r   r   r   r   r   rm   ru   r   ry   r   r~   r   r,  r   r  r   r   r   r   s   @r5   r`  r`  ,  sM     )TH-FD
N
##FE	 	r7   r`  gennormc                   T   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tRtV tR# )halfgennorm_geni-  aY  The upper half of a generalized normal continuous random variable.

%(before_notes)s

See Also
--------
gennorm : generalized normal distribution
expon : exponential distribution
halfnorm : half normal distribution

Notes
-----
The probability density function for `halfgennorm` is:

.. math::

    f(x, \beta) = \frac{\beta}{\Gamma(1/\beta)} \exp(-|x|^\beta)

for :math:`x, \beta > 0`. :math:`\Gamma` is the gamma function
(`scipy.special.gamma`).

`halfgennorm` takes ``beta`` as a shape parameter for :math:`\beta`.
For :math:`\beta = 1`, it is identical to an exponential distribution.
For :math:`\beta = 2`, it is identical to a half normal distribution
(with ``scale=1/sqrt(2)``).

References
----------

.. [1] "Generalized normal distribution, Version 1",
       https://en.wikipedia.org/wiki/Generalized_normal_distribution#Version_1

%(example)s

c                @    \        R R^ \        P                  3R4      .# rb  rj   rl   s   &r5   rm   halfgennorm_gen._shape_infoC-  rd  r7   c                L    \         P                  ! V P                  W4      4      # rO   r.  rf  s   &&&r5   ru   halfgennorm_gen._pdfF-  s     vvdll1+,,r7   c                    \         P                  ! V4      \        P                  ! R V,          4      ,
          W,          ,
          # r8  r_  rf  s   &&&r5   r   halfgennorm_gen._logpdfL-  s)    vvd|bjjT22QW<<r7   c                J    \         P                  ! R V,          W,          4      # r8  rA  rf  s   &&&r5   ry   halfgennorm_gen._cdfO-  s    {{3t8QW--r7   c                Z    \         P                  ! R V,          V4      R V,          ,          # r8  r~  rf  s   &&&r5   r   halfgennorm_gen._ppfR-  s     ~~c$h*SX66r7   c                J    \         P                  ! R V,          W,          4      # r8  rE  rf  s   &&&r5   r~   halfgennorm_gen._sfU-  s    ||CHag..r7   c                Z    \         P                  ! R V,          V4      R V,          ,          # r8  r  rf  s   &&&r5   r   halfgennorm_gen._isfX-  s     s4x+c$h77r7   c                    R V,          \         P                  ! V4      ,
          \        P                  ! R V,          4      ,           # r8  r_  r}  s   &&r5   r  halfgennorm_gen._entropy[-  s+    4x"&&,&CH)===r7   r   Nrk  r   s   @r5   r  r  -  s9     "FH-=.7/8> >r7   r  halfgennormc                   f   a a ] tR tRt oRtR tR tV 3R ltR tR t	R t
R	 tR
 tR tRtVtV ;t# )crystalball_genib-  aY  
Crystalball distribution

%(before_notes)s

Notes
-----
The probability density function for `crystalball` is:

.. math::

    f(x, \beta, m) =  \begin{cases}
                        N \exp(-x^2 / 2),  &\text{for } x > -\beta\\
                        N A (B - x)^{-m}  &\text{for } x \le -\beta
                      \end{cases}

where :math:`A = (m / |\beta|)^m  \exp(-\beta^2 / 2)`,
:math:`B = m/|\beta| - |\beta|` and :math:`N` is a normalisation constant.

`crystalball` takes :math:`\beta > 0` and :math:`m > 1` as shape
parameters.  :math:`\beta` defines the point where the pdf changes
from a power-law to a Gaussian distribution.  :math:`m` is the power
of the power-law tail.

%(after_notes)s

.. versionadded:: 0.19.0

References
----------
.. [1] "Crystal Ball Function",
       https://en.wikipedia.org/wiki/Crystal_Ball_function

%(example)s
c                     V^8  V^ 8  ,          # )z0
Shape parameter bounds are m > 1 and beta > 0.
r   )rD   r  r  s   &&&r5   rd   crystalball_gen._argcheck-  s     A$(##r7   c                    \        R R^ \        P                  3R4      p\        RR^\        P                  3R4      pW.# )r  Fr  r4  rj   )rD   ibetaims   &  r5   rm   crystalball_gen._shape_info-  s:    651bff+~FUQK@{r7   c                &   < \         SV `  VRR7      # )rM   r  rG  ra  rb  s   &&r5   r  crystalball_gen._fitstart-  s    w H 55r7   c                   RW2,          V^,
          ,          \         P                  ! V^,          ) R,          4      ,          \        \        V4      ,          ,           ,          pR pR pV\        P
                  ! W) 8  WV3WV4      ,          # )a(  
Return PDF of the crystalball function.

                                    --
                                   | exp(-x**2 / 2),  for x > -beta
crystalball.pdf(x, beta, m) =  N * |
                                   | A * (B - x)**(-m), for x <= -beta
                                    --
r   r   c                 L    \         P                  ! V ^,          ) ^,          4      # rD  r7  rt   r  r  s   &&&r5   rhs!crystalball_gen._pdf.<locals>.rhs-  s    661a4%!)$$r7   c                     W!,          V,          \         P                  ! V^,          ) R,          4      ,          W!,          V,
          V ,
          V) ,          ,          # r   r7  r  s   &&&r5   lhs!crystalball_gen._pdf.<locals>.lhs-  sB    VaK"&&$'C"88Vd]Q&1"-. /r7   rQ   r   r   r   r  r  rD   rt   r  r  r  r  r  s   &&&&   r5   ru   crystalball_gen._pdf-  so     16QqS>BFFD!G8c>$::401 2	%	/ 3??1u9qlCEEEr7   c                B   RW2,          V^,
          ,          \         P                  ! V^,          ) R,          4      ,          \        \        V4      ,          ,           ,          pR pR p\         P                  ! V4      \
        P                  ! W) 8  WV3WV4      ,           # )z8
Return the log of the PDF of the crystalball function.
r   r   c                 $    V ^,          ) ^,          # rD  r   r  s   &&&r5   r  $crystalball_gen._logpdf.<locals>.rhs-  s    qD57Nr7   c                     V\         P                  ! W!,          4      ,          V^,          ^,          ,
          V\         P                  ! W!,          V,
          V ,
          4      ,          ,
          # rD  rc  r  s   &&&r5   r  $crystalball_gen._logpdf.<locals>.lhs-  sB    RVVAF^#dAgai/!BFF16D=1;L4M2MMMr7   )rQ   r   r   r   r  r  r  r  s   &&&&   r5   r   crystalball_gen._logpdf-  sx     16QqS>BFFD!G8c>$::401 2		N vvay3??1u9qlCMMMr7   c                   RW2,          V^,
          ,          \         P                  ! V^,          ) R,          4      ,          \        \        V4      ,          ,           ,          pR pR pV\        P
                  ! W) 8  WV3WV4      ,          # )z(
Return CDF of the crystalball function
r   r   c                     W!,          \         P                  ! V^,          ) R,          4      ,          V^,
          ,          \        \        V 4      \        V) 4      ,
          ,          ,           # r   rQ   r   r   r   r  s   &&&r5   r  !crystalball_gen._cdf.<locals>.rhs-  sL    VrvvtQwhn551=9Q<)TE2B#BCD Er7   c                     W!,          V,          \         P                  ! V^,          ) R,          4      ,          W!,          V,
          V ,
          V) ^,           ,          ,          V^,
          ,          # r   r7  r  s   &&&r5   r  !crystalball_gen._cdf.<locals>.lhs-  sR    VaK"&&$'C"88Vd]Q&1"Q$/034Q38 9r7   r  r  s   &&&&   r5   ry   crystalball_gen._cdf-  sp     16QqS>BFFD!G8c>$::401 2	E	9 3??1u9qlCEEEr7   c                P   a  R pV 3R lp\         P                  ! W) 8  WV3WE4      # )z4
Survival function of the crystalball distribution.
c                     W!,          V^,
          ,          \         P                  ! V^,          ) ^,          4      ,          \        \        V4      ,          ,           p\        \	        V 4      ,          V,          # r_   )rQ   r   r   r   r   )rt   r  r  Ms   &&& r5   r   crystalball_gen._sf.<locals>.rhs-  sK    ArvvtQwhqj11K	$4OOAx{*1,,r7   c                 6   < ^SP                  WV4      ,
          # r_   r	  )rt   r  r  rD   s   &&&r5   r   crystalball_gen._sf.<locals>.lhs-  s    tyy!,,,r7   r=  )rD   rt   r  r  r  r  s   f&&&  r5   r~   crystalball_gen._sf-  s*    
	-
	- q5y1A,AAr7   c                   R W2,          V^,
          ,          \         P                  ! V^,          ) R,          4      ,          \        \        V4      ,          ,           ,          pWCV,          ,          \         P                  ! V^,          ) ^,          4      ,          V^,
          ,          pR pR p\        P
                  ! W8  WV3Wg4      # )r   r   c                    \         P                  ! V^,          ) ^,          4      pW!,          V,          V^,
          ,          p^V\        \        V4      ,          ,           ,          pW!,          V,
          V^,
          W!,          V) ,          ,          V,          V ,          V,          ^^V,
          ,          ,          ,
          # rD  r  rH  r  r  eb2r  r  s   &&&   r5   ppf_less&crystalball_gen._ppf.<locals>.ppf_less-  s    &&$'!$C3!A#&A1{Yt_445AFTM!eaf^+C/1!3q!A#w?@ Ar7   c                 D   \         P                  ! V^,          ) ^,          4      pW!,          V,          V^,
          ,          p^V\        \        V4      ,          ,           ,          p\	        \        V) 4      ^\        ,          W,          V,
          ,          ,           4      # rD  )rQ   r   r   r   r   r  s   &&&   r5   ppf_greater)crystalball_gen._ppf.<locals>.ppf_greater-  sl    &&$'!$C3!A#&A1{Yt_445AYu-;q0IIJJr7   r  )rD   rH  r  r  r  pbetar  r  s   &&&&    r5   r   crystalball_gen._ppf-  s    16QqS>BFFD!G8c>$::401 2tVrvvtQwhqj11QU;	A	K qy1A,NNr7   c           
        RW2,          V^,
          ,          \         P                  ! V^,          ) R,          4      ,          \        \        V4      ,          ,           ,          pR pV\        P
                  ! V^,           V8  WV3\         P                  ! V\         P                  .R7      \         P                  R7      ,          # )zB
Returns the n-th non-central moment of the crystalball function.
r   r   c                :   W!,          V,          \         P                  ! V^,          ) R,          4      ,          pW!,          V,
          p^V ^,
          R,          ,          \        P                  ! V ^,           ^,          4      ,          RRV ,          \        P                  ! V ^,           ^,          V^,          ^,          4      ,          ,           ,          p\         P
                  ! VP                  4      p\        \        V 4      ^,           4       Fy  pV\        P                  ! W4      W@V,
          ,          ,          RV,          ,          W',
          ^,
          ,          W!,          V) V,           ^,           ,          ,          ,          pK{  	  W6,          V,           # )z_
Returns n-th moment. Defined only if n+1 < m
Function cannot broadcast due to the loop over n
r   r   r  )
rQ   r   r|   r(  rB  r  rG  rR  r+  binom)rc   r  r  r  r  r  r  rk  s   &&&     r5   rM  *crystalball_gen._munp.<locals>.n_th_moment-  s   
 !bffdAgX^44AA!Sy>BHHac1W$552'BKK1aq1$EEEGC((399%C3q6A:&qS1R!G;quqyIA26A:./ 0 ' 7S= r7   r  r  )	rQ   r   r   r   r  r  r  r   rk   )rD   rc   r  r  r  rM  s   &&&&  r5   r,  crystalball_gen._munp-  s     16QqS>BFFD!G8c>$::401 2	! 3??1q519ql#%<<RZZL#Q.0ff6 6 	6r7   r   )r   r   r   r   r   rd   rm   r  ru   r   ry   r~   r   r,  r   r   r  r   s   @@r5   r  r  b-  sB     "F$
6F,NF"B O(6 6r7   r  crystalballzA Crystalball Function)r   longnamec                Z    \         P                  ! RV ^,          ^,          4      ^,          # )a  
Utility function for the argus distribution used in the pdf, sf and
moment calculation.
Note that for all x > 0:
gammainc(1.5, x**2/2) = 2 * (_norm_cdf(x) - x * _norm_pdf(x) - 0.5).
This can be verified directly by noting that the cdf of Gamma(1.5) can
be written as erf(sqrt(x)) - 2*sqrt(x)*exp(-x)/sqrt(Pi).
We use gammainc instead of the usual definition because it is more precise
for small chi.
rS  rA  )re  s   &r5   
_argus_phir  .  s"     ;;sCF1H%))r7   c                   \   a  ] tR tRt o RtR tR tR tR tR t	RR	 lt
RR
 ltR tRtV tR# )	argus_geni.  a  
Argus distribution

%(before_notes)s

Notes
-----
The probability density function for `argus` is:

.. math::

    f(x, \chi) = \frac{\chi^3}{\sqrt{2\pi} \Psi(\chi)} x \sqrt{1-x^2}
                 \exp(-\chi^2 (1 - x^2)/2)

for :math:`0 < x < 1` and :math:`\chi > 0`, where

.. math::

    \Psi(\chi) = \Phi(\chi) - \chi \phi(\chi) - 1/2

with :math:`\Phi` and :math:`\phi` being the CDF and PDF of a standard
normal distribution, respectively.

`argus` takes :math:`\chi` as shape a parameter. Details about sampling
from the ARGUS distribution can be found in [2]_.

%(after_notes)s

References
----------
.. [1] "ARGUS distribution",
       https://en.wikipedia.org/wiki/ARGUS_distribution
.. [2] Christoph Baumgarten "Random variate generation by fast numerical
       inversion in the varying parameter case." Research in Statistics,
       vol. 1, 2023. :doi:`10.1080/27684520.2023.2279060`

.. versionadded:: 0.19.0

%(example)s
c                @    \        R R^ \        P                  3R4      .# )re  Fr4  rj   rl   s   &r5   rm   argus_gen._shape_infoD.      5%!RVVnEFFr7   c                   \         P                  ! R R7      ;_uu_ 4        RW,          ,
          p^\         P                  ! V4      ,          \        ,
          \         P                  ! \	        V4      4      ,
          pV\         P                  ! V4      ,           R\         P
                  ! V) V,          4      ,          ,           V^,          V,          ^,          ,
          uuRRR4       #   + '       g   i     R# ; i)rl  rm  r   r   N)rQ   ro  r  r   r  r  )rD   rt   re  rv  r  s   &&&  r5   r   argus_gen._logpdfG.  s    [[))ac	A"&&+.
31HHArvvay=3rxx1~#55Q
QF *)))s   B>C))C:	c                L    \         P                  ! V P                  W4      4      # rO   r.  rD   rt   re  s   &&&r5   ru   argus_gen._pdfN.  s    vvdll1*++r7   c                2    R V P                  W4      ,
          # r8  r1	  r  s   &&&r5   ry   argus_gen._cdfQ.  s    TXXa%%%r7   c                    \        V\        P                  ! ^V,
          ^V,           ,          4      ,          4      \        V4      ,          # r_   )r  rQ   r'  r  s   &&&r5   r~   argus_gen._sfT.  s0    #QQ 889JsOKKr7   Nc                  a	a
 \         P                  ! V4      pVP                  ^8X  d   V P                  WVR7      pEM\	        VP
                  V4      w  po	\        \         P                  ! V4      4      p\         P                  ! V4      p\         P                  ! V.R.R..R7      o
S
P                  '       g   \        ;QJ d,    . V	V
3R l\        \        V4      ) ^ 4       4       F  NK  	  5M%! V	V
3R l\        \        V4      ) ^ 4       4       4      pV P                  S
^ ,          VVR7      pVP                  V4      WG&   S
P                  4        K  VR8X  d
   VR,          pV# )rM   )r  r   r  r  r  c              3   ~   <"   T F2  pSV,          '       g   SP                   V,          M
\        R 4      x  K4  	  R # 5irO   r  r  s   & r5   rD  !argus_gen._rvs.<locals>.<genexpr>d.  r  r  r   )rQ   r#  r   r  r   rG  r+  rQ  r  r  r  r  rR  r  r  r  )rD   re  r   r   rJ  r  r  r  rI  r  r  s   &&&&     @@r5   r   argus_gen._rvsW.  s%   jjo88q=""30< # >C #399d3GCRWWS\*J((4.CC5"/&0\N4B kkke ;%*CI:q%9;ee ;%*CI:q%9; ;$$RUz2> % @99S>2:b'C
r7   c                   \        \        P                  ! V4      4      p\        \        P                  ! V4      4      p\        P
                  ! V4      p^ pW,          pVR8:  d   V) ^,          p	Wu8  d   WW,
          p
VP                  V
R7      pVP                  V
R7      pVR,          p\        P                  ! V4      W,          8*  p\        P                  ! V4      pV^ 8  g   Ky  \        P                  ! ^W,          ,
          4      pVWgW,           % W,          pK  EMVR8:  d   \        P                  ! V) ^,          4      pWu8  d   WW,
          p
VP                  V
R7      pVP                  V
R7      p^\        P                  ! V^V,
          ,          V,           4      ,          V,          pV^,          V,           ^ 8*  p\        P                  ! V4      pV^ 8  g   K  \        P                  ! ^W,          ,           4      pVWgW,           % W,          pK  MWu8  db   WW,
          p
VP                  RV
R7      pVV^,          8*  p\        P                  ! V4      pV^ 8  g   KL  VV,          WgW,           % W,          pKg  \        P                  ! ^^V,          V,          ,
          4      p\        P                  ! Wd4      # )r   r   r  g?rS  rv  )r  rQ   r  r+  rQ  r  r  r  r  r'  r   r  r  )rD   re  r  r   r  r  rt   r  r7  r  rk  r  r  r  r 	  r	  r)  echirI  s   &&&&               r5   r  argus_gen._rvs_scalaro.  s6   h r}}Z01 HHQK	y#:	A-M ((a(0 ((a(0H&&)qu,VVF^
>''!ai-0C<?A!79+I   CZ664%!)$D-M ((a(0 ((a(0tq1u~122T9 Q$(a-VVF^
>''!ai-0C<?A!79+I   -M //!/<tax-VVF^
><=fIA!79+IAEDL()Azz!$$r7   c                H   \         P                  ! V\        R 7      p\        V4      p\         P                  ! \         P
                  ^,          4      V,          \        P                  ! ^V^,          ^,          4      ,          V,          p\         P                  ! V4      pVR8  pW,          p^^V^,          ,          ,
          V\        V4      ,          W%,          ,          ,           WE&   W( ,          p. ROp\         P                  ! Wv4      WE( &   W4V^,          ,
          RR3# )r	  r!  N)	g_1g־r   gWBar   gp|RH?r   gE'卡?r   g?)rQ   r#  r  r  r'  r  r|   r  r7  r   r
  )rD   re  r  r  rz  r  r\  coefs   &&      r5   r   argus_gen._stats.  s     jjE*oGGBEE!Gs"RVVAsAvax%883>mmC SyIAqDL1y|#3ci#??	JKZZ(E
1*dD((r7   r   r.  )r   r   r   r   r   rm   r   ru   ry   r~   r   r  r   r   r   r   s   @r5   r  r  .  s=     'PGG,&L0c%J) )r7   r  arguszAn Argus Function)r   r  r   r   c                      a a ] tR tRt oRt]P                  tRR/V 3R lltR tR t	R t
R	 tR
 tV 3R ltRtVtV ;t# )rv_histogrami.  a  
Generates a distribution given by a histogram.
This is useful to generate a template distribution from a binned
datasample.

As a subclass of the `rv_continuous` class, `rv_histogram` inherits from it
a collection of generic methods (see `rv_continuous` for the full list),
and implements them based on the properties of the provided binned
datasample.

Parameters
----------
histogram : tuple of array_like
    Tuple containing two array_like objects.
    The first containing the content of n bins,
    the second containing the (n+1) bin boundaries.
    In particular, the return value of `numpy.histogram` is accepted.

density : bool, optional
    If False, assumes the histogram is proportional to counts per bin;
    otherwise, assumes it is proportional to a density.
    For constant bin widths, these are equivalent, but the distinction
    is important when bin widths vary (see Notes).
    If None (default), sets ``density=True`` for backwards compatibility,
    but warns if the bin widths are variable. Set `density` explicitly
    to silence the warning.

    .. versionadded:: 1.10.0

Notes
-----
When a histogram has unequal bin widths, there is a distinction between
histograms that are proportional to counts per bin and histograms that are
proportional to probability density over a bin. If `numpy.histogram` is
called with its default ``density=False``, the resulting histogram is the
number of counts per bin, so ``density=False`` should be passed to
`rv_histogram`. If `numpy.histogram` is called with ``density=True``, the
resulting histogram is in terms of probability density, so ``density=True``
should be passed to `rv_histogram`. To avoid warnings, always pass
``density`` explicitly when the input histogram has unequal bin widths.

There are no additional shape parameters except for the loc and scale.
The pdf is defined as a stepwise function from the provided histogram.
The cdf is a linear interpolation of the pdf.

.. versionadded:: 0.19.0

Examples
--------

Create a scipy.stats distribution from a numpy histogram

>>> import scipy.stats
>>> import numpy as np
>>> data = scipy.stats.norm.rvs(size=100000, loc=0, scale=1.5,
...                             random_state=123)
>>> hist = np.histogram(data, bins=100)
>>> hist_dist = scipy.stats.rv_histogram(hist, density=False)

Behaves like an ordinary scipy rv_continuous distribution

>>> hist_dist.pdf(1.0)
0.20538577847618705
>>> hist_dist.cdf(2.0)
0.90818568543056499

PDF is zero above (below) the highest (lowest) bin of the histogram,
defined by the max (min) of the original dataset

>>> hist_dist.pdf(np.max(data))
0.0
>>> hist_dist.cdf(np.max(data))
1.0
>>> hist_dist.pdf(np.min(data))
7.7591907244498314e-05
>>> hist_dist.cdf(np.min(data))
0.0

PDF and CDF follow the histogram

>>> import matplotlib.pyplot as plt
>>> X = np.linspace(-5.0, 5.0, 100)
>>> fig, ax = plt.subplots()
>>> ax.set_title("PDF from Template")
>>> ax.hist(data, density=True, bins=100)
>>> ax.plot(X, hist_dist.pdf(X), label='PDF')
>>> ax.plot(X, hist_dist.cdf(X), label='CDF')
>>> ax.legend()
>>> fig.show()

densityNc                 < Wn         W n        \        V4      ^8w  d   \        R4      h\        P
                  ! V^ ,          4      V n        \        P
                  ! V^,          4      V n        \        V P                  4      ^,           \        V P                  4      8w  d   \        R4      hV P                  R,          V P                  RR ,
          V n        \        P                  ! V P                  V P                  ^ ,          4      '       * pVf+   V'       d#   Rp\        P                  ! V\        ^R7       RpM*V'       g#   V P                  V P                  ,          V n        V P                  \        \        P                  ! V P                  V P                  ,          4      4      ,          V n        \        P                  ! V P                  V P                  ,          4      V n        \        P"                  ! RV P                  R.4      V n        \        P"                  ! RV P                   .4      V n        V P                  ^ ,          ;VR	&   V n        V P                  R,          ;VR
&   V n        \(        SV `T  ! V/ VB  R# )a  
Create a new distribution using the given histogram

Parameters
----------
histogram : tuple of array_like
    Tuple containing two array_like objects.
    The first containing the content of n bins,
    the second containing the (n+1) bin boundaries.
    In particular, the return value of np.histogram is accepted.
density : bool, optional
    If False, assumes the histogram is proportional to counts per bin;
    otherwise, assumes it is proportional to a density.
    For constant bin widths, these are equivalent.
    If None (default), sets ``density=True`` for backward
    compatibility, but warns if the bin widths are variable. Set
    `density` explicitly to silence the warning.
z)Expected length 2 for parameter histogramzbNumber of elements in histogram content and histogram boundaries do not match, expected n and n+1.r  NzjBin widths are not constant. Assuming `density=True`.Specify `density` explicitly to silence this warning.r  Tr   r   r   r  )
_histogram_densityr  r"  rQ   r#  _hpdf_hbins_hbin_widthsallcloser  r  r  r  r  cumsum_hcdfhstackr   r   r@   r  )rD   	histogramr  rF   r  	bins_varyr  r  s   &&$*,  r5   r  rv_histogram.__init__F/  s   & $y>QHIIZZ	!-
jj1.tzz?Q#dkk"22 3 4 4 !KKOdkk#2.>>D$5$5t7H7H7KLL	?yOGMM'>a@Gd&7&77DJZZ%tzzD<M<M/M(N"OO
YYtzzD,=,==>
YYTZZ56
YYTZZ01
#{{1~-sdf#{{2.sdf$)&)r7   c                j    V P                   \        P                  ! V P                  VRR7      ,          # )z
PDF of the histogram
r8	  )side)r  rQ   searchsortedr  r   s   &&r5   ru   rv_histogram._pdfv/  s$     zz"//$++qwGHHr7   c                X    \         P                  ! WP                  V P                  4      # )z#
CDF calculated from the histogram
)rQ   interpr  r  r   s   &&r5   ry   rv_histogram._cdf|/  s     yyKK44r7   c                X    \         P                  ! WP                  V P                  4      # )z3
Percentile function calculated from the histogram
)rQ   r  r  r  r   s   &&r5   r   rv_histogram._ppf/  s     yyJJ44r7   c                    V P                   R,          V^,           ,          V P                   RR V^,           ,          ,
          V^,           ,          p\        P                  ! V P                  ^R V,          4      # )z$Compute the n-th non-central moment.r  Nr  )r  rQ   r  r  )rD   rc   	integralss   && r5   r,  rv_histogram._munp/  sY    [[_qs+dkk#2.>1.EE!A#N	vvdjj2&233r7   c                    V P                   ^R p\        P                  ! VR8  V\        P                  RR7      p\        P
                  ! W,          V P                  ,          4      ) # )zCompute entropy of distributionr   r  r  )r  r  r  rQ   r  r  r  )rD   hpdfr  s   &  r5   r  rv_histogram._entropy/  sM    zz!BoodSj$3GtzD$5$55666r7   c                `   < \         SV `  4       pV P                  VR&   V P                  VR&   V# )z6
Set the histogram as additional constructor argument
r  r  )r@   _updated_ctor_paramr  r  )rD   dctr  s   & r5   r   rv_histogram._updated_ctor_param/  s2     g)+??KI
r7   )r  r  r  r  r  r  r   r   )r   r   r   r   r   r   rJ  r  ru   ry   r   r,  r  r  r   r   r  r   s   @@r5   r  r  .  sJ     Zv "//M.* .*`I554
7 r7   r  c                   T   a a ] tR tRt oRtR tR tV 3R ltR tR t	R t
R	tVtV ;t# )
studentized_range_geni/  u  A studentized range continuous random variable.

%(before_notes)s

See Also
--------
t: Student's t distribution

Notes
-----
The probability density function for `studentized_range` is:

.. math::

     f(x; k, \nu) = \frac{k(k-1)\nu^{\nu/2}}{\Gamma(\nu/2)
                    2^{\nu/2-1}} \int_{0}^{\infty} \int_{-\infty}^{\infty}
                    s^{\nu} e^{-\nu s^2/2} \phi(z) \phi(sx + z)
                    [\Phi(sx + z) - \Phi(z)]^{k-2} \,dz \,ds

for :math:`x ≥ 0`, :math:`k > 1`, and :math:`\nu > 0`.

`studentized_range` takes ``k`` for :math:`k` and ``df`` for :math:`\nu`
as shape parameters.

When :math:`\nu` exceeds 100,000, an asymptotic approximation (infinite
degrees of freedom) is used to compute the cumulative distribution
function [4]_ and probability distribution function.

%(after_notes)s

References
----------

.. [1] "Studentized range distribution",
       https://en.wikipedia.org/wiki/Studentized_range_distribution
.. [2] Batista, Ben Dêivide, et al. "Externally Studentized Normal Midrange
       Distribution." Ciência e Agrotecnologia, vol. 41, no. 4, 2017, pp.
       378-389., doi:10.1590/1413-70542017414047716.
.. [3] Harter, H. Leon. "Tables of Range and Studentized Range." The Annals
       of Mathematical Statistics, vol. 31, no. 4, 1960, pp. 1122-1147.
       JSTOR, www.jstor.org/stable/2237810. Accessed 18 Feb. 2021.
.. [4] Lund, R. E., and J. R. Lund. "Algorithm AS 190: Probabilities and
       Upper Quantiles for the Studentized Range." Journal of the Royal
       Statistical Society. Series C (Applied Statistics), vol. 32, no. 2,
       1983, pp. 204-210. JSTOR, www.jstor.org/stable/2347300. Accessed 18
       Feb. 2021.

Examples
--------
>>> import numpy as np
>>> from scipy.stats import studentized_range
>>> import matplotlib.pyplot as plt
>>> fig, ax = plt.subplots(1, 1)

Display the probability density function (``pdf``):

>>> k, df = 3, 10
>>> x = np.linspace(studentized_range.ppf(0.01, k, df),
...                 studentized_range.ppf(0.99, k, df), 100)
>>> ax.plot(x, studentized_range.pdf(x, k, df),
...         'r-', lw=5, alpha=0.6, label='studentized_range pdf')

Alternatively, the distribution object can be called (as a function)
to fix the shape, location and scale parameters. This returns a "frozen"
RV object holding the given parameters fixed.

Freeze the distribution and display the frozen ``pdf``:

>>> rv = studentized_range(k, df)
>>> ax.plot(x, rv.pdf(x), 'k-', lw=2, label='frozen pdf')

Check accuracy of ``cdf`` and ``ppf``:

>>> vals = studentized_range.ppf([0.001, 0.5, 0.999], k, df)
>>> np.allclose([0.001, 0.5, 0.999], studentized_range.cdf(vals, k, df))
True

Rather than using (``studentized_range.rvs``) to generate random variates,
which is very slow for this distribution, we can approximate the inverse
CDF using an interpolator, and then perform inverse transform sampling
with this approximate inverse CDF.

This distribution has an infinite but thin right tail, so we focus our
attention on the leftmost 99.9 percent.

>>> a, b = studentized_range.ppf([0, .999], k, df)
>>> a, b
0, 7.41058083802274

>>> from scipy.interpolate import interp1d
>>> rng = np.random.default_rng()
>>> xs = np.linspace(a, b, 50)
>>> cdf = studentized_range.cdf(xs, k, df)
# Create an interpolant of the inverse CDF
>>> ppf = interp1d(cdf, xs, fill_value='extrapolate')
# Perform inverse transform sampling using the interpolant
>>> r = ppf(rng.uniform(size=1000))

And compare the histogram:

>>> ax.hist(r, density=True, histtype='stepfilled', alpha=0.2)
>>> ax.legend(loc='best', frameon=False)
>>> plt.show()

c                     V^8  V^ 8  ,          # r_   r   )rD   rk  r3  s   &&&r5   rd   studentized_range_gen._argcheck0  s    A"q&!!r7   c                    \        R R^\        P                  3R4      p\        RR^ \        P                  3R4      pW.# )rk  Fr3  r4  rj   )rD   r,  r  s   &  r5   rm   !studentized_range_gen._shape_info0  s:    UQK@uq"&&k>Byr7   c                &   < \         SV `  VRR7      # )r   r  )r   rM   ra  rb  s   &&r5   r  studentized_range_gen._fitstart0  s    w F 33r7   c                   aaa R oV P                  4       w  ooVVV3R lp\        P                  ! V^^4      p\        P                  ! V! WV4      \        P                  R7      R,          # )_studentized_range_momentc                   < \         P                  ! W4      pWW#.p\        P                  ! V\        4      P
                  P                  \
        P                  4      p\        P                  ! \         SV4      p\        P                  ) \        P                  3^ \        P                  3S	S
3.p\        RRR7      p\        P                  ! WgVR7      ^ ,          # )r   rw  -q=r%  r$  rangesopts)r   _studentized_range_pdf_logconstrQ   r&  r  r'  r(  r)  r   r*  rk   dictr   nquad)rX  rk  r3  	log_constargusr_datar0  r  r  r   r  cython_symbols   &&&      r5   _single_moment3studentized_range_gen._munp.<locals>._single_moment0  s    >>qEI'CxxU+22::6??KH"..v}hOCw'!RVVr2h?FuU3D??3DA!DDr7   r	  r   )r   rQ   
frompyfuncr#  r   )	rD   rX  rk  r3  r&  ufuncr   r  r%  s	   &&&&  @@@r5   r,  studentized_range_gen._munp0  sT    3""$B
	E na3zz%b/<R@@r7   c                    R  p\         P                  ! V^^4      p\         P                  ! V! WV4      \         P                  R7      R,          # )c                    VR 8  d   Rp\         P                  ! W4      pWW$.p\        P                  ! V\        4      P
                  P                  \
        P                  4      p\        P                  ) \        P                  3^ \        P                  3.pMiRpW.p\        P                  ! V\        4      P
                  P                  \
        P                  4      p\        P                  ) \        P                  3.p\        P                  ! \         W64      p\        RRR7      p	\        P                  ! WV	R7      ^ ,          # )順 _studentized_range_pdf!_studentized_range_pdf_asymptoticrw  r  r  r  )r   r  rQ   r&  r  r'  r(  r)  rk   r   r*  r   r   r!  
r   rk  r3  r%  r"  r#  r$  r  r0  r  s
   &&&       r5   _single_pdf/studentized_range_gen._pdf.<locals>._single_pdf+0  s     F{ 8"BB1I	R+88C/66>>vOFF7BFF+a[9 !Df88C/66>>vOFF7BFF+,"..v}OCuU3D??3DA!DDr7   r	  r   )rQ   r(  r#  r   )rD   rt   rk  r3  r1  r)  s   &&&&  r5   ru   studentized_range_gen._pdf)0  s<    	E( k1a0zz%b/<R@@r7   c           	         R  p\         P                  ! V^^4      p\         P                  ! \         P                  ! V! WV4      \         P                  R7      R,          ^ ^4      # )c                    VR 8  d   Rp\         P                  ! W4      pWW$.p\        P                  ! V\        4      P
                  P                  \
        P                  4      p\        P                  ) \        P                  3^ \        P                  3.pMiRpW.p\        P                  ! V\        4      P
                  P                  \
        P                  4      p\        P                  ) \        P                  3.p\        P                  ! \         W64      p\        RRR7      p	\        P                  ! WV	R7      ^ ,          # )r-  _studentized_range_cdf!_studentized_range_cdf_asymptoticrw  r  r  r  )r   _studentized_range_cdf_logconstrQ   r&  r  r'  r(  r)  rk   r   r*  r   r   r!  r0  s
   &&&       r5   _single_cdf/studentized_range_gen._cdf.<locals>._single_cdfD0  s    
 F{ 8"BB1I	R+88C/66>>vOFF7BFF+a[9 !Df88C/66>>vOFF7BFF+,"..v}OCuU3D??3DA!DDr7   r	  r   )rQ   r(  r  r#  r   )rD   rt   rk  r3  r9  r)  s   &&&&  r5   ry   studentized_range_gen._cdfB0  sK    	E, k1a0 wwrzz%b/DRH!QOOr7   r   )r   r   r   r   r   rd   rm   r  r,  ru   ry   r   r   r  r   s   @@r5   r  r  /  s3     hT"
4A*A2P Pr7   r  studentized_range)r   r   r   c                   p   a a ] tR tRt oRtR tR tR tR tR t	R t
]! ]4      V 3R	 l4       tR
tVtV ;t# )rel_breitwigner_genid0  aO  A relativistic Breit-Wigner random variable.

%(before_notes)s

See Also
--------
cauchy: Cauchy distribution, also known as the Breit-Wigner distribution.

Notes
-----

The probability density function for `rel_breitwigner` is

.. math::

    f(x, \rho) = \frac{k}{(x^2 - \rho^2)^2 + \rho^2}

where

.. math::
    k = \frac{2\sqrt{2}\rho^2\sqrt{\rho^2 + 1}}
        {\pi\sqrt{\rho^2 + \rho\sqrt{\rho^2 + 1}}}

The relativistic Breit-Wigner distribution is used in high energy physics
to model resonances [1]_. It gives the uncertainty in the invariant mass,
:math:`M` [2]_, of a resonance with characteristic mass :math:`M_0` and
decay-width :math:`\Gamma`, where :math:`M`, :math:`M_0` and :math:`\Gamma`
are expressed in natural units. In SciPy's parametrization, the shape
parameter :math:`\rho` is equal to :math:`M_0/\Gamma` and takes values in
:math:`(0, \infty)`.

Equivalently, the relativistic Breit-Wigner distribution is said to give
the uncertainty in the center-of-mass energy :math:`E_{\text{cm}}`. In
natural units, the speed of light :math:`c` is equal to 1 and the invariant
mass :math:`M` is equal to the rest energy :math:`Mc^2`. In the
center-of-mass frame, the rest energy is equal to the total energy [3]_.

%(after_notes)s

:math:`\rho = M/\Gamma` and :math:`\Gamma` is the scale parameter. For
example, if one seeks to model the :math:`Z^0` boson with :math:`M_0
\approx 91.1876 \text{ GeV}` and :math:`\Gamma \approx 2.4952\text{ GeV}`
[4]_ one can set ``rho=91.1876/2.4952`` and ``scale=2.4952``.

To ensure a physically meaningful result when using the `fit` method, one
should set ``floc=0`` to fix the location parameter to 0.

References
----------
.. [1] Relativistic Breit-Wigner distribution, Wikipedia,
       https://en.wikipedia.org/wiki/Relativistic_Breit-Wigner_distribution
.. [2] Invariant mass, Wikipedia,
       https://en.wikipedia.org/wiki/Invariant_mass
.. [3] Center-of-momentum frame, Wikipedia,
       https://en.wikipedia.org/wiki/Center-of-momentum_frame
.. [4] M. Tanabashi et al. (Particle Data Group) Phys. Rev. D 98, 030001 -
       Published 17 August 2018

%(example)s

c                    V^ 8  # r  r   rD   rhos   &&r5   rd   rel_breitwigner_gen._argcheck0  s    Qwr7   c                @    \        R R^ \        P                  3R4      .# )rA  Fr4  rj   rl   s   &r5   rm   rel_breitwigner_gen._shape_info0  r  r7   c           
        \         P                  ! ^^^V^,          ,          ,           ,          ^\         P                  ! ^^V^,          ,          ,           4      ,           ,          4      ^,          \         P                  ,          p\         P                  ! RR7      ;_uu_ 4        W1V,
          W,           ,          V,          ^,          ^,           ,          uuRRR4       #   + '       g   i     R# ; i)r   rl  r  N)rQ   r'  r  ro  )rD   rt   rA  r  s   &&& r5   ru   rel_breitwigner_gen._pdf0  s    GGQsAvX!bgga!CF(l&;";<
 [[h''c'AG,S014q89 ('''s   %1C!!C2	c           
        \         P                  ! ^^\         P                  ! ^^V^,          ,          ,           4      ,           ,          4      \         P                  ,          p\         P                  ! RRV,          ,           4      \         P                  ! V\         P                  ! V) VR,           ,          4      ,          4      ,          pV^,          \         P                  ! V4      ,          p\         P
                  ! VR^4      # )r   r  Nr  )rQ   r'  r  r  imagr  )rD   rt   rA  r  r+	  s   &&&  r5   ry   rel_breitwigner_gen._cdf0  s    GGAq2771qax<00122558GGBCK ii"''3$b/2234 	 Q(wwvtQ''r7   c                f   V^ 8X  d   R# V^8X  d   \         P                  ! ^^^V^,          ,          ,           ,          ^\         P                  ! ^^V^,          ,          ,           4      ,           ,          4      \         P                  ,          V,          pV\         P                  ^,          \         P                  ! V4      ,           ,          # V^8X  d   \         P                  ! ^^V^,          ,          ,           ^^\         P                  ! ^^V^,          ,          ,           4      ,           ,          ,          4      V,          p^VR,          ,
          \         P                  ! RRV,          ,
          4      ,          p^V,          \         P                  ! V4      ,          # \         P
                  # )r   r   r  r  )rQ   r'  r  r  r  rk   )rD   rc   rA  r  r+	  s   &&&  r5   r,  rel_breitwigner_gen._munp0  s   66Q36\"a"''!aQh,*?&?@A a"))C.0116QsAvX!q2771qax<+@'@"ABA #(lbggb2c6k&::Fq52776?**66Mr7   c                F    R R \         P                  \         P                  3# rO   r  r@  s   &&r5   r   rel_breitwigner_gen._stats0  s     T266266))r7   c                  < \        WW#4      w  rrV\        V\        4      pV'       d$   VP                  4       ^ 8X  d   VP                  pRpVe	   V'       d   \
        SV `  ! V.VO5/ VB # VfJ   \        P                  ! W,
          . RO4      w  rp
W,
          pW,          pV'       g   V.pRV9  d   WR&   M/\        P                  ! W,
          4      pW,          pV'       g   V.p\
        SV `  ! V.VO5/ VB # )r   Fr.   )r  r   g      ?)
rR  r>   r)   r?   rC   r@   rB   rQ   quantiler	  )rD   rE   rF   r4   r  r  r  rG   r)  r*  r+  scale_0rho_0M_0r  s   &&*,          r5   rB   rel_breitwigner_gen.fit0  s     !<!
 dL1  "a' '' <87;t3d3d33> KK5FGMCciGMEwd" 'W))DK(CLEww{4/$/$//r7   r   )r   r   r   r   r   rd   rm   ru   ry   r,  r   r   r   rB   r   r   r  r   s   @@r5   r>  r>  d0  sH     <zG:	(&* M* 0 + 0  0r7   r>  rel_breitwignerrO   r  r  )r   rc   )r   r   )r   r\  (N  r  collections.abcr   	functoolsr   r   r'  r/  numpyrQ   numpy.polynomialr   scipy.interpolater   scipy._lib.doccerr	   r
   r   scipy._lib._ccallbackr   scipyr   r   scipy.specialspecialr|   scipy.special._ufuncsrh  rq   scipy._lib._utilr   scipy._lib.array_api_extra_libarray_api_extrar  scipy._lib._array_apir   r  r   _tukeylambda_statsr   r  r   r  _distn_infrastructurer   r   r   r   r   r   r   r   r   _ksstatsr   r   r    
_constantsr!   r"   r#   r$   r%   r&   r'   r(   _censored_datar)   scipy.optimizer*   scipy.stats._warnings_errorsr+   scipy.statsrF  r6   rK   r[   r]   r   r   r   r   r   r'  r  r   r  r   r   r   r   r   r   r   r   r   r   r/  r1  rK  rM  rf  rh  r  r"  r  rX   r  r  r  r  r"  rW  rY  rs  ru  r  r  r  r  r  r  r.  r0  re  rg  r7  r  r  r  r  r  r	  r  r/  r1  rQ  rV  rs  rw  ry  r  r  r  r  r  r  r  r  r  r  r&  r(  r  rY  r  _supportr  r  r  r  r  r  r  r  r  rq  r~  r  r(  r  r  r  r  r  r  r  rU  rW  rl  rr  rt  r  r  r  r  r  r  r  r  r.  r4  rH  rJ  rW  rY  r{  r}  r  r  r<  r	  rE	  rG	  r^	  r`	  r{	  r}	  r	  r	  r	  r	  r	  r	  r	  r	  r
  rR  r
  r+
  r-
  r=
  r?
  rC
  ri
  r
  r
  r
  r
  r
  r
  r
  r  r  r(  r*  r>  r@  r  r  r  r  r  r  r  r  r  r-  r/  rQ  rS  r  r  r  r  r  r  r  r  r  r  r-  rT  rh  rj  r|  r~  r  r  r  r  r  r  r  r  r  r   r"  r6  r8  rI  rK  r[  r]  r  r  r  r  r  r  r  r  r  r  r  r`  rb  r  r  r  r  r  r  r  r  r'  r  r  rD  r^  r`  r  r  r  r  r  r  r  r  r  r  rk   r<  r>  rT  listglobalsr  itemspairs_distn_names_distn_gen_names__all__r   r7   r5   <module>ru     s  
  $ ,    ' %7 7 3    # # ( ( ( , BJ J J 2 1H H H ( & 1 7&*.W! W!t 	C3W-Z) Z)| 	!sc85M 5p Ck2	 ggag$+(m} m` V3' 3'l 	Cg&( (V 
ruufQh"%%'	9*'- *'Z s
3

: 

	X 	C
} C
L #6*lM l^ Ck2	4#= 4#n #:6wE} wEt #F#T2 T2n 
c	)Ox Od #F#I" I"X 
	"NRm NRb % UD} UDp #F#4# 4#n 
ruufH	5J6 J6Z 
	"D- DN &0ABE= EP Z(j( j(Z 	Cg&K!M K!\ {+	&&E4M E4P Ck2	23= 23j #J/Jm JZ -8-.] -.` c5
k@M k@\ 
Cc;= ;| #J/^Fm ^FB -8h!= h!V (-?@ &  D4m D4N -8R0m R0j =1rM rj Ck2	=;= =;@ #J/h"] h"V .
)dO Od 	Cg&40 40n 
c	)^F= ^FB #J//%- /%d &2CDb bJ "7->= ->` #J/*~= ~B Z(K= K\ Z(W] Wt c5
{} {|  #N;P= Pf #J/+M +\ {+	5] 5p cS|<
W= Wt #J/T!= T!n #J/ym yx	 -8P2} P2f  ^4@2] @2F al3
a
M a
H {+	56M 56p C3[9	ZM Zz {+	V Vr 
	"E- EP 9
%])] ])@ ,1EF .*bb.} b.J #F#b. b.J 
c	)q7= q7h Z(r@= r@j Z(^] ^@ c5
C!- C!L )
,:- :-z 
c	)>0- >0B )
,;P ;P| 
c	)LI LI^ 
	"JI JIZ 
c	)Y$ Y$x 	wa#= a#H #J/ Z
} Z
z #F#]m ]@ % oCM oCd 
sODm DN 5[! [!| 
c	)6! 6!r 	Cg&AD= ADH Z(]4= ]4@	 #:640} 40n  #N;31M 31l {+	:3 :3z 	DCg.v= vr #J/c?] c?T .
.
 
  
 <&} <&~ #F#}&M }&@ {+		 39 39l "Co>9&} 9&x  $#NC@'] @'F .
^F= ^FB Z(m2M m2` C3[9	F FR 
cSx	0<4] <4~ c5
 
 0
9%Pk.M k.\ {A6		 \m \~
 -8! 8.m 8.v =1
L 
t(- t(n s
3o= od Z(v_E:&| :&z #F#A$] A$F cQruuW<@
]- ]@ 9
%=>m =>@ 6e6m e6P =;ST*G) G)T 	w)<sKr= rj@PM @PF */Ba,.FF4 Q0- Q0h &2CD 	WY^^##%&!7}!M 
)
)^,<
<r7   