
    VfdU              	       |   d dl Zd dlmZ d dlmZ d dlZd dlmZ d dl	m
Z d dlmZ d dlmZmZmZmZ d dlmZ  G d d          Z G d	 d
e          Z G d de          Z G d de          Z G d de          Z G d de          Z G d d          Z G d de          Z G d d          Zd Zej        j         d             Z! G d d          Z" G d d          Z# G d d           Z$ G d! d"          Z%d# Z&ej        j         ej        '                    d$i d%d&d'g          ej        '                    d(d)d*g          ej        '                    d+d)d*g          ej        '                    d,g d-          d.                                                             Z(ej        j         d/             Z)dS )0    N)assert_equal)stats)gofplots)ProbPlotqqlineqqplotqqplot_2samples)_import_mplc                   >   e Zd Zd Zej        j        d             Zej        j        d             Zej        j        d             Z	ej        j        d             Z
ej        j        d             Zej        j        d             Zej                            d	          ej        j        d
                         Zej        j        d             Zej        j        d             Zej                            d	          ej        j        d                         Zej        j        d             Zej        j        d             Zej        j        d             Zej        j        d             Zej        j        d             Zej        j        d             Zd ZdS )BaseProbplotMixinc                 B   	 dd l m} |                                \  | _        | _        n# t
          $ r Y nw xY wt          j                            | j	        j
        j                  | _        t          | j                  | _        t          dddd          | _        d S )Nr   sizedcornflowerbluewhite      ?)markermarkerfacecolormarkeredgecoloralpha)matplotlib.pyplotpyplotsubplotsfigaxImportErrornprandomnormalprbpltdatashapeother_arrayr   other_prbplotdictplot_optionsselfplts     Hlib/python3.11/site-packages/statsmodels/graphics/tests/test_gofplots.pysetup_methodzBaseProbplotMixin.setup_method   s    	++++++ #DHdgg 	 	 	D	9++1A1G+HH%d&677 ,#	
 
 
   '* 
77c                 N     | j         j        d| j        | j        d| j         d S Nr   line r!   r   r   r1   r'   r)   close_figuress     r+   test_qqplotzBaseProbplotMixin.test_qqplot#   s1    KdgDIKK9JKKKKK    c                 R    | j                             | j        | j                   d S )Nr0   r!   ppplotr   r1   r4   s     r+   test_ppplotzBaseProbplotMixin.test_ppplot'   s'    dgDI66666r7   c                 N     | j         j        d| j        | j        d| j         d S r/   r!   probplotr   r1   r'   r4   s     r+   test_probplotzBaseProbplotMixin.test_probplot+   s1    MdiMM4;LMMMMMr7   c                 P     | j         j        d| j        d| j        d| j         d S )NT)r   exceedr1   r2   r=   r4   s     r+   test_probplot_exceedz&BaseProbplotMixin.test_probplot_exceed/   sE     	
wt$)	
 	
7;7H	
 	
 	
 	
 	
r7   c                 Z     | j         j        d| j        | j        | j        d| j         d S N)r   r1   otherr2   )r!   r   r   r1   r$   r'   r4   s     r+   test_qqplot_other_arrayz)BaseProbplotMixin.test_qqplot_other_array5   L     	
w"	
 	
 		
 	
 	
 	
 	
r7   c                 Z     | j         j        d| j        | j        | j        d| j         d S rD   )r!   r:   r   r1   r$   r'   r4   s     r+   test_ppplot_other_arrayz)BaseProbplotMixin.test_ppplot_other_array>   rG   r7   T)strictc                 Z     | j         j        d| j        | j        | j        d| j         d S rD   )r!   r>   r   r1   r$   r'   r4   s     r+   test_probplot_other_arrayz+BaseProbplotMixin.test_probplot_other_arrayG   sN     	 	
w"	
 	
 		
 	
 	
 	
 	
r7   c                 Z     | j         j        d| j        | j        | j        d| j         d S rD   )r!   r   r   r1   r%   r'   r4   s     r+   test_qqplot_other_prbpltz*BaseProbplotMixin.test_qqplot_other_prbpltQ   L     	
w$	
 	
 		
 	
 	
 	
 	
r7   c                 Z     | j         j        d| j        | j        | j        d| j         d S rD   )r!   r:   r   r1   r%   r'   r4   s     r+   test_ppplot_other_prbpltz*BaseProbplotMixin.test_ppplot_other_prbpltZ   rO   r7   c                 Z     | j         j        d| j        | j        | j        d| j         d S rD   )r!   r>   r   r1   r%   r'   r4   s     r+   test_probplot_other_prbpltz,BaseProbplotMixin.test_probplot_other_prbpltc   sN     	 	
w$	
 	
 		
 	
 	
 	
 	
r7   c                 R     | j         j        d| j        | j        ddd| j         d S NzCustom X-LabelzCustom Y-Label)r   r1   xlabelylabelr2   r3   r4   s     r+   test_qqplot_custom_labelsz+BaseProbplotMixin.test_qqplot_custom_labelsm   L     	
w##		
 	

 	
 	
 	
 	
 	
r7   c                 R     | j         j        d| j        | j        ddd| j         d S rU   )r!   r:   r   r1   r'   r4   s     r+   test_ppplot_custom_labelsz+BaseProbplotMixin.test_ppplot_custom_labelsw   rY   r7   c                 R     | j         j        d| j        | j        ddd| j         d S rU   r=   r4   s     r+   test_probplot_custom_labelsz-BaseProbplotMixin.test_probplot_custom_labels   sL     	
w##		
 	

 	
 	
 	
 	
 	
r7   c                 Z    | j                             | j        | j        dddd           d S Nr   r   r   r   )r   r1   r   r   r   r   )r!   r   r   r1   r4   s     r+   test_qqplot_pltkwargsz'BaseProbplotMixin.test_qqplot_pltkwargs   A    w,# 	 	
 	
 	
 	
 	
r7   c                 Z    | j                             | j        | j        dddd           d S r_   r9   r4   s     r+   test_ppplot_pltkwargsz'BaseProbplotMixin.test_ppplot_pltkwargs   ra   r7   c                 Z    | j                             | j        | j        dddd           d S r_   )r!   r>   r   r1   r4   s     r+   test_probplot_pltkwargsz)BaseProbplotMixin.test_probplot_pltkwargs   sA    w,# 	 	
 	
 	
 	
 	
r7   c                     | j         j        d         | j         j        k    sJ | j         j        d         | j         j        k    sJ d S )N)r!   
fit_paramslocscaler)   s    r+   test_fit_paramsz!BaseProbplotMixin.test_fit_params   sG    {%b)T[_<<<<{%b)T[->>>>>>>r7   N)__name__
__module____qualname__r,   pytestmark
matplotlibr6   r;   r?   rB   rF   rI   xfailrL   rN   rQ   rS   rX   r[   r]   r`   rc   re   rm   r2   r7   r+   r   r      s       
 
 
  [L L L [7 7 7 [N N N [
 
 

 [
 
 
 [
 
 
 [d##[
 
  $#
 [
 
 
 [
 
 
 [d##[
 
  $#
 [
 
 
 [
 
 
 [
 
 
 [
 
 
 [
 
 
 [
 
 
? ? ? ? ?r7   r   c                        e Zd Z fdZ xZS )TestProbPlotLongelyNoFitc                    t           j                            d           t          j        j                                        | _        t          j        | j        j	        d          | j        _	        t          j
        | j        j        | j        j	                                                  | _        t          | j        j        t           j        dd          | _        d| _        t)                                                       d S )N   Fprepend   distdistargsfitrr   r   seedsmdatasetslongleyloadr"   add_constantexogOLSendogr   mod_fitr   residr   tr!   r1   superr,   r)   	__class__s    r+   r,   z%TestProbPlotLongelyNoFit.setup_method   s    
	qK',,..	GGG	vdioty~>>BBDDLUWt
 
 
 	r7   rn   ro   rp   r,   __classcell__r   s   @r+   rv   rv      8        	 	 	 	 	 	 	 	 	r7   rv   c                        e Zd Z fdZ xZS )TestProbPlotLongelyWithFitc                    t           j                            d           t          j        j                                        | _        t          j        | j        j	        d          | j        _	        t          j
        | j        j        | j        j	                                                  | _        t          | j        j        t           j        dd          | _        d| _        t)                                                       d S )Nrx   Fry   r{   Tr}   r   r   r   s    r+   r,   z'TestProbPlotLongelyWithFit.setup_method   s    
	qK',,..	GGG	vdioty~>>BBDDLUWt
 
 
 	r7   r   r   s   @r+   r   r      r   r7   r   c                        e Zd Z fdZ xZS )TestProbPlotRandomNormalMinimalc                 "   t           j                            d           t           j                            ddd          | _        t          | j                  | _        d | _        t          t          |           
                                 d S )Nrx         @      
@%   rj   rk   r   )r   r   r   r    r"   r   r!   r1   r   r   r,   r   s    r+   r,   z,TestProbPlotRandomNormalMinimal.setup_method   sp    
	qI$$T$CC	ty))	-t44AACCCCCr7   r   r   s   @r+   r   r      A        D D D D D D D D Dr7   r   c                        e Zd Z fdZ xZS )TestProbPlotRandomNormalWithFitc                 &   t           j                            d           t           j                            ddd          | _        t          | j        d          | _        d| _        t          t          |           
                                 d S )	Nrx   r   r   r   r   T)r   q)r   r   r   r    r"   r   r!   r1   r   r   r,   r   s    r+   r,   z,TestProbPlotRandomNormalWithFit.setup_method   su    
	qI$$T$CC	tyd333	-t44AACCCCCr7   r   r   s   @r+   r   r      r   r7   r   c                   0     e Zd Z fdZd Zd Zd Z xZS ) TestProbPlotRandomNormalFullDistc                 @   t           j                            d           t           j                            ddd          | _        t          | j        t          j        dd          	          | _        d
| _	        t                                                       d S )Nrx   r   r   r   r         !@      @rj   rk   r~   45)r   r   r   r    r"   r   r   normr!   r1   r   r,   r   s    r+   r,   z-TestProbPlotRandomNormalFullDist.setup_method   s}    
	qI$$T$CC	tyuzc/M/M/MNNN	r7   c                 *    | j         j        dk    sJ d S )Nr   r!   rj   rl   s    r+   test_loc_setz-TestProbPlotRandomNormalFullDist.test_loc_set   s    {#%%%%%%r7   c                 *    | j         j        dk    sJ d S )Nr   r!   rk   rl   s    r+   test_scale_setz/TestProbPlotRandomNormalFullDist.test_scale_set   s    { C''''''r7   c                    t          j        t                    5  t          | j        t          j        dd          d           d d d            n# 1 swxY w Y   t          j        t                    5  t          | j        t          j        dd          d           d d d            n# 1 swxY w Y   t          j        t                    5  t          | j        t          j        dd          d           d d d            n# 1 swxY w Y   t          j        t                    5  t          | j        t          j        dd          d	           d d d            d S # 1 swxY w Y   d S )
Nr   r   r   T)r~   r   )r   r   r~   r   )r~   rj   )r~   rk   )rq   raises
ValueErrorr   r"   r   r   rl   s    r+   test_exceptionsz0TestProbPlotRandomNormalFullDist.test_exceptions   s   ]:&& 	O 	OTYUZCs%C%C%CNNNN	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O]:&& 	 		ZCs333#   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ]:&& 	N 	NTYUZCs%C%C%CMMMM	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N 	N]:&& 	P 	PTYUZCs%C%C%C3OOOO	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	PsG   ,AAA6,B..B25B2,D

DD.,E''E+.E+)rn   ro   rp   r,   r   r   r   r   r   s   @r+   r   r      sl            & & &( ( (P P P P P P Pr7   r   c                   h    e Zd Zd Zej        j        d             Zej        j        d             ZdS )TestCompareSamplesDifferentSizec                    t           j                            d           t          t           j                            ddd                    | _        t          t           j                            ddd                    | _        d S )Nrx   r   r   r   r   7   )r   r   r   r   r    data1data2rl   s    r+   r,   z,TestCompareSamplesDifferentSize.setup_method   sf    
	qbi..4t".MMNN
bi..4t".MMNN


r7   c                     | j                             | j                   t          j        t
                    5  | j                            | j                    d d d            d S # 1 swxY w Y   d S N)rE   )r   r   r   rq   r   r   r4   s     r+   r6   z+TestCompareSamplesDifferentSize.test_qqplot   s    

+++]:&& 	0 	0JDJ///	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0s   !A((A,/A,c                     | j                             | j                   | j                            | j                    d S r   )r   r:   r   r4   s     r+   r;   z+TestCompareSamplesDifferentSize.test_ppplot  s>    

+++

+++++r7   N)	rn   ro   rp   r,   rq   rr   rs   r6   r;   r2   r7   r+   r   r      sh        O O O
 [0 0 0
 [, , , , ,r7   r   c                   6     e Zd Z fdZd Zd Zd Zd Z xZS )$TestProbPlotRandomNormalLocScaleDistc                 (   t           j                            d           t           j                            ddd          | _        t          | j        dd          | _        d	| _        t          t          |           
                                 d S )
Nrx   r   r   r   r         r   r   )r   r   r   r    r"   r   r!   r1   r   r   r,   r   s    r+   r,   z1TestProbPlotRandomNormalLocScaleDist.setup_method  sw    
	qI$$T$CC	tyaq999	2D99FFHHHHHr7   c                 *    | j         j        dk    sJ d S )Nr   r   rl   s    r+   r   z1TestProbPlotRandomNormalLocScaleDist.test_loc_set  s    {!######r7   c                 *    | j         j        dk    sJ d S )Nr   r   rl   s    r+   r   z3TestProbPlotRandomNormalLocScaleDist.test_scale_set  s    { A%%%%%%r7   c                 N    | j         j                                        dk    sJ d S )Ng       @)r!   r~   meanrl   s    r+   test_loc_set_in_distz9TestProbPlotRandomNormalLocScaleDist.test_loc_set_in_dist  s*    {$$&&#------r7   c                 N    | j         j                                        dk    sJ d S )Ng      "@)r!   r~   varrl   s    r+   test_scale_set_in_distz;TestProbPlotRandomNormalLocScaleDist.test_scale_set_in_dist  s*    {##%%,,,,,,r7   )	rn   ro   rp   r,   r   r   r   r   r   r   s   @r+   r   r     sy        I I I I I$ $ $& & &. . .- - - - - - -r7   r   c                       e Zd Zd Zej        j        d             Zej        j        d             Zej        j        d             Z	ej        j        d             Z
dS )TestTopLevelc                 <   t           j        j                                        | _        t          j        | j        j        d          | j        _        t          j        | j        j        | j        j                  	                                | _
        | j
        j        | _        t          | j
        j        t          j        d          | _        t"          j                            | j        j        j                  | _        t          | j                  | _        d S )NFry   r{   r   r   )r   r   r   r   r"   r   r   r   r   r   r   r   resr   r   r   r!   r   r   r    r#   r$   r%   rl   s    r+   r,   zTestTopLevel.setup_method"  s    K',,..	GGG	vdioty~>>BBDD<%t|1$OOO9++1A1G+HH%d&677r7   c                 2    t          | j        d           d S Nr   r1   r   r   r4   s     r+   r6   zTestTopLevel.test_qqplot+      txc""""""r7   c                 :    t          | j        ddddd           d S )Nr   r   r   r   r   )r1   r   r   r   r   r   r4   s     r+   r`   z"TestTopLevel.test_qqplot_pltkwargs/  s7    H,#	
 	
 	
 	
 	
 	
r7   c                 H    dD ]}t          | j        | j        |           d S N)r   r   r   sr   r	   r!   r%   r)   r5   r1   s      r+   &test_qqplot_2samples_prob_plot_objectsz3TestTopLevel.test_qqplot_2samples_prob_plot_objects:  >     * 	H 	HDDK);$GGGGG	H 	Hr7   c                 H    dD ]}t          | j        | j        |           d S r   r	   r   r$   r   s      r+   test_qqplot_2samples_arraysz(TestTopLevel.test_qqplot_2samples_arraysA  >     * 	C 	CDDHd&6TBBBBB	C 	Cr7   N)rn   ro   rp   r,   rq   rr   rs   r6   r`   r   r   r2   r7   r+   r   r   !  s        8 8 8 [# # # [
 
 
 [H H H [C C C C Cr7   r   c                    t           j                            d           t          j        j                                        }t          j        |j        d          |_        t          j	        |j
        |j                                                  }t          j        t          d          5  t          |j        t"          j        d           d d d            d S # 1 swxY w Y   d S )Nrx   Fry   zdist\(0, 1, 4, loc=0, scale=1\))match)r      r|   )r   )r   r   r   r   r   r   r   r   r   r   r   r   rq   r   	TypeErrorr   r   r   r   )r5   r"   r   s      r+   test_invalid_dist_configr   I  s    INN1;##%%D	5999DIfTZ++//11G	y(J	K	K	K = =)<<<<= = = = = = = = = = = = = = = = = =s   /"CC"%C"c                     t           j                            d          } |                     d          }|                     d          }t	          ||          }t	          ||          }|                                d                                         d                                         \  }}|                                d                                         d                                         \  }}t           j        	                    ||           t           j        	                    ||           t          |                                d                                                   }	t          |                                d                                                   }
|	|
k    sJ t          j        j        d             }t          j        j        d             }t          j        j        d             }d S )Nr   d      c                 2    t          | j        d           d S r   r   r4   s     r+   r6   z(test_qqplot_unequal.<locals>.test_qqplotb  r   r7   c                 H    dD ]}t          | j        | j        |           d S r   r   r   s      r+   "test_qqplot_2samples_prob_plot_objz?test_qqplot_unequal.<locals>.test_qqplot_2samples_prob_plot_objf  r   r7   c                 H    dD ]}t          | j        | j        |           d S r   r   r   s      r+   r   z8test_qqplot_unequal.<locals>.test_qqplot_2samples_arraysm  r   r7   )r   r   RandomStatestandard_normalr	   get_axesget_childrenget_datatestingassert_allcloselenrq   rr   rs   )rsr   r   fig1fig2x1y1x2y2numobj1numobj2r6   r   r   s                 r+   test_qqplot_unequalr  S  s   			q	!	!Bs##Es##E5%((D5%((D]]__Q,,..q1::<<FB]]__Q,,..q1::<<FBJr2&&&Jr2&&&$--//!$113344G$--//!$113344Gg[# # # [H H H [C C C C Cr7   c                       e Zd Zd Zd ZdS )TestCheckDistc                     t          j        t          j        d           t          j        t          j        d           d S )Nppfcdf)r   
_check_forr   r   rl   s    r+   	test_goodzTestCheckDist.test_goodv  s2    EJ...EJ.....r7   c                     t          j        t                    5  t          j        dd           d d d            n# 1 swxY w Y   t          j        t                    5  t          j        dd           d d d            d S # 1 swxY w Y   d S )Njunkr  r  )rq   r   AttributeErrorr   r  rl   s    r+   test_badzTestCheckDist.test_badz  s   ]>** 	/ 	/...	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/]>** 	/ 	/...	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/s!   <A A  BB
BN)rn   ro   rp   r  r  r2   r7   r+   r  r  u  s2        / / // / / / /r7   r  c                   :   e Zd Zd Zej        j        d             Zej        j        d             Zej        j        d             Z	ej        j        d             Z
ej        j        d             Zej        j        d             Zej        j        d             Zd	S )

TestDoPlotc                     	 dd l m} |                                \  | _        | _        n# t
          $ r Y nw xY wg d| _        g d| _        dddddd	| _        d
dd| _	        d S )Nr   )	g?g333333?       @      @g      $@g      I@g     T@gfffffX@gX@)	333333?gffffff?g333333?g @g	@g@r  gffffff@g333333@r   r   	firebrickg      ?z--)r   r   r   markeredgewidth	linestyle-mid)r  where)
r   r   r   r   r   r   xyfull_optionsstep_optionsr(   s     r+   r,   zTestDoPlot.setup_method  s    	++++++ #DHdgg 	 	 	D	 DCC>>>/*#
 
 +.>>r-   c                     t                      }t          j        | j        | j                  \  }}t          ||j                  sJ t          ||j                  sJ | j        |usJ | j	        |usJ d S )N)
r
   r   _do_plotr  r  
isinstanceFigureAxesr   r   r)   r5   r*   r   r   s        r+   test_baselinezTestDoPlot.test_baseline  s    mm#DFDF33R#sz*****"ch'''''xs""""wb      r7   c                     t                      }t          j        | j        | j        | j                  \  }}t          ||j                  sJ t          ||j                  sJ | j	        |u sJ | j        |u sJ d S )N)r   )
r
   r   r  r  r  r   r  r   r!  r   r"  s        r+   test_with_axzTestDoPlot.test_with_ax  s~    mm#DFDFtw???R#sz*****"ch'''''x3w"}}}}}}r7   c                 Z    t          j        | j        | j        f| j        dd| j         d S )NFr   stepr   r  r  r  r   r  r4   s     r+   test_plot_full_optionsz!TestDoPlot.test_plot_full_options  sL    FF	
 w		
 	

 	
 	
 	
 	
 	
r7   c                 Z    t          j        | j        | j        f| j        dd| j         d S NTr'  )r   r  r  r  r   r  r4   s     r+   test_step_baselinezTestDoPlot.test_step_baseline  L    FF	
 w		
 	

 	
 	
 	
 	
 	
r7   c                 Z    t          j        | j        | j        f| j        dd| j         d S r,  r)  r4   s     r+   test_step_full_optionsz!TestDoPlot.test_step_full_options  r.  r7   c                 T    t          j        | j        | j        | j        d           d S )Nr   r0   r   r  r  r  r   r4   s     r+   test_plot_qq_linezTestDoPlot.test_plot_qq_line  s(    $&$&TW3??????r7   c                 V    t          j        | j        | j        | j        dd           d S )NTr   )r   r(  r1   r2  r4   s     r+   test_step_qq_linezTestDoPlot.test_step_qq_line  s*    $&$&TW4cJJJJJJr7   N)rn   ro   rp   r,   rq   rr   rs   r#  r%  r*  r-  r0  r3  r5  r2   r7   r+   r  r    s       ? ? ?& [! ! ! [   [
 
 
 [
 
 
 [
 
 
 [@ @ @ [K K K K Kr7   r  c                      e Zd Zd Zej        j        d             Zej        j        d             Zej        j        d             Z	ej        j        d             Z
ej        j        d             Zej        j        d             Zej        j        d             Zej        j        d	             Zej        j        d
             Zej        j        d             Zej        j        d             Zej        j        d             Zej        j        d             Zej        j        d             Zej        j        d             Zej        j        d             ZdS )
TestQQLinec                 
   t           j                            d           t          j        t           j                            ddd                    | _        t          j        t           j                            ddd                    | _        	 dd lm} |	                                \  | _
        | _        | j                            | j        | j        d           n# t          $ r Y nw xY wd	d
dd| _        d| _        d S )Nr   g333333@r  r   r   r   g?ko   )
   r   r   r|   green)	linewidthdashescolorzbo-)r   r   r   sortr    r  r  r   r   r   r   r   plotr   lineoptionsfmtr(   s     r+   r,   zTestQQLine.setup_method  s    
	q))c2)FFGG))c2)FFGG	++++++ #DHdgGLL.... 	 	 	D	 #
 

 s   AC! !
C.-C.c                     t          j        t                    5  t          | j        d           d d d            d S # 1 swxY w Y   d S )Nr
  rq   r   r   r   r   rl   s    r+   test_badlinezTestQQLine.test_badline  s    ]:&& 	$ 	$47F###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$   =AAc                     t          j        t                    5  t          | j        d| j                   d d d            d S # 1 swxY w Y   d S )Nr   )r  )rq   r   r   r   r   r  r4   s     r+   test_non45_no_xzTestQQLine.test_non45_no_x      ]:&& 	+ 	+47C46****	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+   AAAc                     t          j        t                    5  t          | j        d| j                   d d d            d S # 1 swxY w Y   d S )Nr   )r  )rq   r   r   r   r   r  r4   s     r+   test_non45_no_yzTestQQLine.test_non45_no_y  rJ  rK  c                     t          j        t                    5  t          | j        d           d d d            d S # 1 swxY w Y   d S )Nr   rE  r4   s     r+   test_non45_no_x_no_yzTestQQLine.test_non45_no_x_no_y  s    ]:&& 	! 	!47C   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!rG  c                     t          | j                                                  }t          | j        d           t          | j                                                  |k    sJ d S )Nr   )r   r   r   r   r)   r5   	nchildrens      r+   test_45zTestQQLine.test_45  s\    ,,..//	tw47''))**Y666666r7   c                 >    t          | j        d| j                   d S )Nr   )rC  )r   r   rC  r4   s     r+   test_45_fmtzTestQQLine.test_45_fmt  s!    tw$(++++++r7   c                 D    t          | j        dfd| j        i| j         d S )Nr   rC  )r   r   rC  rB  r4   s     r+   test_45_fmt_lineoptionsz"TestQQLine.test_45_fmt_lineoptions   s,    tw??$(?d.>?????r7   c                     t          | j                                                  }t          | j        d| j        | j                   t          | j                                                  |k    sJ d S )Nr   r  r  r   r   r   r   r  r  rQ  s      r+   test_rzTestQQLine.test_r  g    ,,..//	twtv000047''))**Y666666r7   c                 V    t          | j        d| j        | j        | j                   d S Nr   r  r  rC  r   r   r  r  rC  r4   s     r+   
test_r_fmtzTestQQLine.test_r_fmt
  )    twtvTX>>>>>>r7   c                 \    t          | j        df| j        | j        | j        d| j         d S r^  r   r   r  r  rC  rB  r4   s     r+   test_r_fmt_lineoptionsz!TestQQLine.test_r_fmt_lineoptions  G    GS	
 Fdf$(	
 	
>B>N	
 	
 	
 	
 	
r7   c                     t          | j                                                  }t          | j        d| j        | j                   t          | j                                                  |k    sJ d S )Nr   rY  rZ  rQ  s      r+   test_szTestQQLine.test_s  r\  r7   c                 V    t          | j        d| j        | j        | j                   d S Nr   r_  r`  r4   s     r+   
test_s_fmtzTestQQLine.test_s_fmt  rb  r7   c                 \    t          | j        df| j        | j        | j        d| j         d S rj  rd  r4   s     r+   test_s_fmt_lineoptionsz!TestQQLine.test_s_fmt_lineoptions  rf  r7   c                    t          | j                                                  }t          | j        dt          j        | j        | j                   t          | j                                                  |k    sJ d S )Nr   )r~   r  r  )r   r   r   r   r   r   r  r  rQ  s      r+   test_qzTestQQLine.test_q$  sk    ,,..//	tw%*$&AAAA47''))**Y666666r7   c                 l    t          | j        dt          j        | j        | j        | j                   d S Nr   )r~   r  r  rC  )r   r   r   r   r  r  rC  r4   s     r+   
test_q_fmtzTestQQLine.test_q_fmt*  s-    tw%*$&dhOOOOOOr7   c                 r    t          | j        dft          j        | j        | j        | j        d| j         d S rq  )r   r   r   r   r  r  rC  rB  r4   s     r+   test_q_fmt_lineoptionsz!TestQQLine.test_q_fmt_lineoptions.  sS    G	
 ff	
 	
 	
 	
 	
 	
 	
r7   N)rn   ro   rp   r,   rq   rr   rs   rF  rI  rM  rO  rS  rU  rW  r[  ra  re  rh  rk  rm  ro  rr  rt  r2   r7   r+   r7  r7    s9         & [$ $ $ [+ + + [+ + + [! ! ! [7 7 7
 [, , , [@ @ @ [7 7 7
 [? ? ? [
 
 

 [7 7 7
 [? ? ? [
 
 

 [7 7 7
 [P P P [	
 	
 	
 	
 	
r7   r7  c                       e Zd Zd Zd Zej        j        d             Zej        j        d             Z	ej        j        d             Z
ej        j        d             Zej        j        d             ZdS )	TestPlottingPositionc                 P    d| _         t          j        | j                   | _        d S )N   )Nr   aranger"   rl   s    r+   r,   z!TestPlottingPosition.setup_method<  s     Idf%%			r7   c                     t          j        | j        ||          }t          j                            | j        ||          }t          j        ||d           d S )Nab)r   betarx   )decimal)	r   plotting_posry  r   mstatsplotting_positionsr"   nptestassert_array_almost_equal)r)   r   r  smppsppps        r+   do_testzTestPlottingPosition.do_test@  s`    $TVu===|..IU / 
 
 	(tQ??????r7   c                 2    |                      dd           d S )Nr   r  r4   s     r+   test_weibullz!TestPlottingPosition.test_weibullH      Qr7   c                 2    |                      dd           d S )Nr   r   r  r4   s     r+   test_lininterpz#TestPlottingPosition.test_lininterpL  r  r7   c                 2    |                      dd           d S )Nr   r  r4   s     r+   test_piecewisez#TestPlottingPosition.test_piecewiseP      S#r7   c                 2    |                      dd           d S )NgUUUUUU?r  r4   s     r+   test_approx_med_unbiasedz-TestPlottingPosition.test_approx_med_unbiasedT  s    Y	*****r7   c                 2    |                      dd           d S )Ng?r  r4   s     r+   test_cunnanez!TestPlottingPosition.test_cunnaneX  r  r7   N)rn   ro   rp   r,   r  rq   rr   rs   r  r  r  r  r  r2   r7   r+   rv  rv  ;  s        & & &@ @ @ [   [   [   [+ + + [    r7   rv  c            	      z   t          j        g d          } t          t          j        d          t	          j        dd                    }t          |j        |            t          t          j        d          t	          j        dd                    }t          |j        |            t          t          j        d          t	          j        dd                    }t          |j        |            t          j        g d          } t          t          j        d          t	          j        ddd	                    }t          |j        |            t          t          j        d          t	          j        ddd	
                    }t          |j        |            t          j        g d          } t          t          j        d          t	          j        ddd	d                    }t          |j        |            t          t          j        d          t	          j        ddd	d                    }t          |j        |            t          t          j        d          t	          j        ddd	d                    }t          |j        |            t          t          j        d          t	          j        ddd	d                    }t          |j        |            t          t          j        d          t	          j        ddd	d                    }t          |j        |            d S )N)r  r   r   r   r   r:  r   r   )r~  r|  )r  r   r|   r   r|   )r}  r~  rj   )r  r   r|   rx   rx   )rk   r   )r~  rj   rk   )r}  r~  rj   rk   )r   arrayr   emptyr   r  r   ri   )expectedpps     r+   test_param_unpackingr  ]  s   x''H	"(3--ejA&6&6	7	7	7B)))	"(3--A!3!3!3	4	4B)))	"(3--a1!5!5!5	6	6B)))x''H	"(3--Aq!!4!4	5	5B)))	"(3--a1!!<!<!<	=	=B)))x''H	"(3--Aq!Q!7!7	8	8B)))	"(3--Aq!1!=!=!=	>	>B)))	"(3--Aqaq!A!A!A	B	BB)))	"(3--A!C!C!C	D	DB)))	"(3--a1!1!E!E!E	F	FB)))))r7   labelsXY)rV   rW   x_size   2   y_sizer1   )Nr   r   r   r   c                    t           j                            d          }|                    dd|          }|                    d|          }t          j        |          }	t          j        |          }
t          |	|
fd|i|}|                                d         }|	                                }|
                                }||k     r|sd|v sJ d	|v sJ d S d
|v sJ d|v sJ d S |sd	|v sJ d|v sJ d S d|v sJ d
|v sJ d S )NiJ r   g?r   r   r   r1   2nd1str  r  )r   r   r   r    
standard_tr   r   r	   r   
get_xlabel
get_ylabel)r5   reset_randomstater1   r  r  r  r   r  r  pp_xpp_yr   r   x_labely_labels                  r+   test_correct_labelsr  y  sL    
		w	'	'B
		as	00A
af%%A;q>>D;q>>D
$
:
:4
:6
:
:C		BmmooGmmooG 	"G####G######'>>>>'>>>>>> 	"G####G######'>>>>'>>>>>>r7   c                 V   t           j                            ddd          }t           j                            ddd          }t          ||dd          }|                                d         }t          j        |                                          d         }t          j        |                                          d         }||k     sJ t           j                            ddd          }t          ||dd          }|                                d         }t          j        |                                          d         }t          j        |                                          d         }||k     sJ t           j                            ddd          }t          ||dd          }|                                d         }t          j        |                                          d         }t          j        |                                          d         }||k     sJ d S )	Nr;  r   )r   g{Gz?r  r  r   )i  )r   r   r    r	   r   diffget_ylimget_xlim)	r5   xxxyr   r   y_rangex_rangexx_longxy_longs	            r+   test_axis_orderr    s   			"a	(	(B			!T6	*	*B
"b#s
+
+C		Bgbkkmm$$Q'Ggbkkmm$$Q'GWir1g..G
'2sC
0
0C		Bgbkkmm$$Q'Ggbkkmm$$Q'GWiq$00G
"gsC
0
0C		Bgbkkmm$$Q'Ggbkkmm$$Q'GWr7   )*numpyr   numpy.testingr   r  r   rq   scipyr   statsmodels.apiapir   statsmodels.graphicsr   statsmodels.graphics.gofplotsr   r   r   r	   statsmodels.graphics.utilsr
   r   rv   r   r   r   r   r   r   r   r   rr   rs   r  r  r  r7  rv  r  parametrizer  r  r2   r7   r+   <module>r     sC             & & & & & &              ) ) ) ) ) )            3 2 2 2 2 2\? \? \? \? \? \? \? \?~
 
 
 
 
0 
 
 

 
 
 
 
!2 
 
 
D D D D D&7 D D DD D D D D&7 D D DP P P P P'8 P P P:, , , , , , , ,$- - - - -+< - - -*%C %C %C %C %C %C %C %CP= = = C C CB	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/JK JK JK JK JK JK JK JKZj
 j
 j
 j
 j
 j
 j
 j
Z       D* * *8 B3#(F(F#GHHB8,,B8,,!<!<!<==" " >= -, -, IH 
"8     r7   