ridge_distr {ridgetorus} | R Documentation |
Connected component of the toroidal density ridge of a bivariate sine von Mises, bivariate wrapped Cauchy, and bivariate wrapped normal
Description
Computation of the connected component of the density ridge of
in a given set of points or, if not specified, in a regular grid on
[-\pi, \pi)
.
Usage
ridge_bvm(mu, kappa, eval_points, subint_1, subint_2)
ridge_bwc(mu, xi, eval_points, subint_1, subint_2)
ridge_bwn(mu, Sigma, kmax = 2, eval_points, subint_1, subint_2)
Arguments
mu |
circular means of the density, a vector of length |
kappa |
vector of length |
eval_points |
evaluation points for the ridge. |
subint_1 |
number of points for |
subint_2 |
number of points for |
xi |
a vector of length |
Sigma |
covariance matrix of size |
kmax |
integer number up to truncate the wrapped normal series in
|
Value
A matrix of size c(subint_1, 2)
containing the points of the
connected component of the ridge.
References
Ozertem, U. and Erdogmus, D. (2011). Locally defined principal curves and surfaces. Journal of Machine Learning Research, 12(34):1249–1286. doi:10.6083/M4ZG6Q60
Examples
# Bivariate von Mises
mu <- c(0, 0)
kappa <- c(0.3, 0.5, 0.4)
nth <- 100
th <- seq(-pi, pi, l = nth)
x <- as.matrix(expand.grid(th, th))
d <- d_bvm(x = x, mu = mu, kappa = kappa)
image(th, th, matrix(d, nth, nth), col = viridisLite::viridis(20))
ridge <- ridge_bvm(mu = mu, kappa = kappa, subint_1 = 5e2,
subint_2 = 5e2)
points(ridge)
# Bivariate wrapped Cauchy
mu <- c(0, 0)
xi <- c(0.3, 0.6, 0.25)
nth <- 100
th <- seq(-pi, pi, l = nth)
x <- as.matrix(expand.grid(th, th))
d <- d_bwc(x = x, mu = mu, xi = xi)
image(th, th, matrix(d, nth, nth), col = viridisLite::viridis(20))
ridge <- ridge_bwc(mu = mu, xi = xi, subint_1 = 5e2, subint_2 = 5e2)
points(ridge)
# Bivariate wrapped normal
mu <- c(0, 0)
Sigma <- matrix(c(10, 3, 3, 5), nrow = 2)
nth <- 100
th <- seq(-pi, pi, l = nth)
x <- as.matrix(expand.grid(th, th))
d <- d_bwn(x = x, mu = mu, Sigma = Sigma)
image(th, th, matrix(d, nth, nth), col = viridisLite::viridis(20))
ridge <- ridge_bwn(mu = mu, Sigma = Sigma, subint_1 = 5e2,
subint_2 = 5e2)
points(ridge)