# Questions tagged [kolmogorov-smirnov-test]

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.

621 questions
Filter by
Sorted by
Tagged with
1 vote
23 views

### The F-test and the t-test reject the null hypothesis while the KS test and the Chi-Squared test do not

This is a follow-up question to How can the F-test reject the null hypothesis while the KS test does not?. Let's consider I perform the following tests: Two-sample Kolmogorov-Smirnov test (KS-test), ...
• 280
25 views

### Where can I find a Kolmogorov-Smirnov critical value table for an F-distribution? [closed]

I have developed an Excel model for a one-sample Kolmogorov-Smirnov test for an F-distribution. I have the K-S test statistic, but no CV to compare it to. If anyone knows of an online table of ...
267 views

### Estimating Probability Density for Sample

I have a dataset of over 20,000+ samples. The objective here is to define a distribution for the sample so that I can plot all possible outcomes. However, I am unable to find an appropriate ...
1 vote
71 views

### Two-sample Kolmogorov-Smirnoff test in R and/or Python, how to find degrees of freedom?

I am trying to run a Kolmogorov-Smirnov/K-S test in R using the ks.test() function, and I am trying to find the degrees of freedom when comparing across two different groups. I am also trying in ...
• 13
1 vote
75 views

### My professor insists that this data is normally distributed but I cannot work out how that can be!

I have a data set on deforestation and the impact that the distance from a road has on deforestation. For the assignment, I need to assess the correlation between these two variables. In class, my ...
• 11
1 vote
38 views

### Statistical test to check if two samples come from the same DISCRETE distribution

I am computing hourly backward wind trajectories for the 1985-2023 period, and obtaining all the pixels that are crossed by these trajectories. I have the pixel ID frequencies for these trajectories - ...
82 views

### Two-sided KS-Test for Evaluating Prediction Model?

In the article https://ginimachine.com/blog/machine-learning-model-evaluation/ there is a proposal of using Two-Sided KS-Tests for evaluating the accuracy of predictions from Machine Learning (ML) ...
• 133
34 views

### Using two-sample K-S test for the same time-series data

I have time-series data which is a recording of neural activity in a neuron before and after some stimuli (I know the specific time when the stimuli was introduced). I'm considering using the two-...
36 views

### How to estimate required sample size for the two-sample Kolmogorov-Smirnov test

I have a simulation model which produces a value for an output variable. Running it many times gives skewed distributions for this output variable. What I'd like to do is compare two distributions, ...
• 151
23 views

### Comparing 2 distributions in R from a smaller sample

I am in the process of planning out a statistical analysis for future data I will collect. I am primarily a neurobiologist, trying to implement more appropriate statistical models for my data. First, ...
171 views

### Which statistic to use for measurement between two samples [closed]

I am measuring stem widths of a control plant and a mutant plant and want to determine if there is any significant difference between them. The sample sizes are not the same. When I use a test like ...
• 141
1 vote
77 views

### Sampling 1 item from groups of correlated values and combining the statistics

We have a dataset consisting of several groups of observations: Group Object Value Gr_1 Ob_1 V_1 Gr_1 Ob_2 V_2 Gr_2 Ob_3 V_3 ... ... ... All values lie in the interval [0,1]. In each of the ...
15 views

### Can we compare distributions in a subsampled Kolmogorov Smirnov test?

(stats newbie here) The highlighted answer to Can you compare p-values of Kolmogorov Smirnov tests of normality of two variables to say which is more normal? refers to a paper* that says that when the ...
63 views

### How to evaluate model's performance using a K-S test

I am wondering if a K-S test or other test can be used for comparing models' performance. For example, I have two prediction models, the prediction result of first model is ...
• 121
1 vote
63 views

### How to perform a 2 sample Kolmogorov-Smirnov test controlling for a type II error instead of type 1

I have four completely different sets of two samples and want to check for each set if both samples come from the same distribution, so four Kolmogorov-Smirnov tests total. If it's going to be ...
• 21
31 views

### Test Distribution Difference between small sample sizes

My first post of StackExchange. I am working on data analysis project for comparison of fraud and nonfraud transactions. My objective is to compare the feature vectors of nonfraud transactions and ...
43 views

### testing difference in distributions with population values (using python)

I am looking for the best method to test for a difference between two distributions. I have data from a patient group, and my aim is to compare the distribution to a reference distribution. However, ...
• 101
40 views

### What Python library functions can one use to determine if a sample is drawn from a Laplace distribution?

I have some data I suspect is drawn from a Laplace distribution rather than a Gaussian one. I can use the Kolmogrov-Smirnov test and the ability to create Uniform and Gaussian distributions of the ...
73 views

### What is this nonparametric goodness-of-fit test?

I wrote down a goodness-of-fit test that I have not seen before. However, it is quite elementary and has many applications, so I bet it must have been known. Could someone tell me its name? Setup. The ...
• 235
54 views

### Correctly interpreting a two-sample Kolmogorov-Smirnov test and a Kruskal-Wallis test

I want to confirm my understanding of the two tests referenced in the title. Say I have data on a variable $Y$ from two groups (0 and 1), and I perform the following tests in Stata: ...
• 1
24 views

### What is the relationship between convergence in measure and convergence in Kolmogorove distance?

Suppose I have a sequence of distribution $F_1, ..., F_n$ convergence to a limiting distribution $F$ in the sense that \begin{align} \sup ||F_n - F|| \overset{a.s.}{\rightarrow} 0 \end{align} which ...
• 21
36 views

### Tests that Quantify Deviation from Null Hypotheses

I have been delving into non-parametric tests recently, and I've come to realize that most of these tests offer only a partial perspective. For example, lets say the underlying distribution is $\theta$...
• 235
1 vote
65 views

### Discrete P-values in Kolmogorov-Smirnov Test with Small Sample Sizes

I'm facing an issue while conducting the Kolmogorov-Smirnov (KS) test with two datasets of different sizes: 84 and 28 samples. I got these sets from normal distribution. I've noticed that the ...
40 views

### How to test for significance of differences between metrics for two models? (Machine learning model selection)

Problem - I want to test whether the difference in a metric (say AUC) between two models is significant. I have one vector of binary class predictions from a custom function and one from sklearn....
194 views

### Kolmogorov-Smirnov test with median ranks instead of traditional empirical distribution function

I know that Kolmogorov-Smirnov test uses the empirical distribution function of the sample studied $\widehat{F}(X_i) = \frac{i}{n}$ and then measures the adequacy of function $\widehat{F}$ to function ...
• 43
1k views

### Kolmogorov-Smirnov test fails to recognize a normally distributed sample

I created a sample with 10000 normally distributed numbers. Subsequently, I used the Kolmogorov-Smirnov test to check if they are indeed normally distributed, and it turned out that they are not. How ...
32 views

### How to apply equivalence test of whether data come from a specified distribution?

I have evenly-spaced locations from $1, 2, \dotsc, 1000$. At each location I have data from my $N$ samples coming from two groups, and I apply a (one-sided) test to obtain a p-value. I want to know if ...
1 vote
157 views

### What test can I use to compare two peaks in an image?

This question is related but I want to check if my idea is valid. I have two peaks and I want to check if they are the same. They are the linecut of an image. The background noise in the image is not ...
• 13
37 views

### Relation between the sample size with the powers of Kolmogorov Smirnov, Cramer Von Mises and Anderson Darling?

I want to know the mathematical relation between the sample size with the powers of 1. Kolmogorov Smirnov, 2. Cramer Von Mises, and 3. Anderson Darling. I have seen many posts and other websites ...
1k views

### Kolmognorov Smirnov test p values is 0

I am trying to use Kolmogorov-Smirnov test to check the goodness of fit of the distributions for the dataset. I have dataset consisting of 100,000 samples and I apply expectation-maximization ...
• 117
102 views

### How to determine whether a sample from a known population is significantly biased?

I have a large dataset (the population) and a large subset of it (the sample) containing the same, continuous variables. The sample represents more than 90% of the population but is not random -- we ...
• 133
52 views

### Does the null distribution matter when choosing between goodness-of-fit tests?

There are multiple goodness of fit tests such as Kolmogorov-Smirnov, Cramer-von Mises, Anderson-Darling, and Kuiper's. Which one shall one use? There are threads (e.g. 1, 2, 3) and a nice textbook ...
• 68.6k
83 views

### Comparison of KS test and MWW test

I want to compare two data samples which come from continuous distributions. However, the data is highly skewed and t-test is obviously not a choice. As an alternative, I wanted to use the MWW test ...
• 21
141 views

### P-Value == 1 of two-sided Kolmogorov-Smirnov test for clearly distinct distributions

I have preformed two-sided Kolmogorov-Smirnov test pair-wise across 6 datasets. It performs as expected (p-value <<< 0.05 in most cases, ...
25 views

### Is two-sample Kolmogorov test working correctly?

I have two one-dimensional samples that I'm trying to quantifiably distinguish (or deny such distinction). I.e. the null-hypothesis is that they come from the same population (distribution?). The ...
185 views

### How does the assumption that the distribution must be fully specified when using a Kolmogorov-Smirnov practically impact comparison of distributions?

As specified here on the NIST website, the 3rd assumption for the K-S test is "... the distribution must be fully specified. That is, if location, scale, and shape parameters are estimated from ...
• 85
42 views

### Two-sample Kolmogorov Smirnov test for global sensitivity analysis - How to treat discrete distributions?

Dear Cross Validated community, We are working on a uncertainty & sensitivity analysis using a mathematical optimization model. More specifically, we have a set of uncertain parameters, which ...
• 101
1 vote
94 views

### Kolmogorov Smirnov Test Consistency

I was reading that the Kolmogorov Smirnov 2 sample test is consistent, that is Probability of rejection under $H_1$ is 1 for sample size going to infinity. Say we have 2 random variables X and Y. K-S ...
78 views

### Are there any differences in R if I use a "pnorm" or create a distribution with rnorm for Kolmogorov-Smirnov?

For testing distributions existing in base R, say normal or beta distributions, is there any difference if I use a one-sampled or two-sampled Kolmogorov-Smirnov test with same parameters? For example: ...
1 vote
79 views

### Upper bound on Kolmogorov-Smirnov distance after some transformation $h$

Problem setup: Suppose $X_1, \ldots, X_n$ is an i.i.d. sample from $F_X$ (CDF), and $Y_1, \ldots, Y_n$ is another i.i.d. sample from $F_Y$ (also CDF). In addition, $h(z_1, \ldots, z_n)$ is a real-...
• 43
143 views

• 107