transport_costmat: Cost Matrix for two-dimensional Optimal Transport
Description
Calculate the cost matrix for the optimal transport between two-dimensional grids with respect to the cost function
$$c(x, y) = | x_1 - y_1 |^{p_1} + | x_2 - y_2 |^{p_2}.$$
Usage
transport_costmat(x, ...)
# S3 method for otgrid
transport_costmat(x, y, p.1 = 2, p.2 = p.1, ...)
# S3 method for otgridtransport
transport_costmat(x, ...)
Value
a matrix giving the pairwise costs in column-mayor format.
Arguments
x
an object of class "otgridtransport" or "otgrid", in the latter case it gives the object the mass is to be transported from.
...
further arguments (currently unused).
y
an object of class "otgrid" the mass is to be transported from.