Repository navigation
Add KS-test, a new example and a custom constructor. - #528
Open
Chrthegreat wants to merge 2 commits into
Open
Chrthegreat wants to merge 2 commits into
Chrthegreat wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A global uniformity diagnostic based on the Kolmogorov–Smirnov (KS) test is introduced to evaluate the quality of the generated samples. The method transforms the samples radial distances from the empirical center using the probability integral transform (u=r^d), where (d) is the dimension of the polytope. For uniformly distributed samples, the transformed values should approximately follow a Uniform(0,1) distribution. The KS statistic measures the maximum deviation between the empirical and theoretical cumulative distribution functions, while the associated p-value quantifies the evidence against uniformity.
The result looks like this:
KS Statistic: 0.028998
P-Value: 0.848145
We want KS Statistic close to 0 and p value greater than 0.05.
Other additions in this PR include some functions to read custom polytopes Ax<=b where A and b are provided in CSV files, some tests for the KS test and a new example that benchmarks the sampling methods. Also, we add a new constructor (needed for the example) in the sparse billiard walk, so we can use it the same way as the rest of the uniform walks. The logic in this constructor follows the same logic provided in the official example for the sparse billiard walk.