niche.runif | R Documentation |
Uniform sampling from an elliptical niche region.
niche.runif(n, mu, Sigma, alpha = 0.95)
n |
Number of random draws. |
mu |
Mean vector. |
Sigma |
Variance matrix. |
alpha |
Probabilistic niche size |
IID draws from a uniform distribution on the elliptical niche region.
ellipse()
and niche.size()
for the definition of the elliptical niche region.
# 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 = ".")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.