# Questions tagged [kolmogorov-smirnov]

The Kolmogorov-Smirnov test is a test for goodness of fit of data to a distribution. It is often used to test whether a variable is normally distributed.

519 questions
Filter by
Sorted by
Tagged with
75 views

### Explain the results of the 2-sample Kolmogorov-Smirnov test for two random Gaussian sets of numbers

Suppose I have two sets of random numbers drawn from the Gaussian distribution, $\mathbf{r_1}$ and $\mathbf{r_2}$. I then do a 2-sample Kolmogorov-Smirnov test (KS test) between the two to determine ...
470 views

### Trying to understand the Kolmogorov-Smirnov test in MATLAB

I have two sets of data, $\mathbf{d_1}$ and $\mathbf{d_2}$ which I want to test to see if they are drawn from the same distribution using the two-sample KS test in MATLAB. My understanding of the KS ...
95 views

### Are my two samples independent enough for a Kolmogorov-Smirnov test?

I have a set of polygons that correspond to home ranges of, say, 100 individuals for which I have measured the overlap between all possible pairs. This has given me a square matrix of dimensions ...
393 views

### Checking the similarity of two classes in a binary classification

So, I have a binary classification problem. The classes are fairly balanced and I have a separate training set and a test set. No matter what I try, both classification accuracy and the f1 score are ...
83 views

### Kolmogorov Smirnoff test result vs paired t-test result

I have a set of medical data which contains two samples taken in different time periods. Although the samples do not strictly contain the same people in each group, a large proportion in each group ...
102 views

### Testing equivalence of two censored distributions

If we observe two censored distributions, where all observations above a cutoff are set at the value of the cutoff, how can we test whether the observable distributions suggest that the two censored ...
236 views

### Testing that training and test data sets (not vectors) have been drawn from the same population in R

I have two data frames in R (training + test). The test set is not drawm splitted from one sample by myself but I got those two dataset and am supposed to built the model on the training set and make ...
18 views

### Can I use this distribution to model my data according to these plots?

I used the Anderson-Darling and the KS tests to decide whether my data and the distribution fitted on my data has the same distribution. Both tests rejects the null hypothesis. However when I look at ...
116 views

### Kolmogorov distributuon derivation

I would like to know if there is a book talking about the derivation of Kolmogorov distribution (Using usual definition for the bridge process) \begin{align} P(K\leq x)=1-2\sum_{i=1}^{\infty}(-1)^{i-1}...
43 views

### What among location, scale and shape is KolmogorovāSmirnov test statistic sensitive to and why? [closed]

I understand that the KolmogorovāSmirnov test statistic for a given cumulative distribution function $F(x)$ is $D_n = \sup_x |F_n(x) - F(x)|$. However, if I have to rank its sensitivity to location, ...
6k views

### Wilcoxon Rank Sum test unequal sample sizes [duplicate]

I am comparing two sets of data using the Wilcoxon Rank Sum test. Although the distributions appear to be quite different, the p-value is quite high (0.344). This is the line of code being used for ...
38 views

### Finding a distribution that fits different observations of data

I am observing session lengths on a network. I want to fit a distribution to the data that I have collected. I have data from two different observations (about a month apart). The plot below shows ...
69 views

### Different p-value between KS test and Wilcoxon test

I would like to know if the values in vector A are greater than the values in vector B. Here are my two vectors: ...
450 views

### Interprete GARCH residuals QQ plot

How to conclude, that time series' volatilty is not constant? I used GARCH, but have trouble with interpretation. I did the Kolmogorov-Smirnov test for normal distribution with GARCH residuals, which ...
471 views

### Calculating p-values for the 1-Sample Kolmogorov Smirnov Test for Normality [closed]

I have coded the algorithm for computing the p-value for the 1-Sample Kolmogorov Smirnov Test for Normality in EXCEL VBA published by Marsaglia et al. During recent tests prior to release of my code, ...
798 views

### Alternatives to 2-sample Kolmogorov-Smirnov Test?

I have 2 samples with numerous repeating numbers like this: Sample 1: 1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,4,4,4,4,... Sample 2: 1,1,1,2,2,2,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,... and I would like to ...
517 views

### what is the correct order of parameters of the GEV dist. for the ks.test in R?

I'm trying to evaluate the ks statistic for the gev distribution with ks.test stat function in R. I read the help a few times and remained puzzled as to what the order has to be and can't find any ...
30 views

### Using the D-statistic from 2-sample KS-tests

this my first attempt at applying a 2-sample KS-test. I have 3 sets of data; each comprises of control and treatment values, as follows and plotted in the image: Set 1: 10,849 values each for control ...
327 views

### Is there a rule of thumb regarding effect size and the two sample KS test?

I have performed the KS test comparing two samples. My sample size is very large so the p value is very low even though the effect looks weak. I found a an explanation for the calculation of the ...
215 views

### Calculating the 1 Sample Kolmogorov Smirnov Test Statistic for Normality

Can anyone give me some insight into where this calculation for the KS test statistic is going wrong (see figure 1)? I ran the test in SPSS and SAS as a check. I have used the same process for other ...
2k views

### Explaining K-S test results

I have two distributions as the above image. They look similar to me. The first vector has ~18K data points and the second one has ~400 data points. However, when I performed K-S test ...
59 views

### Comparison of empirical distributions in ciruclar/polar coordinates

I have 4 sets of 24 measurements of a polar variable (univariate). I want to use a statistical test, like the Kolmogorov-Smirnov test, to test whether said sets differ significantly from each other. ...
55 views

### Sample space of the two-sample Kolmogorov-Smirnov $D$ statistic?

I am trying to write a simple piece of code to produce the sample space for the Kolmogorov-Smirnov statistic $D_{m,n} = \underset{x}{\max}\left|S_{m}(x)-S_{n}(x)\right|$, where $m$ and $n$ are the ...
234 views

### Kolmogorov-Smirnov test for the distribution of p-values

I have a set of independent null hypothesis significance tests and their resulting p-values and I would like to make the claim that they are not all null by looking at the distribution of independent ...
402 views

### KolmogorovāSmirnov TOST based on confidence bands

I am trying to setup a two one-sided test (TOST) version of the KolmogorovāSmirnov test (KS) based on confidence bands. I would like to know if there is anything wrong with my approach. Similar to ...
255 views

### Goodness-of-fit test on arbitrary parametric distributions with estimated parameters

There have been many questions regarding this topic already addressed on CV. However, I was still unsure if this question was addressed directly. Is it possible, for any arbitrary parametric ...
1k views

### Change detection point with python

How reliable is using KS test (https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ks_2samp.html) for change-point detection (in a single vector)? Is there a better way for this, in ...
48 views

### Use results from two-sample Kolmogorov-Smirnov to compare methods

Let say I observe a phenomenon an I get its PDF. Then I come up with two models to simulate this phenomenon. From these models, I can get a PDF and I want to know which model is better. I am not ...
358 views

### Test if two distributions are same up to translation

The Mann-Whitney U Test can be used to test whether a randomly selected value from one distribution, $\ f_1(x)$, will be less than or greater than a randomly selected value from a second distribution, ...
592 views

### KS test always significant

I have been stuck with a couple of problems, so I decided to open an account here to post these questions of mine. Sorry if I am posting this in the wrong section. I want to analyze a frequency ...
68 views

### What is the intuition regarding the different viewpoints of the Kullback-Leibler Divergence and the Kolmogorov-Smirnov Statistic? [duplicate]

In trying to understand the Kullback-Leibler Divergence I conceive it as a metric that if minimized would make the Approximation PDF Q as close as possible to the True PDF P either in the ...
767 views

### Two-sample Kolmogorov-Smirnov Test

Back in Stackoverflow, I had asked this question but was redirected here for clarifications related to statistics. As mentioned in the question, I have about 200 brain anatomical measurements from two ...
198 views

### Can I use Kolmogorov-Smirnov test with estimated distribution parameters if I'm not interested in p-value?

I want to compare a list of 12 candidate distributions to sets of observed data, to see which estimated candidate distribution fits each data set best. Given a list of candidate distributions, I fit ...
307 views

### Is KS test really appropriate when validating a power law/estimating power law parameters?

I'm attempting to find out whether some highly skewed data are drawn from a power law distribution, following the popular paper by Clauset, Shalizi and Newman, 2009. Clauset et al. use the Kolmogorov-...
181 views

### Mismatch between KS test and qq plot?

I read many posts about the Kolmogorov-Smirnov test, Q-Q plots and CDFs. I decided to ask my own question about some difficulties I have with some real data. The data I'm using is available on this ...
24 views

### Compare the quality of distribution fits

I have two random variables $A$ and $B$ they are of different size. Both are well fitted as $\gamma$ distributions. My question is to find which one is more gamma like. Could You help me to solve ...
58 views

### Test of significance

I am facing an issue, while trying to test for significance my data issue from mass spectrometry. I am working in the omics domain, where data collected have a natural variance that can reach 30%. To ...
43 views

### How to rank similarities between sets of observations

Hi say I have a data frame where each row is a person and each column is measurement. What I want to do is to find which persons are most closely related. Say for example I want to test a and rank ...
68 views

### Test both tails in distributions comparison

I have several distributions that can be pretty skewed, like the example. I can use KS test to asses if they are different but I'm also interested in testing the single tails separately. What would ...
4k views

### Is the Kolmogorov-Smirnov-Test too strict if the sample size is large?

I often hear the statement that the KS-Test (for comparing two distributions described by two samples) is too strict if the sample size is rather large, meaning that the 0-hypothesis of equal ...
907 views

### Compare central distribution between two data sets

I have a distribution of empirical data (plotted in yellow) that I am comparing to simulated data (plotted in blue). I am interested in whether my empirical data (yellow) "clusters" around the ...
47 views

### $Pr<W$ and $Pr>D$ - interpretation of statistic tests results

I have found the following test results: Source: Link Could you tell me what does it mean and how to interpret the following quantities: $Pr<W$, $Pr>D$, $Pr>W-Sq$ and $Pr>A-Sq$? For ...
109 views

### Calculating n for Kolmogorov-Smirnov two-sample test

I'm comparing two samples using python's scipy.stats.ks_2samp which returns a D value and P value. How do you calculate n for ...
64 views

### Is it normal for the Kolmogorv-Smirnov p value to fluctuate when using randomly generated data?

Right now I'm generating 100 Beta RV's and using these data to test the null hypothesis of whether they are uniform, but my Kolmogorov-Smirnov p-value fluctuates greatly (from far below 0.05 to far ...
190 views

### Testing for symmetric distributions

Suppose we have $n$ samples $s_1,...,s_n$ from an unknown real-valued distribution $D$. We are interested in a statistic to test if $D$ is symmetric around zero. (In my application, $n$ is only ...
148 views

### Three component mixture model for element concentration using mixtools in R

As an update to a previously posed question, Fitting a mixture distribution for two approximately normally distributed populations using mixtools in R , I have now fit a three component mixture ...
178 views

### 1-Sample KS-Test always give me .000 Asymp. Sig. in SPSS

I am following this tutorial and trying to perform AnalyzeāNonparametric TestsāLegacy Dialogsā1-Sample K-S but Asymp. Sig. is .000 for every variable. Am I missing ...
3k views

### Kolmogorov - Smirnov Test in Python Example [duplicate]

This is a very simple example, I'm simulating normally distributed data in Python, and performing a Kolmogorov - Smirnov Test on my sample to check the goodness-of-fit(of the sample distribution ...
110 views

### Rolling sum of 2 sample KS test results

In order to compare two lists of samples from 'before-treatment' and 'after-treatment', I am doing a two sample KS test using the ks_2samp function from Python's scipy.stats package which gives me the ...