-
Notifications
You must be signed in to change notification settings - Fork 2
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
9368f77
commit aa8a229
Showing
1 changed file
with
2 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
import numpy as np | ||
|
||
from abacus.utilities import ( | ||
generalized_pareto, | ||
norm_poisson_mixture, | ||
student_poisson_mixture, | ||
) | ||
from src.abacus.utils.distributions import gp | ||
|
||
|
||
def test_pdf_positivity_gpd(): | ||
gp_pdf = generalized_pareto.gp.pdf | ||
gp_pdf = gp.pdf | ||
space = np.linspace(0, 10, 100) | ||
|
||
for x in space: | ||
assert gp_pdf(x, 0.15, 0.25) >= 0 | ||
|
||
|
||
def test_pdf_positivity_npm(): | ||
npm_pdf = norm_poisson_mixture.npm.pdf | ||
space = np.linspace(-100, 100, 1000) | ||
|
||
for x in space: | ||
assert npm_pdf(x, 0, 1, 0.001, 0.000001) >= 0 | ||
|
||
|
||
def test_pdf_positivity_spm(): | ||
spm_pdf = student_poisson_mixture.spm.pdf | ||
space = np.linspace(-100, 100, 1000) | ||
|
||
for x in space: | ||
assert spm_pdf(x, 0, 1, 0.001, 0.000001, 5) >= 0 |