+
    –°³jÇ  ã                   ón   € ^ RI t ^ RIHtHt ^ RIt^ RIHtHt ^ RIHtH	t	 ^ RI
Ht R.t ! R R]	4      tR# )é    N)ÚNumberÚReal)ÚinfÚnan)ÚconstraintsÚDistribution)Úbroadcast_allÚGeneralizedParetoc                   óR  a a€ ] tR t^t oRtR]P                  R]P                  R]P                  /tRt	RV 3R llt
RV 3R llt]P                  ! 4       3R ltR	 tR
 tR tR tR tR t]R 4       t]R 4       tR t]R 4       t]P4                  ! R^ R7      R 4       tRtVtV ;t# )r
   a]  
Creates a Generalized Pareto distribution parameterized by :attr:`loc`, :attr:`scale`, and :attr:`concentration`.

The Generalized Pareto distribution is a family of continuous probability distributions on the real line.
Special cases include Exponential (when :attr:`loc` = 0, :attr:`concentration` = 0), Pareto (when :attr:`concentration` > 0,
:attr:`loc` = :attr:`scale` / :attr:`concentration`), and Uniform (when :attr:`concentration` = -1).

This distribution is often used to model the tails of other distributions. This implementation is based on the
implementation in TensorFlow Probability.

Example::

    >>> # xdoctest: +IGNORE_WANT("non-deterministic")
    >>> m = GeneralizedPareto(torch.tensor([0.1]), torch.tensor([2.0]), torch.tensor([0.4]))
    >>> m.sample()  # sample from a Generalized Pareto distribution with loc=0.1, scale=2.0, and concentration=0.4
    tensor([ 1.5623])

Args:
    loc (float or Tensor): Location parameter of the distribution
    scale (float or Tensor): Scale parameter of the distribution
    concentration (float or Tensor): Concentration parameter of the distribution
ÚlocÚscaleÚconcentrationTc                óJ  <€ \        WV4      w  V n        V n        V n        \	        V\
        4      '       dC   \	        V\
        4      '       d-   \	        V\
        4      '       d   \        P                  ! 4       pMV P                  P                  4       p\        SV `)  WTR 7       R# )©Úvalidate_argsN)r	   r   r   r   Ú
isinstancer   ÚtorchÚSizeÚsizeÚsuperÚ__init__)Úselfr   r   r   r   Úbatch_shapeÚ	__class__s   &&&&& €Úg/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/distributions/generalized_pareto.pyr   ÚGeneralizedPareto.__init__.   ss   ø€ Ü3@Ø˜ó4
Ñ0ˆŒ�$”*˜dÔ0ô �sœF×#Ò#Ü˜5¤&×)Ò)Ü˜=¬&×1Ò1äŸ*š*›,‰KàŸ(™(Ÿ-™-›/ˆKÜ‰Ñ˜ÐÖBó    c                ól  <€ V P                  \        V4      p\        P                  ! V4      pV P                  P                  V4      Vn        V P                  P                  V4      Vn        V P                  P                  V4      Vn        \        \        V`'  VR R7       V P                  Vn
        V# )Fr   )Ú_get_checked_instancer
   r   r   r   Úexpandr   r   r   r   Ú_validate_args)r   r   Ú	_instanceÚnewr   s   &&& €r   r    ÚGeneralizedPareto.expand<   s�   ø€ Ø×(Ñ(Ô):¸IÓFˆÜ—j’j Ó-ˆØ—(‘(—/‘/ +Ó.ˆŒØ—J‘J×%Ñ% kÓ2ˆŒ	Ø ×.Ñ.×5Ñ5°kÓBˆÔÜÔ Ñ.¨{È%Ð.ÔPØ!×0Ñ0ˆÔØˆ
r   c                óÆ   € V P                  V4      p\        P                  ! W P                  P                  V P                  P
                  R 7      pV P                  V4      # ))ÚdtypeÚdevice)Ú_extended_shaper   Úrandr   r&   r'   Úicdf)r   Úsample_shapeÚshapeÚus   &&  r   ÚrsampleÚGeneralizedPareto.rsampleF   s@   € Ø×$Ñ$ \Ó2ˆÜ�JŠJ�u§H¡H§N¡N¸4¿8¹8¿?¹?ÔKˆØ�y‰y˜‹|Ðr   c           	     ó  € V P                   '       d   V P                  V4       V P                  V4      p\        P                  ! V P
                  \        P                  ! R 4      4      p\        P                  ! V\        P                  ! V P
                  4      V P
                  4      p^V,          \        P                  ! V4      ,           p\        P                  ! V^ 8H  WU\        P                  ! WB,          4      ,          4      p\        V P                  \        4      '       d!   \        P                  ! V P                  4      MV P                  P                  4       pV) \        P                  ! W2V4      ,
          # ©g        )r!   Ú_validate_sampleÚ_zr   Úiscloser   ÚtensorÚwhereÚ	ones_likeÚlog1pr   r   r   ÚmathÚlog)r   ÚvalueÚzÚeq_zeroÚ	safe_concÚyÚwhere_nonzeroÚ	log_scales   &&      r   Úlog_probÚGeneralizedPareto.log_probK   sû   € Ø××ÐØ×!Ñ! %Ô(Ø�G‰G�E‹NˆÜ—-’- × 2Ñ 2´E·L²LÀÓ4EÓFˆÜ—K’KØ”U—_’_ T×%7Ñ%7Ó8¸$×:LÑ:Ló
ˆ	ð �	�MœEŸOšO¨AÓ.Õ.ˆÜŸš A¨¡F¨A´5·;²;¸y½}Ó3MÕ/MÓNˆä$.¨t¯z©z¼4×$@Ò$@ŒD�HŠH�T—Z‘ZÔ ÀdÇjÁjÇnÁnÓFVð 	ð ˆzœEŸKšK¨°MÓBÕBÐBr   c                óÌ  € V P                   '       d   V P                  V4       V P                  V4      p\        P                  ! V P
                  \        P                  ! R 4      4      p\        P                  ! V\        P                  ! V P
                  4      V P
                  4      p\        P                  ! WB,          4      ) V,          p\        P                  ! W2) V4      # r1   )
r!   r2   r3   r   r4   r   r5   r6   r7   r8   )r   r;   r<   r=   r>   r@   s   &&    r   Úlog_survival_functionÚ'GeneralizedPareto.log_survival_functionZ   sŸ   € Ø××ÐØ×!Ñ! %Ô(Ø�G‰G�E‹NˆÜ—-’- × 2Ñ 2´E·L²LÀÓ4EÓFˆÜ—K’KØ”U—_’_ T×%7Ñ%7Ó8¸$×:LÑ:Ló
ˆ	ô Ÿš Y¥]Ó3Ð3°iÕ?ˆÜ�{Š{˜7 B¨Ó6Ð6r   c                óv   € \         P                  ! \         P                  ! V P                  V4      4      ) 4      # ©N)r   r8   ÚexprE   ©r   r;   s   &&r   Úlog_cdfÚGeneralizedPareto.log_cdfe   s(   € Ü�{Š{œEŸIšI d×&@Ñ&@ÀÓ&GÓHÐHÓIÐIr   c                óL   € \         P                  ! V P                  V4      4      # rH   )r   rI   rK   rJ   s   &&r   ÚcdfÚGeneralizedPareto.cdfh   s   € Ü�yŠy˜Ÿ™ eÓ,Ó-Ð-r   c                óÖ  € V P                   pV P                  pV P                  p\        P                  ! V\        P
                  ! V4      4      p\        P                  ! V\        P                  ! V4      V4      p\        P                  ! V) 4      pW#V,          \        P                  ! V) V,          4      ,          ,           pW#V,          ,
          p	\        P                  ! WYV4      # rH   )
r   r   r   r   r4   Ú
zeros_liker6   r7   r8   Úexpm1)
r   r;   r   r   r   r=   r>   Úlogur@   Ú
where_zeros
   &&        r   r*   ÚGeneralizedPareto.icdfk   s¤   € Ø�h‰hˆØ—
‘
ˆØ×*Ñ*ˆÜ—-’- ¬u×/?Ò/?ÀÓ/NÓOˆÜ—K’K ¬¯ª¸Ó)GÈÓWˆ	Ü�{Š{˜E˜6Ó"ˆØ iÕ/´%·+²+¸y¸jÈ4Õ>OÓ2PÕPÕPˆØ 4�<Õ'ˆ
Ü�{Š{˜7°Ó>Ð>r   c                óH   € WP                   ,
          V P                  ,          # rH   )r   r   )r   Úxs   &&r   r3   ÚGeneralizedPareto._zv   s   € Ø—H‘H• §
¡
Õ*Ð*r   c                óÞ   € V P                   pV^8  p\        P                  ! W!R4      pV P                  V P                  ^V,
          ,          ,           p\        P                  ! W$\
        4      # )é   ç      à?)r   r   r6   r   r   r   ©r   r   Úvalidr>   Úresults   &    r   ÚmeanÚGeneralizedPareto.meany   sS   € à×*Ñ*ˆØ Ñ!ˆÜ—K’K °cÓ:ˆ	Ø—‘˜DŸJ™J¨!¨i­-Õ8Õ8ˆÜ�{Š{˜5¬#Ó.Ð.r   c                ó  € V P                   pVR 8  p\        P                  ! W!R4      pV P                  ^,          ^V,
          ^,          ^^V,          ,
          ,          ,          p\        P                  ! W$\        4      # )r[   g      Ð?)r   r   r6   r   r   r\   s   &    r   ÚvarianceÚGeneralizedPareto.variance�   sa   € à×*Ñ*ˆØ Ñ#ˆÜ—K’K °dÓ;ˆ	Ø—‘˜Q• 1 y¥=°QÕ"6¸!¸aÀ)½mÕ:KÕ"LÕMˆÜ�{Š{˜5¬#Ó.Ð.r   c                ó²   € \         P                  ! V P                  4      V P                  ,           ^,           p\         P                  ! WP
                  4      # )rZ   )r   r:   r   r   Úbroadcast_toÚ_batch_shape)r   Úanss   & r   ÚentropyÚGeneralizedPareto.entropy‰   s;   € Ü�iŠi˜Ÿ
™
Ó# d×&8Ñ&8Õ8¸1Õ<ˆÜ×!Ò! #×'8Ñ'8Ó9Ð9r   c                ó   € V P                   # rH   )r   )r   s   &r   ÚmodeÚGeneralizedPareto.mode�   s   € à�x‰xˆr   F)Úis_discreteÚ	event_dimc                óÚ   € V P                   p\        P                  ! V P                  ^ 8  WP                  V P                  ,          ,
          \
        4      p\        P                  ! W4      # )r   )r   r   r6   r   r   r   r   Úinterval)r   ÚlowerÚuppers   &  r   ÚsupportÚGeneralizedPareto.support‘   sR   € ð —‘ˆÜ—’Ø×Ñ Ñ" E¯J©J¸×9KÑ9KÕ,KÕ$KÌSó
ˆô ×#Ò# EÓ1Ð1r   )r   r   r   rH   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚrealÚpositiveÚarg_constraintsÚhas_rsampler   r    r   r   r.   rB   rE   rK   rN   r*   r3   Úpropertyr_   rb   rh   rk   Údependent_propertyrs   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r   Ú__classdict__s   @@r   r
   r
      sÞ   ù‡ € ñð2 	ˆ{×ÑØ�×%Ñ%Ø˜×)Ñ)ð€Oð
 €K÷C÷ð $)§:¢:£<ô ò
Cò	7òJò.ò	?ò+ð ñ/ó ð/ð ñ/ó ð/ò:ð ñó ðð ×#Ò#°ÀÔCñ2ó D÷2ð 2r   )r9   Únumbersr   r   r   r   r   Útorch.distributionsr   r   Útorch.distributions.utilsr	   Ú__all__r
   © r   r   Ú<module>r‰      s/   ðã ß  ã ß ß 9Ý 3ð Ð
€ôJ2˜ö J2r   