Open jkbest2 opened 5 years ago
I think this is a cool idea. There's an enormous amount missing from #951 et al, but it seems to have got bogged down for ages in other issues, and I definitely don't think I will be adding anything more to it. In this context, I'd really like to have been able to fix support()
so that things like expectation()
in src/functionals.jl
can use a distribution's support directly to work out what to integrate or sum over, and that would definitely extend to multivariate / matrixvariate distributions. I don't have a strong opinion about the type hierarchy at the moment, and I'm not confident that minimum and maximum really make sense in this context, but I think the general idea is great.
Is there any interest in adding
support
,minimum
, andmaximum
methods for the multivariate distributions?insupport
allows checking, but there are currently no methods for querying the support. I'm not sure the best approach to this within theDistributions.jl
framework/type hierarchy. I see that continuous univariate distributions return aRealInterval
object, and discrete distributions generally return aUnitInverval
(though I see the latter may change with #951 and related).Considering just the multivariate (not matrix-variate for now) I would (very tentatively) propose the following type hierarchy, with the distributions they would apply to:
AbstractVectorSupport <: Any
HomogeneousVectorSupport <: AbstractVectorSupport
AbstractMvNormal
AbstractMvLogNormal
AbstractMvTDist
Multinomial
DirichletMultinomial
AbstractMixtureModel{Multivariate, VS, C}
HeterogeneousVectorSupport <: AbstractVectorSupport
Product
SumZeroVectorSupport <: AbstractVectorSupport
Dirichlet
Each of the three concrete types would have fields:
dim <: Integer
elsupport
where the
elsupport
would be something likeRealInterval
, an appropriate discrete support, or in the case ofHeterogeneousVectorSupport
a vector with the support for each element.Then
support
,minimum
, andmaximum
would return the elementwise support for each element. The methods forinsupport
could also use these.I'm open to any and all comments, including that this is unnecessary or unwanted.