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.

0
votes
1answer
24 views

Probability Integral Transforms (Not getting U(0,1))

I am trying to transform my GARCH standardized residuals to PITs in order to use them in a copula. The following code has been so far applied: ...
-1
votes
0answers
30 views

Probability Integral Transfroms [on hold]

I am currently trying to find the dependence structure of two market indices (financial time-series) using a Clayton copula. I decided to go for the Two-Step Likelihood Estimation whereby the marginal ...
0
votes
0answers
22 views

Python: How to implement a KS-test [closed]

scipy.stats.kstest may be used to perform a KS-Test on a dataset - that is, testing if the dataset follows a certain probability distribution. this method takes ...
1
vote
1answer
44 views

Why does the ks.test function give a p-value of 0 for these two samples?

I have two numeric data vectors: NA_Sales and EU_Sales, which are really similar. When I plot their ECDFs like this: ...
0
votes
1answer
37 views

Test of uniform distribution using KS-test and chi square in R

I want to test if a given sample $x$ of $n = 500$ continuous observations is uniformly distributed on a given interval of $[a,b]$ ($a = min(x)$ and $b = max(x)$). Therefore I would like to compare the ...
1
vote
1answer
32 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 ...
1
vote
0answers
28 views

Kolmogorov-Smirnov Critical Values

I'm conducting some research where I need the critical values of the one-sample Kolmogorov-Smirnov distribution. I've found a number of tables online, but the answers from these tables seem too high. ...
3
votes
1answer
47 views

Kolmogorov Smirnov test vs. Anderson Darling test

I learned that Kolmogorov Smirnov loses sensitivity (power) in the tails, thus it is not adequate for testing goodness-of-fit of fat tailed distributions. However, Anderson Darling test is more ...
0
votes
0answers
20 views

Two-tails Kolmogorov-Smirnov statistic between the two weighted samples

I am trying to calculate a Two-tails Kolmogorov-Smirnov test statistic for two weighted samples. The only reference that I've found is in Numerical Methods of Statistics by Monohan, pg. 334 in 1E and ...
0
votes
0answers
6 views

Can draws from a Bayesian model be used in a Kolmorogov Smirnov test to assess group differences, even though we use the data for estimation?

Suppose we have a Bayesian model where: \begin{equation} X_{iz} \sim N(\mu_z, \sigma^2_z) \\ \mu_z \sim N(0, 1) \\ \sigma^2_1 \sim Gamma(1,1) \\ \sigma^2_2 \sim Gamma(3,1) \\ \forall \ z \in \{1,2\} \...
1
vote
1answer
53 views

After performing Matching w/ replacement, should tests to evaluate treatment effect between the matched groups include repeated subjects?

I am using Genetic Matching to infer causality from observational data. Because I am matching with replacement, the matched Control group has multiple instances of some of the same subjects. In this ...
0
votes
1answer
48 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: ...
1
vote
0answers
19 views

Is it possible to evaluate similarity (as in Kolmogorov-Smirnov test) between two sample vectors using copulas?

Consider the Two-sample Kolmogorov-Smirnov test: given 2 vectors of samples $X$ and $Y$ it is possible to test whether they are drawn from the same continuous distribution by calling (in R, for ...
0
votes
1answer
23 views

Kolmogorov Distribution D statistics

As far as I have searched the cumulative distribution function of 𝐾, asymptotically (kolmogorov distribution) is given by Pr(𝐾≤𝑥)=1−2∑∞𝑘=1(−1)𝑘−1𝑒−2𝑘2𝑥2=2𝜋√𝑥∑∞𝑘=1𝑒−(2𝑘−1)2𝜋2/(8𝑥2). But ...
2
votes
0answers
18 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
23 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
35 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
15 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
25 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
47 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
10 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
20 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
34 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
321 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
305 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
35 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
68 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
91 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
33 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
75 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
161 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
406 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
86 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
17 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
23 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
190 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
73 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
97 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
30 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
88 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
48 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
32 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
26 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
1k 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
29 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
49 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: ...