Skip to content

Commit

Permalink
fix: Set probability density to zero for non-positive arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
abensonca committed Dec 11, 2024
1 parent c41896d commit 76f43b6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/statistics.distributions.lognormal.F90
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,12 @@ double precision function logNormalDensity(self,x)
class (distributionFunction1DLogNormal), intent(inout) :: self
double precision , intent(in ) :: x

logNormalDensity=+self%distributionFunction1DNormal%density(log(x)) &
& /x
if (x > 0.0d0) then
logNormalDensity=+self%distributionFunction1DNormal%density(log(x)) &
& /x
else
logNormalDensity=+0.0d0
end if
return
end function logNormalDensity

Expand Down

0 comments on commit 76f43b6

Please sign in to comment.