← Back
Editing: _fit.cpython-311.pyc
� d�c�� � � � d dl Z d dlmZ d dlZd dlmZmZ d dlm Z d� Z G d� d� � Zdddej d �d �Z edd� � Zdddd ddd�d�Zd� Zdd�Zej eiZd� Zd� Zdd�Zd� Zd� Zeeed�Zd� ZdS )� N)� namedtuple)�optimize�stats)�check_random_statec �t � t j |� � }|d |d k r%d| � dt |� � � d�}t |� � �t |d |d � � t |d |d � � f}|rKt j |d � � t j |d � � k rd| � d�}t |� � �|s'|d |d k rd| � d�}t |� � �t j t j |� � � � sd| � d | � d �}t |� � �|S )zCIntersection of user-defined bounds and distribution PDF/PMF domainr � zThere are no values for `z` on the interval �.z!There are no integer values for `zY` on the interval defined by the user-provided bounds and the domain of the distribution.z.The intersection of user-provided bounds for `z\` and the domain of the distribution is not finite. Please provide finite bounds for shape `z` in `bounds`.) �np� atleast_1d�list� ValueError�max�min�ceil�floor�all�isfinite)�name�user_bounds�shape_domain�integral�message�boundss �2/usr/lib/python3/dist-packages/scipy/stats/_fit.py�_combine_boundsr s� � � �-��,�,�K��1�~��A��&�&�+�t� +� +��;�'�'�+� +� +����!�!�!��+�a�.�,�q�/�2�2��+�a�.�,�q�/�2�2�4�F� � "�R�W�V�A�Y�'�'�"�(�6�!�9�*=�*=�=�=�*�t� *� *� *�� ��!�!�!� � "�6�!�9�v�a�y�0�0�*�t� *� *� *�� ��!�!�!� �6�"�+�f�%�%�&�&� "�L�D� L� L�7;�L� L� L�� ��!�!�!��M� c �Z � e Zd ZdZd� Zd� Zdd�Zddd�d�Zd � Zd � Z d� Z d� Zdd�Zd� Z dS )� FitResulta� Result of fitting a discrete or continuous distribution to data Attributes ---------- params : namedtuple A namedtuple containing the maximum likelihood estimates of the shape parameters, location, and (if applicable) scale of the distribution. success : bool or None Whether the optimizer considered the optimization to terminate successfully or not. message : str or None Any status message provided by the optimizer. c � � || _ || _ || _ t |dd � � pt |dd � � | _ |j �g n|j � d� � }|st d|ddgz � � }nt d|dgz � � } ||j � | _ |j r4t j | � � � � � sd|_ d|_ t |d d � � | _ t |d d � � | _ d S )N�pmf�pdf�, � FitParams�loc�scaleFzOOptimization converged to parameter values that are inconsistent with the data.�successr )�_dist�_data�discrete�getattr�pxf�shapes�splitr �x�paramsr&