If you run @edit logpdf(Normal(0, 1), 0.5) it will open up the line where this is implemented. However, in this case it is a bit obscure: it is a macro that delegates to the corresponding function to StatsFuns.jl. e.g. for the Normal distribution the delegation occurs here, which causes logpdf(d::Normal, x) to call StatsFuns.normlogpdf(d.μ, d.σ, x).
2 Likes