Your IP : 3.15.195.84


Current Path : /opt/alt/python312/lib64/python3.12/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/__pycache__/statistics.cpython-312.opt-2.pyc

�

�Q�f3����Ugd�ZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZddl
mZmZddlmZmZmZmZmZmZmZmZmZddlmZdd	lmZdd
lmZmZm Z ed�Z!Gd�d
e"�Z#d�Z$dBd�Z%d�Z&d�Z'd�Z(d�Z)dCd�Z*ddddd�de+e,fd�Z-de.de.de.fd�Z/dej`jbzdzZ2e.e3d <de.de.de,fd!�Z4de.de.defd"�Z5d#�Z6dBd$�Z7d%�Z8dBd&�Z9d'�Z:d(�Z;d)�Z<dDd*�Z=d+�Z>d,�Z?d-d.d/�d0�Z@dBd1�ZAdBd2�ZBdBd3�ZCdBd4�ZDd5�ZEd6�ZFd7d8�d9�ZGed:d;�ZHdd<�d=�ZId>�ZJ	dd?lKmJZJGd@�dA�ZMy#eL$rY�wxYw)E)�
NormalDist�StatisticsError�correlation�
covariance�fmean�geometric_mean�
harmonic_mean�linear_regression�mean�median�median_grouped�median_high�
median_low�mode�	multimode�pstdev�	pvariance�	quantiles�stdev�variance�N��Fraction)�Decimal)�count�groupby�repeat)�bisect_left�bisect_right)	�hypot�sqrt�fabs�exp�erf�tau�log�fsum�sumprod)�reduce)�
itemgetter)�Counter�
namedtuple�defaultdict�@c��eZdZy)rN)�__name__�
__module__�__qualname__���1/opt/alt/python312/lib64/python3.12/statistics.pyrr�s��r3rc�p�	d}t�}|j}i}|j}t|t�D]9\}}||�tt|�D]\}}	|dz
}||	d�|z||	<��;d|vr|d}
n td�|j�D��}
tt|t�}||
|fS)Nr�c3�:K�|]\}}t||����y�w�Nr��.0�d�ns   r4�	<genexpr>z_sum.<locals>.<genexpr>�s����@�/?�t�q�!�H�Q��N�/?���)�set�add�getr�type�map�_exact_ratio�sum�itemsr(�_coerce�int)�datar�types�	types_add�partials�partials_get�typ�valuesr<r;�total�Ts            r4�_sumrR�s����>
�E��E�E��	�	�I��H��<�<�L��t�T�*���V��#����f�-�D�A�q��Q�J�E�&�q�!�,�q�0�H�Q�K�.�+�
�x�������@�x�~�~�/?�@�@���w��s�#�A�
�u�e��r3c�~���	��t��fd�|D��\}}}||�|fSd}t�}|j}tt�}tt�}t|t�D]G\}	}
||	�tt|
�D]'\}�|dz
}|�xx|z
cc<|�xx||zz
cc<�)�I|std�x}�n_d|vr|dx}�nStd�|j�D��}td�|j�D��}
||
z||zz
|z}||z�tt|t�}||�|fS)Nc3�2�K�|]}|�z
x��z���y�wr8r2)r:�x�cr;s  ��r4r=z_ss.<locals>.<genexpr>�s�����<�t�!�1�q�5�j�a�A�-�t�s�rr6c3�:K�|]\}}t||����y�wr8rr9s   r4r=z_ss.<locals>.<genexpr>�s����@�,?�D�A�q��!�Q��,?�r>c3�@K�|]\}}t|||z����y�wr8rr9s   r4r=z_ss.<locals>.<genexpr>�s"����D�/C�t�q�!�(�1�a��c�"�/C�s�)rRr?r@r,rHrrBrCrDrrErFr(rG)rIrVrQ�ssdrrJrK�sx_partials�sxx_partialsrNrOr<�sx�sxxr;s `            @r4�_ssr^�sV����	�}��<�t�<�<�
��3���3��5�!�!�
�E��E�E��	�	�I��c�"�K��s�#�L��t�T�*���V��#����f�-�D�A�q��Q�J�E���N�a��N���O�q�1�u�$�O�.�+���1�+���a�	
��	��d�#�#��a��@�K�,=�,=�,?�@�
@���D�|�/A�/A�/C�D�D���s�{�R�"�W�$��-����J���w��s�#�A�
�s�A�u��r3c�l�	|j�S#t$rtj|�cYSwxYwr8)�	is_finite�AttributeError�math�isfinite)rUs r4�	_isfiniterd�s1�� ��{�{�}���� ��}�}�Q��� �s��3�3c��	||ur|S|tus|tur|S|tur|St||�r|St||�r|St|t�r|St|t�r|St|t�rt|t�r|St|t�rt|t�r|Sd}t||j|jfz��)Nz"don't know how to coerce %s and %s)rH�bool�
issubclassr�float�	TypeErrorr/)rQ�S�msgs   r4rGrGs����	�A�v�q���C�x�1��9�a�x��C�x��(��!�Q���(��!�Q���(��!�S��1�H��!�S��1�H��!�X��:�a��#7����!�U��
�1�h� 7���
.�C�
�C�1�:�:�q�z�z�2�2�
3�3r3c��		|j�S#t$rYnttf$r|dfcYSwxYw	|j|j
fS#t$r%dt
|�j�d�}t|��wxYw)Nzcan't convert type 'z' to numerator/denominator)	�as_integer_ratiora�
OverflowError�
ValueError�	numerator�denominatorrBr/ri)rUrks  r4rDrDs����:��!�!�#�#���
���:�&���4�y��������Q�]�]�+�+����$�T�!�W�%5�%5�$6�6P�Q����n���s��	3�3�3�A�.A=c��	t|�|ur|St|t�r|jdk7rt}	||�S#t
$r9t|t�r'||j�||j�zcYS�wxYw�Nr6)rBrgrHrqrhrirrp)�valuerQs  r4�_convertruMs}��0��E�{�a�����!�S��e�/�/�1�4������x������a��!��U�_�_�%��%�*;�*;�(<�<�<��	�s�?�>B�?Bc#�DK�	|D]}|dkrt|��|���y�w)Nr)r)rO�errmsgrUs   r4�	_fail_negrx_s*����A�
���q�5�!�&�)�)����s� F�averager6)�key�reverse�ties�start�returnc�V�	|dk7rtd|����|�t||�}tt|t	��|��}|dz
}dgt|�z}t
|td���D]:\}}	t|	�}
t|
�}||dzdzz}|
D]
\}
}|||<�||z
}�<|S)NryzUnknown tie resolution method: )r{r6r)rz�)	rorC�sorted�zipr�lenrr)�list)rIrzr{r|r}�val_pos�i�result�_�g�group�size�rankrt�orig_poss               r4�_rankr�gs����H�y���:�4�(�C�D�D�
���3��~���S��u�w�'��9�G�
��	�A��S�3�w�<�
�F���Z��]�3���1��Q����5�z���D�1�H��>�!��$�O�E�8�#�F�8�� %�	�T�	��
4��Mr3r<�mc�P�	tj||z�}|||z|z|k7zSr8)rb�isqrt)r<r��as   r4�_integer_sqrt_of_frac_rtor��s.��P��
�
�1��6��A���!��A���
��r3r���_sqrt_bit_widthc���	|j�|j�z
tz
dz}|dk\rt||d|zz�|z}d}||zSt|d|zz|�}d|z}||zS)Nr�rr6���)�
bit_lengthr�r�)r<r��qrprqs     r4�_float_sqrt_of_fracr��s���;�	
����!�,�,�.�	(�?�	:�q�@�A��A�v�-�a��a�!�e��<��A�	����{�"�"�.�a�2��6�k�1�=�	��A�2�g���{�"�"r3c��	|dkr|std�S||}}t|�t|�zj�}|j�\}}|j�}|j�\}}d|z||zdzz|||z||zzdzzkDr|S|j	�}|j�\}	}
d|z||
zdzz|||	z|
|zzdzzkr|S|S)Nrz0.0�r�)rr rm�	next_plus�
next_minus)r<r��root�nr�dr�plus�np�dp�minus�nm�dms           r4�_decimal_sqrt_of_fracr��s���=�	�A�v���5�>�!��r�A�2�1���A�J����#�)�)�+�D�
�
"�
"�
$�F�B���>�>��D�
�
"�
"�
$�F�B���1�u��2���z��A��B���B���� 2�2�2����O�O��E�
�
#�
#�
%�F�B���1�u��2���z��A��B���B���� 2�2�2����Kr3c�`�	t|�\}}}|dkrtd��t||z|�S)Nr6z%mean requires at least one data point)rRrru)rIrQrPr<s    r4r
r
�s<����t�*�K�A�u�a��1�u��E�F�F��E�A�I�q�!�!r3c�^��	|�)	t|��t|�}�std��|�zSt	|t
tf�st|�}	t||�}t|�}|std��||zS#t$rd��fd�}||�}Y��wxYw#t$rtd��wxYw)Nrc3�@�K�t|d��D]	\�}|���y�w)Nr6�r})�	enumerate)�iterablerUr<s  �r4rzfmean.<locals>.count�s!�����%�h�a�8�D�A�q��G�9�s�z&fmean requires at least one data pointz(data and weights must be the same lengthzsum of weights must be non-zero)	r�rir&r�
isinstancer��tupler'ro)rI�weightsrrP�num�denr<s      @r4rr�s�������		��D�	�A��T�
���!�"J�K�K��q�y���g��e�}�-��w�-��J��d�G�$���w�-�C���?�@�@���9���+�	��A�
���;�D�	�� �J��H�I�I�J�s�A9�B�9B�B�B,c�|�		tttt|���S#t$r
td�d�wxYw)NzGgeometric mean requires a non-empty dataset containing positive numbers)r"rrCr%ror)rIs r4rrsJ��
�G��5��S�$��(�)�)���G��<�=�BF�	G�G�s�!%�;c�z�	t|�|urt|�}d}t|�}|dkrtd��|dk(rD|�B|d}t	|t
jtf�r|dkrt|��|Std��|�td|�}|}nQt|�|urt|�}t|�|k7rtd��td�t||�D��\}}}	t||�}td�t||�D��\}}}	|dkrtd	��t||z|�S#t$rYywxYw)
Nz.harmonic mean does not support negative valuesr6z.harmonic_mean requires at least one data pointrzunsupported typez*Number of weights does not match data sizec3� K�|]}|���y�wr8r2)r:�ws  r4r=z harmonic_mean.<locals>.<genexpr>Ns���� G�,F�q��,F�s�c3�4K�|]\}}|r||znd���y�w)rNr2)r:r�rUs   r4r=z harmonic_mean.<locals>.<genexpr>Qs"����P�=O�T�Q���q�1�u�q�0�=O�s�zWeighted sum must be positive)�iterr�r�rr��numbers�RealrrirrRrxr��ZeroDivisionErrorru)
rIr�rwr<rU�sum_weightsr�rQrPrs
          r4rr!sR���,�D�z�T���D�z��
=�F��D�	�A��1�u��N�O�O�	
�a��G�O���G���a�'�,�,��0�1��1�u�%�f�-�-��H��.�/�/�����A�,������=�G�#��7�m�G��w�<�1��!�"N�O�O� � G�I�g�v�,F� G�G���;�����v�&���P�S��$�=O�P�P���5�%�
��z��=�>�>��K�%�'��+�+��	����s�#,D.�.	D:�9D:c��	t|�}t|�}|dk(rtd��|dzdk(r||dzS|dz}||dz
||zdzS�Nr�no median for empty datar�r6�r�r�r)rIr<r�s   r4rrYsl����$�<�D��D�	�A��A�v��8�9�9��1�u��z��A��F�|��
��F���Q��U��d�1�g�%��*�*r3c��	t|�}t|�}|dk(rtd��|dzdk(r||dzS||dzdz
Sr�r��rIr<s  r4rrqsZ��
��$�<�D��D�	�A��A�v��8�9�9��1�u��z��A��F�|���A��F�Q�J��r3c�`�	t|�}t|�}|dk(rtd��||dzS)Nrr�r�r�r�s  r4r
r
�s<��
��$�<�D��D�	�A��A�v��8�9�9���Q��<�r3c�,�	t|�}t|�}|std��||dz}t||�}t	|||��}	t|�}t|�}||dzz
}|}||z
}|||dz|z
z|zzS#t$rtd��wxYw)Nr�r�)�loz$Value cannot be converted to a floatr-)r�r�rrrrhrori)	rI�intervalr<rUr��j�L�cf�fs	         r4rr�s���)�T�$�<�D��D�	�A���8�9�9�	
�Q�!�V��A�	�D�!��A��T�1��#�A�A���?���!�H��	
�H�s�N��A�	
�B�	�A��A��x�1�q�5�2�:�&��*�*�*���A��>�@�@�A�s�A>�>Bc��	tt|��jd�}	|ddS#t$r
t	d�d�wxYw)Nr6rzno mode for empty data)r*r��most_common�
IndexErrorr)rI�pairss  r4rr�sU���,
�D��J��+�+�A�.�E�B��Q�x��{����B��6�7�T�A�B�s	�.�Ac���	tt|��}|sgSt|j��}|j	�D��cgc]
\}}||k(s�|��c}}Scc}}wr8)r*r��maxrOrF)rI�counts�maxcountrtrs     r4rrsX����T�$�Z�
 �F���	��6�=�=�?�#�H�&,�l�l�n�J�n�l�e�U���8I�E�n�J�J��Js�
A�Ar��	exclusive)r<�methodc�*�	|dkrtd��t|�}t|�}|dkrtd��|dk(rW|dz
}g}td|�D]?}t	||z|�\}}||||z
z||dz|zz|z}	|j|	��A|S|dk(rn|dz}g}td|�D]V}||z|z}|dkrdn||dz
kDr|dz
n|}||z||zz
}||dz
||z
z|||zz|z}	|j|	��X|St
d|����)Nr6zn must be at least 1r�z"must have at least two data points�	inclusiver��Unknown method: )rr�r��range�divmod�appendro)
rIr<r��ldr�r�r�r��delta�interpolateds
          r4rr9sf���	�1�u��4�5�5��$�<�D�	�T��B�	�A�v��B�C�C�
�����F�����q�!��A��a�!�e�Q�'�H�A�u� ��G�q�5�y�1�D��Q��K�%�4G�G�1�L�L��M�M�,�'���
�
�����F�����q�!��A��A���
�A���U���B�q�D���1��a�A��a�C�!�A�#�I�E� ��Q��K�1�u�9�5��Q��%��G�1�L�L��M�M�,�'���
�
�'��z�2�
3�3r3c�j�	t||�\}}}}|dkrtd��t||dz
z|�S)Nr�z*variance requires at least two data pointsr6�r^rru)rI�xbarrQ�ssrVr<s      r4rrjsE��$�J�d�D�/�K�A�r�1�a��1�u��J�K�K��B�!�a�%�L�!�$�$r3c�d�	t||�\}}}}|dkrtd��t||z|�S)Nr6z*pvariance requires at least one data pointr�)rI�murQr�rVr<s      r4rr�sA��!�D�d�B�-�K�A�r�1�a��1�u��J�K�K��B��F�A��r3c��	t||�\}}}}|dkrtd��||dz
z}t|t�r t	|j
|j�St|j
|j�S�Nr�z'stdev requires at least two data pointsr6�r^rrgrr�rprqr�)rIr�rQr�rVr<�msss       r4rr�sp����d�D�/�K�A�r�1�a��1�u��G�H�H�
��A��,�C��!�W��$�S�]�]�C�O�O�D�D��s�}�}�c�o�o�>�>r3c���	t||�\}}}}|dkrtd��||z}t|t�r t	|j
|j�St|j
|j�S)Nr6z'pstdev requires at least one data pointr�)rIr�rQr�rVr<r�s       r4rr�sl����d�B�-�K�A�r�1�a��1�u��G�H�H�
�q�&�C��!�W��$�S�]�]�C�O�O�D�D��s�}�}�c�o�o�>�>r3c��	t|�\}}}}|dkrtd��||dz
z}	t|�t|j|j
�fS#t$r%t|�t|�t|�zfcYSwxYwr�)r^rrhr�rprqra)rIrQr�r�r<r�s      r4�_mean_stdevr��s���P���Y�N�A�r�4���1�u��G�H�H�
��A��,�C�4��T�{�/��
�
�s���O�O�O���4��T�{�E�$�K�%��)�3�3�3�4�s�*A�+B�Bc�����	t|�}t|�|k7rtd��|dkrtd��t|�|z�t|�|z�t�fd�|D��fd�|D��}||dz
zS)NzDcovariance requires that both inputs have same number of data pointsr�z,covariance requires at least two data pointsc3�(�K�|]	}|�z
���y�wr8r2)r:�xir�s  �r4r=zcovariance.<locals>.<genexpr>s�����)�q��2��9�q���c3�(�K�|]	}|�z
���y�wr8r2�r:�yi�ybars  �r4r=zcovariance.<locals>.<genexpr>s�����+B��"�B��I��r�r6)r�rr&r')rU�yr<�sxyr�r�s    @@r4rr�s}���� 	�A��A�
�1�v��{��d�e�e��1�u��L�M�M���7�Q�;�D���7�Q�;�D�
�)�q�)�+B��+B�
C�C��!�a�%�=�r3�linear)r�c��	t|�}t|�|k7rtd��|dkrtd��|dvrtd|����|dk(r#|dz
dz}t||�	�}t||�	�}n@t	|�|z}t	|�|z}|D�cgc]}||z
��	}}|D�cgc]}||z
��	}}t||�}	t||�}
t||�}	|	t
|
|z�zScc}wcc}w#t$rtd
��wxYw)NzEcorrelation requires that both inputs have same number of data pointsr�z-correlation requires at least two data points>r��rankedr�r�r6r�r�z&at least one of the inputs is constant)r�rror�r&r'r r�)rUr�r�r<r}r�r�r�r�r�r]�syys            r4rrs0���,	�A��A�
�1�v��{��e�f�f��1�u��M�N�N�
�)�)��+�F�:�6�7�7�
����Q��"����!�5�!���!�5�!���A�w��{���A�w��{��!"�#��2�R�$�Y���#�!"�#��2�R�$�Y���#�
�!�Q�-�C�
�!�Q�-�C�
�!�Q�-�C�H��T�#��)�_�$�$��

$��#���H��F�G�G�H�s�C&�"C+�C0�0D�LinearRegression��slope�	intercept)�proportionalc��
�	t|�}t|�|k7rtd��|dkrtd��|s9t|�|z}t|�|z�
|D�cgc]}||z
��	}}�
fd�|D�}t||�dz}t||�}	||z}|rdn�
|zz
}	t||	��Scc}w#t$rtd��wxYw)NzKlinear regression requires that both inputs have same number of data pointsr�z3linear regression requires at least two data pointsc3�(�K�|]	}|�z
���y�wr8r2r�s  �r4r=z$linear_regression.<locals>.<genexpr>us�����#��2�R�$�Y��r��z
x is constantr�)r�rr&r'r�r�)rUr�r�r<r�r�r�r]r�r�r�s          @r4r	r	Fs����$�J	�A��A�
�1�v��{��k�l�l��1�u��S�T�T���A�w��{���A�w��{��!"�#��2�R�$�Y���#�#��#��
�!�Q�-�#�
�C�
�!�Q�-�C�/��c�	��$������)<�I��%�9�=�=��
$���/��o�.�.�/�s�B,�B1�1Cc���|dz
}t|�dkrpd||zz
}d|zdz|zdz|zdz|zdz|zd	z|zd
z|zdz|z}d|zd
z|zdz|zdz|zdz|zdz|zdz|zdz}||z}|||zzS|dkr|nd|z
}tt|��}|dkr^|dz
}d|zdz|zdz|zdz|zdz|zdz|zdz|zdz}d|zd z|zd!z|zd"z|zd#z|zd$z|zd%z|zdz}n]|dz
}d&|zd'z|zd(z|zd)z|zd*z|zd+z|zd,z|zd-z}d.|zd/z|zd0z|zd1z|zd2z|zd3z|zd4z|zdz}||z}|dkr|}|||zzS)5N��?g333333�?g��Q��?g^�}o)��@g�E.k�R�@g ��Ul�@g*u��>l�@g�N����@g�"]Ξ@gnC���`@gu��@giK��~j�@gv��|E�@g��d�|1�@gfR��r��@g��u.2�@g���~y�@g�n8(E@��?rg@g�������?g鬷�ZaI?gg�El�D�?g7\�����?g�uS�S�?g�=�.
@gj%b�@g���Hw�@gjR�e�?g�9dh?
>g('߿��A?g��~z �?g@�3��?gɅ3��?g3fR�x�?gI�F��l@g����t��>g*�Y��n�>gESB\T?g�N;A+�?g�UR1��?gE�F���?gP�n��@g&�>���@g����i�<g�@�F�>g�tcI,\�>g�ŝ���I?g*F2�v�?g�C4�?g��O�1�?)r!r r%)�pr��sigmar��rr�r�rUs        r4�_normal_dist_inv_cdfr�s���	
�C��A��A�w�%���q�1�u���0�1�4�0�1�45�6�0�1�45�6�1�1�56�6�1�	1�56�	6�
1�1�
56�6�1�
1�56�
6�1�1�56�6��1�1�4�0�1�45�6�0�1�45�6�1�1�56�6�1�	1�56�	6�
1�1�
56�6�1�
1�56�
6����
�#�I���Q��Y���
�#�X��3��7�A��c�!�f�W�
�A��C�x�
��G��1�A�5�1�2�56�7�1�2�56�7�2�2�67�7�2�	2�67�	7�
2�2�
67�7�2�
2�67�
7�2�2��2�A�5�1�2�56�7�1�2�56�7�2�2�67�7�2�	2�67�	7�
2�2�
67�7�2�
2�67�
7����
��G��1�A�5�1�2�56�7�1�2�56�7�2�2�67�7�2�	2�67�	7�
2�2�
67�7�2�
2�67�
7�2�2��3�Q�6�1�2�56�7�1�2�56�7�2�2�67�7�2�	2�67�	7�
2�2�
67�7�2�
2�67�
7����	�c�	�A��3�w�
�B��
��U���r3)rc��eZdZ	ddd�Zd d�Zed��Zdd�d�Zd	�Zd
�Z	d�Z
d!d�Zd
�Zd�Z
ed��Zed��Zed��Zed��Zed��Zd�Zd�Zd�Zd�Zd�Zd�ZeZd�ZeZd�Zd�Zd�Zd�Z d�Z!y)"rz(Arithmetic mean of a normal distributionz+Standard deviation of a normal distribution��_mu�_sigmac�f�	|dkrtd��t|�|_t|�|_y)Nrzsigma must be non-negative)rrhrr)�selfr�rs   r4�__init__zNormalDist.__init__�s.��N��3�;�!�">�?�?���9����E�l��r3c� �	|t|��Sr8)r�)�clsrIs  r4�from_sampleszNormalDist.from_samples�s��?��K��%�&�&r3N)�seedc���	|�tjntj|�j}|j|j}}td|�D�cgc]}|||���
c}Scc}wr8)�random�gauss�Randomrrr)rr<rrr�rr�s       r4�sampleszNormalDist.samples�sY��G� $�����&�-�-��2E�2K�2K���H�H�d�k�k�E��*0��q�/�:�/�Q��b�%� �/�:�:��:s�A,c��	|j|jz}|std��||jz
}t||zd|zz�t	t
|z�zS)Nz$pdf() not defined when sigma is zerog�)rrrr"r r$)rrUr�diffs    r4�pdfzNormalDist.pdf�sY��>��;�;����,���!�"H�I�I��4�8�8�|���4�$�;�$��/�2�3�d�3��>�6J�J�Jr3c��	|jstd��ddt||jz
|jtzz�zzS)Nz$cdf() not defined when sigma is zerorr)rrr#r�_SQRT2�rrUs  r4�cdfzNormalDist.cdf�sC��6��{�{�!�"H�I�I��c�C��T�X�X��$�+�+��2F� G�H�H�I�Ir3c�p�	|dks|dk\rtd��t||j|j�S)Nrrz$p must be in the range 0.0 < p < 1.0)rrrr)rrs  r4�inv_cdfzNormalDist.inv_cdf�s9��	�
��8�q�C�x�!�"H�I�I�#�A�t�x�x����=�=r3c�f�	td|�D�cgc]}|j||z���c}Scc}wrs)r�r!)rr<r�s   r4rzNormalDist.quantiless4��	�.3�1�a�[�9�[�����Q��U�#�[�9�9��9s�.c	� �	t|t�std��||}}|j|jf|j|jfkr||}}|j
|j
}}|r|st
d��||z
}t|j|jz
�}|s%dt|d|jztzz�z
S|j|z|j|zz
}|j|jzt||z|t||z�zz�z}	||	z|z}
||	z
|z}dt|j|
�|j|
�z
�t|j|�|j|�z
�zz
S)Nz$Expected another NormalDist instancez(overlap() not defined when sigma is zerorr-)
r�rrirrrrr!r#rr r%r)r�other�X�Y�X_var�Y_var�dvr�r��b�x1�x2s            r4�overlapzNormalDist.overlapsd��
	��%��,��B�C�C��U�1��
�H�H�a�e�e�����!�%�%�0�0��a�q�A��z�z�1�:�:�u���E�!�"L�M�M�
�U�]��
�!�%�%�!�%�%�-�
 �����R�3����>�F�#:�;�<�<�<�
�E�E�E�M�A�E�E�E�M�)��
�H�H�q�x�x��$�r�B�w��c�%�%�-�6H�1H�'H�"I�I���!�e�r�\���!�e�r�\���d�1�5�5��9�q�u�u�R�y�0�1�D����r��Q�U�U�2�Y�9N�4O�O�P�Pr3c�j�	|jstd��||jz
|jzS)Nz'zscore() not defined when sigma is zero)rrrrs  r4�zscorezNormalDist.zscore9s3��	��{�{�!�"K�L�L��D�H�H�����+�+r3c��	|jSr8�r�rs r4r
zNormalDist.meanDs��5��x�x�r3c��	|jSr8r1r2s r4rzNormalDist.medianIs��6��x�x�r3c��	|jSr8r1r2s r4rzNormalDist.modeNs��	�
�x�x�r3c��	|jSr8�rr2s r4rzNormalDist.stdevWs��8��{�{�r3c�6�	|j|jzSr8r6r2s r4rzNormalDist.variance\s��+��{�{�T�[�[�(�(r3c���	t|t�rAt|j|jzt|j|j��St|j|z|j�Sr8�r�rrrr�r+r,s  r4�__add__zNormalDist.__add__a�T��	��b�*�%��b�f�f�r�v�v�o�u�R�Y�Y��	�	�/J�K�K��"�&�&�2�+�r�y�y�1�1r3c���	t|t�rAt|j|jz
t|j|j��St|j|z
|j�Sr8r9r:s  r4�__sub__zNormalDist.__sub__or<r3c�b�	t|j|z|jt|�z�Sr8�rrrr!r:s  r4�__mul__zNormalDist.__mul__}�+��	�
�"�&�&�2�+�r�y�y�4��8�';�<�<r3c�b�	t|j|z|jt|�z�Sr8r@r:s  r4�__truediv__zNormalDist.__truediv__�rBr3c�D�	t|j|j�Sr8�rrr�r+s r4�__pos__zNormalDist.__pos__�s��(��"�&�&�"�)�)�,�,r3c�F�	t|j|j�Sr8rFrGs r4�__neg__zNormalDist.__neg__�s��2��2�6�6�'�2�9�9�-�-r3c��	||z
Sr8r2r:s  r4�__rsub__zNormalDist.__rsub__�s��F��b��z�r3c��	t|t�stS|j|jk(xr|j|jk(Sr8)r�r�NotImplementedrrr:s  r4�__eq__zNormalDist.__eq__�s:��P��"�j�)�!�!��v�v�����:�B�I�I����$:�:r3c�F�	t|j|jf�Sr8)�hashrrr2s r4�__hash__zNormalDist.__hash__�s��M��T�X�X�t�{�{�+�,�,r3c�f�t|�j�d|j�d|j�d�S)Nz(mu=z, sigma=�))rBr/rrr2s r4�__repr__zNormalDist.__repr__�s.���t�*�%�%�&�d�4�8�8�,�h�t�{�{�o�Q�O�Or3c�2�|j|jfSr8r
r2s r4�__getstate__zNormalDist.__getstate__�s���x�x����$�$r3c�"�|\|_|_yr8r
)r�states  r4�__setstate__zNormalDist.__setstate__�s�� %����$�+r3)rr)r�)"r/r0r1�	__slots__r�classmethodrrrrr!rr-r/�propertyr
rrrrr;r>rArDrHrJ�__radd__rL�__rmul__rOrRrUrWrZr2r3r4rr�s��.�
:�?��I�
#��'��'�"&�;�K�J�>�	:� Q�D	,������������������)��)�2�2�=�=�-�.��H���H�;�-�P�%�&r3rr8)znegative value)r)N�__all__rbr�r�sys�	fractionsr�decimalr�	itertoolsrrr�bisectrrrr r!r"r#r$r%r&r'�	functoolsr(�operatorr)�collectionsr*r+r,rrorrRr^rdrGrDrurxr�rhr�rHr��
float_info�mant_digr��__annotations__r�r�r
rrrrrr
rrrrrrrrr�rrr�r	r�_statistics�ImportErrorrr2r3r4�<module>rns���h�T��.��
�
���,�,�,�E�E�E���8�8�	
�c���	�j�	�3�l&�R �4�>+�\�$���I�Q�3�4�PU�;�3�l��������3�>�>�2�2�2�Q�6���6�
#�3�
#�3�
#�5�
#��S��S��W��<"�,!�HG�&5,�p+�0 �,�&E+�PB�<K�r�;�(4�b)%�X&�R?�$?�$
4�(�8$,�-H�`�0�2H�I��05�7>�zG�V	�0�
Z&�Z&��	�	��	�s�/E�E�E

?>