diff --git a/src/distribution_wrappers.jl b/src/distribution_wrappers.jl index 33dd451ff..2c9657392 100644 --- a/src/distribution_wrappers.jl +++ b/src/distribution_wrappers.jl @@ -10,11 +10,19 @@ using Distributions: using FillArrays: Fill """ + NamedDist(dist::Distribution, name::Symbol) + A named distribution that carries the name of the random variable with it. + +# Fields + +$(TYPEDFIELDS) """ struct NamedDist{variate,support,Td<:Distribution{variate,support},Tv<:VarName} <: Distribution{variate,support} + "the underlying distribution" dist::Td + "the name of the random variable" name::Tv end @@ -122,4 +130,4 @@ function arraydist(dists::AbstractArray{<:Distribution}) end function arraydist(dists::AbstractVector{<:UnivariateDistribution}) return Product(dists) -end +end \ No newline at end of file