hydra
with additional stress minimizationRuns the hydra
method and then performs a further optimization step by minimizing the stress of the embedding and optimizing hyperbolic curvature
hydraPlus(D, dim = 2, curvature = 1, alpha = 1.1, equi.adj = 0.5,
control = list(), curvature.bias = 1, curvature.freeze = TRUE,
curvature.max = NULL, maxit = 1000, ...)
a square symmetric matrix of distances (or dissimiliarities) to be embdedded, can also be a dist
object
embedding dimension
embedding curvature; if this argument is NULL, hydra tries to find the optimal curvature
real number greater one; adjusts the hyperbolic curvature. Values larger than one yield a more distorted embedding where points are pushed
to the outer boundary (i.e. the ideal points) of hyperblic space. The interaction between curvature
and alpha
is non-linear.
equi-angular adjustment; must be a real number between zero and one; only used if dim
is 2. Value 0 means no ajustment, 1 adjusts
embedded data points such that their angular coordinates in the Poincare disc are uniformly distributed. Other values interpolate between the two extremes. Setting the parameter to non-zero values can make the embedding result look more harmoniuous in plots.
a list which may contain the following boolean flags:
polar - return polar coordinates in dimension 2 (default: TRUE if dim
is 2. This flag is ignored in higher dimension)
isotropic.adj - perform isotropic adjustment, ignoring Eigenvalues (default: TRUE if dim
is 2, FALSE else)
return.lorentz - return raw Lorentz coordinates (before projection to hyperbolic space) (default: FALSE)
return.stress - return embedding stress (default: TRUE)
return.dist - return hyperbolic distance matrix of embedded points (default: FALSE)
use.eigs - use eigs
function from RSpectra and norm
function from Matrix to speed up computation (default: FALSE)
Modify curvature before stress minimization by multiplying with curvature.bias
Freeze the curvature returned by hydra
. If TRUE then no optimization of curvature is attempted in the second stage of the algorithm. If FALSE then curvature is optimized in the second stage
Upper bound for the curvature. If NULL, a defulat bound is used
Maximal number of iterations. This parameter is passed to the optimization routine optim
Additional parameters are passed to optim
, which performs the underlying stress minimization
A `hydra' object, which is a list with all or some of the following components:
a vector containing the radial coordinates of the embedded points
a matrix with dim
columns containing as rows the directional coordinates of the embedded points
a vector containing the angular coordinates of the embedded points (only returned if dim
is 2 and polar
flag is TRUE)
the curvature used for the returned embedding
the dimension used for the returned embedding
the stress (i.e. the mean-square difference) between distances supplied in D
and the hyperbolic distance matrix of the returned embedding
the hyperbolic distance matrix of the returned embedding (only returned if flag return.dist
is true. Computation may be time- and memory-intensive.)
a vector containing the 'time-like' coordinate of the raw Lorentz embedding (only returned if flag return.lorentz
is true)
a matrix with dim
columns containing as rows the 'space-like' coordinate of the raw Lorentz embedding (only returned if flag return.lorentz
is true)
See https://arxiv.org/abs/1903.08977 for more details.
# NOT RUN {
data(karate)
embedding <- hydraPlus(karate$distance)
plot(embedding,labels=karate$label,node.col=karate$group,graph.adj=karate$adjacency)
# }
Run the code above in your browser using DataLab