Skip to content

Commit

Permalink
Updated distributions test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sinbad-The-Sailor committed Feb 6, 2024
1 parent 9368f77 commit aa8a229
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions tests/test_distributions.py
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

0 comments on commit aa8a229

Please sign in to comment.