Skip to content

Commit

Permalink
Add Mode to Rice (#649)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleicazatti authored Feb 21, 2025
1 parent f21909f commit 4aad654
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion preliz/distributions/rice.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from preliz.distributions.distributions import Continuous
from preliz.internal.distribution_helper import all_not_none, eps
from preliz.internal.optimization import optimize_ml, optimize_moments_rice
from preliz.internal.optimization import find_mode, optimize_ml, optimize_moments_rice
from preliz.internal.special import cdf_bounds, ppf_bounds_cont


Expand Down Expand Up @@ -129,6 +129,9 @@ def entropy(self):
def mean(self):
return self.sigma * np.sqrt(np.pi / 2) * _l_half(-(self.nu**2) / (2 * self.sigma**2))

def mode(self):
return find_mode(self)

def median(self):
return self.ppf(0.5)

Expand Down

0 comments on commit 4aad654

Please sign in to comment.