← Back
Editing: _mannwhitneyu.cpython-311.pyc
� d�cJ � �� � d dl Zd dlmZ d dlmZ d dlmZ ddlmZ d� Z G d� d � � Z e � � Zd � Zd� Z dd �Zd� Zd� Zd� Z edd� � Z eed�� � dd�� � ZdS )� N)� namedtuple)�special)�stats� )�_axis_nan_policy_factoryc �z � t j | |d� � } t j ||d� � }t j | d |d � � }t j | |j | j d fz � � } t j ||j |j d fz � � }t j | |fd�� � }| ||fS )zBBroadcast then concatenate arrays, leaving concatenation axis last���).r ��axis)�np�moveaxis� broadcast�broadcast_to�shape�concatenate)�x�yr �zs �;/usr/lib/python3/dist-packages/scipy/stats/_mannwhitneyu.py�_broadcast_concatenater s� � � ��A�t�R� � �A� ��A�t�R� � �A� ��Q�v�Y��&� �*�*�A� ���1�7�a�g�b�k�^�3�4�4�A� ���1�7�a�g�b�k�^�3�4�4�A� ���1�v�B�'�'�'�A��a��7�N� c �B � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z d � Zd S )�_MWUz7Distribution of MWU statistic under the null hypothesisc �H � t j d� � | _ d| _ dS )zMinimal initializer)r r r N)r �ones�_fmnks� _recursive)�selfs r �__init__z _MWU.__init__ s! � ��w�y�)�)�)�������r c � � | j �|dk r|dk s| j r| � |||� � S | � |||� � S )Ni� )r � pmf_recursive� pmf_iterative�r �k�m�ns r �pmfz_MWU.pmf sT � ��O�#��S���Q�#�X�X��?� 6>��%�%�a��A�.�.�.��%�%�a��A�.�.�.r c � � | � ||t j |� � � � t j |� � D ]}| � |||� � �| j |||f t j ||z |� � z S )z,Probability mass function, recursive version)� _resize_fmnksr �max�ravel�_fr r �binom)r r$ r% r&