Skip to main content
`Ctrl`+`K`

# scipy.stats.mstats.ks_1samp

scipy.stats.mstats.ks_1samp(x, cdf, args=(), alternative='two-sided', method='auto')

  Computes the Kolmogorov-Smirnov test on one sample of masked values.

  Missing values in x are discarded.

  Parameters:
    x array_like

      a 1-D array of observations of random variables.

    cdf str or callable

      If a string, it should be the name of a distribution in `scipy.stats`. If a callable, that callable is used to calculate the cdf.

    args tuple, sequence, optional

      Distribution parameters, used if cdf is a string.

    alternative{‘two-sided’, ‘less’, ‘greater’}, optional

      Indicates the alternative hypothesis. Default is ‘two-sided’.

    method{‘auto’, ‘exact’, ‘asymp’}, optional

      Defines the method used for calculating the p-value. The following options are available (default is ‘auto’):

      > - ‘auto’ : use ‘exact’ for small size arrays, ‘asymp’ for large

      > - ‘exact’ : use approximation to exact distribution of test statistic

      > - ‘asymp’ : use asymptotic distribution of test statistic

  Returns:
    d float

      Value of the Kolmogorov Smirnov test

    p float

      Corresponding p-value.