# 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
42 views

### How to differentiate statistically between two numerical continuous datasets?

Sample from: Green - Gamma(45, 1); Red - Normal(375, 19) These two samples clearly come from two different distributions. Is it possible to verify that these two samples come from two different ...
150 views

### Mann-Whitney-U for exponential distributions?

I have two distributions, that look like the following: They appear to be exponential and have different sample sizes (369 vs 60). I would like to do some hypothesis testing. I know that I can use ...
254 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 ...
51 views

### Kolmogorov-Smirnov two-sample test p-value evaluation

I'm using python's scpipy implementation of the Kolmogorov-Smirnov two-sample test (ks_2samp). Q1: Why are my p-values in the examples below so low, specifically on the first example? Q2: Can I ...
14 views

### different results between the published paper and my code to calculate the p-value of Kolmogorov–Smirnov (K–S) test using R

I want to know if the following distributions fit the given data well or not. I used the Kolmogorov–Smirnov (K–S) statistic for the following two distributions but, i obtained different p-value of k-s ...
31 views

### Kolmogorov-Smirnov two sample p-value is not consistent [duplicate]

I'm using python's scpipy implementation of the Kolmogorov-Smirnov two-sample test (ks_2samp). I'm using it on gene expression quantification data to assess if two different size distributions (s1, s2)...
16 views

### Kolmogorov-Smirnov two sample, how to evaluate p-value [duplicate]

I'm using python's scpipy implementation of the Kolmogorov-Smirnov two-sample test (ks_2samp). I'm using it on gene expression quantification data to assess if two different size distributions (s1, s2)...
16 views

### Why are people using KS statistic to choose cutoff for binary predictions?

I've seen that people are sometimes using Kolmogorov-Smirnov statistic to determine a cutoff in a binary classification models, such as logistic regression. However, i do not fully understand why and ...
19 views

### Statistical power of the Lilliefors test: how to compare results for samples of different sizes?

The power of the Lilliefors test (LT) strongly depends on the sample size. I need to apply LT to a discrete distribution to find the minimum value m_min above which it is exponential. I need to do it ...
323 views

### Comparing 2D data sets using python

Thanks in advance for everyone reading this question. I have to write a program that takes a 2D data set (Force[y axis] versus displacement[x axis] data, if it matters), compare it with around 600 2D ...
12 views

### Feature selection using LASSO and KS tests

I have derived a binary classification model using LASSO-based feature selection and got a list of 10 features that gave an overall AUROC 0f 0.83. Now I wanted to check whether there exist any class-...
364 views

### How to use Kolomogorov-Smirnov test to show the T distribution converges to a standard normal?

I'm trying to use the Kolomogorov-Smirnov test to show that at large degrees of freedom, the T distribution can be approximated by a standard normal distribution. This is the code I have written in R: ...
15 views

### KS Test for Hawkes Process

I am analyzing some data by applying 1d-Hawkes processes. To evaluate the fit of the model itself (and particularly the chosen kernel, i.e. exponential), I am performing a KS test. However, it is not ...
152 views

### Kolmogorov Smirnoff and Predictive Analytics

I am trying to interpret the Kolmogorof Smirnoff test in the case of predicitve analytics to compare three models: a neural network, a decision tree and a logistic regression. The target variable is ...
40 views

### Is the following approach a reasonable way of defining $p$-value thresholds?

I have many small sets of data (each sample containing 8 to 64 individual points) which I would like to test for normality. I want to do this with two main tests: Shapiro-Wilk Kolmogorov–Smirnov ...
284 views

### Peacock Test Implementation in R

I have two empirical distribution (without access to the observations themselves). So, in order to see if the empirical distributions are "significantly" different, I took two large random samples ...
233 views

### Multivariate Kolmogorov-Smirnov for two samples

Let’s say we have data of some fruits and we want to consider different statistics for each fruit (there are various samples for each statistic). For example: Watermelon: Sugar: 50, 57, 36… Water: ...
104 views

### Kolmogorov-Smirnov and AIC giving opposite goodness-of-fit results. Is this possible/surprising/normal?

I have some data on the duration of several activities (rounded to the nearest half hour). I'm trying to add up these random variables (one per activity) so that I can calculate the total duration of ...
4 views

### Comparing species size distribution across multiple habitats

I am looking at one species' size distribution across three primary habitats, we'll call them Habitat A, B, and C for simplicity. I have taken multiple samples (seine tows) within each habitat (n ...
17 views

### two-sample Kolmogorov-Smirnov test suggest that sample with the same data generating process from different populations

I have two different samples I need to test if they are drawn from the same population distribution. The two samples are of the volatility of an asset that I simulated. Since the data is simulated I ...
30 views

### Intepretation of $p$-values for a Kolmogorov-Smirnov test

I'm using a Kolmogorov-Smirnov test to examine how normal (or Gaussian) some data sets I have are. I am having trouble with interpreting the $p$-values (surprise surprise). My present understanding is ...
340 views

### Combine multiple metrics to evaluate / choose a ML Model

I'm working on a credit binary classification task.For this business is something usual to meassure model's performance from two metrics: ROC AUC and KS .This sounds reasonable until I have to choose ...
239 views

### DHARMa diagnostics show significant deviations in KS tests for a glmm with beta distribution

I'm trying to use glmmTMB to fit a beta-distributed generalized mixed effects model with nested random effects. DHARMa residual diagnostics show a KS test with significant deviation. Is this serious ...
20 views

### Any paper proposing calibration to increase Kolmogorov Smirnov distance in a binary classification?

Consider a traditional classification settings, when we already came up with a model parameter $\theta$ ( by Logistic Regression as example). We also have the scores $f(x, \theta |y=1) \in R$ for ...
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 ...
30 views

### comparing gene expression distributions with replicates

I have gene expression data for single cells (hundreds per sample) in two conditions that I would like to compare. For each condition I have 4 replicates. So in essence I need to compare 4 ...
22 views

### Is it accurate to take the maximum distance between CDF and ECDF only at the edges? (Kolmogorov-Smirnov Test)

I have two samples, one obtained empirically and the other is the result of a simulation. I want to tune the simulation so that the result resembles the reality, for that I will minimize the KS ...
59 views

### Appropiate test for comparing integer distance distributions

I am trying to determine if wildfires occur closer to forests or not. For this, I have two matrices with the same shape: A matrix of ones and zeros where each value represents whether a fire is ...
189 views

### Finding the probability of normality via Anderson-Darling, Shapiro-Wilk , and Kolomogrov-Smirov

I have quite a few distributions that were generated by some system, and I am trying to find the probability of accordance to normality for these distributions. So, the probability of accordance to ...
24 views

### KS two sample test, p-value equal to 1

I have done a KS two sample test with the following samples: I have received a P-value of 1, I was expecting a high p-value but I thought this value can never reach 1 unless both samples are exactly ...
258 views

### KS test for normality on residuals from OLS vs. MLE

This is a conceptual issue. Suppose, one wants to test the residuals $e_t$ from the regression for normality. So, he runs the regression, obtains the estimates of error variance $\sigma^2$, and forms ...
14 views

### Significant change over NxM distributions

I have 100 sets of data, each of which consists of ~ 15 distributions along time, I've attached a figure of 1 of these sets to hopefully clear up what I mean. The plot shows the 95% confidence ...
40 views

### Distribution Selection based on Kolmogorov Smirnov Test

I am trying to model the distribution of some non normal data, to do so i am fitting many different distributions(Student, Pareto...) to the data. When computing the Kolmogorov Smirnov Statistic for ...
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 ...
31 views

### What distribution could the data stem from?

From checking the histogram of the distribution I had the intuition that the data could follow a Poisson or an exponential distribtuion. However, Lilliefors test that the data is exponentially ...
20 views

### Why do I have different KS test results?

I have been using scipython ks2samp to apply a two sided , sample KS test to some data. import scipy.stats as ss import numpy as np All_smirnoff = ss.ks_2samp(X, Y) where X and Y are two 1D numpy ...
238 views

### Compare cumulative distribution functions of several function point counters

Function point counters are used to measure the size of software. However, they are believed not to deliver exact results. Different measurements sometimes produce different results. The performance ...
33 views

### goodness-of-fit and bootstrap

Assume one has two data samples: $X = \{ x_{1}, \dots, x_{n} \}$ and $Y = \{y_{1}, \dots, y_{m}\}$. Next, we aim to check if the data $Y$ was generated by the same data generating process (DGP) as $X$ ...
17 views

### Unexpected behaviour of Anderson Darling test for normality for low sample size

I’m testing the power of the Anderson Darling test to detect deviations from standard normal distributions. I’m calibrating the AD test statistic numerically using python and I noticed an unexpected ...
40 views

### Identifying data generating process by testing

Assume one has two data samples: the first one , $X = x_{1}, \dots, x_{n}$ and second, $Y = y_{1}, \dots, y_{m}$, with $m \ll n$. I aim to check if the data $Y$ was generated by the same data ...
14 views

### Chapman kolmogrovs equation diffrential vs integrated

I wasstudying about the markov chains and jumps properties and ways to solve and form equation about them when I came across the chapman kolmogrovs equation. So i just wanted to ask when should i use ...
30 views

### Two-sample Kolmogorov-Smirnov, Anderson-Darling, and after?

I am trying to investigate the differences between two datasets. Each one is composed of 20 000 elements obtained from a Monte-Carlo method whose implementation slightly differs in both cases. I'd ...
592 views

### Circular distributions Kolmogorov-Smirnov vs. Watson test vs. Rayleigh test

I am interested in assessing whether my angular data distribution is satisfactorily described by a von Mises distribution. In scale data, one can potentially use a Kolmogorov-Smirnov test. However, ...
27 views

### p-value to Z-statistic for a KS test

Say you had a two tailed normal distribution A for some dataset, and you then measured the probability that some set of data points ...
54 views

### How to find ks test statistic using the given maximum likelihood estimator values and a sorted data in R?

The random variable Y is said to have a two-parameter APE distribution denoted by APE(α, λ), with the shape and scale parameters as α > 0 and λ > 0, respectively, if the PDF of Y for y > 0 is ...
28 views

### p-values not uniform in KS simulation with estimated parameters

I want to perform a bootstrap/simulation of the significance of a KS test in some observed data and have come up with some synthetic examples to make sure my code works, which I base off Greg Snow's ...
27 views

### Finding the difference between a normally distributed random number and randn with an offset using Kolmogorov-Smirnov test and Chi-square test

A normally disturbed random number is generated using randn function in Python. The KS test and Chi-square test is performed to check if the generated numbers belong to a Gaussian (zero mean, unit ...
48 views

### power of paired Kolmogorow-Smirnov test

Is the following conclusion correct? Assume I have two data samples, with $n$ and $m$ the sizes of first and second samples respectively. Next, I perform Kolmogorov-Smirnov test with some significance ...