-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06b9b0e
commit 15a173f
Showing
2 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Test caput.foreground.poisson""" | ||
|
||
import numpy as np | ||
|
||
from cora.foreground.poisson import inhomogeneous_process_approx | ||
|
||
def test_inhomogeneous_process_approx(): | ||
"""Test inhomogeneous_process_approx""" | ||
|
||
# the most boringest rate function | ||
rate = lambda s: 1000 * (5 - s) | ||
|
||
|
||
|
||
result = inhomogeneous_process_approx(5, rate) | ||
|
||
# Mean should be approximately 1.666 | ||
mean = result.mean() | ||
assert mean > 1.6 | ||
assert mean < 1.75 | ||
|
||
# stdev should be approximately 1.2 | ||
stdev = result.std() | ||
assert stdev > 1.1 | ||
assert stdev < 1.3 |