View source: R/scale-transformation.R
to_uniform_scale | R Documentation |
Since Kullback-Leibler divergence is scale-invariant, its sample-based
approximations can be computed on a conveniently chosen scale. This helper
functions transforms each variable in a way that all marginal distributions
of the joint dataset (X,Y)
are uniform. In this way, the scales of
different variables are rendered comparable, with the idea of a better
performance of neighbour-based methods in this situation.
to_uniform_scale(X, Y)
X , Y |
|
A list with fields X
and Y
, containing the transformed samples.
# 2D example
n <- 10L
X <- cbind(rnorm(n, mean = 0, sd = 3),
rnorm(n, mean = 1, sd = 2))
Y <- cbind(rnorm(n, mean = 1, sd = 2),
rnorm(n, mean = 0, sd = 2))
to_uniform_scale(X, Y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.