403Webshell
Server IP : 93.86.61.54  /  Your IP : 216.73.216.60
Web Server : Apache/2.4.62 (Ubuntu)
System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64
User : www-data ( 33)
PHP Version : 8.4.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/sympy/stats/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/sympy/stats/__pycache__/drv.cpython-310.pyc
o

�8Va�,�@srddlmZmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZddlmZddlmZddlmZmZmZmZmZmZmZm Z m!Z!ddl"m#Z#ddl$m%Z%m&Z&ddl'm(Z(ddl)m*Z*dd	l+m,Z,dd
l-m.Z.Gdd�de!�Z/Gd
d�de/e�Z0Gdd�de�Z1Gdd�de1e�Z2Gdd�de1e�Z3Gdd�de�Z4Gdd�de e1�Z5Gdd�de4e�Z6dS)�)�Basic�sympify�symbols�Dummy�Lambda�	summation�	Piecewise�S�cacheit�Sum�exp�I�Ne�Eq�poly�series�	factorial�And�floor)�PolynomialError)�!reduce_rational_inequalities_wrap)	�NamedArgsMixin�SinglePSpace�SingleDomain�random_symbols�PSpace�ConditionalDomain�RandomDomain�
ProductDomain�Distribution)�Probability)�Range�	FiniteSet)�Union)�Contains)�
filldedent)�_sympifyc@�eZdZdd�ZdS)�DiscreteDistributioncG�
|j|�S�N��pdf��self�args�r0�1/usr/lib/python3/dist-packages/sympy/stats/drv.py�__call__�
zDiscreteDistribution.__call__N)�__name__�
__module__�__qualname__r2r0r0r0r1r(�r(c@s�eZdZdZejZdd�Zedd��Z	e
dd��Zdd	�Zd
d�Z
e
dd
��Zdd�Zdd�Ze
dd��Zdd�Zdd�Ze
dd��Zdd�Zdd�Zd$dd �Zd!d"�Zd#S)%�SingleDiscreteDistributionz� Discrete distribution of a single variable.

    Serves as superclass for PoissonDistribution etc....

    Provides methods for pdf, cdf, and sampling

    See Also:
        sympy.stats.crv_types.*
    cGs ttt|��}tj|g|�R�Sr*)�list�maprr�__new__)�clsr/r0r0r1r;$sz"SingleDiscreteDistribution.__new__cG�dSr*r0)r/r0r0r1�check(sz SingleDiscreteDistribution.checkcKsftddtd�}tddtd�}|jj}|�|�}t|||t|�ffi|��}t|||kfd�}t||�S)zB Compute the CDF from the PDF.

        Returns a Lambda.
        �xT)�integerr<�z��realr<)rT)	rr�set�infr,rrrr)r.�kwargsr?rA�
left_boundr,�cdfr0r0r1�compute_cdf,s

z&SingleDiscreteDistribution.compute_cdfcCr=r*r0�r.r?r0r0r1�_cdf=�zSingleDiscreteDistribution._cdfcK�.|s
|�|�}|dur
|S|jdi|��|�S�z Cumulative density function Nr0)rKrI)r.r?rFrHr0r0r1rH@�

zSingleDiscreteDistribution.cdfcKsNtddtd�\}}|�|�}ttt||�|||jj|jjf�}t	||�S)zV Compute the characteristic function from the PDF.

        Returns a Lambda.
        zx, tTrB)
rrr,rrr
rDrE�supr)r.rFr?�tr,�cfr0r0r1�compute_characteristic_functionHs
(
z:SingleDiscreteDistribution.compute_characteristic_functioncCr=r*r0�r.rQr0r0r1�_characteristic_functionSrLz3SingleDiscreteDistribution._characteristic_functioncKrM)z Characteristic function Nr0)rUrS)r.rQrFrRr0r0r1�characteristic_functionVrOz2SingleDiscreteDistribution.characteristic_functioncKsPtddd�}tddd�}|�|�}tt||�|||jj|jjf�}t||�S)NrQT�rCr?�r@)rr,rrrDrErPr)r.rFrQr?r,�mgfr0r0r1�"compute_moment_generating_function^s

$
z=SingleDiscreteDistribution.compute_moment_generating_functioncCr=r*r0rTr0r0r1�_moment_generating_functionfrLz6SingleDiscreteDistribution._moment_generating_functioncKs.|s
|�|�}|dur
|S|jdi|��|�S)Nr0)r[rZ)r.rQrFrYr0r0r1�moment_generating_functionis

z5SingleDiscreteDistribution.moment_generating_functioncKs^tddd�}tddd�}|jj}|�|�}t||||ffi|��}|||kff}t|t|��S)zG Compute the Quantile from the PDF.

        Returns a Lambda.
        r?TrX�prW)rrDrEr,rrr)r.rFr?r]rGr,rHrDr0r0r1�compute_quantileps
z+SingleDiscreteDistribution.compute_quantilecCr=r*r0rJr0r0r1�	_quantile~rLz$SingleDiscreteDistribution._quantilecKrMrN)r_r^)r.r?rF�quantiler0r0r1r`�rOz#SingleDiscreteDistribution.quantileTcKs�|rezDt||�}tddd�}|�|�}|��}tt||d|d���|�}	d}
t|d�D]}|
|�||�|	�||�t|�7}
q-|
WSt	ydt
||�|�||jj
|jjffi|��YSwt||�|�||jj
|jjffi|��S)z- Expectation of expression over distribution rQTrWr�)rrr\�degreer�removeO�range�coeff_monomialrrrr,rDrErPr)r.�expr�var�evaluaterFr]rQrY�deg�taylor�result�kr0r0r1�expectation�s.

*�
����z&SingleDiscreteDistribution.expectationcGr)r*r+r-r0r0r1r2�r3z#SingleDiscreteDistribution.__call__N)T)r4r5r6�__doc__r	�IntegersrDr;�staticmethodr>r
rIrKrHrSrUrVrZr[r\r^r_r`rmr2r0r0r0r1r8s0








r8c@seZdZdZdZdS)�DiscreteDomainze
    A domain with discrete support with step size one.
    Represented using symbols and Range.
    TN)r4r5r6rn�is_Discreter0r0r0r1rq�srqc@r')�SingleDiscreteDomaincC�t|j|j�Sr*)r$�symbolrD�r.r0r0r1�
as_boolean�szSingleDiscreteDomain.as_booleanN�r4r5r6rwr0r0r0r1rs�r7rsc@seZdZdZedd��ZdS)�ConditionalDiscreteDomainzb
    Domain with discrete support of step size one, that is restricted by
    some condition.
    cCsB|j}t|j�dkrttd���t|�d}t|j|��|jj	�S)NrazJ
                Multivariate conditional domains are not yet implemented.r)
r�len�NotImplementedErrorr%r9r�	condition�	intersect�
fulldomainrD)r.�rvr0r0r1rD�s�
�zConditionalDiscreteDomain.setN)r4r5r6rn�propertyrDr0r0r0r1ry�sryc@s@eZdZdZdZedd��Zdd�Zdd�Zdd	�Z	d
d�Z
dS)
�DiscretePSpaceTcCs|j|j�Sr*)�densityrrvr0r0r1r,�szDiscretePSpace.pdfcsft|�}t�fdd�|D��sJ�t|�dkrttd���t||d�}|��jj�}t	|dj
|�S)Nc3s�|]	}|j�jvVqdSr*)rur��.0�rrvr0r1�	<genexpr>�s�z'DiscretePSpace.where.<locals>.<genexpr>razIMultivariate discrete
            random variables are not yet supported.r)r�allrzr{r%rr}�domainrDrsru)r.r|�rvs�conditional_domainr0rvr1�where�s�zDiscretePSpace.wherec	Cst|t�}|rt|jd|jd�}z(|�|�j}|dks"|tjur&tjWS|dks0||j	jkr4tj
WS|�|�}Wn=tywddl
m}|j|j}||�}t|t�s`ddlm}||�}tddd�}	t|	|�}
|
�|�|
jd��}Ynw|dur�t|�}|s�|Stj
|S)	NrraFT)r�)�DiscreteDistributionHandmaderArW)�
isinstancerrr/r�rDr	�EmptySet�Zeror��One�	eval_probr{�sympy.stats.rvr��lhs�rhsr(�sympy.stats.drv_typesr�r�SingleDiscretePSpace�probability�	__class__�valuer )r.r|�
complement�_domain�probr�rf�densr�rA�spacer0r0r1r��s0


�
zDiscretePSpace.probabilityc	s�t�j�d}t|t�r8tddd�}dd�|jD�\}}}�j�|||�}t||||||df���}|St|t	�rPt
|�j��t�fdd�|D��}|St|t�rct�fd	d�|jD��}|SdS)
Nr�nTrXcss�|]}|VqdSr*r0r�r0r0r1r��s�z+DiscretePSpace.eval_prob.<locals>.<genexpr>rac3s�|]}�|�VqdSr*r0�r�r?r+r0r1r��s�c3s�|]}��|�VqdSr*)r�r�rvr0r1r��s�)
r9rr�r!r/r,�replacer�doitr"r�sumr#)	r.r��symr�rErP�step�summandrr0)r,r.r1r��s*
���

�zDiscretePSpace.eval_probcCsHtt|j�|j|�|��}|�dd�|jD��}t|j|�}t	||�S)NcS�i|]}||j�qSr0�ru�r�rr0r0r1�
<dictcomp>�z4DiscretePSpace.conditional_space.<locals>.<dictcomp>)
r�tuplerr,r��xreplace�valuesryr�r�)r.r|r�r�r0r0r1�conditional_spaces
z DiscretePSpace.conditional_spaceN)r4r5r6�is_realrrr�r,r�r�r�r�r0r0r0r1r��s
r�c@r')�ProductDiscreteDomaincCstdd�|jD��S)NcSsg|]}|j�qSr0)rw)r�r�r0r0r1�
<listcomp>sz4ProductDiscreteDomain.as_boolean.<locals>.<listcomp>)r�domainsrvr0r0r1rwsz ProductDiscreteDomain.as_booleanNrxr0r0r0r1r�
r7r�c@sheZdZdZdZedd��Zedd��Zdd
d�Zddd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd	S)r�z> Discrete probability space over a single univariate variable TcCs|jjSr*)�distributionrDrvr0r0r1rDszSingleDiscretePSpace.setcCrtr*)rsrurDrvr0r0r1r�szSingleDiscretePSpace.domainr0�scipyNcCs|j|jj|||d�iS)zp
        Internal sample method.

        Returns dictionary mapping RandomSymbol to realization value.
        )�library�seed)r�r��sample)r.�sizer�r�r0r0r1r�szSingleDiscretePSpace.samplecKs�|p|jf}|j|vr
|St|�}|�dd�|D��}|jj}z|jj||fd|i|��WStyIt||j||j	j
|j	jffi|��YSw)NcSr�r0r�r�r0r0r1r�(r�z<SingleDiscretePSpace.compute_expectation.<locals>.<dictcomp>rh)r�r&r�rur�rmr{rr,rDrErP)r.rfr�rhrFr?r0r0r1�compute_expectation"s
�
��z(SingleDiscretePSpace.compute_expectationcK�6||jkrtddd�}t||jj|fi|���St��)Nr?TrW)r�rrr�rHr{)r.rfrFr?r0r0r1rI2�
z SingleDiscretePSpace.compute_cdfcKs||jkr|jSt��r*)r�r�r{)r.rfrFr0r0r1�compute_density9s
z$SingleDiscretePSpace.compute_densitycKr��NrQTrW)r�rrr�rVr{�r.rfrFrQr0r0r1rS>r�z4SingleDiscretePSpace.compute_characteristic_functioncKr�r�)r�rrr�r\r{r�r0r0r1rZEr�z7SingleDiscretePSpace.compute_moment_generating_functioncKr�)Nr]TrW)r�rrr�r`r{)r.rfrFr]r0r0r1r^Lr�z%SingleDiscretePSpace.compute_quantile)r0r�N)NT)r4r5r6rnr�r�rDr�r�r�rIr�rSrZr^r0r0r0r1r�s



r�N)7�sympyrrrrrrrr	r
rrr
rrrrrrr�sympy.polys.polyerrorsr�sympy.stats.crvrr�rrrrrrrrr� sympy.stats.symbolic_probabilityr �sympy.sets.fancysetsr!r"�sympy.sets.setsr#�sympy.sets.containsr$�sympy.utilitiesr%�sympy.core.sympifyr&r(r8rqrsryr�r�r�r0r0r0r1�<module>s&T,F

Youez - 2016 - github.com/yon3zu
LinuXploit