View source: R/transport_plan.R
general_1d_transport | R Documentation |
One-dimensional optimal transport for measures with more general mass
general_1d_transport(
X,
Y,
a = NULL,
b = NULL,
method = c("hilbert", "univariate")
)
X |
Data for sample one. Should be a vector if method is "univariate" or a matrix if method is "hilbert" |
Y |
Data for sample two Should be a vector if method is "univariate" or a matrix if method is "hilbert" |
a |
Empirical measure for sample one. |
b |
Empirical measure for sample two. |
method |
One of "hilbert" or "univariate" |
An optimal transportation plan as a list with slots "from", "to", and "mass"
set.seed(23423)
n <- 100
d <- 10
x <- matrix(stats::rnorm((n + 11)*d), n + 11 , d)
y <- matrix(stats::rnorm(n*d), n, d)
trans <- general_1d_transport(t(x), t(y))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.