powered by
Uniform sampling from an elliptical niche region.
niche.runif(n, mu, Sigma, alpha = 0.95)
IID draws from a uniform distribution on the elliptical niche region.
Number of random draws.
Mean vector.
Variance matrix.
Probabilistic niche size
ellipse() and niche.size() for the definition of the elliptical niche region.
ellipse()
niche.size()
# 2d example d <- 2 # number of dimensions V <- crossprod(matrix(rnorm(4),d,d)) mu <- rnorm(d) plot(ellipse(mu, V), type = "l") points(niche.runif(1e4, mu, V), col = "brown", pch = ".")
Run the code above in your browser using DataLab