Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: David Widmann <devmotion@users.noreply.github.com>
  • Loading branch information
giordano and devmotion authored May 14, 2021
1 parent 72e2eb9 commit fbd84e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pdfnorm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Return the square of the L2 norm of the probability density function ``f(x)`` of the distribution `d`:
```math
\\big(\\int_{S} f(x)^{2} \\mathrm{d} x \\big)^{1/2}
\\int_{S} f(x)^{2} \\mathrm{d} x
```
where ``S`` is the support of ``f(x)``.
Expand Down Expand Up @@ -36,7 +36,7 @@ end

pdfsquaredL2norm(d::Exponential) = 1 / (2 * d.θ)

function pdfsquaredL2norm(d::Gamma{T}) where {T}
function pdfsquaredL2norm(d::Gamma)
α, θ = params(d)
z = (2^(1 - 2 * α) * gamma(2 * α - 1)) / (gamma(α) ^ 2 * θ)
# L2 norm of the pdf converges only for α > 0.5
Expand Down

0 comments on commit fbd84e8

Please sign in to comment.