Solved – Two-sample Kolmogorov–Smirnov test with weights

kolmogorov-smirnov testweighted-data

I have to compare two datasets. The first is real data, while the second is a simulation. I want to look just to one variable in the datasets, and testing if it is compatibile between data and simulation. The underlying random variable in continuos. The usual test is the KS test, but in my case the data in the simulation are weighted.

How to run a two-sample KS-test with weighted samples? Should I simply redefine the empirical CDF with weights? Is the distribution of the test statistics the same? Should I do something special?

Best Answer

I have found some information about how to modify the KS and AD tests for weighted samples in Numerical Methods of Statistics by Monohan, pg. 334 in 1E and pg. 358 in 2E. This Google Books link may show the relevant page. I have also attached a screenshot of the relevant page.enter image description here