niche.runif: Uniform sampling from an elliptical niche region.

View source: R/niche.runif.R

niche.runifR Documentation

Uniform sampling from an elliptical niche region.

Description

Uniform sampling from an elliptical niche region.

Usage

niche.runif(n, mu, Sigma, alpha = 0.95)

Arguments

n

Number of random draws.

mu

Mean vector.

Sigma

Variance matrix.

alpha

Probabilistic niche size

Value

IID draws from a uniform distribution on the elliptical niche region.

See Also

ellipse() and niche.size() for the definition of the elliptical niche region.

Examples

# 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 = ".")

nicheROVER documentation built on Oct. 13, 2023, 5:10 p.m.