Skip to content

Commit

Permalink
Added test for phase_dispersion_logprobability
Browse files Browse the repository at this point in the history
  • Loading branch information
dhuppenkothen committed Apr 24, 2023
1 parent b309b84 commit bb8cd27
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions stingray/tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,15 @@ def test_compare_fold_logprob_with_prob(self, nbin):
p = fold_profile_probability(stat, nbin)
assert np.allclose(logp, np.log(p))


@pytest.mark.parametrize("nbin", [8, 16, 23, 72])
def test_compare_pdm_logprob_with_prob(self, nbin):
nsamples = 10000
stat = np.random.uniform(5, 200, 5)
logp = phase_dispersion_logprobability(stat, nsamples, nbin)
p = phase_dispersion_probability(stat, nsamples, nbin)
assert np.allclose(logp, np.log(p))

@pytest.mark.parametrize("n", [2, 16, 23, 72])
def test_compare_z2n_logprob_with_prob(self, n):
stat = np.random.uniform(5, 200, 5)
Expand Down

0 comments on commit bb8cd27

Please sign in to comment.