
    M/Ph3V              	          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 d dlmZmZmZmZ d dlmZ  G d d	          Zej                            ed
           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 d0          d1                                                             Z+ej        j#        d2             Z,dS )3    N)assert_equal)stats)PYTHON_IMPL_WASM)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        ej                            ed
          d                                     Zej        j        d             Zej        j        d             Zej                            d	          ej        j        ej                            ed
          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     h/var/www/html/test/jupyter/venv/lib/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   r2   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 )Nr1   r"   ppplotr   r2   r5   s     r,   test_ppplotzBaseProbplotMixin.test_ppplot(   s'    dgDI66666r8   c                 N     | j         j        d| j        | j        d| j         d S r0   r"   probplotr   r2   r(   r5   s     r,   test_probplotzBaseProbplotMixin.test_probplot,   s1    MdiMM4;LMMMMMr8   c                 P     | j         j        d| j        d| j        d| j         d S )NT)r   exceedr2   r3   r>   r5   s     r,   test_probplot_exceedz&BaseProbplotMixin.test_probplot_exceed0   sE     	
wt$)	
 	
7;7H	
 	
 	
 	
 	
r8   c                 Z     | j         j        d| j        | j        | j        d| j         d S N)r   r2   otherr3   )r"   r	   r   r2   r%   r(   r5   s     r,   test_qqplot_other_arrayz)BaseProbplotMixin.test_qqplot_other_array6   L     	
w"	
 	
 		
 	
 	
 	
 	
r8   c                 Z     | j         j        d| j        | j        | j        d| j         d S rE   )r"   r;   r   r2   r%   r(   r5   s     r,   test_ppplot_other_arrayz)BaseProbplotMixin.test_ppplot_other_array?   rH   r8   T)strict1Matplotlib uses different backend in WASM/Pyodidereasonc                 Z     | j         j        d| j        | j        | j        d| j         d S rE   )r"   r?   r   r2   r%   r(   r5   s     r,   test_probplot_other_arrayz+BaseProbplotMixin.test_probplot_other_arrayH   sN     	 	
w"	
 	
 		
 	
 	
 	
 	
r8   c                 Z     | j         j        d| j        | j        | j        d| j         d S rE   )r"   r	   r   r2   r&   r(   r5   s     r,   test_qqplot_other_prbpltz*BaseProbplotMixin.test_qqplot_other_prbpltV   L     	
w$	
 	
 		
 	
 	
 	
 	
r8   c                 Z     | j         j        d| j        | j        | j        d| j         d S rE   )r"   r;   r   r2   r&   r(   r5   s     r,   test_ppplot_other_prbpltz*BaseProbplotMixin.test_ppplot_other_prbplt_   rS   r8   c                 Z     | j         j        d| j        | j        | j        d| j         d S rE   )r"   r?   r   r2   r&   r(   r5   s     r,   test_probplot_other_prbpltz,BaseProbplotMixin.test_probplot_other_prbplth   sN     	 	
w$	
 	
 		
 	
 	
 	
 	
r8   c                 R     | j         j        d| j        | j        ddd| j         d S NzCustom X-LabelzCustom Y-Label)r   r2   xlabelylabelr3   r4   r5   s     r,   test_qqplot_custom_labelsz+BaseProbplotMixin.test_qqplot_custom_labelsv   L     	
w##		
 	

 	
 	
 	
 	
 	
r8   c                 R     | j         j        d| j        | j        ddd| j         d S rY   )r"   r;   r   r2   r(   r5   s     r,   test_ppplot_custom_labelsz+BaseProbplotMixin.test_ppplot_custom_labels   r]   r8   c                 R     | j         j        d| j        | j        ddd| j         d S rY   r>   r5   s     r,   test_probplot_custom_labelsz-BaseProbplotMixin.test_probplot_custom_labels   sL     	
w##		
 	

 	
 	
 	
 	
 	
r8   c                 Z    | j                             | j        | j        dddd           d S Nr   r   r   r   )r   r2   r   r   r   r   )r"   r	   r   r2   r5   s     r,   test_qqplot_pltkwargsz'BaseProbplotMixin.test_qqplot_pltkwargs   A    w,# 	 	
 	
 	
 	
 	
r8   c                 Z    | j                             | j        | j        dddd           d S rc   r:   r5   s     r,   test_ppplot_pltkwargsz'BaseProbplotMixin.test_ppplot_pltkwargs   re   r8   c                 Z    | j                             | j        | j        dddd           d S rc   )r"   r?   r   r2   r5   s     r,   test_probplot_pltkwargsz)BaseProbplotMixin.test_probplot_pltkwargs   sA    w,# 	 	
 	
 	
 	
 	
r8   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[->>>>>>>r8   N)__name__
__module____qualname__r-   pytestmark
matplotlibr7   r<   r@   rC   rG   rJ   xfailskipifr   rP   rR   rU   rW   r\   r_   ra   rd   rg   ri   rq   r3   r8   r,   r   r      s       
 
 
  [L L L [7 7 7 [N N N [
 
 

 [
 
 
 [
 
 
 [d##[[B   
 
	   $#
 [
 
 
 [
 
 
 [d##[[B   
 
	   $#
 [
 
 
 [
 
 
 [
 
 
 [
 
 
 [
 
 
 [
 
 
? ? ? ? ?r8   r   rL   rM   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"   r2   superr-   r*   	__class__s    r,   r-   z%TestProbPlotLongelyNoFit.setup_method   s    
	qK',,..	GGG	vdioty~>>BBDDLUWt
 
 
 	r8   rr   rs   rt   r-   __classcell__r   s   @r,   r{   r{      s8        
	 	 	 	 	 	 	 	 	r8   r{   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 )Nr}   Fr~   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
 
 
 	r8   r   r   s   @r,   r   r      s8        	 	 	 	 	 	 	 	 	r8   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                      	                                 d S )Nr}         @      
@%   rn   ro   r   
r   r    r   r!   r#   r   r"   r2   r   r-   r   s    r,   r-   z,TestProbPlotRandomNormalMinimal.setup_method   si    
	qI$$T$CC	ty))	r8   r   r   s   @r,   r   r      8                r8   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                      	                                 d S )	Nr}   r   r   r   r   T)r   qr   r   s    r,   r-   z,TestProbPlotRandomNormalWithFit.setup_method   sn    
	qI$$T$CC	tyd333	r8   r   r   s   @r,   r   r      r   r8   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 )Nr}   r   r   r   r         !@      @rn   ro   r   45)r   r    r   r!   r#   r   r   normr"   r2   r   r-   r   s    r,   r-   z-TestProbPlotRandomNormalFullDist.setup_method   s}    
	qI$$T$CC	tyuzc/M/M/MNNN	r8   c                 *    | j         j        dk    sJ d S )Nr   r"   rn   rp   s    r,   test_loc_setz-TestProbPlotRandomNormalFullDist.test_loc_set   s    {#%%%%%%r8   c                 *    | j         j        dk    sJ d S )Nr   r"   ro   rp   s    r,   test_scale_setz/TestProbPlotRandomNormalFullDist.test_scale_set   s    { C''''''r8   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   rn   )r   ro   )ru   raises
ValueErrorr   r#   r   r   rp   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+)rr   rs   rt   r-   r   r   r   r   r   s   @r,   r   r      sl            & & &( ( (P P P P P P Pr8   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 )Nr}   r   r   r   r   7   )r   r    r   r   r!   data1data2rp   s    r,   r-   z,TestCompareSamplesDifferentSize.setup_method  sf    
	qbi..4t".MMNN
bi..4t".MMNN


r8   c                     | j                             | j                   t          j        t
                    5  | j                            | j                    d d d            d S # 1 swxY w Y   d S N)rF   )r   r	   r   ru   r   r   r5   s     r,   r7   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   r5   s     r,   r<   z+TestCompareSamplesDifferentSize.test_ppplot  s>    

+++

+++++r8   N)	rr   rs   rt   r-   ru   rv   rw   r7   r<   r3   r8   r,   r   r     sh        O O O
 [0 0 0
 [, , , , ,r8   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                      	                                 d S )
Nr}   r   r   r   r         r   r   r   r   s    r,   r-   z1TestProbPlotRandomNormalLocScaleDist.setup_method  sp    
	qI$$T$CC	tyaq999	r8   c                 *    | j         j        dk    sJ d S )Nr   r   rp   s    r,   r   z1TestProbPlotRandomNormalLocScaleDist.test_loc_set!  s    {!######r8   c                 *    | j         j        dk    sJ d S )Nr   r   rp   s    r,   r   z3TestProbPlotRandomNormalLocScaleDist.test_scale_set$  s    { A%%%%%%r8   c                 N    | j         j                                        dk    sJ d S )Ng       @)r"   r   meanrp   s    r,   test_loc_set_in_distz9TestProbPlotRandomNormalLocScaleDist.test_loc_set_in_dist'  s*    {$$&&#------r8   c                 N    | j         j                                        dk    sJ d S )Ng      "@)r"   r   varrp   s    r,   test_scale_set_in_distz;TestProbPlotRandomNormalLocScaleDist.test_scale_set_in_dist*  s*    {##%%,,,,,,r8   )	rr   rs   rt   r-   r   r   r   r   r   r   s   @r,   r   r     st            $ $ $& & &. . .- - - - - - -r8   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 )NFr~   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&   rp   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r8   c                 2    t          | j        d           d S Nr   r2   r	   r   r5   s     r,   r7   zTestTopLevel.test_qqplot8      txc""""""r8   c                 :    t          | j        ddddd           d S )Nr   r   r   r   r   )r2   r   r   r   r   r   r5   s     r,   rd   z"TestTopLevel.test_qqplot_pltkwargs<  s7    H,#	
 	
 	
 	
 	
 	
r8   c                 H    dD ]}t          | j        | j        |           d S N)r   r   r   sr   r
   r"   r&   r*   r6   r2   s      r,   &test_qqplot_2samples_prob_plot_objectsz3TestTopLevel.test_qqplot_2samples_prob_plot_objectsG  >     * 	H 	HDDK);$GGGGG	H 	Hr8   c                 H    dD ]}t          | j        | j        |           d S r   r
   r   r%   r   s      r,   test_qqplot_2samples_arraysz(TestTopLevel.test_qqplot_2samples_arraysN  >     * 	C 	CDDHd&6TBBBBB	C 	Cr8   N)rr   rs   rt   r-   ru   rv   rw   r7   rd   r   r   r3   r8   r,   r   r   .  s        8 8 8 [# # # [
 
 
 [H H H [C C C C Cr8   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 )Nr}   Fr~   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   ru   r   	TypeErrorr   r   r   r   )r6   r#   r   s      r,   test_invalid_dist_configr   V  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   r5   s     r,   r7   z(test_qqplot_unequal.<locals>.test_qqploto  r   r8   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_objs  r   r8   c                 H    dD ]}t          | j        | j        |           d S r   r   r   s      r,   r   z8test_qqplot_unequal.<locals>.test_qqplot_2samples_arraysz  r   r8   )r   r    RandomStatestandard_normalr
   get_axesget_childrenget_datatestingassert_allcloselenru   rv   rw   )rsr   r   fig1fig2x1y1x2y2numobj1numobj2r7   r   r   s                 r,   test_qqplot_unequalr  `  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r8   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   rp   s    r,   	test_goodzTestCheckDist.test_good  s2    EJ...EJ.....r8   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  )ru   r   AttributeErrorr   r  rp   s    r,   test_badzTestCheckDist.test_bad  s   ]>** 	/ 	/...	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/]>** 	/ 	/...	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/s!   <A A  BB
BN)rr   rs   rt   r  r  r3   r8   r,   r  r    s2        / / // / / / /r8   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*   r6   r+   r   r   s        r,   test_baselinezTestDoPlot.test_baseline  s    mm#DFDF33R#sz*****"ch'''''xs""""wb      r8   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"}}}}}}r8   c                 Z    t          j        | j        | j        f| j        dd| j         d S )NFr   stepr   r#  r  r  r   r   r5   s     r,   test_plot_full_optionsz!TestDoPlot.test_plot_full_options  sL    FF	
 w		
 	

 	
 	
 	
 	
 	
r8   c                 Z    t          j        | j        | j        f| j        dd| j         d S NTr,  )r   r#  r  r  r   r!  r5   s     r,   test_step_baselinezTestDoPlot.test_step_baseline  L    FF	
 w		
 	

 	
 	
 	
 	
 	
r8   c                 Z    t          j        | j        | j        f| j        dd| j         d S r1  r.  r5   s     r,   test_step_full_optionsz!TestDoPlot.test_step_full_options  r3  r8   c                 T    t          j        | j        | j        | j        d           d S )Nr   r1   r   r#  r  r  r   r5   s     r,   test_plot_qq_linezTestDoPlot.test_plot_qq_line  s(    $&$&TW3??????r8   c                 V    t          j        | j        | j        | j        dd           d S )NTr   )r   r-  r2   r7  r5   s     r,   test_step_qq_linezTestDoPlot.test_step_qq_line  s*    $&$&TW4cJJJJJJr8   N)rr   rs   rt   r-   ru   rv   rw   r(  r*  r/  r2  r5  r8  r:  r3   r8   r,   r  r    s       ? ? ?& [! ! ! [   [
 
 
 [
 
 
 [
 
 
 [@ @ @ [K K K K Kr8   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  ru   r   r   r   r   rp   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  )ru   r   r   r   r   r  r5   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  )ru   r   r   r   r   r  r5   s     r,   test_non45_no_yzTestQQLine.test_non45_no_y  rO  rP  c                     t          j        t                    5  t          | j        d           d d d            d S # 1 swxY w Y   d S )Nr   rJ  r5   s     r,   test_non45_no_x_no_yzTestQQLine.test_non45_no_x_no_y  s    ]:&& 	! 	!47C   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!rL  c                     t          | j                                                  }t          | j        d           t          | j                                                  |k    sJ d S )Nr   )r   r   r   r   r*   r6   	nchildrens      r,   test_45zTestQQLine.test_45  s\    ,,..//	tw47''))**Y666666r8   c                 >    t          | j        d| j                   d S )Nr   )rH  )r   r   rH  r5   s     r,   test_45_fmtzTestQQLine.test_45_fmt	  s!    tw$(++++++r8   c                 D    t          | j        dfd| j        i| j         d S )Nr   rH  )r   r   rH  rG  r5   s     r,   test_45_fmt_lineoptionsz"TestQQLine.test_45_fmt_lineoptions  s,    tw??$(?d.>?????r8   c                     t          | j                                                  }t          | j        d| j        | j                   t          | j                                                  |k    sJ d S )Nr   r  r  r   r   r   r   r  r  rV  s      r,   test_rzTestQQLine.test_r  g    ,,..//	twtv000047''))**Y666666r8   c                 V    t          | j        d| j        | j        | j                   d S Nr   r  r  rH  r   r   r  r  rH  r5   s     r,   
test_r_fmtzTestQQLine.test_r_fmt  )    twtvTX>>>>>>r8   c                 \    t          | j        df| j        | j        | j        d| j         d S rc  r   r   r  r  rH  rG  r5   s     r,   test_r_fmt_lineoptionsz!TestQQLine.test_r_fmt_lineoptions  G    GS	
 Fdf$(	
 	
>B>N	
 	
 	
 	
 	
r8   c                     t          | j                                                  }t          | j        d| j        | j                   t          | j                                                  |k    sJ d S )Nr   r^  r_  rV  s      r,   test_szTestQQLine.test_s!  ra  r8   c                 V    t          | j        d| j        | j        | j                   d S Nr   rd  re  r5   s     r,   
test_s_fmtzTestQQLine.test_s_fmt'  rg  r8   c                 \    t          | j        df| j        | j        | j        d| j         d S ro  ri  r5   s     r,   test_s_fmt_lineoptionsz!TestQQLine.test_s_fmt_lineoptions+  rk  r8   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  rV  s      r,   test_qzTestQQLine.test_q1  sk    ,,..//	tw%*$&AAAA47''))**Y666666r8   c                 l    t          | j        dt          j        | j        | j        | j                   d S Nr   )r   r  r  rH  )r   r   r   r   r  r  rH  r5   s     r,   
test_q_fmtzTestQQLine.test_q_fmt7  s-    tw%*$&dhOOOOOOr8   c                 r    t          | j        dft          j        | j        | j        | j        d| j         d S rv  )r   r   r   r   r  r  rH  rG  r5   s     r,   test_q_fmt_lineoptionsz!TestQQLine.test_q_fmt_lineoptions;  sS    G	
 ff	
 	
 	
 	
 	
 	
 	
r8   N)rr   rs   rt   r-   ru   rv   rw   rK  rN  rR  rT  rX  rZ  r\  r`  rf  rj  rm  rp  rr  rt  rw  ry  r3   r8   r,   r<  r<    s9         & [$ $ $ [+ + + [+ + + [! ! ! [7 7 7
 [, , , [@ @ @ [7 7 7
 [? ? ? [
 
 

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

 [7 7 7
 [P P P [	
 	
 	
 	
 	
r8   r<  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#   rp   s    r,   r-   z!TestPlottingPosition.setup_methodI  s     Idf%%			r8   c                     t          j        | j        ||          }t          j                            | j        ||          }t          j        ||d           d S )Nab)r   betar}   )decimal)	r   plotting_posr~  r   mstatsplotting_positionsr#   nptestassert_array_almost_equal)r*   r   r  smppsppps        r,   do_testzTestPlottingPosition.do_testM  s`    $TVu===|..IU / 
 
 	(tQ??????r8   c                 2    |                      dd           d S )Nr   r  r5   s     r,   test_weibullz!TestPlottingPosition.test_weibullU      Qr8   c                 2    |                      dd           d S )Nr   r   r  r5   s     r,   test_lininterpz#TestPlottingPosition.test_lininterpY  r  r8   c                 2    |                      dd           d S )Nr   r  r5   s     r,   test_piecewisez#TestPlottingPosition.test_piecewise]      S#r8   c                 2    |                      dd           d S )NgUUUUUU?r  r5   s     r,   test_approx_med_unbiasedz-TestPlottingPosition.test_approx_med_unbiaseda  s    Y	*****r8   c                 2    |                      dd           d S )Ng?r  r5   s     r,   test_cunnanez!TestPlottingPosition.test_cunnanee  r  r8   N)rr   rs   rt   r-   r  ru   rv   rw   r  r  r  r  r  r3   r8   r,   r{  r{  H  s        & & &@ @ @ [   [   [   [+ + + [    r8   r{  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  rn   )r  r   r   r}   r}   )ro   r   )r  rn   ro   )r  r  rn   ro   )r   arrayr   emptyr   r  r   rm   )expectedpps     r,   test_param_unpackingr  j  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)))))r8   labelsXY)rZ   r[   x_size   2   y_sizer2   )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   r2   2nd1str  r  )r   r    r   r!   
standard_tr   r   r
   r   
get_xlabel
get_ylabel)r6   reset_randomstater2   r  r  r  r   r  r  pp_xpp_yr   r   x_labely_labels                  r,   test_correct_labelsr    sL    
		w	'	'B
		as	00A
af%%A;q>>D;q>>D
$
:
:4
:6
:
:C		BmmooGmmooG 	"G####G######'>>>>'>>>>>> 	"G####G######'>>>>'>>>>>>r8   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)	r6   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r8   )-numpyr   numpy.testingr   r  r   ru   scipyr   statsmodels.apiapir   statsmodels.compat.pythonr   statsmodels.graphicsr   statsmodels.graphics.gofplotsr   r   r	   r
   statsmodels.graphics.utilsr   r   rv   ry   r{   r   r   r   r   r   r   r   r   rw   r  r  r  r<  r{  r  parametrizer  r  r3   r8   r,   <module>r     sq             & & & & & &              6 6 6 6 6 6 ) ) ) ) ) )            3 2 2 2 2 2d? d? d? d? d? d? d? d?N >   
 
 
 
 
0 
 
	 

 
 
 
 
!2 
 
 
    &7       &7   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     r8   