
    g3V              	          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j0                  j3                  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j0                  jF                  d        Z$ G d d      Z% G d  d!      Z& G d" d#      Z' G d$ d%      Z(d& Z)ej0                  jF                  ej0                  jU                  d'i d(d)d*g      ej0                  jU                  d+d,d-g      ej0                  jU                  d.d,d-g      ej0                  jU                  d/g d0      d1                                    Z+ej0                  jF                  d2        Z,y)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
                  j                  d	      ej
                  j                  ej
                  j                  ed
      d                      Zej
                  j                  d        Zej
                  j                  d        Zej
                  j                  d	      ej
                  j                  ej
                  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y)BaseProbplotMixinc                 L   	 dd l m} |j                         \  | _        | _        t        j                  j                  | j                  j                  j                        | _        t        | j                        | _        t        dddd      | _        y # t
        $ r Y }w xY w)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     [/var/www/html/venv/lib/python3.12/site-packages/statsmodels/graphics/tests/test_gofplots.pysetup_methodzBaseProbplotMixin.setup_method   s    	+ #DHdg 99++1A1A1G1G+H%d&6&67 ,#	
	  		s   #B 	B#"B#c                 ~     | j                   j                  d| j                  | j                  d| j                   y Nr   line r"   r	   r   r1   r(   r*   close_figuress     r,   test_qqplotzBaseProbplotMixin.test_qqplot$   s.    KdggDIIK9J9JK    c                 f    | j                   j                  | j                  | j                         y )Nr0   r"   ppplotr   r1   r4   s     r,   test_ppplotzBaseProbplotMixin.test_ppplot(   s!    dggDII6r7   c                 ~     | j                   j                  d| j                  | j                  d| j                   y r/   r"   probplotr   r1   r(   r4   s     r,   test_probplotzBaseProbplotMixin.test_probplot,   s.    MdiiM4;L;LMr7   c                      | j                   j                  d| j                  d| j                  d| j                   y )NT)r   exceedr1   r2   r=   r4   s     r,   test_probplot_exceedz&BaseProbplotMixin.test_probplot_exceed0   s8     	
wwt$))	
7;7H7H	
r7   c                      | j                   j                  d| j                  | j                  | j                  d| j
                   y N)r   r1   otherr2   )r"   r	   r   r1   r%   r(   r4   s     r,   test_qqplot_other_arrayz)BaseProbplotMixin.test_qqplot_other_array6   B     	
ww""	
 		
r7   c                      | j                   j                  d| j                  | j                  | j                  d| j
                   y rD   )r"   r:   r   r1   r%   r(   r4   s     r,   test_ppplot_other_arrayz)BaseProbplotMixin.test_ppplot_other_array?   rG   r7   T)strict1Matplotlib uses different backend in WASM/Pyodidereasonc                      | j                   j                  d| j                  | j                  | j                  d| j
                   y rD   )r"   r>   r   r1   r%   r(   r4   s     r,   test_probplot_other_arrayz+BaseProbplotMixin.test_probplot_other_arrayH   sD     	 	
ww""	
 		
r7   c                      | j                   j                  d| j                  | j                  | j                  d| j
                   y rD   )r"   r	   r   r1   r&   r(   r4   s     r,   test_qqplot_other_prbpltz*BaseProbplotMixin.test_qqplot_other_prbpltV   B     	
ww$$	
 		
r7   c                      | j                   j                  d| j                  | j                  | j                  d| j
                   y rD   )r"   r:   r   r1   r&   r(   r4   s     r,   test_ppplot_other_prbpltz*BaseProbplotMixin.test_ppplot_other_prbplt_   rR   r7   c                      | j                   j                  d| j                  | j                  | j                  d| j
                   y rD   )r"   r>   r   r1   r&   r(   r4   s     r,   test_probplot_other_prbpltz,BaseProbplotMixin.test_probplot_other_prbplth   sD     	 	
ww$$	
 		
r7   c                      | j                   j                  d| j                  | j                  ddd| j                   y NzCustom X-LabelzCustom Y-Label)r   r1   xlabelylabelr2   r3   r4   s     r,   test_qqplot_custom_labelsz+BaseProbplotMixin.test_qqplot_custom_labelsv   ?     	
ww##		

 	
r7   c                      | j                   j                  d| j                  | j                  ddd| j                   y rX   )r"   r:   r   r1   r(   r4   s     r,   test_ppplot_custom_labelsz+BaseProbplotMixin.test_ppplot_custom_labels   r\   r7   c                      | j                   j                  d| j                  | j                  ddd| j                   y rX   r=   r4   s     r,   test_probplot_custom_labelsz-BaseProbplotMixin.test_probplot_custom_labels   s?     	
ww##		

 	
r7   c                 n    | j                   j                  | j                  | j                  dddd       y Nr   r   r   r   )r   r1   r   r   r   r   )r"   r	   r   r1   r4   s     r,   test_qqplot_pltkwargsz'BaseProbplotMixin.test_qqplot_pltkwargs   3    ww,# 	 	
r7   c                 n    | j                   j                  | j                  | j                  dddd       y rb   r9   r4   s     r,   test_ppplot_pltkwargsz'BaseProbplotMixin.test_ppplot_pltkwargs   rd   r7   c                 n    | j                   j                  | j                  | j                  dddd       y rb   )r"   r>   r   r1   r4   s     r,   test_probplot_pltkwargsz)BaseProbplotMixin.test_probplot_pltkwargs   s3    ww,# 	 	
r7   c                     | j                   j                  d   | j                   j                  k(  sJ | j                   j                  d   | j                   j                  k(  sJ y )N)r"   
fit_paramslocscaler*   s    r,   test_fit_paramsz!BaseProbplotMixin.test_fit_params   sN    {{%%b)T[[__<<<{{%%b)T[[->->>>>r7   N)__name__
__module____qualname__r-   pytestmark
matplotlibr6   r;   r?   rB   rF   rI   xfailskipifr   rO   rQ   rT   rV   r[   r^   r`   rc   rf   rh   rp   r2   r7   r,   r   r      sh   
  [[L L [[7 7 [[N N [[
 

 [[
 
 [[
 
 [[d#[[[[B  
	  $
 [[
 
 [[
 
 [[d#[[[[B  
	  $
 [[
 
 [[
 
 [[
 
 [[
 
 [[
 
 [[
 
?r7   r   rK   rL   c                        e Zd Z fdZ xZS )TestProbPlotLongelyNoFitc                 J   t         j                  j                  d       t        j                  j
                  j                         | _        t        j                  | j                  j                  d      | j                  _	        t        j                  | j                  j                  | j                  j                        j                         | _        t        | j                  j                  t         j"                  dd      | _        d| _        t(        | U          y )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KK'',,.	G		vvdiiootyy~~>BBDLLUWWt
 	r7   rq   rr   rs   r-   __classcell__r   s   @r,   rz   rz      s    
	 	r7   rz   c                        e Zd Z fdZ xZS )TestProbPlotLongelyWithFitc                 J   t         j                  j                  d       t        j                  j
                  j                         | _        t        j                  | j                  j                  d      | j                  _	        t        j                  | j                  j                  | j                  j                        j                         | _        t        | j                  j                  t         j"                  dd      | _        d| _        t(        | U          y )Nr|   Fr}   r   Tr   r   r   r   s    r,   r-   z'TestProbPlotLongelyWithFit.setup_method   s    
		qKK'',,.	G		vvdiiootyy~~>BBDLLUWWt
 	r7   r   r   s   @r,   r   r      s    	 	r7   r   c                        e Zd Z fdZ xZS )TestProbPlotRandomNormalMinimalc                     t         j                  j                  d       t         j                  j                  ddd      | _        t        | j                        | _        d | _        t        | %          y )Nr|         @      
@%   rm   rn   r   
r   r    r   r!   r#   r   r"   r1   r   r-   r   s    r,   r-   z,TestProbPlotRandomNormalMinimal.setup_method   sR    
		qII$$T$C	tyy)	r7   r   r   s   @r,   r   r           r7   r   c                        e Zd Z fdZ xZS )TestProbPlotRandomNormalWithFitc                     t         j                  j                  d       t         j                  j                  ddd      | _        t        | j                  d      | _        d| _        t        | %          y )	Nr|   r   r   r   r   T)r   qr   r   s    r,   r-   z,TestProbPlotRandomNormalWithFit.setup_method   sT    
		qII$$T$C	tyyd3	r7   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                  j                  d       t         j                  j                  ddd      | _        t        | j                  t        j                  dd      	      | _        d
| _	        t        | -          y )Nr|   r   r   r   r         !@      @rm   rn   r   45)r   r    r   r!   r#   r   r   normr"   r1   r   r-   r   s    r,   r-   z-TestProbPlotRandomNormalFullDist.setup_method   s_    
		qII$$T$C	tyyuzzc/MN	r7   c                 :    | j                   j                  dk(  sJ y )Nr   r"   rm   ro   s    r,   test_loc_setz-TestProbPlotRandomNormalFullDist.test_loc_set   s    {{#%%%r7   c                 :    | j                   j                  dk(  sJ y )Nr   r"   rn   ro   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        t        j                  t              5  t        | j                  t        j                  dd      d       d d d        t        j                  t              5  t        | j                  t        j                  dd      d       d d d        t        j                  t              5  t        | j                  t        j                  dd      d	       d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   qxY w# 1 sw Y   y xY w)
Nr   r   r   T)r   r   )r   r   r   r   )r   rm   )r   rn   )rt   raises
ValueErrorr   r#   r   r   ro   s    r,   test_exceptionsz0TestProbPlotRandomNormalFullDist.test_exceptions   s   ]]:& 	OTYYUZZCs%CN	O]]:& 			ZZCs3#	 ]]:& 	NTYYUZZCs%CM	N]]:& 	PTYYUZZCs%C3O	P 	P	O 	O	 		N 	N	P 	Ps/   .D>).E
8.E.E">E
EE"E+)rq   rr   rs   r-   r   r   r   r   r   s   @r,   r   r      s    &(Pr7   r   c                       e Zd Zd Zej
                  j                  d        Zej
                  j                  d        Zy)TestCompareSamplesDifferentSizec                    t         j                  j                  d       t        t         j                  j	                  ddd            | _        t        t         j                  j	                  ddd            | _        y )Nr|   r   r   r   r   7   )r   r    r   r   r!   data1data2ro   s    r,   r-   z,TestCompareSamplesDifferentSize.setup_method  sV    
		qbii..4t".MN
bii..4t".MN
r7   c                     | j                   j                  | j                         t        j                  t
              5  | j                  j                  | j                          d d d        y # 1 sw Y   y xY wN)rE   )r   r	   r   rt   r   r   r4   s     r,   r6   z+TestCompareSamplesDifferentSize.test_qqplot  sU    



+]]:& 	0JJDJJ/	0 	0 	0s    'A00A9c                     | j                   j                  | j                         | j                  j                  | j                          y r   )r   r:   r   r4   s     r,   r;   z+TestCompareSamplesDifferentSize.test_ppplot  s4    



+



+r7   N)	rq   rr   rs   r-   rt   ru   rv   r6   r;   r2   r7   r,   r   r     sD    O
 [[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                  j                  d       t         j                  j                  ddd      | _        t        | j                  dd      | _        d	| _        t        | %          y )
Nr|   r   r   r   r         r   r   r   r   s    r,   r-   z1TestProbPlotRandomNormalLocScaleDist.setup_method  sV    
		qII$$T$C	tyyaq9	r7   c                 :    | j                   j                  dk(  sJ y )Nr   r   ro   s    r,   r   z1TestProbPlotRandomNormalLocScaleDist.test_loc_set!  s    {{!###r7   c                 :    | j                   j                  dk(  sJ y )Nr   r   ro   s    r,   r   z3TestProbPlotRandomNormalLocScaleDist.test_scale_set$  s    {{  A%%%r7   c                 V    | j                   j                  j                         dk(  sJ y )Ng       @)r"   r   meanro   s    r,   test_loc_set_in_distz9TestProbPlotRandomNormalLocScaleDist.test_loc_set_in_dist'  s#    {{$$&#---r7   c                 V    | j                   j                  j                         dk(  sJ y )Ng      "@)r"   r   varro   s    r,   test_scale_set_in_distz;TestProbPlotRandomNormalLocScaleDist.test_scale_set_in_dist*  s#    {{##%,,,r7   )	rq   rr   rs   r-   r   r   r   r   r   r   s   @r,   r   r     s    $&.-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
y)TestTopLevelc                    t         j                  j                  j                         | _        t        j
                  | j                  j                  d      | j                  _        t        j                  | j                  j                  | j                  j                        j                         | _
        | j                  j                  | _        t        | j                  j                  t        j                  d      | _        t"        j$                  j'                  | j                   j                  j(                        | _        t        | j*                        | _        y )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&   ro   s    r,   r-   zTestTopLevel.setup_method/  s    KK'',,.	G		vvdiiootyy~~>BBD<<%%t||11$O99++1A1A1G1G+H%d&6&67r7   c                 2    t        | j                  d       y Nr   r1   r	   r   r4   s     r,   r6   zTestTopLevel.test_qqplot8      txxc"r7   c                 :    t        | j                  ddddd       y )Nr   r   r   r   r   )r1   r   r   r   r   r   r4   s     r,   rc   z"TestTopLevel.test_qqplot_pltkwargs<  s     HH,#	
r7   c                 V    dD ]$  }t        | j                  | j                  |       & y N)r   r   r   sr   r
   r"   r&   r*   r5   r1   s      r,   &test_qqplot_2samples_prob_plot_objectsz3TestTopLevel.test_qqplot_2samples_prob_plot_objectsG  +     * 	HDDKK););$G	Hr7   c                 V    dD ]$  }t        | j                  | j                  |       & y r   r
   r   r%   r   s      r,   test_qqplot_2samples_arraysz(TestTopLevel.test_qqplot_2samples_arraysN  +     * 	CDDHHd&6&6TB	Cr7   N)rq   rr   rs   r-   rt   ru   rv   r6   rc   r   r   r2   r7   r,   r   r   .  s    8 [[# # [[
 
 [[H H [[C Cr7   r   c                    t         j                  j                  d       t        j                  j
                  j                         }t        j                  |j                  d      |_        t        j                  |j                  |j                        j                         }t        j                  t        d      5  t        |j                   t"        j$                  d       d d d        y # 1 sw Y   y xY w)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   rt   r   	TypeErrorr   r   r   r   )r5   r#   r   s      r,   test_invalid_dist_configr   V  s    IINN1;;##%D		59DIffTZZ+//1G	y(J	K =)<= = =s   'C11C:c                     t         j                  j                  d      } | j                  d      }| j                  d      }t	        ||      }t	        ||      }|j                         d   j                         d   j                         \  }}|j                         d   j                         d   j                         \  }}t         j                  j                  ||       t         j                  j                  ||       t        |j                         d   j                               }	t        |j                         d   j                               }
|	|
k(  sJ t        j                  j                  d        }t        j                  j                  d        }t        j                  j                  d        }y )Nr   d      c                 2    t        | j                  d       y r   r   r4   s     r,   r6   z(test_qqplot_unequal.<locals>.test_qqploto  r   r7   c                 V    dD ]$  }t        | j                  | j                  |       & y r   r   r   s      r,   "test_qqplot_2samples_prob_plot_objz?test_qqplot_unequal.<locals>.test_qqplot_2samples_prob_plot_objs  r   r7   c                 V    dD ]$  }t        | j                  | j                  |       & y r   r   r   s      r,   r   z8test_qqplot_unequal.<locals>.test_qqplot_2samples_arraysz  r   r7   )r   r    RandomStatestandard_normalr
   get_axesget_childrenget_datatestingassert_allcloselenrt   ru   rv   )rsr   r   fig1fig2x1y1x2y2numobj1numobj2r6   r   r   s                 r,   test_qqplot_unequalr  `  sr   			q	!Bs#Es#E5%(D5%(D]]_Q,,.q1::<FB]]_Q,,.q1::<FBJJr2&JJr2&$--/!$1134G$--/!$1134Gg[[# # [[H H [[C Cr7   c                       e Zd Zd Zd Zy)TestCheckDistc                     t        j                  t        j                  d       t        j                  t        j                  d       y )Nppfcdf)r   
_check_forr   r   ro   s    r,   	test_goodzTestCheckDist.test_good  s*    EJJ.EJJ.r7   c                    t        j                  t              5  t        j                  dd       d d d        t        j                  t              5  t        j                  dd       d d d        y # 1 sw Y   BxY w# 1 sw Y   y xY w)Njunkr	  r
  )rt   r   AttributeErrorr   r  ro   s    r,   test_badzTestCheckDist.test_bad  si    ]]>* 	/.	/]]>* 	/.	/ 	/	/ 	/	/ 	/s   A2A>2A;>BN)rq   rr   rs   r  r  r2   r7   r,   r  r    s    //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y	)

TestDoPlotc                     	 dd l m} |j                         \  | _        | _        g d| _        g d| _        dddddd	| _        d
dd| _	        y # t
        $ r Y 5w xY w)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  sk    	+ #DHdg D>/*#
 +.>  		s   #A 	AAc                    t               }t        j                  | j                  | j                        \  }}t        ||j                        sJ t        ||j                        sJ | j                  |usJ | j                  |usJ y )N)
r   r   _do_plotr  r  
isinstanceFigureAxesr   r   r*   r5   r+   r   r   s        r,   test_baselinezTestDoPlot.test_baseline  ss    m##DFFDFF3R#szz***"chh'''xxs"""wwb   r7   c                 *   t               }t        j                  | j                  | j                  | j
                        \  }}t        ||j                        sJ t        ||j                        sJ | j                  |u sJ | j
                  |u sJ y )N)r   )
r   r   r"  r  r  r   r#  r$  r%  r   r&  s        r,   test_with_axzTestDoPlot.test_with_ax  su    m##DFFDFFtww?R#szz***"chh'''xx3ww"}}r7   c                     t        j                  | j                  | j                  f| j                  dd| j
                   y )NFr   stepr   r"  r  r  r   r  r4   s     r,   test_plot_full_optionsz!TestDoPlot.test_plot_full_options  s?    FFFF	
 ww		

 	
r7   c                     t        j                  | j                  | j                  f| j                  dd| j
                   y NTr+  )r   r"  r  r  r   r   r4   s     r,   test_step_baselinezTestDoPlot.test_step_baseline  ?    FFFF	
 ww		

 	
r7   c                     t        j                  | j                  | j                  f| j                  dd| j
                   y r0  r-  r4   s     r,   test_step_full_optionsz!TestDoPlot.test_step_full_options  r2  r7   c                 r    t        j                  | j                  | j                  | j                  d       y )Nr   r0   r   r"  r  r  r   r4   s     r,   test_plot_qq_linezTestDoPlot.test_plot_qq_line  s"    $&&$&&TWW3?r7   c                 t    t        j                  | j                  | j                  | j                  dd       y )NTr   )r   r,  r1   r6  r4   s     r,   test_step_qq_linezTestDoPlot.test_step_qq_line  s$    $&&$&&TWW4cJr7   N)rq   rr   rs   r-   rt   ru   rv   r'  r)  r.  r1  r4  r7  r9  r2   r7   r,   r  r    s    ?& [[! ! [[  [[
 
 [[
 
 [[
 
 [[@ @ [[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y)
TestQQLinec                    t         j                  j                  d       t        j                  t         j                  j	                  ddd            | _        t        j                  t         j                  j	                  ddd            | _        	 dd lm} |j                         \  | _
        | _        | j                  j                  | j
                  | j                  d       d	d
dd| _        d| _        y # t        $ r Y w xY w)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G))c2)FG	+ #DHdgGGLL.
 #

   		s   AC< <	DDc                     t        j                  t              5  t        | j                  d       d d d        y # 1 sw Y   y xY w)Nr  rt   r   r   r   r   ro   s    r,   test_badlinezTestQQLine.test_badline  s1    ]]:& 	$477F#	$ 	$ 	$	   :Ac                     t        j                  t              5  t        | j                  d| j
                         d d d        y # 1 sw Y   y xY w)Nr   )r  )rt   r   r   r   r   r  r4   s     r,   test_non45_no_xzTestQQLine.test_non45_no_x  7    ]]:& 	+477C466*	+ 	+ 	+   #AAc                     t        j                  t              5  t        | j                  d| j
                         d d d        y # 1 sw Y   y xY w)Nr   )r  )rt   r   r   r   r   r  r4   s     r,   test_non45_no_yzTestQQLine.test_non45_no_y  rN  rO  c                     t        j                  t              5  t        | j                  d       d d d        y # 1 sw Y   y xY w)Nr   rI  r4   s     r,   test_non45_no_x_no_yzTestQQLine.test_non45_no_x_no_y  s1    ]]:& 	!477C 	! 	! 	!rK  c                     t        | j                  j                               }t        | j                  d       t        | j                  j                               |kD  sJ y )Nr   )r   r   r   r   r*   r5   	nchildrens      r,   test_45zTestQQLine.test_45  sG    ,,./	tww477'')*Y666r7   c                 H    t        | j                  d| j                         y )Nr   )rG  )r   r   rG  r4   s     r,   test_45_fmtzTestQQLine.test_45_fmt	  s    tww$((+r7   c                 ^    t        | j                  dfd| j                  i| j                   y )Nr   rG  )r   r   rG  rF  r4   s     r,   test_45_fmt_lineoptionsz"TestQQLine.test_45_fmt_lineoptions  s$    tww?$((?d.>.>?r7   c                     t        | j                  j                               }t        | j                  d| j                  | j
                         t        | j                  j                               |kD  sJ y )Nr   r  r  r   r   r   r   r  r  rU  s      r,   test_rzTestQQLine.test_r  S    ,,./	twwtvv0477'')*Y666r7   c                 t    t        | j                  d| j                  | j                  | j                         y Nr   r  r  rG  r   r   r  r  rG  r4   s     r,   
test_r_fmtzTestQQLine.test_r_fmt  "    twwtvvTXX>r7   c                     t        | j                  df| j                  | j                  | j                  d| j
                   y rb  r   r   r  r  rG  rF  r4   s     r,   test_r_fmt_lineoptionsz!TestQQLine.test_r_fmt_lineoptions  9    GGS	
 FFdff$((	
>B>N>N	
r7   c                     t        | j                  j                               }t        | j                  d| j                  | j
                         t        | j                  j                               |kD  sJ y )Nr   r]  r^  rU  s      r,   test_szTestQQLine.test_s!  r`  r7   c                 t    t        | j                  d| j                  | j                  | j                         y Nr   rc  rd  r4   s     r,   
test_s_fmtzTestQQLine.test_s_fmt'  rf  r7   c                     t        | j                  df| j                  | j                  | j                  d| j
                   y rn  rh  r4   s     r,   test_s_fmt_lineoptionsz!TestQQLine.test_s_fmt_lineoptions+  rj  r7   c                    t        | j                  j                               }t        | j                  dt        j
                  | j                  | j                         t        | j                  j                               |kD  sJ y )Nr   )r   r  r  )r   r   r   r   r   r   r  r  rU  s      r,   test_qzTestQQLine.test_q1  sY    ,,./	tww%**$&&A477'')*Y666r7   c                     t        | j                  dt        j                  | j                  | j
                  | j                         y Nr   )r   r  r  rG  )r   r   r   r   r  r  rG  r4   s     r,   
test_q_fmtzTestQQLine.test_q_fmt7  s(    tww%**$&&dhhOr7   c                     t        | j                  dft        j                  | j                  | j
                  | j                  d| j                   y ru  )r   r   r   r   r  r  rG  rF  r4   s     r,   test_q_fmt_lineoptionsz!TestQQLine.test_q_fmt_lineoptions;  sG    GG	
 ffff	
 	
r7   N)rq   rr   rs   r-   rt   ru   rv   rJ  rM  rQ  rS  rW  rY  r[  r_  re  ri  rl  ro  rq  rs  rv  rx  r2   r7   r,   r;  r;    s   & [[$ $ [[+ + [[+ + [[! ! [[7 7
 [[, , [[@ @ [[7 7
 [[? ? [[
 

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

 [[7 7
 [[P P [[	
 	
r7   r;  c                   0   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y)	TestPlottingPositionc                 Z    d| _         t        j                  | j                         | _        y )N   )Nr   aranger#   ro   s    r,   r-   z!TestPlottingPosition.setup_methodI  s    IIdff%	r7   c                     t        j                  | j                  ||      }t        j                  j                  | j                  ||      }t        j                  ||d       y )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  sR    $$TVVu=||..IIU / 
 	((tQ?r7   c                 (    | j                  dd       y )Nr   r  r4   s     r,   test_weibullz!TestPlottingPosition.test_weibullU      Qr7   c                 (    | j                  dd       y )Nr   r   r  r4   s     r,   test_lininterpz#TestPlottingPosition.test_lininterpY  r  r7   c                 (    | j                  dd       y )Nr   r  r4   s     r,   test_piecewisez#TestPlottingPosition.test_piecewise]      S#r7   c                 (    | j                  dd       y )NgUUUUUU?r  r4   s     r,   test_approx_med_unbiasedz-TestPlottingPosition.test_approx_med_unbiaseda  s    Y	*r7   c                 (    | j                  dd       y )Ng?r  r4   s     r,   test_cunnanez!TestPlottingPosition.test_cunnanee  r  r7   N)rq   rr   rs   r-   r  rt   ru   rv   r  r  r  r  r  r2   r7   r,   rz  rz  H  s    &@ [[  [[  [[  [[+ + [[ r7   rz  c            	      j   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                  |        y )N)r  r   r   r   r   r>  r   r   )r  r  )r  r   r   r   r   )r  r  rm   )r  r   r   r|   r|   )rn   r   )r  rm   rn   )r  r  rm   rn   )r   arrayr   emptyr   r  r   rl   )expectedpps     r,   test_param_unpackingr  j  s   xx'H	"((3-ejjA&6	7B)	"((3-A!3	4B)	"((3-a1!5	6B)xx'H	"((3-Aq!!4	5B)	"((3-a1!!<	=B)xx'H	"((3-Aq!Q!7	8B)	"((3-Aq!1!=	>B)	"((3-Aqaq!A	BB)	"((3-A!C	DB)	"((3-a1!1!E	FB)r7   labelsXY)rY   rZ   x_size   2   y_sizer1   )Nr   r   r   r   c                    t         j                  j                  d      }|j                  dd|      }|j	                  d|      }t        j                  |      }	t        j                  |      }
t        |	|
fd|i|}|j                         d   }|j                         }|j                         }||k  r|sd|v sJ d	|v sJ d
|v sJ d|v sJ y y |sd	|v sJ d|v sJ y d|v sJ d
|v sJ y )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    s    
		w	'B
		as	0A
af%A;;q>D;;q>D
$
:4
:6
:C		BmmoGmmoGG###G###'>!>'>!> $
 G###G###'>!>'>!>r7   c                    t         j                  j                  ddd      }t         j                  j                  ddd      }t        ||dd      }|j	                         d   }t        j
                  |j                               d   }t        j
                  |j                               d   }||k  sJ t         j                  j                  ddd      }t        ||dd      }|j	                         d   }t        j
                  |j                               d   }t        j
                  |j                               d   }||k  sJ t         j                  j                  ddd      }t        ||dd      }|j	                         d   }t        j
                  |j                               d   }t        j
                  |j                               d   }||k  sJ y )	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ggbkkm$Q'Gggbkkm$Q'GWiir1g.G
'2sC
0C		Bggbkkm$Q'Gggbkkm$Q'GWiiq$0G
"gsC
0C		Bggbkkm$Q'Gggbkkm$Q'GWr7   )-numpyr   numpy.testingr   r  r   rt   scipyr   statsmodels.apiapir   statsmodels.compat.pythonr   statsmodels.graphicsr   statsmodels.graphics.gofplotsr   r   r	   r
   statsmodels.graphics.utilsr   r   ru   rx   rz   r   r   r   r   r   r   r   r   rv   r  r  r  r;  rz  r  parametrizer  r  r2   r7   r,   <module>r     s     &    6 )  3d? d?N >  
0 
	

!2 
&7 &7 P'8 P:, ,$-+< -*%C %CP= C CB	/ 	/JK JKZj
 j
Z D*8 B3#(F#GHB8,B8,!<=" > - - I 
"8  r7   