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.

Filter by
Sorted by
Tagged with
1
vote
1answer
33 views

Kolmogorov Smirnov test - correct data to compare against a standard normal distribution or not correct?

The question arose from my analysis on Matlab. The function kstest(x) compares data set x against a standard normal distribution (mean 0 and std 1) My question is, do you correct the data set to ...
0
votes
0answers
16 views

Testing asymmetry and normality directly on my time series

This might be a stupid question but I am just approaching time series analysis in r for the first time. I have to choose a model for my financial time series, I have daily frquency data and I want to ...
2
votes
0answers
19 views

Two-sample KS test null distribution, reference request

I follow, more or less, the derivation of the KS test statistics's distribution that is given on Wikipedia. The following section on the two-sample test also makes sense if all I want to do is reject ...
0
votes
1answer
35 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 ...
7
votes
2answers
436 views

How can the F-test reject the null hypothesis while the KS test does not?

Suppose I have two datasets, $\mathbf{a}$ and $\mathbf{b}$. I want to test whether the two datasets are different in a statistically significant way. To compute the F-test, I take the ratio of the ...
0
votes
2answers
26 views

Why do my Kolmogorov-Smirnov test statistic D differ?

I did a ks test on excel through a youtube video. https://www.youtube.com/watch?v=cltWQsmBg0k In case I had done the excel wrongly I thought that I should check it with an online calculator of the ...
0
votes
1answer
32 views

Checking the normality of a large sample?

If I want to analyze a large sample size (N = 50.000) of continuous data ($ revenue) from an A/B test, what would then be the best way to check for normality? Thanks in advance!
1
vote
1answer
27 views

Using one-sample Kolmogorov-Smirnov test impementation for comparing two samples with purely discrete CDF

In one-sample Kolmogorov-Smirnov test one tests whether sample $X = (X_1,\dots,X_n)$ come from theoretical distribution by computing $D_n = \sup_{x} |F_n(x) - F(x)|$, where $F_n(x)$ denotes the ...
2
votes
0answers
27 views

What linear transformation minimizes the Kolmogorov–Smirnov distance between two sets of points?

Suppose we have two sets of real-valued points $X_1, \dots, X_m$ and $Y_1, \dots, Y_n$. We want to find the linear transformation that makes the distributions look alike. If we want them to have the ...
1
vote
1answer
35 views

How can I evaluate the performance of a program to calculate the exact Kolmogorov-Smirnof PDF

For reasons abstruse I wish to create a program to calculate the exact density function for the $D$ statistic from Kolmogorov-Smirnov's two-sample test. Here is the code I have so far. ...
1
vote
0answers
25 views

KS-style test between curves in general

The setup of my problem is that I have some response variable, $Y$, and a predictor, $X$. I have measurements on both variables from two groups. In each group, there is one $Y$ per $X$. I want to ...
2
votes
1answer
80 views

Limitations of Kolmogorov–Smirnov test

In this article, it is said that the test statistic tends to be more sensitive near the center of the distribution than at the tails. Can some please explain this what it means? (with a simple example ...
0
votes
0answers
35 views

Test to compare cumulative distributions

I would like to compare multiple cumulative distributions, and cluster them accordingly to their 'shape'. My distributions look like the one in the figure on the x axis there are the number of items ...
1
vote
1answer
16 views

How can a neural net recognize it is out of its training domain?

In a recent kaggle competition with a huge overfitting potential the winning team first searched for features on the training data and after the feature engineering used a Kolmogorov-Smirnov Test for ...
1
vote
1answer
22 views

Scipy Kolmogorov Smirnov test

I wanted to know what is significance level (alpha) in scipy's Kolmogorov test. Here is a link to documentation page. I couldn't find anything in its documentation.
1
vote
1answer
69 views

Difference between QQ plot and KS test

While solving some exercises for HW, I came up to use QQ plot and KS test for the sake of testing goodness of fitting, where I also came up with the following doubts: Precisely, let $X, Y \sim \text{...
6
votes
1answer
82 views

Kolmogorov Smirnov p-values not uniform under the null in R?

It is well known that the distribution of the p-value in a statistical test is $U(0,1)$ under the null. Now, consider the following implementation of the two-samples Kolmogorov Smirnov test on normal ...
0
votes
1answer
20 views

Use Effect Size VS p-Value when determining the best fitting distribution?

I have a large sample size of about 50,000 I want to determine what theoretical distribution fits the distribution of my samples the best. What I did is to fit all distributions I know to the data ...
2
votes
2answers
83 views

Can the Kolmogorov-Smirnov statistic be used to check if these

Disclaimer: Note this is a simplified version of my actual problem. These are not my real data. The set up The hexbin plot shows mass and height of goats in Iceland. There are a few thousand samples....
0
votes
2answers
46 views

Two-sample KS test results vs distributions

WARNING : MAJOR UPDATE BELOW, I've made a mistake I am currently working on validating a predictive model that was made some years ago. In doing so, I am comparing the distribution of the Target ...
0
votes
1answer
44 views

What statistical test should I perform for the data who comes from more than one population? [closed]

I want to check the chosen property (for example volume, density etc.) between data of experiment 1 and experiment 2, whether the difference of property between the experiment is significant or not? ...
1
vote
1answer
35 views

Is a Kolmogorov-Smirnov test appropriate for this use case?

I have two surveys out right now, both with approximately 200K responses. After looking at their descriptive statistics, one of them seem to be getting slightly higher ratings (type int; range(0-5)). ...
1
vote
1answer
48 views

Is Kolmogorov-Smirnov test known to fail in some special cases?

I would like to use two samples Kolmogorov-Smirnov test to check if two given samples are coming from different distributions. For that I use scipy implementation of the KS test. I have found out ...
0
votes
0answers
58 views

Comparing two-sample statistical test results: Kolmogorov-Smirnov and Anderson-Darling

I am not sure how to interpret a given Anderson-Darling criterion as computed from SciPy. Suppose, for example, I have a Kolmogorov-Smirnov (KS) statistic of 0.60 and an Anderson-Darling (AD) ...
0
votes
0answers
8 views

Questions Tags Users Unanswered Connection of the critical value for KS distance and model complexity

I asked a similar question is math exchange, but here it seems to fit better. I wonder about a relationship of the critical value for the KS distance (with Lilliefor correction) and model complexity? ...
1
vote
1answer
28 views

Comparing survey data to passively measured data

Basic Situation: I have quite a large sample of around 10k people. In that sample I have two values for each person: a passively measured value of an amount of time, as well as their estimation of ...
0
votes
0answers
16 views

Tests if k-samples are from same population are rejected for large N?

For a very large data set I have created a number of samples and try to verify whether the distribution of the variables in those samples is similar. I.e. I'm trying to verify that the sampling ...
3
votes
1answer
184 views

Kolmogorov-Smirnov (ks_2samp) p-value not as expected - Wrong test or understanding?

Context I am using scipy's ks_samp in order to apply the Kolmogorov-Smirnov-test. The data I use is twofold: I have a dataset ...
1
vote
1answer
29 views

How do I statistically compare the readings from two different sensors? [duplicate]

I have temperature and humidity readings from two different sensors (located in the same geographical area). The data is logged every hour and I have data for more than a year, logged this way 2/1/...
0
votes
1answer
26 views

Comparing the distribution

I want to compare the distribution of 2 independant datasets. Measurements were performed on an experimental dataset (TEST) and compared with a completely independant reference dataset (REF). The idea ...
3
votes
2answers
87 views

How do you decide what an acceptable p-value is for a K-S test?

Let's say you're thinking about running a hypothesis test (like a t-test) on some data that requires your sample to be normally distributed. You decide on a 95% CI and you run a Kolmogorov-Smirnov ...
0
votes
0answers
29 views

Kolmogorov–Smirnov (KS) two sample test interpretation

I am reading a paper which uses the KS two sample test to compare two signals: observed signal and predicted signal. The authors compute the test statistic value and p-value, and set the critical ...
1
vote
1answer
67 views

Interpretation of the D-statistic from 2-sample KS-tests

I've been using the two sample Kolmogorov-Smirnov test to compare observations from 2018 vs observations from 2019. I heard from my co-worker that you can interpret the D-statistic as the magnitude ...
0
votes
0answers
12 views

Why does the test statistic of a 2 Sample K-S test change drastically when noise is added to samples?

I believe I have gone through all 2 Sample K-S test related posts here, but I could not see the answer to my problem. At this point, I don't know whether the problem is related to a bug in the ...
0
votes
0answers
23 views

Mysterious recurrance of p value 0.2 in Kolmogorov Smirnov test

I am using the code that I posted in this question, although the question was different. So my problem is that I am running Kolmogorov Smirnov test for normality in statsmodels diagnostics, to test ...
0
votes
1answer
130 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 ...
0
votes
0answers
37 views

QQ plot looks like gaussian, but kolmogorov smirnov test suggests to reject null hypothesis

I am testing my estimation of maximum likelihood parameters using the normal equation for gaussian generalised linear model. I am trying 3 covariates and 4 parameters (i.e. includingintercept) and in ...
0
votes
0answers
21 views

Anomaly detection through distribution-based hypothesis testing

I have a table of event logs that contains several categorical variables (gender, age bucket, city of residence, and education level), and I'd like to retroactively identify if a given hour of logs ...
0
votes
0answers
73 views

How to test difference in skewness and kurtosis for two samples with different mean?

There are several questions asking for comparing these moments for two distributions coming from the same population distribution (i.e. expecting to have the same mean). Examples are here and here. ...
1
vote
1answer
112 views

Kolmogorov-Smirnov test vs. Wilcoxon signed-rank test for two samples

I would like to ask a question about the usage of Kolmogorov-Smirnov test and Wilcoxon signed-rank test to show that two samples have the same distribution (specifically, log-normal). Specifically, I ...
0
votes
0answers
16 views

Estimator maximizing pvalue of Kolmogorov-Smirnov test

Suppose we have some reasonable distribution known up to some unknown parameter $θ$ and sample $X_1$, $X_2$, ..., $X_n$ from that distribution. For each possible candidate parameter $\hat{θ}$ we can ...
5
votes
1answer
96 views

Non-uniform distribution of p-values

I'm running a Monte Carlo simulation to check whether a distribution generated by my model fits a pre-defined target distribution where the parameters of the target distribution are estimated from the ...
1
vote
0answers
118 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 ...
2
votes
1answer
80 views

How to test statistics for the similarity or dissimilarity between these two curve?

I want to check how dissimilar these two curves are. What statistical test shall I perform? Pvalue from following test (MATLAB command) are given. ...
1
vote
0answers
21 views

Stopping rule in a Monte Carlo simulation for a convergent sequence of unknown random variables

Given an unknown random variable $X: \Omega \mapsto [a,b] \subset \mathbb{R}$, let us imagine we want to estimate $\mathbb{E}(X)$. We can sample sequentially as many times as desired, let us say $m$ ...
3
votes
1answer
39 views

solve an exercise of two samples using Kolmogorov-smirnov

I'm looking for books and information like crazy and I can not find what I need. Well the example proposed is about methods that have been used in literature students and these are the data collected: ...
1
vote
1answer
31 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
vote
1answer
193 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: ...
1
vote
1answer
596 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
75 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 ...