Stack Exchange Network

Stack Exchange network consists of 174 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
0answers
28 views

Determine spread of data for non normal distribution

I've collected data from 12 sensors, the sensors are sampled at various times, mounted in one of three orientations and at different temperatures. I'm trying to determine the maximum and minimum ...
0
votes
0answers
17 views

Kolmogorov Smirnov test for multivariate Generalized Hyperbolic Distribution in R [on hold]

I am trying to make a goodness of fit for multivariate generalized hyperbolic distribution in R. My data set is the returns for 2 stocks of s&p500. First, I fit a GHD and find the coeficients, ...
0
votes
0answers
25 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
12 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
24 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
22 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
23 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
26 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
72 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
264 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
47 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
11 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
18 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
43 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
62 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
46 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
19 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
77 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
35 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 ...
0
votes
0answers
22 views

In which way i should split my data into buckets in order to perform K.S test?

So i would like to run K.S test on a credit scoring model. one of the ways to perform this test is by spliting the database into 10 buckekts and than measure the max differnce between the cumulative ...
3
votes
0answers
25 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
18 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
267 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
42 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
6 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
63 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
71 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
137 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
81 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
16 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
82 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
47 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
236 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
30 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
18 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 ...
1
vote
0answers
57 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 ...
2
votes
0answers
80 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 ...
0
votes
0answers
61 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 ...
0
votes
0answers
328 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 ...
1
vote
1answer
38 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 ...
5
votes
1answer
83 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, ...
1
vote
0answers
169 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 ...
0
votes
0answers
19 views

How well does a subsample of a large dataset represents the full set in a statistical sense?

Suppose that a large sample $ \{X_k\}_{k=1}^{n} $ (from a multivariate distribution $ X $) is given. I would like find a subsample $ \{ Y_k \}_{k=1}^{m} \subset \{X_k\}_{k=1}^{n} $ of this dataset in ...
2
votes
0answers
45 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 ...
0
votes
0answers
240 views

How to test the goodness of fit with Gamma distribution?

The data is related to stock market whose size is about 1300, and I suggested from the histogram that it should follow distribution of Gamma family. With MATLAB I fit the data, and the fitted curve of ...