Skip to content

Fast C++ programs for computing the boundary crossing probability of Poisson and Binomial stochastic processes.

License

Notifications You must be signed in to change notification settings

mosco/crossing-probability

Repository files navigation

crossing-probability

Fast C++ programs (with Python interface) for computing the boundary crossing probability of the empirical CDF.

Currently, the main application of this code is to compute p-values for continuous goodness-of-fit tests such as Kolmogorov-Smirnov and their power for detecting specific distributions. These code may be applied to other problems in the fields of sequential analysis, change-point detection, queuing theory, diffusion, finance, etc.

To learn more, check out the papers:

Amit Moscovich. Fast calculation of p-values for one-sided Kolmogorov-Smirnov type statistics. Computational Statistics & Data Analysis 185 (2023): 107769. https://doi.org/10.1016/j.csda.2023.107769

Amit Moscovich, Boaz Nadler. Fast calculation of boundary crossing probabilities for Poisson processes. Statistics & Probability Letters 123 (2017): 177-182. https://doi.org/10.1016/j.spl.2016.11.027

Illustration of one-sided crossing

Building the binaries

I've tried to build the code on Linux and Mac OSX only. Building on Windows should be possible (e.g. using MinGW or some other GCC installation), but I haven't tried it. It was tested on the gcc and clang compilers.

Prerequisite: The FFTW3 library. Installation instructions.

Simply run make This will build two programs in the ./bin directory:

  • bin/crossprob implements algorithms for computing one-sided and two-sided crossing probabilities.
  • bin/crossprob_mc estimates crossing probabilities using Monte-Carlo simulations.

Then run the tests make test.

Building the Python extension

Run make python followed by python setup.py install to build and install the python module crossprob into your site-packages directory. This uses the standard distutils system. You should then be able to "import crossprob" in your python code.

Build errors?

If you installed FFTW3 on your system, the compilation should just work. If FFTW3 is not installed system-wide (e.g. because you do not have root privilieges) then before configuring and building you need to:

  • Build FFTW3.
  • Add -I (pointing to wherever "fftw3.h" is located) to CXXFLAGS in the Makefile.
  • Add the directory containing libfftw3 to the path in the environment variable LD_LIBRARY_PATH (on linux) or DYLD_LIBRARY_PATH (on OSX).

Usage

Just run ./bin/crossprob or ./bin/crossprob_mc. Usage instructions will be displayed.

Contact

Feel free to ask any questions: moscovich@gmail.com

Amit Moscovich.

About

Fast C++ programs for computing the boundary crossing probability of Poisson and Binomial stochastic processes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published