From 72e2eb9b5afb2380a52a007c0f3ecdb33bea898b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Fri, 14 May 2021 22:35:56 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: David Widmann --- src/pdfnorm.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pdfnorm.jl b/src/pdfnorm.jl index 51edfb69e..2fca711fb 100644 --- a/src/pdfnorm.jl +++ b/src/pdfnorm.jl @@ -4,7 +4,7 @@ Return the square of the L2 norm of the probability density function ``f(x)`` of the distribution `d`: ```math -\\int_{S} f(x)^{2} \\mathrm{d} x +\\big(\\int_{S} f(x)^{2} \\mathrm{d} x \\big)^{1/2} ``` where ``S`` is the support of ``f(x)``. @@ -18,7 +18,7 @@ function pdfsquaredL2norm(d::Beta) return α > 0.5 && β > 0.5 ? z : oftype(z, Inf) end -pdfsquaredL2norm(d::Cauchy) = inv(twoπ * d.σ) +pdfsquaredL2norm(d::Cauchy) = inv2π / d.σ function pdfsquaredL2norm(d::Chi) ν = d.ν