
    !gT              	       F   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>                  jO                  d$i d%d&d'g      ej>                  jO                  d(d)d*g      ej>                  jO                  d+d)d*g      ej>                  jO                  d,g d-      d.                                    Z(ej>                  j@                  d/        Z)y)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
                  j                  d	      ej
                  j                  d
               Zej
                  j                  d        Zej
                  j                  d        Zej
                  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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     e/var/www/dash_apps/app1/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   r0   r'   r)   close_figuress     r+   test_qqplotzBaseProbplotMixin.test_qqplot#   s.    KdggDIIK9J9JK    c                 f    | j                   j                  | j                  | j                         y )Nr/   r!   ppplotr   r0   r3   s     r+   test_ppplotzBaseProbplotMixin.test_ppplot'   s!    dggDII6r6   c                 ~     | j                   j                  d| j                  | j                  d| j                   y r.   r!   probplotr   r0   r'   r3   s     r+   test_probplotzBaseProbplotMixin.test_probplot+   s.    MdiiM4;L;LMr6   c                      | j                   j                  d| j                  d| j                  d| j                   y )NT)r   exceedr0   r1   r<   r3   s     r+   test_probplot_exceedz&BaseProbplotMixin.test_probplot_exceed/   s8     	
wwt$))	
7;7H7H	
r6   c                      | j                   j                  d| j                  | j                  | j                  d| j
                   y N)r   r0   otherr1   )r!   r   r   r0   r$   r'   r3   s     r+   test_qqplot_other_arrayz)BaseProbplotMixin.test_qqplot_other_array5   B     	
ww""	
 		
r6   c                      | j                   j                  d| j                  | j                  | j                  d| j
                   y rC   )r!   r9   r   r0   r$   r'   r3   s     r+   test_ppplot_other_arrayz)BaseProbplotMixin.test_ppplot_other_array>   rF   r6   T)strictc                      | j                   j                  d| j                  | j                  | j                  d| j
                   y rC   )r!   r=   r   r0   r$   r'   r3   s     r+   test_probplot_other_arrayz+BaseProbplotMixin.test_probplot_other_arrayG   sD     	 	
ww""	
 		
r6   c                      | j                   j                  d| j                  | j                  | j                  d| j
                   y rC   )r!   r   r   r0   r%   r'   r3   s     r+   test_qqplot_other_prbpltz*BaseProbplotMixin.test_qqplot_other_prbpltQ   B     	
ww$$	
 		
r6   c                      | j                   j                  d| j                  | j                  | j                  d| j
                   y rC   )r!   r9   r   r0   r%   r'   r3   s     r+   test_ppplot_other_prbpltz*BaseProbplotMixin.test_ppplot_other_prbpltZ   rN   r6   c                      | j                   j                  d| j                  | j                  | j                  d| j
                   y rC   )r!   r=   r   r0   r%   r'   r3   s     r+   test_probplot_other_prbpltz,BaseProbplotMixin.test_probplot_other_prbpltc   sD     	 	
ww$$	
 		
r6   c                      | j                   j                  d| j                  | j                  ddd| j                   y NzCustom X-LabelzCustom Y-Label)r   r0   xlabelylabelr1   r2   r3   s     r+   test_qqplot_custom_labelsz+BaseProbplotMixin.test_qqplot_custom_labelsm   ?     	
ww##		

 	
r6   c                      | j                   j                  d| j                  | j                  ddd| j                   y rT   )r!   r9   r   r0   r'   r3   s     r+   test_ppplot_custom_labelsz+BaseProbplotMixin.test_ppplot_custom_labelsw   rX   r6   c                      | j                   j                  d| j                  | j                  ddd| j                   y rT   r<   r3   s     r+   test_probplot_custom_labelsz-BaseProbplotMixin.test_probplot_custom_labels   s?     	
ww##		

 	
r6   c                 n    | j                   j                  | j                  | j                  dddd       y Nr   r   r   r   )r   r0   r   r   r   r   )r!   r   r   r0   r3   s     r+   test_qqplot_pltkwargsz'BaseProbplotMixin.test_qqplot_pltkwargs   3    ww,# 	 	
r6   c                 n    | j                   j                  | j                  | j                  dddd       y r^   r8   r3   s     r+   test_ppplot_pltkwargsz'BaseProbplotMixin.test_ppplot_pltkwargs   r`   r6   c                 n    | j                   j                  | j                  | j                  dddd       y r^   )r!   r=   r   r0   r3   s     r+   test_probplot_pltkwargsz)BaseProbplotMixin.test_probplot_pltkwargs   s3    ww,# 	 	
r6   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[[->->>>>r6   N)__name__
__module____qualname__r,   pytestmark
matplotlibr5   r:   r>   rA   rE   rH   xfailrK   rM   rP   rR   rW   rZ   r\   r_   rb   rd   rl   r1   r6   r+   r   r      s$   
  [[L L [[7 7 [[N N [[
 

 [[
 
 [[
 
 [[d#[[
  $
 [[
 
 [[
 
 [[d#[[
  $
 [[
 
 [[
 
 [[
 
 [[
 
 [[
 
 [[
 
?r6   r   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!   r0   superr,   r)   	__class__s    r+   r,   z%TestProbPlotLongelyNoFit.setup_method   s    
		qKK'',,.	G		vvdiiootyy~~>BBDLLUWWt
 	r6   rm   rn   ro   r,   __classcell__r   s   @r+   ru   ru          	 	r6   ru   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 )Nrw   Frx   rz   Tr|   r   r   r   s    r+   r,   z'TestProbPlotLongelyWithFit.setup_method   s    
		qKK'',,.	G		vvdiiootyy~~>BBDLLUWWt
 	r6   r   r   s   @r+   r   r      r   r6   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 )Nrw         @      
@%   ri   rj   r   
r   r   r   r    r"   r   r!   r0   r   r,   r   s    r+   r,   z,TestProbPlotRandomNormalMinimal.setup_method   sR    
		qII$$T$C	tyy)	r6   r   r   s   @r+   r   r           r6   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 )	Nrw   r   r   r   r   T)r   qr   r   s    r+   r,   z,TestProbPlotRandomNormalWithFit.setup_method   sT    
		qII$$T$C	tyyd3	r6   r   r   s   @r+   r   r      r   r6   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 )Nrw   r   r   r   r         !@      @ri   rj   r}   45)r   r   r   r    r"   r   r   normr!   r0   r   r,   r   s    r+   r,   z-TestProbPlotRandomNormalFullDist.setup_method   s_    
		qII$$T$C	tyyuzzc/MN	r6   c                 :    | j                   j                  dk(  sJ y )Nr   r!   ri   rk   s    r+   test_loc_setz-TestProbPlotRandomNormalFullDist.test_loc_set   s    {{#%%%r6   c                 :    | j                   j                  dk(  sJ y )Nr   r!   rj   rk   s    r+   test_scale_setz/TestProbPlotRandomNormalFullDist.test_scale_set   s    {{  C'''r6   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}   ri   )r}   rj   )rp   raises
ValueErrorr   r"   r   r   rk   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+)rm   rn   ro   r,   r   r   r   r   r   s   @r+   r   r      s    &(Pr6   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 )Nrw   r   r   r   r   7   )r   r   r   r   r    data1data2rk   s    r+   r,   z,TestCompareSamplesDifferentSize.setup_method   sV    
		qbii..4t".MN
bii..4t".MN
r6   c                     | j                   j                  | j                         t        j                  t
              5  | j                  j                  | j                          d d d        y # 1 sw Y   y xY wN)rD   )r   r   r   rp   r   r   r3   s     r+   r5   z+TestCompareSamplesDifferentSize.test_qqplot   sU    



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



+



+r6   N)	rm   rn   ro   r,   rp   rq   rr   r5   r:   r1   r6   r+   r   r      sD    O
 [[0 0
 [[, ,r6   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 )
Nrw   r   r   r   r         r   r   r   r   s    r+   r,   z1TestProbPlotRandomNormalLocScaleDist.setup_method  sV    
		qII$$T$C	tyyaq9	r6   c                 :    | j                   j                  dk(  sJ y )Nr   r   rk   s    r+   r   z1TestProbPlotRandomNormalLocScaleDist.test_loc_set  s    {{!###r6   c                 :    | j                   j                  dk(  sJ y )Nr   r   rk   s    r+   r   z3TestProbPlotRandomNormalLocScaleDist.test_scale_set  s    {{  A%%%r6   c                 V    | j                   j                  j                         dk(  sJ y )Ng       @)r!   r}   meanrk   s    r+   test_loc_set_in_distz9TestProbPlotRandomNormalLocScaleDist.test_loc_set_in_dist  s#    {{$$&#---r6   c                 V    | j                   j                  j                         dk(  sJ y )Ng      "@)r!   r}   varrk   s    r+   test_scale_set_in_distz;TestProbPlotRandomNormalLocScaleDist.test_scale_set_in_dist  s#    {{##%,,,r6   )	rm   rn   ro   r,   r   r   r   r   r   r   s   @r+   r   r     s    $&.-r6   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 )NFrx   rz   r   r   )r   r   r   r   r"   r   r   r   r   r   r   r   resr   r   r   r!   r   r   r    r#   r$   r%   rk   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r6   c                 2    t        | j                  d       y Nr   r0   r   r   r3   s     r+   r5   zTestTopLevel.test_qqplot+      txxc"r6   c                 :    t        | j                  ddddd       y )Nr   r   r   r   r   )r0   r   r   r   r   r   r3   s     r+   r_   z"TestTopLevel.test_qqplot_pltkwargs/  s     HH,#	
r6   c                 V    dD ]$  }t        | j                  | j                  |       & y N)r   r   r   sr   r	   r!   r%   r)   r4   r0   s      r+   &test_qqplot_2samples_prob_plot_objectsz3TestTopLevel.test_qqplot_2samples_prob_plot_objects:  +     * 	HDDKK););$G	Hr6   c                 V    dD ]$  }t        | j                  | j                  |       & y r   r	   r   r$   r   s      r+   test_qqplot_2samples_arraysz(TestTopLevel.test_qqplot_2samples_arraysA  +     * 	CDDHHd&6&6TB	Cr6   N)rm   rn   ro   r,   rp   rq   rr   r5   r_   r   r   r1   r6   r+   r   r   !  s    8 [[# # [[
 
 [[H H [[C Cr6   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)Nrw   Frx   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   rp   r   	TypeErrorr   r   r   r   )r4   r"   r   s      r+   test_invalid_dist_configr   I  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   r3   s     r+   r5   z(test_qqplot_unequal.<locals>.test_qqplotb  r   r6   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_objf  r   r6   c                 V    dD ]$  }t        | j                  | j                  |       & y r   r   r   s      r+   r   z8test_qqplot_unequal.<locals>.test_qqplot_2samples_arraysm  r   r6   )r   r   RandomStatestandard_normalr	   get_axesget_childrenget_datatestingassert_allcloselenrp   rq   rr   )rsr   r   fig1fig2x1y1x2y2numobj1numobj2r5   r   r   s                 r+   test_qqplot_unequalr  S  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r6   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   rk   s    r+   	test_goodzTestCheckDist.test_goodv  s*    EJJ.EJJ.r6   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  )rp   r   AttributeErrorr   r  rk   s    r+   test_badzTestCheckDist.test_badz  si    ]]>* 	/.	/]]>* 	/.	/ 	/	/ 	/	/ 	/s   A2A>2A;>BN)rm   rn   ro   r  r  r1   r6   r+   r  r  u  s    //r6   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)   r4   r*   r   r   s        r+   test_baselinezTestDoPlot.test_baseline  ss    m##DFFDFF3R#szz***"chh'''xxs"""wwb   r6   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"}}r6   c                     t        j                  | j                  | j                  f| j                  dd| j
                   y )NFr   stepr   r  r  r  r   r  r3   s     r+   test_plot_full_optionsz!TestDoPlot.test_plot_full_options  s?    FFFF	
 ww		

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

 	
r6   c                     t        j                  | j                  | j                  f| j                  dd| j
                   y r,  r)  r3   s     r+   test_step_full_optionsz!TestDoPlot.test_step_full_options  r.  r6   c                 r    t        j                  | j                  | j                  | j                  d       y )Nr   r/   r   r  r  r  r   r3   s     r+   test_plot_qq_linezTestDoPlot.test_plot_qq_line  s"    $&&$&&TWW3?r6   c                 t    t        j                  | j                  | j                  | j                  dd       y )NTr   )r   r(  r0   r2  r3   s     r+   test_step_qq_linezTestDoPlot.test_step_qq_line  s$    $&&$&&TWW4cJr6   N)rm   rn   ro   r,   rp   rq   rr   r#  r%  r*  r-  r0  r3  r5  r1   r6   r+   r  r    s    ?& [[! ! [[  [[
 
 [[
 
 [[
 
 [[@ @ [[K Kr6   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
  rp   r   r   r   r   rk   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  )rp   r   r   r   r   r  r3   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  )rp   r   r   r   r   r  r3   s     r+   test_non45_no_yzTestQQLine.test_non45_no_y  rJ  rK  c                     t        j                  t              5  t        | j                  d       d d d        y # 1 sw Y   y xY w)Nr   rE  r3   s     r+   test_non45_no_x_no_yzTestQQLine.test_non45_no_x_no_y  s1    ]]:& 	!477C 	! 	! 	!rG  c                     t        | j                  j                               }t        | j                  d       t        | j                  j                               |kD  sJ y )Nr   )r   r   r   r   r)   r4   	nchildrens      r+   test_45zTestQQLine.test_45  sG    ,,./	tww477'')*Y666r6   c                 H    t        | j                  d| j                         y )Nr   )rC  )r   r   rC  r3   s     r+   test_45_fmtzTestQQLine.test_45_fmt  s    tww$((+r6   c                 ^    t        | j                  dfd| j                  i| j                   y )Nr   rC  )r   r   rC  rB  r3   s     r+   test_45_fmt_lineoptionsz"TestQQLine.test_45_fmt_lineoptions   s$    tww?$((?d.>.>?r6   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  rQ  s      r+   test_rzTestQQLine.test_r  S    ,,./	twwtvv0477'')*Y666r6   c                 t    t        | j                  d| j                  | j                  | j                         y Nr   r  r  rC  r   r   r  r  rC  r3   s     r+   
test_r_fmtzTestQQLine.test_r_fmt
  "    twwtvvTXX>r6   c                     t        | j                  df| j                  | j                  | j                  d| j
                   y r^  r   r   r  r  rC  rB  r3   s     r+   test_r_fmt_lineoptionsz!TestQQLine.test_r_fmt_lineoptions  9    GGS	
 FFdff$((	
>B>N>N	
r6   c                     t        | j                  j                               }t        | j                  d| j                  | j
                         t        | j                  j                               |kD  sJ y )Nr   rY  rZ  rQ  s      r+   test_szTestQQLine.test_s  r\  r6   c                 t    t        | j                  d| j                  | j                  | j                         y Nr   r_  r`  r3   s     r+   
test_s_fmtzTestQQLine.test_s_fmt  rb  r6   c                     t        | j                  df| j                  | j                  | j                  d| j
                   y rj  rd  r3   s     r+   test_s_fmt_lineoptionsz!TestQQLine.test_s_fmt_lineoptions  rf  r6   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  rQ  s      r+   test_qzTestQQLine.test_q$  sY    ,,./	tww%**$&&A477'')*Y666r6   c                     t        | j                  dt        j                  | j                  | j
                  | j                         y Nr   )r}   r  r  rC  )r   r   r   r   r  r  rC  r3   s     r+   
test_q_fmtzTestQQLine.test_q_fmt*  s(    tww%**$&&dhhOr6   c                     t        | j                  dft        j                  | j                  | j
                  | j                  d| j                   y rq  )r   r   r   r   r  r  rC  rB  r3   s     r+   test_q_fmt_lineoptionsz!TestQQLine.test_q_fmt_lineoptions.  sG    GG	
 ffff	
 	
r6   N)rm   rn   ro   r,   rp   rq   rr   rF  rI  rM  rO  rS  rU  rW  r[  ra  re  rh  rk  rm  ro  rr  rt  r1   r6   r+   r7  r7    s   & [[$ $ [[+ + [[+ + [[! ! [[7 7
 [[, , [[@ @ [[7 7
 [[? ? [[
 

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

 [[7 7
 [[P P [[	
 	
r6   r7  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"   rk   s    r+   r,   z!TestPlottingPosition.setup_method<  s    IIdff%	r6   c                     t        j                  | j                  ||      }t        j                  j                  | j                  ||      }t        j                  ||d       y )Nab)r   betarw   )decimal)	r   plotting_posry  r   mstatsplotting_positionsr"   nptestassert_array_almost_equal)r)   r   r  smppsppps        r+   do_testzTestPlottingPosition.do_test@  sR    $$TVVu=||..IIU / 
 	((tQ?r6   c                 (    | j                  dd       y )Nr   r  r3   s     r+   test_weibullz!TestPlottingPosition.test_weibullH      Qr6   c                 (    | j                  dd       y )Nr   r   r  r3   s     r+   test_lininterpz#TestPlottingPosition.test_lininterpL  r  r6   c                 (    | j                  dd       y )Nr   r  r3   s     r+   test_piecewisez#TestPlottingPosition.test_piecewiseP      S#r6   c                 (    | j                  dd       y )NgUUUUUU?r  r3   s     r+   test_approx_med_unbiasedz-TestPlottingPosition.test_approx_med_unbiasedT  s    Y	*r6   c                 (    | j                  dd       y )Ng?r  r3   s     r+   test_cunnanez!TestPlottingPosition.test_cunnaneX  r  r6   N)rm   rn   ro   r,   r  rp   rq   rr   r  r  r  r  r  r1   r6   r+   rv  rv  ;  s    &@ [[  [[  [[  [[+ + [[ r6   rv  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~  ri   )r  r   r{   rw   rw   )rj   r   )r~  ri   rj   )r}  r~  ri   rj   )r   arrayr   emptyr   r  r   rh   )expectedpps     r+   test_param_unpackingr  ]  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)r6   labelsXY)rU   rV   x_size   2   y_sizer0   )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   r0   2nd1str  r  )r   r   r   r    
standard_tr   r   r	   r   
get_xlabel
get_ylabel)r4   reset_randomstater0   r  r  r  r   r  r  pp_xpp_yr   r   x_labely_labels                  r+   test_correct_labelsr  y  s    
		w	'B
		as	0A
af%A;;q>D;;q>D
$
:4
:6
:C		BmmoGmmoGG###G###'>!>'>!> $
 G###G###'>!>'>!>r6   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)	r4   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r6   )*numpyr   numpy.testingr   r  r   rp   scipyr   statsmodels.apiapir   statsmodels.graphicsr   statsmodels.graphics.gofplotsr   r   r   r	   statsmodels.graphics.utilsr
   r   ru   r   r   r   r   r   r   r   r   rq   rr   r  r  r  r7  rv  r  parametrizer  r  r1   r6   r+   <module>r     s     &    )  3\? \?~
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  r6   