Skip to content

Conversation

@JoseKling
Copy link
Owner

@JoseKling JoseKling commented Jul 21, 2025

Statistics

Implemented two versions of the Kolmogorov-Smirnov distance as a test statistic.

  1. Time-rescaled event times against a uniform distribution
  2. Time-rescaled interevent times against a unit exponential distribution

Tests

Bootstrap and non-bootstrap based tests

  1. Bootstrap

    1. Estimate process
    2. Calculate test statistic
    3. Simulate data with estimated process
    4. Estimate processes from each simulation
    5. Calculate test statistic for each simulation
    6. Compare test statistic from data and from simulations to get the p value
  2. Non-bootstrap
    Same as above, but skip step 4, so use estimation in step 1 to calculate test statistic

Issues

  • Types and methods names
    Perhaps the names can be improved. If you have any suggestions...

  • Type piracy
    Tried implementing a fit method for the Dirac distribution (there isn't one in Distributions.jl), so the fit method works for the UnivariatePoissonProcess, but tests complain about type piracy. Decided to implement a fit method specifically for unmarked Poisson processes instead.

- Bootstrap and non-bootstrap based tests
- KSDistance statistic for hypothesis testing
    - Time re-scaled events againt uniform
    - Time re-scaled inter events against exponential
- Tests take types instead of instances of point processes
- `NoBootstrapTest` may take an instances

TODO:
- Add Tests
- Statistics now work for general types
- Added a `AbstractRNG` to the tests to control simulations
- `BootstrapTest` and `NoBootstrapTest` are subtypes of `HypothesisTest`
    - Fields have fixed types, as done in `HypothesisTests.jl`
- Fixed some mistakes

TODO: Add tests
@codecov
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

❌ Patch coverage is 94.73684% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/HypothesisTests/PPTests/BootstrapTest.jl 93.33% 1 Missing ⚠️
src/HypothesisTests/PPTests/NoBootstrapTest.jl 94.44% 1 Missing ⚠️
src/HypothesisTests/pp_test.jl 91.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@JoseKling JoseKling mentioned this pull request Oct 28, 2025
ISSUES:
- Type piracy: needed to implement `fit` for the `Dirac` distribution
- Names: type and method names could maybe be improved
- PPTest: Fields in `BootstrapTest` and `NoBootstrapTest` make sense
          only for simulation based tests. Anything more general?
@JoseKling JoseKling marked this pull request as ready for review November 17, 2025 10:54
`Distributions.jl` does not provide a `fit` method, so a separate `fit`
method for unmarked Poisson processes was added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants