
    Џkh'Y                     n   d dl mZmZmZ d dlZd dlmZmZm	Z	m
Z
mZmZ d dlZd dlmZ d Zd Zej$                  j'                  dd ej(                  d	ej$                  j*                  g
      g      d        Zej$                  j'                  dd ej(                  d	ej$                  j*                  g
      g      d        Zd Zd Z G d dej4                        Z G d dej4                        Z G d dej4                        Zd Zd Zd Z d Z!g dZ"ej$                  j'                  de"ddgz         ej$                  j'                  de"      d               Z#d Z$d  Z%d! Z&d" Z'ej$                  j*                  d#        Z(d$ Z)ej$                  j*                  d%        Z*d& Z+d' Z,d( Z-d) Z.d* Z/y)+    )statslinalg	integrateN)assert_almost_equalassert_assert_equalassert_array_almost_equalassert_array_almost_equal_nulpassert_allclose)raisesc                  D   t         j                  j                  d      } d}| j                  dd|      }|j	                         }|j                  d      }t        j                  |      }t        j                  g d      }|j                  t        j                  |j                        }}t         ||      t        j                  j                  |d d d f   ||      j                  d	      |j                   z  d
       t        j"                  ddd      }	|j%                  |	      }
t        j                  j                  |	||      }|	d   |	d   z
  }t'        t        j                  |
|z
  dz        |z  dk         |j)                  |t         j*                        }|j)                  t         j*                   |      }t-        |dd       t-        |dd       t-        |j/                  |t         j*                        |d       t-        |j/                  t         j*                   |      |d       t-        |j1                  |      |
dz  j                         |z  d       t-        |j3                  ||dz        |
|z  j                         |z  d       y )N   r      )ddofg?      ?g?locscaleaxisvIh%,=rtol        {Gz?r   decimal   )nprandomdefault_rngnormalmeanstdr   gaussian_kdeasarraydatasetsqrt
covariancer   normpdfsumnlinspaceevaluater   integrate_box_1dinfr   integrate_boxintegrate_kdeintegrate_gaussian)rngn_basesamplexnxnmeanxnstdgkdexxr   r   xskdepdfnormpdf	intervallprob1prob2s                  Y/var/www/teggl/fontify/venv/lib/python3.12/site-packages/scipy/stats/tests/test_kdeoth.pytest_kde_1drI   
   s   
))


(CL	Aq,	'BWWYFFFFNE b!D 
O	$Brwwt7CR

r!T'{59==2=FO 
RC	 B]]2FjjnnRV5n9G11IBFFFW$q())3d:;!!&"&&1E!!266'62EsA.sA.**6266:E2N**BFF7F;UBO**40))3Q@//qA,,.y8!E    c            
         t         j                  j                  d      } d}| j                  dd|      }| j                  |      }t        j                  ||      }t        j
                  t        j                  ||z
  dz  |            }t        j                  ||      }t        j                  g d      }|j                  t        j
                  |j                        }	}t        j                  j                  }
t         ||      t        j                   |
|d d d f   ||	      |j                  z  d	
      d       t        j                   ddd      }|j#                  |      }t        j                  j                  |||      }|d   |d   z
  }t%        t        j                  ||z
  dz        |z  dk         |j'                  |t         j(                        }|j'                  t         j(                   |      }t+        |dd       t+        |dd       t+        |j-                  |t         j(                        |d       t+        |j-                  t         j(                   |      |d       t+        |j/                  |      |dz  j                         |z  d       t+        |j1                  ||dz        ||z  j                         |z  d       y )Nr   r   r   r   weightsr    r   r   r   r   r   r   r   r   r   r!   r   r"   r$   )r%   r&   r'   r(   averager.   r   r+   r,   r-   r/   r0   r1   r   r2   rM   r4   r5   r   r6   r7   r   r8   r9   r:   )r;   r<   r=   wnr>   r?   r@   rA   r   r   r1   rB   rC   rD   rE   rF   rG   s                    rH   test_kde_1d_weightedrP   1   sA   
))


(CL	Aq,	'B	L	!BZZB'FGGBJJ6	A~r:;E b"-D 
O	$Brwwt7C
**..CR
s2ag;Cu5D2N 
RC	 B]]2FjjnnRV5n9G11IBFFFW$q())3d:;!!&"&&1E!!266'62EsA.sA.**6266:E2N**BFF7F;UBO**40))3Q@//qA,,.y8!ErJ   r<      r   )marksc           	      "   t         j                  j                  d      }t        j                  ddg      }t        j                  ddgddgg      }|j	                  |||       j
                  }t        j                  |      }t        j                  ddgd	d
gddgg      }|d d d d d f   |j                  j
                  z
  }t        j                  j                  }t         ||j
                         |||j                        j                  d      |j                  z  d       t        j                  j                  }	ddgddg}}
|
|j                  j
                  z
  ||j                  j
                  z
  }}t        |j!                  |
||       |	|||j                  |      j                  d      |j                  z  d       t         j"                  ddddddf   \  }}t        j$                  |j'                         |j'                         g      }|j)                  |      }|j+                  dd      }t        j                  j                  t        j,                  ||g      ||      }|j'                         d   |j'                         d   z
  }t/        t        j                  ||z
  dz        |dz  z  dk         d}d}|j!                  ||d   g||g|      }|j!                  ||g||d   g|      }t1        |dd        t1        |dd        t1        |j3                  |      |dz  j                         |dz  z  d        t1        |j5                  ||      ||z  j                         |dz  z  d        y )!Nr         ?      @       @      @sizer   r                covr   r   r   r   r   r;   lower_limitr_   r;   gƠ>r   r                @@r   r)   r_   r!   }Ô%I}Ô%ITr   r"   )r%   r&   r'   arraymultivariate_normalTr   r+   r,   r-   r1   r   r/   r2   r3   cdfr8   mgridvstackravelr5   reshapedstackr   r   r9   r:   )r<   r;   r)   r/   r=   r@   rA   argr1   rk   lohilo_hi_xygrid_coordsrC   rD   rE   smalllargerF   rG   s                           rH   test_kde_2dr{   \   s6    ))


(C88S#JDC:Sz23J 
	 	 z	 	E	G	GB b!D 
aVaVaV,	-B
QaZ.4<<>>
)C

#
#
'
'CRTT
CT__%))r)2TVV; 
#
#
'
'C"X1vBDLLNN"B$7C2rs+CSdoo3?CCCLtvvU 88BqIr!Dy()DAq))QWWY	23K]];'F^^C%F''++BIIq!f,=15: , GG	!qwwy|+IBFFFW$q()Y\:TABEEtAw/%SIEu~tAw/?SIEsA.sA.**40)9a<8!E//jA,,.	1=qJrJ   c                 \   t         j                  j                  d      }t        j                  ddg      }t        j                  ddgddgg      }|j	                  |||       j
                  }|j                  |       }t        j                  ||      }t        j                  dd	gd
dgddgg      }|d d d d d f   |j                  j
                  z
  }t        j                  j                  }	t         ||j
                        t        j                   |	||j                        |j                  z  d      d       t        j                  j                   }
ddgddg}}||j                  j
                  z
  ||j                  j
                  z
  }}t        |j#                  |||      t        j                   |
|||j                  |      |j                  z  d      d       t         j$                  ddddddf   \  }}t        j&                  |j)                         |j)                         g      }|j+                  |      }|j-                  dd      }t        j                  j                  t        j.                  ||g      ||      }|j)                         d   |j)                         d   z
  }t1        t        j                  ||z
  d	z        |d	z  z  dk         d}d}|j#                  ||d   g||g|      }|j#                  ||g||d   g|      }t3        |d d!       t3        |d d!       t3        |j5                  |      |d	z  j                         |d	z  z  d	!       t3        |j7                  ||      ||z  j                         |d	z  z  d	!       y )"Nr   rT   rU   rV   rW   rX   rL   r   r    rZ   r[   r\   r]   r^   r   r   r   r   r`   r   ra   rb   gh㈵>r   r   rd   r   re   r!   rf   rg   r   r"   )r%   r&   RandomStaterh   ri   rj   randr   r+   r,   r-   r1   r   r2   r/   rM   rk   r8   rl   rm   rn   r5   ro   rp   r   r   r9   r:   )r<   r;   r)   r/   r=   rO   r@   rA   rq   r1   rk   rr   rs   rt   ru   rv   rw   rx   rC   rD   rE   ry   rz   rF   rG   s                            rH   test_kde_2d_weightedr      sF    ))


(C88S#JDC:Sz23J 
	 	 z	 	E	G	GB	,	B b"-D 
aVaVaV,	-B
QaZ.4<<>>
)C

#
#
'
'CRTT

s3DOO,t||;"E 
#
#
'
'C"X1vBDLLNN"B$7C2rs+
s3CT__#F||"$	&	 88BqIr!Dy()DAq))QWWY	23K]];'F^^C%F''++BIIq!f,=15: , GG	!qwwy|+IBFFFW$q()Y\:TABEEtAw/%SIEu~tAw/?SIEsA.sA.**40)9a<8!E//jA,,.	1=qJrJ   c                     d } t         j                  j                  d      }d}|j                  dd|      }t	        j
                  |      }t	        j
                  ||       }t	        j
                  ||j                        }t        j                  ddd	      }|j                  |      }|j                  |      }	t        ||	       |j                  |      }
t        ||
       t        t        t        j
                  |d
       y )Nc                 b    t        j                  | j                  d| j                  dz   z        S z*Same as default, just check that it works.g      r[   )r%   powerr3   dkde_objs    rH   scotts_factorz0test_kde_bandwidth_method.<locals>.scotts_factor   s$    xx		3		!#455rJ   r   2   r   r   	bw_methodr   r   3   wrongstringr%   r&   r'   r(   r   r+   factorr4   r5   r   assert_raises
ValueErrorr   r;   r<   r=   r@   gkde2gkde3rB   rC   kdepdf2kdepdf3s              rH   test_kde_bandwidth_methodr      s    6 ))


(CL	Aq,	'B b!Dr];ErT[[9E	R"	B]]2FnnR G(nnR G(*e00"NrJ   c                     d } t         j                  j                  d      }d}|j                  dd|      }t	        j
                  |      }t	        j
                  ||       }t	        j
                  ||j                        }t        j                  ddd	      }|j                  |      }|j                  |      }	t        ||	       |j                  |      }
t        ||
       t        t        t        j
                  |d
       y )Nc                 b    t        j                  | j                  d| j                  dz   z        S r   )r%   r   neffr   r   s    rH   r   z9test_kde_bandwidth_method_weighted.<locals>.scotts_factor   s$    xxc799Q;&788rJ   r   r   r   r   r   r   r   r   r   r   r   s              rH   "test_kde_bandwidth_method_weightedr      s    9 ))


(CL	Aq,	'B b!Dr];ErT[[9E	R"	B]]2FnnR G(nnR G(*e00"NrJ   c                       e Zd Zd Zy)_kde_subclass1c                     t        j                  |      | _        | j                  j                  \  | _        | _        | j                  | _        | j                          y N)	r%   
atleast_2dr-   shaper   r3   r   covariance_factor_compute_covariance)selfr-   s     rH   __init__z_kde_subclass1.__init__  sC    }}W-++!%!3!3  "rJ   N)__name__
__module____qualname__r    rJ   rH   r   r     s    #rJ   r   c                        e Zd Z fdZ xZS )_kde_subclass2c                 F    | j                   | _        t        |   |       y r   )r   r   superr   )r   r-   	__class__s     rH   r   z_kde_subclass2.__init__   s    !%!3!3!rJ   )r   r   r   r   __classcell__)r   s   @rH   r   r     s    " "rJ   r   c                       e Zd Zd Zy)_kde_subclass4c                 (    d| j                         z  S )Nr   )silverman_factor)r   s    rH   r   z _kde_subclass4.covariance_factor&  s    T**,,,rJ   N)r   r   r   r   r   rJ   rH   r   r   %  s    -rJ   r   c                     t        j                  g dt              } t        j                  ddd      }t	        j
                  |        |      }t        |       } ||      }t        ||d       t        |       } ||      }t        ||d       t        |       } ||       }g d}	t        |	|d	
       }
fd|
_        |
j                           |
|      }t        ||d       y )Nr   r   r[   r\   dtype
   r   numnulp)gn,?gǻe??gW[3?ga )?gKd8;?r]   r"   c                       j                   S r   )r   )kdes   rH   <lambda>z/test_gaussian_kde_subclassing.<locals>.<lambda>H  s    SZZ rJ   )r%   rh   floatr4   r   r+   r   r
   r   r   r	   r   r   )x1rB   yskde1y1kde2y2kde4y4
y_expectedkde5y5r   s               @rH   test_gaussian_kde_subclassingr   *  s    	#5	1B	S""	%B 

R
 C	RB "D	bB"2r3 "D	bB"2r3 "D	bBMJj"a8 D/D	bB"2r3rJ   c                     t        j                  g dt              } t        j                  ddd      }g d}t	        j
                  |       }|j                  d	       |j                  d
	        ||      }t        ||d       y )Nr   r   r   r   r\   r   )g>L\9?gp4=?gH꟫?g8(H	MT?gĲCR?r   r   scottr   r"   )r%   rh   r   r4   r   r+   set_bandwidthr	   )r   rB   r   r   r   s        rH   $test_gaussian_kde_covariance_cachingr   N  sv    	#5	1B	S"!	$B NJ 

R
 C$(	RBj"a8rJ   c                  D   t        j                  g dt              } t        j                  ddd      }t	        j
                  |       }|j                  |_        |j                           ||      }t	        j
                  | d      } ||      }t        ||d	       y
)zUgly, but people may rely on this.  See scipy pull request 123,
    specifically the linked ML thread "Width of the Gaussian in stats.kde".
    If it is necessary to break this later on, that is to be discussed on ML.
    r   r   r   r   r   r   	silvermanr   r   N)
r%   rh   r   r4   r   r+   r   r   r   r
   )r   rB   r   r   r   r   s         rH   test_gaussian_kde_monkeypatchr   ^  s    
 
#5	1B	S""	%B 

R
 C00C	RB bK8D	bB"2r3rJ   c                      t        j                  d      } t        j                  |       }g d}t	         ||       |d       y)zRegression test for #1181.r\   )B\A?筱ES?g
f?r   r   r]   r"   N)r%   aranger   r+   r	   )r   r   r   s      rH   test_kde_integer_inputr   s  s4    	1B


R
 CMJc"gz1=rJ   )float32float64float96float128int32int64bw_typer   r   r   c                    t        t        | d       } |dv r|}nt        t        |d       }|r |d      nd }t        d | |fD              rt        j                          t        j
                  d|       }t        j
                  d|       }t        j                  |||      }t        j
                  d|       } ||      }|j                  t        j                  ||t        j                  |      |j                        k(  sJ y )N)r   r   rZ   c              3   $   K   | ]  }|d u  
 y wr   r   ).0dts     rH   	<genexpr>z(test_kde_output_dtype.<locals>.<genexpr>  s     
,"2:
,s   r\   r   )r   rM   )getattrr%   anypytestskipr   r   r+   r   result_typer   r   )r   r   bwrM   r-   kpointsresults           rH   test_kde_output_dtyper   ~  s     Bt$E(("gt,"WQZ

,
,,ii'Gii'G7b'BAYYq&FvYF<<2>>'62::g;N*+((4 4 4 4rJ   c                  6   t         j                  j                  d      } | j                  d      }t	        j
                  |      }| j                  d      }d}t        j                  t        |      5  |j                  |       d d d        y # 1 sw Y   y xY w)Nl	   Fgu	\U.lt&0 )r    r   )rZ   r   z0points have dimension 3, dataset has dimension 2match)
r%   r&   r'   standard_normalr   r+   r   r   r   logpdf)r;   r=   r@   rB   msgs        rH   test_pdf_logpdf_validationr     sz    
))

 F
GC			W	%Bb!D			W	%B
<C	z	- B  s   4BBc                  <   t         j                  j                  d      } d}| j                  dd|      }t	        j
                  |      }t        j                  ddd      }|j                  |      }|j                  |      }t        ||d       t        j                  |      }|j                  |      }t        ||d       t	        j
                  |      }t        j                  |j                  |            }|j                  |      }t        ||d       y )Nr   r   r         r"   )r%   r&   r'   r(   r   r+   r4   r5   r1   r   logr   )	r;   r<   r=   r@   rB   r1   pdf2r   logpdf2s	            rH   test_pdf_logpdfr     s    
))


"CL	Aq,	'B b!D	S"b	!B
--
C88B<DT2.VVC[Fkk"oG4 b!D
&&r"
#C;;r?DT2.rJ   c                     t         j                  j                  d      } d}| j                  dd|      }| j                  |      }t	        j
                  ||      }t        j                  ddd      }|j                  |      }|j                  |      }t        ||d       t        j                  |      }|j                  |      }	t        ||	d       t	        j
                  |t         j                  j                  t        |                  }t        j                  |j                  |            }|j                  |      }t        ||d       y )	Nr   r   r   rL   r   r   r   r"   )r%   r&   r'   r(   r   r+   r4   r5   r1   r   r   r   r~   len)
r;   r<   r=   rO   r@   rB   r1   r   r   r   s
             rH   test_pdf_logpdf_weightedr    s   
))


"CL	Aq,	'B	L	!B b"-D	S"b	!B
--
C88B<DT2.VVC[Fkk"oG4 b"))..R*ABD
&&r"
#C;;r?DT2.rJ   c                    	
 t         j                  j                  d      } d}d}| j                  ||f      }| j                  |df      }t        j                  g d      	t        j                  |      

j                  	      }|j                  |	         }	
fdfd} ||      }t        ||d	
       y )N   K b1d& r   r   rX   rZ   )	r   r    rZ   r[   r\   r]   r      	   c                       fd}t        j                  |t        j                   t        j                        d   S )Nc                 b    t        j                  | g   f      } j                  |       d   S Nr   )r%   concatenater1   )rv   
dimensionsr   points    rH   fz<test_marginal_1_axis.<locals>.marginal_pdf_single.<locals>.f  s/    U:%678A771:a= rJ   r   )r   quadr%   r7   r  r  r
  r   s   ` rH   marginal_pdf_singlez1test_marginal_1_axis.<locals>.marginal_pdf_single  s,    	! ~~a"&&"&&1!44rJ   c                 4    t        j                  d|       S )Nr   r   arrr%   apply_along_axis)r   r  s    rH   marginal_pdfz*test_marginal_1_axis.<locals>.marginal_pdf  s    ""#6QFKKrJ   ư>r   
r%   r&   r'   r(   rh   r   r+   marginalr1   r   )r;   n_datan_dimr-   r   r  r1   r  refr
  r   r  s            @@@rH   test_marginal_1_axisr    s    
))

 3
4CFEjjufoj.GZZeQZZ(F56J


W
%C||J'H
,,vj)
*C5L v
CC4(rJ   c                  x  	
 t         j                  j                  d      } d}d}| j                  ||f      }| j                  |df      }t        j                  ddg      	t        j                  |      

j                  	      }|j                  |	         }	
fd} ||      }t        ||d	       y )
Nr     r[   rX   rZ   r   c                 @    fd}t        j                  |d|       S )Nc                       fd}t        j                  |t        j                   t        j                  t        j                   t        j                        d   S )Nc                 n       \  }}t        j                  ||| |g      }j                  |      d   S r  )r%   rh   r1   )rw   rv   wzr
  r   r  s       rH   r  zRtest_marginal_2_axis.<locals>.marginal_pdf.<locals>.marginal_pdf_single.<locals>.f  s9    Z(1HHaAq\*wwqz!}$rJ   r   )r   dblquadr%   r7   r  s   ` rH   r  zGtest_marginal_2_axis.<locals>.marginal_pdf.<locals>.marginal_pdf_single  s<    % $$Q"&&"&&I!LLrJ   r   r  r  )r   r  r
  r   s     rH   r  z*test_marginal_2_axis.<locals>.marginal_pdf  s!    	M ""#6QFKKrJ   r  r   r  )r;   r  r  r-   r   r  r1   r  r  r
  r   s            @@rH   test_marginal_2_axisr%    s    
))

 3
4CFEjjufoj.GZZeQZZ(F1a&!J


W
%C||J'H
,,vj)
*CL v
CC4(rJ   c                     t         j                  j                  d      } d}d}| j                  ||f      }| j                  |df      }t	        j
                  |      }ddg}|j                  |      }|j                  ||         }ddg}	|j                  |	      }
|
j                  ||	         }t        ||       d	}t        j                  t        |
      5  |j                  ddg       d d d        d}t        j                  t        |
      5  |j                  g d       d d d        d}t        j                  t        |
      5  |j                  g d       d d d        y # 1 sw Y   |xY w# 1 sw Y   OxY w# 1 sw Y   y xY w)Nr  r  r[   rX   rZ   r   r   z,Elements of `dimensions` must be integers...r   g      @z,All elements of `dimensions` must be unique.)r   r    r    z;Dimensions \[-5  6\] are invalid for a distribution in 4...)r   r   r]   )r%   r&   r'   r(   r   r+   r  r1   r   r   r   r   )r;   r  r  r-   r   r   dimensions1	marginal1pdf1dimensions2	marginal2r   messages                rH   test_marginal_ivr.    se   
))

 3
4CFEjjufoj.GZZeQZZ(F


W
%C q'K[)I==,-Db'K[)I==,-Dt =G	z	1 aX =G	z	1  Y  NG	z	1 !Z ! ! 
   
! !s$   E+E7F+E47F Fc            
      "   t         j                  j                  d      } d}d}t        j                  t	        d|      D cg c]  }| j                  dd|      |z    c}      }t        j                  |      }|j                  t        j                  d|            }t         j                  j                  t        j                  |d         d       t         j                  j                  t        j                  |d         d       y c c}w )Nr   i	  i  r   F)r%   r&   r'   rh   ranger(   r   r+   r   r   testingr   isneginfisnan)r;   n_dimensions	n_samplesr3   r=   r@   r   s          rH   test_logpdf_overflowr6  0  s     ))


"CLI	e	<? 3::aI.!4  
B b!D[[1l34FJJBKKq	2E:JJBHHVAY/7s   Dc                  6   t         j                  j                  d      } | j                  d      }| j	                  g d|j
                        }|j                         }t        j                  t        j                  |      |       t        ||dd       y )Ni90  d   rX   )rT   g      $@r8  rL   +=atolr   )r%   r&   r'   	lognormalchoicerY   copyr   r+   log10r   )r;   valsrM   orig_weightss       rH   test_weights_intactrB  B  sn    
))


&C==c="Djj)		j:G<<>L	rxx~w7G\EBrJ   c                      g d} g d}t        j                  | |      }t        j                  | t        j                  |            }g d}t	        |j                  |      |j                  |      dd       y )N)g?g      +@g      5@g     R@g     X@)r   r    r[   r     rL   )g333333?   X   r9  r:  )r   r+   r%   r   r   r5   )valuesrM   pdf_ipdf_fr=   s        rH   test_weights_integerrJ  M  sb    *FGvw7Evrzz'/BCE	BENN2&NN2&U@rJ   c                  $   d } t         j                  j                  d      }d}|j                  |      }|j                  dd|      }t	        j
                  |      } | |       t	        j
                  ||      } | |       t        j                  ddg      }t        j                  dd	gd	d
gg      }|j                  |||      j                  }	t	        j
                  |	      }
 | |
       t	        j
                  |	|      } | |       y )Nc                 j   d}| j                  |      }| j                  |      }t        t        t        ||d       d}| j                  ||      }| j                  ||      }t        ||d       t        j
                  j                  d      }| j                  ||      }t        j
                  j                  d      }| j                  ||      }t        ||d       t        t        j
                  d      r3t        j
                  j                  d      }| j                  ||       y y )	N   gvIh%<=)r;  i?  )seed   r'   i  )	resampler   AssertionErrorr   r%   r&   r}   hasattrr'   )
gkde_trailn_samplesamp1samp2rN  rstate1rstate2r;   s           rH   test_seed_subz test_seed.<locals>.test_seed_sub[  s   ##H-##H-OUE	
 ##H4#8##H4#8u51))''S'1##H7#;))''S'1##H7#;u51 299m,))''-Cs3 -rJ   r   r   r   r   rL   rT   rU   rV   rW   rX   )	r%   r&   r'   r(   r   r+   rh   ri   rj   )rY  r;   r<   rO   xn_1dgkde_1dgkde_1d_weightedr)   r/   xn_2dgkde_2dgkde_2d_weighteds               rH   	test_seedr`  Y  s    44 ))


(CL	L	!BJJq!\*E  'G'))%<"# 88S#JDC:Sz23J##D*<#HJJE  'G'))%<"#rJ   c                     t         j                  j                  d      } t        j                  g d      }t        j                  g dg dg dg      }| j	                  ||d      }	 t        j                  |j                         y # t        j                  $ rU d}t        t        j                  |      5  t        j                  |j                         d d d        Y y # 1 sw Y   Y y xY ww xY w)	Nl   SDG. )r   r   rQ   )r[   r   r   )r   r   r   )r   r   r8  i  z:The data appears to lie in a lower-dimensional subspace...r   )r%   r&   r'   rh   ri   r   r+   rj   r   LinAlgErrorr   )r;   musigmadatar   s        rH   %test_singular_data_covariance_gh10205rf    s     ))

 3
4C	+	BHHj+{;<E""2ud3D'466" 'J6--S9 	'tvv&	' 	' 	''s*   )B	 	0C19 C#C1#C-	(C1-C1c                  D   t         j                  j                  d      } | j                  t        j                  d      t        j
                  d      d      }d}t        j                  t        |      5  t        j                  |       d d d        y # 1 sw Y   y xY w)Nl   &8*c rZ   r\   rX   z9Number of dimensions is greater than number of samples...r   )r%   r&   r'   ri   zeroseyer   r   r   r   r+   )r;   rvsr-  s      rH   )test_fewer_points_than_dimensions_gh17436rk    sv     ))

 3
4C

!
!"((1+rvvayq
!
ACIG	z	1  3     s   7BB)0scipyr   r   r   numpyr%   numpy.testingr   r   r   r	   r
   r   r   r   r   rI   rP   markparametrizeparamxslowr{   r   r   r   r+   r   r   r   r   r   r   r   _ftypesr   r   r   r  r  r%  r.  r6  rB  rJ  r`  rf  rk  r   rJ   rH   <module>rt     s   * * L L  *$EN(EV (FLLV[[5F5F4GH7J7Jt (FLLV[[5F5F4GH:J:JzO4O<#U'' #"U'' "-U'' -
!4H9 4*> J Gw.D$DE'*4 + F4./0/2)6 ) )8"!J 8 8"C	@/$d'
 rJ   