Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add partype method to lognormal and semicircle #1773

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions src/univariate/continuous/lognormal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ stdlogx(d::LogNormal) = d.σ
mean(d::LogNormal) = ((μ, σ) = params(d); exp(μ + σ^2/2))
median(d::LogNormal) = exp(d.μ)
mode(d::LogNormal) = ((μ, σ) = params(d); exp(μ - σ^2))
partype(d::LogNormal{T}) where {T<:Real} = T
bgctw marked this conversation as resolved.
Show resolved Hide resolved

function var(d::LogNormal)
(μ, σ) = params(d)
Expand Down
2 changes: 2 additions & 0 deletions src/univariate/continuous/semicircle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Semicircle(r::Integer; check_args::Bool=true) = Semicircle(float(r); check_args=
@distr_support Semicircle -d.r +d.r

params(d::Semicircle) = (d.r,)
partype(d::Semicircle{T}) where {T<:Real} = T
bgctw marked this conversation as resolved.
Show resolved Hide resolved


mean(d::Semicircle) = zero(d.r)
var(d::Semicircle) = d.r^2 / 4
Expand Down
Loading