Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Distributions"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
authors = ["JuliaStats"]
version = "0.25.128"
version = "0.25.129"

[deps]
AliasTables = "66dad0bd-aa9a-41b7-9441-69ab47430ed8"
Expand Down
4 changes: 1 addition & 3 deletions src/censored.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ function params(d::Censored)
return (d0params..., d.lower, d.upper)
end

function partype(d::Censored{<:UnivariateDistribution,<:ValueSupport,T}) where {T}
return promote_type(partype(d.uncensored), T)
end
partype(::Type{<:Censored{D,S,T}}) where {D,S,T} = promote_type(partype(D), T)

Base.eltype(::Type{<:Censored{D,S,T}}) where {D,S,T} = promote_type(T, eltype(D))

Expand Down
2 changes: 1 addition & 1 deletion src/cholesky/lkjcholesky.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ end

StatsBase.params(d::LKJCholesky) = (d.d, d.η, d.uplo)

@inline partype(::LKJCholesky{T}) where {T <: Real} = T
partype(::Type{<:LKJCholesky{T}}) where {T <: Real} = T

# -----------------------------------------------------------------------------
# Evaluation
Expand Down
2 changes: 1 addition & 1 deletion src/matrix/inversewishart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ size(d::InverseWishart) = size(d.Ψ)
rank(d::InverseWishart) = rank(d.Ψ)

params(d::InverseWishart) = (d.df, d.Ψ)
@inline partype(d::InverseWishart{T}) where {T<:Real} = T
partype(::Type{<:InverseWishart{T}}) where {T<:Real} = T

function mean(d::InverseWishart)
df = d.df
Expand Down
2 changes: 1 addition & 1 deletion src/matrix/lkj.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ end

params(d::LKJ) = (d.d, d.η)

@inline partype(d::LKJ{T}) where {T <: Real} = T
partype(::Type{<:LKJ{T}}) where {T <: Real} = T

# -----------------------------------------------------------------------------
# Evaluation
Expand Down
2 changes: 1 addition & 1 deletion src/matrix/matrixbeta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ params(d::MatrixBeta) = (size(d, 1), d.W1.df, d.W2.df)

mean(d::MatrixBeta) = ((p, n1, n2) = params(d); Matrix((n1 / (n1 + n2)) * I, p, p))

@inline partype(d::MatrixBeta{T}) where {T <: Real} = T
partype(::Type{<:MatrixBeta{T}}) where {T <: Real} = T

# Konno (1988 JJSS) Corollary 3.3.i
function cov(d::MatrixBeta, i::Integer, j::Integer, k::Integer, l::Integer)
Expand Down
2 changes: 1 addition & 1 deletion src/matrix/matrixfdist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function mean(d::MatrixFDist)
return (n1 / (n2 - p - 1)) * Matrix(B)
end

@inline partype(d::MatrixFDist{T}) where {T <: Real} = T
partype(::Type{<:MatrixFDist{T}}) where {T <: Real} = T

# Konno (1988 JJSS) Corollary 2.4.i
function cov(d::MatrixFDist, i::Integer, j::Integer, k::Integer, l::Integer)
Expand Down
2 changes: 1 addition & 1 deletion src/matrix/matrixnormal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var(d::MatrixNormal) = reshape(diag(cov(d)), size(d))

params(d::MatrixNormal) = (d.M, d.U, d.V)

@inline partype(d::MatrixNormal{T}) where {T<:Real} = T
partype(::Type{<:MatrixNormal{T}}) where {T<:Real} = T

# -----------------------------------------------------------------------------
# Evaluation
Expand Down
2 changes: 1 addition & 1 deletion src/matrix/matrixtdist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ var(d::MatrixTDist) = d.ν <= 2 ? throw(ArgumentError("var only defined for df >

params(d::MatrixTDist) = (d.ν, d.M, d.Σ, d.Ω)

@inline partype(d::MatrixTDist{T}) where {T <: Real} = T
partype(::Type{<:MatrixTDist{T}}) where {T <: Real} = T

# -----------------------------------------------------------------------------
# Evaluation
Expand Down
2 changes: 1 addition & 1 deletion src/matrix/wishart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ size(d::Wishart) = size(d.S)

rank(d::Wishart) = d.rank
params(d::Wishart) = (d.df, d.S)
@inline partype(d::Wishart{T}) where {T<:Real} = T
partype(::Type{<:Wishart{T}}) where {T<:Real} = T

mean(d::Wishart) = d.df * Matrix(d.S)

Expand Down
2 changes: 1 addition & 1 deletion src/mixtures/mixturemodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ component(d::MixtureModel, k::Int) = d.components[k]

probs(d::MixtureModel) = probs(d.prior)
params(d::MixtureModel) = ([params(c) for c in d.components], params(d.prior)[1])
partype(d::MixtureModel) = promote_type(partype(d.prior), map(partype, d.components)...)
partype(::Type{<:MixtureModel{VF,VS,C,CT}}) where {VF,VS,C,CT} = promote_type(partype(CT), partype(C))

minimum(d::MixtureModel) = minimum([minimum(dci) for dci in d.components])
maximum(d::MixtureModel) = maximum([maximum(dci) for dci in d.components])
Expand Down
1 change: 1 addition & 0 deletions src/mixtures/unigmm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ rand(rng::AbstractRNG, d::UnivariateGMM) =
(k = rand(rng, d.prior); d.means[k] + randn(rng) * d.stds[k])

params(d::UnivariateGMM) = (d.means, d.stds, d.prior)
partype(::Type{<:UnivariateGMM{VT1,VT2,C}}) where {VT1,VT2,C} = promote_type(eltype(VT1), eltype(VT2), partype(C))

struct UnivariateGMMSampler{VT1<:AbstractVector{<:Real},VT2<:AbstractVector{<:Real}} <: Sampleable{Univariate,Continuous}
means::VT1
Expand Down
2 changes: 1 addition & 1 deletion src/multivariate/dirichlet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Base.show(io::IO, d::Dirichlet) = show(io, d, (:alpha,))
length(d::Dirichlet) = length(d.alpha)
mean(d::Dirichlet) = d.alpha .* inv(d.alpha0)
params(d::Dirichlet) = (d.alpha,)
@inline partype(::Dirichlet{T}) where {T<:Real} = T
partype(::Type{<:Dirichlet{T}}) where {T<:Real} = T

function var(d::Dirichlet)
α0 = d.alpha0
Expand Down
2 changes: 1 addition & 1 deletion src/multivariate/dirichletmultinomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ncategories(d::DirichletMultinomial) = length(d.α)
length(d::DirichletMultinomial) = ncategories(d)
ntrials(d::DirichletMultinomial) = d.n
params(d::DirichletMultinomial) = (d.n, d.α)
@inline partype(d::DirichletMultinomial{T}) where {T} = T
partype(::Type{<:DirichletMultinomial{T}}) where {T} = T

# Statistics
mean(d::DirichletMultinomial) = d.α .* (d.n / d.α0)
Expand Down
2 changes: 1 addition & 1 deletion src/multivariate/jointorderstatistics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ minimum(d::JointOrderStatistics) = Fill(minimum(d.dist), length(d))
maximum(d::JointOrderStatistics) = Fill(maximum(d.dist), length(d))

params(d::JointOrderStatistics) = tuple(params(d.dist)..., d.n, d.ranks)
partype(d::JointOrderStatistics) = partype(d.dist)
partype(::Type{<:JointOrderStatistics{D}}) where {D} = partype(D)
Base.eltype(::Type{<:JointOrderStatistics{D}}) where {D} = Base.eltype(D)
Base.eltype(d::JointOrderStatistics) = eltype(d.dist)

Expand Down
2 changes: 1 addition & 1 deletion src/multivariate/multinomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ probs(d::Multinomial) = d.p
ntrials(d::Multinomial) = d.n

params(d::Multinomial) = (d.n, d.p)
@inline partype(d::Multinomial{T}) where {T<:Real} = T
partype(::Type{<:Multinomial{T}}) where {T<:Real} = T

### Conversions
convert(::Type{Multinomial{T, TV}}, d::Multinomial) where {T<:Real, TV<:AbstractVector{T}} = Multinomial(d.n, TV(d.p))
Expand Down
2 changes: 1 addition & 1 deletion src/multivariate/mvlogitnormal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ length(d::MvLogitNormal) = length(d.normal) + 1
Base.eltype(::Type{<:MvLogitNormal{D}}) where {D} = eltype(D)
Base.eltype(d::MvLogitNormal) = eltype(d.normal)
params(d::MvLogitNormal) = params(d.normal)
@inline partype(d::MvLogitNormal) = partype(d.normal)
partype(::Type{<:MvLogitNormal{D}}) where {D} = partype(D)

location(d::MvLogitNormal) = mean(d.normal)
minimum(d::MvLogitNormal) = fill(zero(eltype(d)), length(d))
Expand Down
2 changes: 1 addition & 1 deletion src/multivariate/mvlognormal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ end

length(d::MvLogNormal) = length(d.normal)
params(d::MvLogNormal) = params(d.normal)
@inline partype(d::MvLogNormal{T}) where {T<:Real} = T
partype(::Type{<:MvLogNormal{T}}) where {T<:Real} = T

"""
location(d::MvLogNormal)
Expand Down
2 changes: 1 addition & 1 deletion src/multivariate/mvnormal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ Base.show(io::IO, d::MvNormal) =
length(d::MvNormal) = length(d.μ)
mean(d::MvNormal) = d.μ
params(d::MvNormal) = (d.μ, d.Σ)
@inline partype(d::MvNormal{T}) where {T<:Real} = T
partype(::Type{<:MvNormal{T}}) where {T<:Real} = T

var(d::MvNormal) = diag(d.Σ)
cov(d::MvNormal) = d.Σ
Expand Down
2 changes: 1 addition & 1 deletion src/multivariate/mvnormalcanon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ canonform(d::MvNormal{T,C,Zeros{T}}) where {C, T<:Real} = MvNormalCanon(inv(d.Σ
length(d::MvNormalCanon) = length(d.μ)
mean(d::MvNormalCanon) = convert(Vector{eltype(d.μ)}, d.μ)
params(d::MvNormalCanon) = (d.μ, d.h, d.J)
@inline partype(d::MvNormalCanon{T}) where {T<:Real} = T
partype(::Type{<:MvNormalCanon{T}}) where {T<:Real} = T
Base.eltype(::Type{<:MvNormalCanon{T}}) where {T} = T

var(d::MvNormalCanon) = diag(inv(d.J))
Expand Down
2 changes: 1 addition & 1 deletion src/multivariate/mvtdist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ invcov(d::GenericMvTDist) = d.df>2 ? ((d.df-2)/d.df)*Matrix(inv(d.Σ)) : NaN*one
logdet_cov(d::GenericMvTDist) = d.df>2 ? logdet((d.df/(d.df-2))*d.Σ) : NaN

params(d::GenericMvTDist) = (d.df, d.μ, d.Σ)
@inline partype(d::GenericMvTDist{T}) where {T} = T
partype(::Type{<:GenericMvTDist{T}}) where {T} = T
Base.eltype(::Type{<:GenericMvTDist{T}}) where {T} = T

# For entropy calculations see "Multivariate t Distributions and their Applications", S. Kotz & S. Nadarajah
Expand Down
1 change: 1 addition & 0 deletions src/multivariate/product.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function Base.eltype(::Type{<:Product{S,T}}) where {S<:ValueSupport,
T<:UnivariateDistribution{S}}
return eltype(T)
end
partype(::Type{<:Product{S,T}}) where {S,T} = partype(T)

_rand!(rng::AbstractRNG, d::Product, x::AbstractVector{<:Real}) =
map!(Base.Fix1(rand, rng), x, d.v)
Expand Down
2 changes: 1 addition & 1 deletion src/multivariate/vonmisesfisher.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ concentration(d::VonMisesFisher) = d.κ

insupport(d::VonMisesFisher, x::AbstractVector{T}) where {T<:Real} = isunitvec(x)
params(d::VonMisesFisher) = (d.μ, d.κ)
@inline partype(d::VonMisesFisher{T}) where {T<:Real} = T
partype(::Type{<:VonMisesFisher{T}}) where {T<:Real} = T

### Evaluation

Expand Down
2 changes: 1 addition & 1 deletion src/reshaped.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end
Base.size(d::ReshapedDistribution) = d.dims
Base.eltype(::Type{ReshapedDistribution{<:Any,<:ValueSupport,D}}) where {D} = eltype(D)

partype(d::ReshapedDistribution) = partype(d.dist)
partype(::Type{<:ReshapedDistribution{<:Any,<:ValueSupport,D}}) where {D} = partype(D)
params(d::ReshapedDistribution) = (d.dist, d.dims)

function insupport(d::ReshapedDistribution{N}, x::AbstractArray{<:Real,N}) where {N}
Expand Down
2 changes: 1 addition & 1 deletion src/truncate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function truncated(d::Truncated, l::Real, ::Nothing)
end

params(d::Truncated) = tuple(params(d.untruncated)..., d.lower, d.upper)
partype(d::Truncated{<:UnivariateDistribution,<:ValueSupport,T}) where {T<:Real} = promote_type(partype(d.untruncated), T)
partype(::Type{<:Truncated{D,S,T}}) where {D,S,T} = promote_type(partype(D), T)

Base.eltype(::Type{<:Truncated{D}}) where {D<:UnivariateDistribution} = eltype(D)
Base.eltype(d::Truncated) = eltype(d.untruncated)
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/arcsine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Base.convert(::Type{Arcsine{T}}, d::Arcsine{T}) where {T<:Real} = d
location(d::Arcsine) = d.a
scale(d::Arcsine) = d.b - d.a
params(d::Arcsine) = (d.a, d.b)
partype(::Arcsine{T}) where {T} = T
partype(::Type{<:Arcsine{T}}) where {T} = T


### Statistics
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/beta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Base.convert(::Type{Beta{T}}, d::Beta{T}) where {T<:Real} = d
#### Parameters

params(d::Beta) = (d.α, d.β)
@inline partype(d::Beta{T}) where {T<:Real} = T
partype(::Type{<:Beta{T}}) where {T<:Real} = T


#### Statistics
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/betaprime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Base.convert(::Type{BetaPrime{T}}, d::BetaPrime{T}) where {T<:Real} = d
#### Parameters

params(d::BetaPrime) = (d.α, d.β)
@inline partype(d::BetaPrime{T}) where {T<:Real} = T
partype(::Type{<:BetaPrime{T}}) where {T<:Real} = T

#### Statistics

Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/biweight.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Biweight(μ::Real=0.0) = Biweight(μ, one(μ); check_args=false)

## Parameters
params(d::Biweight) = (d.μ, d.σ)
@inline partype(d::Biweight{T}) where {T<:Real} = T
partype(::Type{<:Biweight{T}}) where {T<:Real} = T

## Properties
mean(d::Biweight) = d.μ
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/cauchy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ location(d::Cauchy) = d.μ
scale(d::Cauchy) = d.σ

params(d::Cauchy) = (d.μ, d.σ)
@inline partype(d::Cauchy{T}) where {T<:Real} = T
partype(::Type{<:Cauchy{T}}) where {T<:Real} = T


#### Statistics
Expand Down
2 changes: 2 additions & 0 deletions src/univariate/continuous/chernoff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ cdf(Chernoff(),-x) # For tail probabilities, use this instead of 1-
struct Chernoff <: ContinuousUnivariateDistribution
end

partype(::Type{Chernoff}) = Union{}

module ChernoffComputations
import QuadGK.quadgk
# The following arrays of constants have been precomputed to speed up computation.
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/chi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Base.convert(::Type{Chi{T}}, d::Chi{T}) where {T<:Real} = d

dof(d::Chi) = d.ν
params(d::Chi) = (d.ν,)
@inline partype(d::Chi{T}) where {T<:Real} = T
partype(::Type{<:Chi{T}}) where {T<:Real} = T


#### Statistics
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/chisq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Chisq(ν::Integer; check_args::Bool=true) = Chisq(float(ν); check_args=check_ar

dof(d::Chisq) = d.ν
params(d::Chisq) = (d.ν,)
@inline partype(d::Chisq{T}) where {T<:Real} = T
partype(::Type{<:Chisq{T}}) where {T<:Real} = T

### Conversions
convert(::Type{Chisq{T}}, ν::Real) where {T<:Real} = Chisq(T(ν))
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/cosine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ location(d::Cosine) = d.μ
scale(d::Cosine) = d.σ

params(d::Cosine) = (d.μ, d.σ)
@inline partype(d::Cosine{T}) where {T<:Real} = T
partype(::Type{<:Cosine{T}}) where {T<:Real} = T


#### Statistics
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/epanechnikov.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Base.convert(::Type{Epanechnikov{T}}, d::Epanechnikov{T}) where {T<:Real} = d
location(d::Epanechnikov) = d.μ
scale(d::Epanechnikov) = d.σ
params(d::Epanechnikov) = (d.μ, d.σ)
@inline partype(d::Epanechnikov{T}) where {T<:Real} = T
partype(::Type{<:Epanechnikov{T}}) where {T<:Real} = T

## Properties
mean(d::Epanechnikov) = d.μ
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/erlang.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ shape(d::Erlang) = d.α
scale(d::Erlang) = d.θ
rate(d::Erlang) = inv(d.θ)
params(d::Erlang) = (d.α, d.θ)
@inline partype(d::Erlang{T}) where {T<:Real} = T
partype(::Type{<:Erlang{T}}) where {T<:Real} = T

#### Statistics

Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/exponential.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ scale(d::Exponential) = d.θ
rate(d::Exponential) = inv(d.θ)

params(d::Exponential) = (d.θ,)
partype(::Exponential{T}) where {T<:Real} = T
partype(::Type{<:Exponential{T}}) where {T<:Real} = T

#### Statistics

Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/fdist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Base.convert(::Type{FDist{T}}, d::FDist{T}) where {T<:Real} = d
#### Parameters

params(d::FDist) = (d.ν1, d.ν2)
@inline partype(d::FDist{T}) where {T<:Real} = T
partype(::Type{<:FDist{T}}) where {T<:Real} = T


#### Statistics
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/frechet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Base.convert(::Type{Frechet{T}}, d::Frechet{T}) where {T<:Real} = d
shape(d::Frechet) = d.α
scale(d::Frechet) = d.θ
params(d::Frechet) = (d.α, d.θ)
partype(::Frechet{T}) where {T} = T
partype(::Type{<:Frechet{T}}) where {T} = T


#### Statistics
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/gamma.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ scale(d::Gamma) = d.θ
rate(d::Gamma) = 1 / d.θ

params(d::Gamma) = (d.α, d.θ)
partype(::Gamma{T}) where {T} = T
partype(::Type{<:Gamma{T}}) where {T} = T

#### Statistics

Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/generalizedextremevalue.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ shape(d::GeneralizedExtremeValue) = d.ξ
scale(d::GeneralizedExtremeValue) = d.σ
location(d::GeneralizedExtremeValue) = d.μ
params(d::GeneralizedExtremeValue) = (d.μ, d.σ, d.ξ)
@inline partype(d::GeneralizedExtremeValue{T}) where {T<:Real} = T
partype(::Type{<:GeneralizedExtremeValue{T}}) where {T<:Real} = T


#### Statistics
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/generalizedpareto.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ location(d::GeneralizedPareto) = d.μ
scale(d::GeneralizedPareto) = d.σ
shape(d::GeneralizedPareto) = d.ξ
params(d::GeneralizedPareto) = (d.μ, d.σ, d.ξ)
partype(::GeneralizedPareto{T}) where {T} = T
partype(::Type{<:GeneralizedPareto{T}}) where {T} = T

#### Statistics

Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/gumbel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Base.convert(::Type{Gumbel{T}}, d::Gumbel{T}) where {T<:Real} = d
location(d::Gumbel) = d.μ
scale(d::Gumbel) = d.θ
params(d::Gumbel) = (d.μ, d.θ)
partype(::Gumbel{T}) where {T} = T
partype(::Type{<:Gumbel{T}}) where {T} = T

function Base.rand(rng::Random.AbstractRNG, d::Gumbel)
return d.μ - d.θ * log(randexp(rng, float(eltype(d))))
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/inversegamma.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ scale(d::InverseGamma) = d.θ
rate(d::InverseGamma) = scale(d.invd)

params(d::InverseGamma) = (shape(d), scale(d))
partype(::InverseGamma{T}) where {T} = T
partype(::Type{<:InverseGamma{T}}) where {T} = T


#### Parameters
Expand Down
Loading
Loading