mitchelloharawild / distributional

Vectorised distributions for R
https://pkg.mitchelloharawild.com/distributional
GNU General Public License v3.0
94 stars 15 forks source link

hilo(<dist_default>) does not work for multivariate distributions #74

Closed mitchelloharawild closed 2 years ago

mitchelloharawild commented 2 years ago

Should <hilo> objects allow for matrix (or even non-numeric) inputs for lower/upper? Or should hilo(<dist_default>) restructure inputs to provide multiple hilo objects?

I'm currently inclined to generalise the object class, as intervals of variables in multivariate distributions should be tightly coupled. Similarly, you might want intervals of ordered categories.

library(distributional)
dist <- dist_multivariate_normal(mu = list(c(1,2)), sigma = list(matrix(c(4,2,2,3), ncol=2)))
hilo(dist)
#> Error: `lower` must be a vector with type <double>.
#> Instead, it has type <double[,2]>.

Created on 2021-11-19 by the reprex package (v2.0.0)