Skip to content

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

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

Finesim97/crossing-probability

 
 

Repository files navigation

crossing-probability

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

Changes by Lukas Klein:

  • Add missing includes for iterator and limits
  • R Package build files (configure scripts, run autoreconf to update them from configure.ac and devtools::document())

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 preprint:

Amit Moscovich (2020). Fast calculation of p-values for one-sided Kolmogorov-Smirnov type statistics.

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: [email protected]

Amit Moscovich.

About

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

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 83.5%
  • Python 8.7%
  • R 2.9%
  • C 1.9%
  • SWIG 0.9%
  • Makefile 0.8%
  • Other 1.3%