
    Ph'a                         d dl Zd dlmZ d dlmZ d dlmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZ ddZd Zd Zd Zd	 Zd
 Zd Zd Z d Z!d Z"d Z#d Z$d Z%d Z&d Z'd Z(d Z)d Z*d Z+y)    N)assert_allclosefmin)CensoredDatabetacauchychi2expongammagumbel_lgumbel_rinvgauss
invweibulllaplacelogisticlognormnctncx2normweibull_maxweibull_minc                 $    t        | |||dd      S )Ng-q=)argsdispxtolftolr   )funcx0r   r   s       yC:\Users\daisl\Desktop\realtime-object-detection\venv\Lib\site-packages\scipy/stats/tests/test_continuous_fit_censored.py	optimizerr       s    bt$UGG    c                      t        ddgddgddgddgg	      } t        j                  | d
dt              \  }}}}t	        |dd       t	        |dd       |d
k(  sJ |dk(  sJ y)a  
    Test fitting beta shape parameters to interval-censored data.

    Calculation in R:

    > library(fitdistrplus)
    > data <- data.frame(left=c(0.10, 0.50, 0.75, 0.80),
    +                    right=c(0.20, 0.55, 0.90, 0.95))
    > result = fitdistcens(data, 'beta', control=list(reltol=1e-14))

    > result
    Fitting of the distribution ' beta ' on censored data by maximum likelihood
    Parameters:
           estimate
    shape1 1.419941
    shape2 1.027066
    > result$sd
       shape1    shape2
    0.9914177 0.6866565
    皙?皙?      ?皙?      ??皙?ffffff?intervalr      flocfscaler    g?h㈵>rtolg*Vn?N)r   r   fitr    r   )dataablocscales        r   	test_betar:      s|    * 4,#',#',#',"0 1D xx1Q)LAq#uAxd+Axd+!8O8A::r!   c                      t        ddgdg      } t        j                  | t              \  }}t	        |dd       t	        |d	d       y
)a  
    Test fitting the Cauchy distribution to right-censored data.

    Calculation in R, with two values not censored [1, 10] and
    one right-censored value [30].

    > library(fitdistrplus)
    > data <- data.frame(left=c(1, 10, 30), right=c(1, 10, NA))
    > result = fitdistcens(data, 'cauchy', control=list(reltol=1e-14))
    > result
    Fitting of the distribution ' cauchy ' on censored data by maximum
    likelihood
    Parameters:
             estimate
    location 7.100001
    scale    7.455866
    r-   
      )
uncensoredrightr    g}if@r1   r2   gne@Nr   r   r4   r    r   r5   r8   r9   s      r   test_cauchy_right_censoredrC   5   sB    $ Ar72$7DDI6JCCt,E8$/r!   c                      t        ddgdgdgddgg      } t        j                  | t              \  }}t	        |dd	
       t	        |dd	
       y)a\  
    Test fitting the Cauchy distribution to data with mixed censoring.

    Calculation in R, with:
    * two values not censored [1, 10],
    * one left-censored [1],
    * one right-censored [30], and
    * one interval-censored [[4, 8]].

    > library(fitdistrplus)
    > data <- data.frame(left=c(NA, 1, 4, 10, 30), right=c(1, 1, 8, 10, NA))
    > result = fitdistcens(data, 'cauchy', control=list(reltol=1e-14))
    > result
    Fitting of the distribution ' cauchy ' on censored data by maximum
    likelihood
    Parameters:
             estimate
    location 4.605150
    scale    5.900852
    r-   r<   r=         r>   leftr?   r,   r@   gqk@r1   r2   g%Zx@NrA   rB   s      r   test_cauchy_mixedrI   M   sQ    * Ar7!RD#$a&+DDI6JCC-E8$/r!   c                      t        ddgdgdgddgg      } t        j                  | ddt              \  }}}t	        |d	d
       |dk(  sJ |dk(  sJ y)a=  
    Test fitting just the shape parameter (df) of chi2 to mixed data.

    Calculation in R, with:
    * two values not censored [1, 10],
    * one left-censored [1],
    * one right-censored [30], and
    * one interval-censored [[4, 8]].

    > library(fitdistrplus)
    > data <- data.frame(left=c(NA, 1, 4, 10, 30), right=c(1, 1, 8, 10, NA))
    > result = fitdistcens(data, 'chisq', control=list(reltol=1e-14))
    > result
    Fitting of the distribution ' chisq ' on censored data by maximum
    likelihood
    Parameters:
             estimate
    df 5.060329
    r-   r<   r=   rE   rF   rG   r   r.   ge =@r1   r2   N)r   r	   r4   r    r   )r5   dfr8   r9   s       r   test_chi2_mixedrL   i   sb    ( Ar7!RD#$a&+DXXd1	JNBUBt,!8O8A::r!   c                  d   g d} dgdz  dgdz  z   }t        j                  | |      }t        j                  |dt              \  }}|dk(  sJ t        |      |j                         z
  }|j                  j                         |j                  j                         z   }||z  }t        ||d       y	)
a  
    For the exponential distribution with loc=0, the exact solution for
    fitting n uncensored points x[0]...x[n-1] and m right-censored points
    x[n]..x[n+m-1] is

        scale = sum(x)/n

    That is, divide the sum of all the values (not censored and
    right-censored) by the number of uncensored values.  (See, for example,
    https://en.wikipedia.org/wiki/Censoring_(statistics)#Likelihood.)

    The second derivative of the log-likelihood function is

        n/scale**2 - 2*sum(x)/scale**3

    from which the estimate of the standard error can be computed.

    -----

    Calculation in R, for reference only. The R results are not
    used in the test.

    > library(fitdistrplus)
    > dexps <- function(x, scale) {
    +     return(dexp(x, 1/scale))
    + }
    > pexps <- function(q, scale) {
    +     return(pexp(q, 1/scale))
    + }
    > left <- c(1, 2.5, 3, 6, 7.5, 10, 12, 12, 14.5, 15,
    +                                     16, 16, 20, 20, 21, 22)
    > right <- c(1, 2.5, 3, 6, 7.5, 10, 12, 12, 14.5, 15,
    +                                     NA, NA, NA, NA, NA, NA)
    > result = fitdistcens(data, 'exps', start=list(scale=mean(data$left)),
    +                      control=list(reltol=1e-14))
    > result
    Fitting of the distribution ' exps ' on censored data by maximum likelihood
    Parameters:
          estimate
    scale    19.85
    > result$sd
       scale
    6.277119
    )r-         @      g      @r<      rQ   g      -@      rS      rT         Fr<   TrP   r   r/   r    g:0yE>N)r   right_censoredr
   r4   r    lennum_censored_uncensoredsum_rightr   )obscensr5   r8   r9   ntotalexpecteds           r   test_expon_right_censoredrc      s    \ LC72:q D&&sD1D4a9=JC!8O8 	D	D%%''A  "T[[__%66EqyHE8T*r!   c                      t        j                  g ddgdz  dgz         } t        j                  | dt              \  }}}t        |dd       |dk(  sJ t        |d	d       y
)a  
    Fit gamma shape and scale to data with one right-censored value.

    Calculation in R:

    > library(fitdistrplus)
    > data <- data.frame(left=c(2.5, 2.9, 3.8, 9.1, 9.3, 12.0, 23.0, 25.0),
    +                    right=c(2.5, 2.9, 3.8, 9.1, 9.3, 12.0, 23.0, NA))
    > result = fitdistcens(data, 'gamma', start=list(shape=1, scale=10),
    +                      control=list(reltol=1e-13))
    > result
    Fitting of the distribution ' gamma ' on censored data by maximum
      likelihood
    Parameters:
          estimate
    shape 1.447623
    scale 8.360197
    > result$sd
        shape     scale
    0.7053086 5.1016531
    )rN   g333333@gffffff@g333333"@g"@g      (@g      7@g      9@r      r-   rW   gv)?r1   r2   g<k @N)r   rX   r   r4   r    r   )xr6   r8   r9   s       r   test_gamma_right_censoredrg      se    . 	## %+%&CEQCK	1A IIaa9=MAsEAxd+!8O8E8$/r!   c            	         t        j                  g d      } t        j                  ddg      }t        j                  ddgg      }t        | ||      }t        j                  |t
              \  }}t        |dd	       t        |d
d	       t        |  | |dddddf          }t        j                  |t
              \  }}t        |dd	       t        |d
d	       y)aB  
    Fit gumbel_l and gumbel_r to censored data.

    This R calculation should match gumbel_r.

    > library(evd)
    > library(fitdistrplus)
    > data = data.frame(left=c(0, 2, 3, 9, 10, 10),
    +                   right=c(1, 2, 3, 9, NA, NA))
    > result = fitdistcens(data, 'gumbel',
    +                      control=list(reltol=1e-14),
    +                      start=list(loc=4, scale=5))
    > result
    Fitting of the distribution ' gumbel ' on censored data by maximum
    likelihood
    Parameters:
          estimate
    loc   4.487853
    scale 4.843640
       rO   	   r<   r   r-   )r?   r,   r@   g@r1   r2   gc*_@N)rH   r,   g)nparrayr   r   r4   r    r   r   )	r>   r?   r,   r5   r8   r9   data2loc2scale2s	            r   test_gumbelrr      s    , )$JHHb"XExx!Q!H
%(CDdi8JCC-E8$/ *E6#+AttG#4"46E <<;LD&D)$/FH40r!   c                  ,   g d} t        | dgdg      }t        j                  |ddt              \  }}}t	        |dd	
       |dk(  sJ |dk(  sJ t        j                  |dt              \  }}}t	        |dd	
       |dk(  sJ t	        |dd	
       y)a  
    Fit just the shape parameter of invgauss to data with one value
    left-censored and one value right-censored.

    Calculation in R; using a fixed dispersion parameter amounts to fixing
    the scale to be 1.

    > library(statmod)
    > library(fitdistrplus)
    > left <- c(NA, 0.4813096, 0.5571880, 0.5132463, 0.3801414, 0.5904386,
    +           0.4822340, 0.3478597, 3, 0.7191797, 1.5810902, 0.4442299)
    > right <- c(0.15, 0.4813096, 0.5571880, 0.5132463, 0.3801414, 0.5904386,
    +            0.4822340, 0.3478597, NA, 0.7191797, 1.5810902, 0.4442299)
    > data <- data.frame(left=left, right=right)
    > result = fitdistcens(data, 'invgauss', control=list(reltol=1e-12),
    +                      fix.arg=list(dispersion=1), start=list(mean=3))
    > result
    Fitting of the distribution ' invgauss ' on censored data by maximum
      likelihood
    Parameters:
         estimate
    mean 0.853469
    Fixed parameters:
               value
    dispersion     1
    > result$sd
        mean
    0.247636

    Here's the R calculation with the dispersion as a free parameter to
    be fit.

    > result = fitdistcens(data, 'invgauss', control=list(reltol=1e-12),
    +                      start=list(mean=3, dispersion=1))
    > result
    Fitting of the distribution ' invgauss ' on censored data by maximum
    likelihood
    Parameters:
                estimate
    mean       0.8699819
    dispersion 1.2261362

    The parametrization of the inverse Gaussian distribution in the
    `statmod` package is not the same as in SciPy (see
        https://arxiv.org/abs/1603.06687
    for details).  The translation from R to SciPy is

        scale = 1/dispersion
        mu    = mean * dispersion

    > 1/result$estimate['dispersion']  # 1/dispersion
    dispersion
     0.8155701
    > result$estimate['mean'] * result$estimate['dispersion']
        mean
    1.066716

    Those last two values are the SciPy scale and shape parameters.
    )
g?g ({?gL`)l?g6<T?gy}?g;?g*TUC?gNn%?gj<%L?gC?Cn?g333333?rO   r>   rH   r?   r   r-   r.   g\d8O?g-C6
?r2   rW   gBD?gcw&?N)r   r   r4   r    r   )rf   r5   mur8   r9   s        r   test_invgaussrv     s    z	A 1D6!=D \\$QqINNBUBt,!8O8A:: \\$Q)DNBUBt,!8O8E940r!   c                      t        g dddgddgg      } t        j                  | dt              \  }}}t	        |dd	       |dk(  sJ t	        |d
d	       y)a  
    Fit invweibull to censored data.

    Here is the calculation in R.  The 'frechet' distribution from the evd
    package matches SciPy's invweibull distribution.  The `loc` parameter
    is fixed at 0.

    > library(evd)
    > library(fitdistrplus)
    > data = data.frame(left=c(0, 2, 3, 9, 10, 10),
    +                   right=c(1, 2, 3, 9, NA, NA))
    > result = fitdistcens(data, 'frechet',
    +                      control=list(reltol=1e-14),
    +                      start=list(loc=4, scale=5))
    > result
    Fitting of the distribution ' frechet ' on censored data by maximum
    likelihood
    Parameters:
           estimate
    scale 2.7902200
    shape 0.6379845
    Fixed parameters:
        value
    loc     0
    ri   r<   r   r-   r>   r?   r,   rW   gp[[x^j?r1   r2   g5)^R@N)r   r   r4   r    r   )r5   cr8   r9   s       r   test_invweibullrz   ^  sZ    8 9RH#$a&+DNN4a9EMAsEAyt,!8O8E940r!   c                     t        j                  g d      } | | dk7  | dk7  z     }| | dk(     }| | dk(     }t        |||      }t        j                  |ddt
              \  }}t        |dd	
       t        |dd	
       y)a  
    Fir the Laplace distribution to left- and right-censored data.

    Calculation in R:

    > library(fitdistrplus)
    > dlaplace <- function(x, location=0, scale=1) {
    +     return(0.5*exp(-abs((x - location)/scale))/scale)
    + }
    > plaplace <- function(q, location=0, scale=1) {
    +     z <- (q - location)/scale
    +     s <- sign(z)
    +     f <- -s*0.5*exp(-abs(z)) + (s+1)/2
    +     return(f)
    + }
    > left <- c(NA, -41.564, 50.0, 15.7384, 50.0, 10.0452, -2.0684,
    +           -19.5399, 50.0,   9.0005, 27.1227, 4.3113, -3.7372,
    +           25.3111, 14.7987,  34.0887,  50.0, 42.8496, 18.5862,
    +           32.8921, 9.0448, -27.4591, NA, 19.5083, -9.7199)
    > right <- c(-50.0, -41.564,  NA, 15.7384, NA, 10.0452, -2.0684,
    +            -19.5399, NA, 9.0005, 27.1227, 4.3113, -3.7372,
    +            25.3111, 14.7987, 34.0887, NA,  42.8496, 18.5862,
    +            32.8921, 9.0448, -27.4591, -50.0, 19.5083, -9.7199)
    > data <- data.frame(left=left, right=right)
    > result <- fitdistcens(data, 'laplace', start=list(location=10, scale=10),
    +                       control=list(reltol=1e-13))
    > result
    Fitting of the distribution ' laplace ' on censored data by maximum
      likelihood
    Parameters:
             estimate
    location 14.79870
    scale    30.93601
    > result$sd
         location     scale
    0.1758864 7.0972125
    )      Igx&1D      I@gz/@r}   gSt$$@g_L gC63r}   gK7A "@g8gDi;@g\m>@gg?O9@b4-@gޓZA@r}   g?W[lE@gK42@g|a2U0r@@g"@gݓu;r|   g3@gǘp#r|   2   r}   rt   r<   r8   r9   r    r~   r1   r2   gY>@N)rm   rn   r   r   r4   r    r   )r^   rf   rH   r?   r5   r8   r9   s          r   test_laplacer     s    N (( H IC 	SE\cRi()Ase|DtE14u=DTryIJCC-E8$/r!   c                      t        j                  g d      } t        j                  | | dk(        }t	        j
                  |t              \  }}t        |dd       t        |dd	       y
)a  
    Fit the logistic distribution to left-censored data.

    Calculation in R:
    > library(fitdistrplus)
    > left = c(13.5401, 37.4235, 11.906 , 13.998 ,  NA    ,  0.4023,  NA    ,
    +          10.9044, 21.0629,  9.6985,  NA    , 12.9016, 39.164 , 34.6396,
    +          NA    , 20.3665, 16.5889, 18.0952, 45.3818, 35.3306,  8.4949,
    +          3.4041,  NA    ,  7.2828, 37.1265,  6.5969, 17.6868, 17.4977,
    +          16.3391, 36.0541)
    > right = c(13.5401, 37.4235, 11.906 , 13.998 ,  0.    ,  0.4023,  0.    ,
    +           10.9044, 21.0629,  9.6985,  0.    , 12.9016, 39.164 , 34.6396,
    +           0.    , 20.3665, 16.5889, 18.0952, 45.3818, 35.3306,  8.4949,
    +           3.4041,  0.    ,  7.2828, 37.1265,  6.5969, 17.6868, 17.4977,
    +           16.3391, 36.0541)
    > data = data.frame(left=left, right=right)
    > result = fitdistcens(data, 'logis', control=list(reltol=1e-14))
    > result
    Fitting of the distribution ' logis ' on censored data by maximum
      likelihood
    Parameters:
              estimate
    location 14.633459
    scale     9.232736
    > result$sd
    location    scale
    2.931505 1.546879
    )g#+@g|?5B@gZd;'@g"+@        g:H?r   g;M%@g65@gʡe#@r   g%䃞)@gEC@gBiQA@r   g]4@gI&0@gF_2@gpΈްF@g_QA@gec @gAǘ;@r   g6<R!@gx&1B@g9c@gү1@g8gDi1@gAV0@gW[B@r   )censoredr@   gTD-@gƠ>r2   g&4I,)w"@r1   N)rm   rn   r   left_censoredr   r4   r    r   )rf   r5   r8   r9   s       r   test_logisticr     s[    < 	  	A
 %%a16;Ddi8JCC.E8$/r!   c                     g d} t        j                  | dgdz  z   dgt        |       z  dgdz  z         }t        j                  |d      \  }}}|dk(  sJ t        j                  |      }t        |dd	       t        |d
d	       y)a#  
    Ref: https://math.montana.edu/jobo/st528/documents/relc.pdf

    The data is the locomotive control time to failure example that starts
    on page 8.  That's the 8th page in the PDF; the page number shown in
    the text is 270).
    The document includes SAS output for the data.
    )%g     6@g     B@g      G@g     @H@g     I@g     J@g     @K@g     L@g     P@g      Q@g     `Q@g      S@g     @S@g     S@g      T@g     `T@g     T@g     T@g      U@g     V@g     `W@g     Y@g     Z@g      [@g      \@g     `\@g      ]@g     @]@g     ]@g     ]@g      ^@g     ^@g     ^@g     _@g     ``@g     `@g     `@   ;   r   r-   r/   g3w@Mb@?r2   g~jt?g{Gzt?N)r   rX   rY   r   r4   rm   logr   )miles_to_failr5   sigmar8   r9   ru   s         r   test_lognormr     s    *M &&}uRx'?()s3}+='=B'FHDDq1E3!8O8 
B BT*E6-r!   c                  &   t        j                  g dg d      } t        j                  d      5  t	        j
                  | ddt              \  }}}}ddd       t        d	d
       t        dd
       dk(  sJ dk(  sJ y# 1 sw Y   4xY w)a
  
    Test fitting the noncentral t distribution to censored data.

    Calculation in R:

    > library(fitdistrplus)
    > data <- data.frame(left=c(1, 2, 3, 5, 8, 10, 25, 25),
    +                    right=c(1, 2, 3, 5, 8, 10, NA, NA))
    > result = fitdistcens(data, 't', control=list(reltol=1e-14),
    +                      start=list(df=1, ncp=2))
    > result
    Fitting of the distribution ' t ' on censored data by maximum likelihood
    Parameters:
         estimate
    df  0.5432336
    ncp 2.8893565

    )r-   rj   rO      rF   r<      r   )r   r   r   r   r   r   r-   r-   ignoreoverr   r-   r.   NgBn+b?r1   r2   gTf@)r   rX   rm   errstater   r4   r    r   )r5   rK   ncr8   r9   s        r   test_nctr     s    & &&'B'?AD 
(	# WWT!/8:BU 
$ B	-B	-!8O8A:: 
$	#s   #BBc                     t        g dddgddgg      } t        j                  d      5  t        j                  | dd	t
        
      \  }}}}ddd       t        dd       t        dd       dk(  sJ d	k(  sJ y# 1 sw Y   4xY w)a  
    Test fitting the shape parameters (df, ncp) of ncx2 to mixed data.

    Calculation in R, with
    * 5 not censored values [2.7, 0.2, 6.5, 0.4, 0.1],
    * 1 interval-censored value [[0.6, 1.0]], and
    * 2 right-censored values [8, 8].

    > library(fitdistrplus)
    > data <- data.frame(left=c(2.7, 0.2, 6.5, 0.4, 0.1, 0.6, 8, 8),
    +                    right=c(2.7, 0.2, 6.5, 0.4, 0.1, 1.0, NA, NA))
    > result = fitdistcens(data, 'chisq', control=list(reltol=1e-14),
    +                      start=list(df=1, ncp=2))
    > result
    Fitting of the distribution ' chisq ' on censored data by maximum
    likelihood
    Parameters:
        estimate
    df  1.052871
    ncp 2.362934
    )g@r$   g      @g?r#   rF   g333333?g      ?rx   r   r   r   r-   r.   NgQB?r1   r2   g
I@)r   rm   r   r   r4   r    r   )r5   rK   ncpr8   r9   s        r   	test_ncx2r     s    , #<QF#&*/D	(	#"hht!A1:<Ce 
$ Bt,C-!8O8A:: 
$	#s   #BBc                      t        ddgddgddgddgg	      } t        j                  | t        
      \  }}t	        |dd       t	        |dd       y)a  
    Test fitting the normal distribution to interval-censored data.

    Calculation in R:

    > library(fitdistrplus)
    > data <- data.frame(left=c(0.10, 0.50, 0.75, 0.80),
    +                    right=c(0.20, 0.55, 0.90, 0.95))
    > result = fitdistcens(data, 'norm', control=list(reltol=1e-14))

    > result
    Fitting of the distribution ' norm ' on censored data by maximum likelihood
    Parameters:
          estimate
    mean 0.5919990
    sd   0.2868042
    > result$sd
         mean        sd
    0.1444432 0.1029451
    r#   r$   r%   r&   r'   r(   r)   r*   r+   r@   gux?r1   r2   g  [?N)r   r   r4   r    r   rB   s      r   	test_normr   >  s\    * 4,#',#',#',"0 1D
 $)4JCC.E940r!   c            	      R   d} t        | j                  d      D cg c]  }|j                  d       c}D cg c]  }t        |d         t        |      dk(  f  c} \  }}t	        j
                  ||      }t        j                  |d      \  }}}t        |dd	       |dk(  sJ t        |d
d	       t	        j                  t        j                  |       |      }	t        j                  |	d      \  }
}}t        |
dd	       |dk(  sJ t        |d
d	       y c c}w c c}w )Nz>3,5,6*,8,10*,11*,15,20*,22,23,27*,29,32,35,40,26,28,33*,21,24*,*r   rj   r   gx&1@gMbP?r2   g=
ףp<@)zipsplitfloatrY   r   rX   r   r4   r   r   rm   rn   r   )swttimesr_   r5   ry   r8   r9   ro   c2rp   rq   s                r   test_weibull_censored1r   ^  s    	IA89!E1!''#,!EG!EA qtc!fk2!EG HKE4&&ud3DOODq1MAsE Au4(!8O8E5t,
 &&'7>E"u15BfBD)199FE-' "FGs
   D#D$c                  |   d} t        j                  | j                         D cg c]  }t        |       c}      j	                  dd      j
                  \  }}|dz  }t        j                  ||      }t        j                  |dt              \  }}}t        |dd	       t        |d
d	       |dk(  sJ y c c}w )Na  
           450 0    460 1   1150 0   1150 0   1560 1
          1600 0   1660 1   1850 1   1850 1   1850 1
          1850 1   1850 1   2030 1   2030 1   2030 1
          2070 0   2070 0   2080 0   2200 1   3000 1
          3000 1   3000 1   3000 1   3100 0   3200 1
          3450 0   3750 1   3750 1   4150 1   4150 1
          4150 1   4150 1   4300 1   4300 1   4300 1
          4300 1   4600 0   4850 1   4850 1   4850 1
          4850 1   5000 1   5000 1   5000 1   6100 1
          6100 0   6100 1   6100 1   6300 1   6450 1
          6450 1   6700 1   7450 1   7800 1   7800 1
          8100 1   8100 1   8200 1   8500 1   8500 1
          8500 1   8750 1   8750 0   8750 1   9400 1
          9900 1  10100 1  10100 1  10100 1  11500 1
    rl   rj   g     @@r   rW   ga4?g-C6?r2   gsK:@gh㈵>)rm   rn   r   intreshapeTr   rX   r   r4   r    r   )textr   lifer_   r5   ry   r8   r9   s           r   test_weibull_min_sas1r   {  s    
D" 4::<8<a3q6<89AA"aHJJJD$;D&&tT2DOODqIFMAsEAvD)E7.!8O8 9s   B9c                  $   t        j                  g d      } t        j                  | dgt	        |       dz
  z  dgdz  z         }t        j                  |dddt              \  }}}t        |dd	       t        |d
d	       t        |dd	       y )N)         r                                    i	  i0  r      r   rj   r-   d   r   gTR'@r   r2   gR^@gHz[@)	rm   rn   r   rX   rY   r   r4   r    r   )daysr5   ry   r8   r9   s        r   test_weibull_min_sas2r     s    
 88 = >D &&taS#d)a--@A3q5-HIDOOD!C.79MAsE AvD)Cd+E6-r!   ) r   ),numpyrm   numpy.testingr   scipy.optimizer   scipy.statsr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r:   rC   rI   rL   rc   rg   rr   rv   rz   r   r   r   r   r   r   r   r   r   r   r!   r   <module>r      s     ) & & & & &H F00088;+|0D%1PN1b!1H10h&0R.>>B1@.:B.r!   