# Univariate empirical distribution from a vector
ed <- empirical_dist(c(1, 2, 3, 4, 5))
mean(ed)
# Multivariate empirical distribution from a matrix
mat <- matrix(c(1, 2, 3, 4, 5, 6), ncol = 2)
ed_mv <- empirical_dist(mat)
dim(ed_mv)
Run the code above in your browser using DataLab