Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
0answers
11 views

Comparing distributions of unequal sample size

I need to test whether a series of two distributions are statistically different. The approach I have taken is to test each for normality with Shapiro Wilk before testing with a two tailed t-test if ...
0
votes
0answers
31 views

Comparing distribution with small sample [on hold]

I have to determine the minimal number of random point following a N(0,1) needed to match the true PDF of a gaussian N(0,1) I simulated 1000 times one single point following a N(0,1) in R. Each time ...
0
votes
0answers
19 views

Kolmogorov Smirnov test and dependence on number of parameters

Somewhere I heard that Kolmogorov Smirnov test depends on number of parameters, is true? If yes, so I have problem because I have used ks.test(...) in R for normal distribution with 2 parameters and ...
1
vote
1answer
34 views

How to use classifier a to test whether the boundary between classes (and the classes, themselves) is (are) similar across two datasets

I have two datasets which each contain two classes (four classes total). I suspect that both datasets contain the same kinds of classes (i.e. the boundary that distinguishes classes is similar across ...
0
votes
0answers
14 views

Transforming GPS location datapoints in R

I'm very new to this kind of analysis so I hope my question is of good interest. I've GPS locations from three independent GPS loggers, which data consists of two variables: latitude and longitude. ...
1
vote
0answers
17 views

Goodness Of Fit Testing When Multiple Parameters Are Estimated

I am working with independent data points $X_1,...,X_N$ each of which, under my model assumptions, is a sum of exponential waiting times with different rates, and so should come from gamma ...
0
votes
0answers
23 views

Kolmogorov Smirnov, CVM, AD all reject Null hypothesis - comparing two samples

I have an empirical sample (with N >10000) and I fit it to a beta-distribution. Now, as a goodness of fit, I first looked at the density function plots of the empirical and the estimated beta ...
0
votes
0answers
8 views

Comparing groups of empirical probability density functions

I'm a neuroscientist approaching doing some complex statistics and can't find anyone to point me in the right direction of what I need. I'm happy to read around the subject, I just don't know enough ...
0
votes
0answers
19 views

How to use RSSI (Received Signal Strength) data to find out a wireless channel model?

I am trying to obtain the distribution of RSSI measurements collected from 802.15.4 devices like Zolertia Re-Motes. These devices provide RSSI values in dBm units with +/-1 dBm error in measurements. ...
2
votes
0answers
33 views

Do mismatches in areas of peak density affect the KS-test more than mismatches in low-density areas?

In the following plot you see my empirical data (black) plotted against a hypothesised distribution (blue). However, a KS-test shows that there is no indication that my sample follows this ...
0
votes
0answers
13 views

Appropriate statistical test for continuos bounded r.v

I have a number of continuous random variables bounded in the domain [0,b] and I need to perform a statistical test to check whether their average is different from ...
2
votes
1answer
146 views

Ties in a two-sample Kolmgorov-Smirnov test

This question is somehow connected to this one. I am performing a two-sample KS test in R and I think I have not fully understood the issue of the ties. Reading the help: ...
0
votes
2answers
84 views

Kolmogorov Smirnov Test Calculating the P Value Manually

So I'm trying to calculate the p value for a KS Test across some score data. I am using a variable called bad that is either 1 or 0 that splits the data into 2 samples effectively. I have run in SAS ...
0
votes
0answers
29 views

Determining differences between curves with the K-S test

I'm running an experiment where my treatments have a significant and highly sensitive effect of the distribution of a result. For example, if i alter a certain nutrient in a vegetable, the ...
0
votes
0answers
32 views

Distribution Comparison on Multiple Dimensions in Python

I work as an analyst at a company that is in the midst of transitioning to more cloud-friendly tools. That means we've gone from using SAS/TD SQL (from my actual analyst days) to working with Python ...
3
votes
0answers
25 views

Bounds for the expected value of the Kolmogorov-Smirnoff loss function

Let $$ \mathcal{F}=\{F:\mathbb{R}\longrightarrow\mathbb{R}: \text{$F$ is the CDF of some probability measure on $\mathbb{R}$}\}. $$ Consider the loss function, $L:\mathcal F\times\mathcal F\to\mathbb ...
0
votes
1answer
39 views

What is the p-value for one-tailed Kolmogorov-Smirnov Test? [duplicate]

I am healthcare professional with minimal knowledge on statistics. I am comparing 2 anti-hypertensives for their efficacy in lowering blood pressure, Drug A is the current standard treatment and Drug ...
1
vote
0answers
29 views

Testing for differences between distributions in the real world

I have a data set that consists of measurements of the size and biomass of zooplankton in the Great Lakes. The dataset covers 20 years of sampling in each of the lakes. In essence a net is used to ...
0
votes
0answers
39 views

ks.test, ties problem and test to compare two vectors [duplicate]

I'm trying to use ks.test in order to compare two vectors (curves). I have the following warning: impossible to calculate exact exact value with ex-aequos. This ...
1
vote
2answers
112 views

Distribution fitted well but kolmogorov -smirnov test not showing right results? Am I doing it right?

I want to do Kolmogorov -Smirnov test to see whether my data follows a particular distribution or not? When I fitted my data to lognormal distribution it fitted well. But When I am doing ks test, it ...
2
votes
1answer
321 views

Does the 2-sample KS test work? If so, why is it so unintuitive?

Here is an example. I have two data sets as shown below as histograms: I want to examine whether these data sets are drawn from the same underlying distribution. To do this, I am using the 2-sample ...
0
votes
0answers
69 views

Compare the degree distribution of a real networks and multiple random networks

Before the paper real world networks are rarely scale free, studies used to (still do) check for the slope in degree distribution graphs and if the slope fell between 2 and 3, discern that the network ...
24
votes
3answers
3k views

Why does the Kolmogorov-Smirnov test work?

In reading about the 2-sample KS test, I understand exactly what it is doing but I don't understand why it works. In other words, I can follow all the steps to compute the empirical distribution ...
0
votes
0answers
14 views

Is there a relationship between the “significance level” of a KS test and the size of the error bars in a given data set?

Suppose I have a data set with error, $\mathbf{d}+\mathbf{\Delta d}$ where the error is some percentage of the data (e.g. $\mathbf{\Delta d} = \epsilon \mathbf{d}$, $0 < \epsilon < 1$). I also ...
0
votes
0answers
21 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 ...
0
votes
0answers
110 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 ...
2
votes
0answers
68 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 ...
0
votes
1answer
76 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 ...
0
votes
0answers
24 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 ...
3
votes
1answer
82 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 ...
0
votes
2answers
41 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 ...
1
vote
0answers
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 ...
3
votes
0answers
28 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}...
1
vote
0answers
22 views

What among location, scale and shape is Kolmogorov–Smirnov test statistic sensitive to and why?

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, ...
1
vote
0answers
640 views

Wilcoxon Rank Sum test unequal sample sizes

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 ...
2
votes
0answers
28 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 ...
2
votes
1answer
43 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: ...
0
votes
0answers
7 views

Comparing discrete distributions when the sample set contains long streams of unique erroneous observations?

There is a reference dataset which is a discrete count over a set of names which produces a distribution $P$, and a set of names that are entered into a website as usernames which has a distribution $...
0
votes
1answer
93 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 ...
1
vote
0answers
185 views

Calculating p-values for the 1-Sample Kolmogorov Smirnov Test for Normality

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, ...
3
votes
1answer
209 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 ...
1
vote
1answer
161 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 ...
1
vote
0answers
18 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 ...
1
vote
0answers
122 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 ...
2
votes
1answer
52 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 ...
1
vote
1answer
428 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 ...
0
votes
1answer
32 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. ...
0
votes
0answers
20 views

Quantifying similarity of two objects in a population on certain characteristics

I have a set of objects (these are businesses) and for these businesses I have data on a number of characteristics. To keep this simple, we will consider these to be number of staff number of ...
0
votes
0answers
17 views

Detecting “biases” in model predictions with discrete and continuous features

I have a model that predicts a binary value based on a set of features for a data point. I want to be able to detect whether the predictions indicate any "biases" that aren't present in the data. For ...
4
votes
1answer
38 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 ...