Solve optimal transport problems. Compute Wasserstein distances (a.k.a. Kantorovitch, Fortet--Mourier, Mallows, Earth Mover's, or minimal L_p distances), return the corresponding transference plans, and display them graphically. Objects that can be compared include grey-scale images, (weighted) point patterns, and mass vectors.
CHANGES IN transport VERSION 0.9-4 (2017-10-03)
o Compilation with the most recent version of clang resulted in an error. Fixed.
CHANGES IN transport VERSION 0.9-3 (2017-09-29)
o Minor change to remove a compiler warning
CHANGES IN transport VERSION 0.9-2 (2017-09-28)
o Minor changes in Makevars to enable compilation under Windows and pass CRAN checks
CHANGES IN transport VERSION 0.9-1 (2017-09-15)
o Minor bug fixes
CHANGES IN transport VERSION 0.9-0 (2017-08-24)
o Fixed serious bug, introduced in version 0.7-0, by which the algorithm hanged for pgrid-objects if p>1 method="revsimplex" (the default) if masses are not integer valued o New method "shielding" for pgrid-objects if p=2 that is considerably faster than the existing methods. Option to link package against CPLEX makes this combination even much faster and enables computation for 128x128 grids within a few seconds. C++ code by Bernhard Schmitzer
CHANGES IN transport VERSION 0.8-2 (2017-03-09)
o New function wasserstein1d to compute the Wasserstein distance between two univariate samples (with weights)
CHANGES IN transport VERSION 0.8-1 (2016-12-03)
o We thank Atreju Tauschinsky for contributions o The wasserstein function supports now the wpp class o Several minor bug fixes
CHANGES IN transport VERSION 0.8-0 (2016-10-15)
o We thank Florian Heinemann and Timo Wilm for contributions o New class weighted point patterns with full functionality o Optimal transport between pgrid and wpp that returns transport tesselation o Dynamic optimal transport (displacement interpolation)
o wpp The class wpp describes general discrete measures with finite support, i.e. patterns of finitely many "weighted" points (without specific structure for the locations or weights). There are constructors for this class, as well as plot, print and summary functions. The function 'transport' can deal with this class. We thank Timo Wilm for help with creating this class.
o semidiscrete Computes the transport map (in the form of a power diagram) for the semidiscrete transport problem from a pgrid to a wpp object for the case p=2. This function is not usually called by the user because the function transport offers the same flexibility now. o plot_pgrid_wpp Plots a representation of a transport map (available as a power diagram) between a pgrid and a wpp object. This function gets called when using the generic plot function with a pgrid and a wpp object (in that order), but a direct call to plot_pgrid_wpp by the user offers more possibilites for customizing the plot. o transport_track Computes a dynamic version of a given transference plan by interpolating in time. The linear interpolation of the projections of the transference plan is computed, which in many important cases corresponds to the displacement interpolation. The result can be either returned as an array or is saved as an animated gif. We thank Florian Heinemann for contributing large parts of this function.
o transport Can now deal with two wpp objects and in the case p=2 also with one pgrid and one wpp object as inputs (in that order). o aha It is now possible to return the parameters for the optimal power diagram, rather than the (approximative) optimal transference plan in terms of the pixel centers of the source measure. For this, use the new option powerdiag.
OTHER USER-VISIBLE CHANGES
o pgrid If no information is provided on the positions of the pixels, it is now assumed that we have square pixels and the boundary points in the first dimension are 0 and 1 (previous behaviour: boundary points in every dimension are 0 and 1, leading to non-square pixels if the pgrid is non-square). o pgrid A pgrid object has two additional components 'totmass' giving the sum of pixel values, and 'totcontmass' giving the sum of pixel values divided by pixel areas. The former may be interpreted as totol mass of pgrid if interpreted as a discrete measure on the grid of pixel centers. The latter may be interpreted as total mass of pgrid if interpreted as a continuous measure with constant density on each pixel (seen as small contiguous rectangles).
Various smaller bug fixes for special input.
CHANGES IN transport VERSION 0.7-5 (2016-09-28)
o We thank Ramon Diaz-Uriarte for contributions o aha can return optimal power diagram now o Several minor bug fixes
o aha It is now possible to return the parameters for the optimal power diagram, rather than the (approximative) optimal transference plan in terms of the pixel centers of the source measure. For this, use the new option powerdiag.
o transport.pp, transport.default Computing the optimal transport from a mass distribution to itself resulted in an error. Fixed.
CHANGES IN transport VERSION 0.7-4 (2016-06-28)
o We thank Yann Abraham and Stefan Kain for contributions o Several unnecessary outputs are now suppressed by default (timing information, warnings about degenerate bases that did not affect the result) o Several minor bug fixes
o transport.pgrid For p=1 computing the optimal transport from a mass distribution to itself resulted in a segfault or an error (depending on the method used). Fixed. o transport.pgrid Having a mass distribution of integers and at least one zero could cause an integer overflow. Fixed.
CHANGES IN transport VERSION 0.7-3 (2016-02-24)
o We thank Ludo Daemen and Stefan Kain for contributions o Minor changes in the documentation and a bug fix
o transport.default Using transport.default with the shortlist method gave an error message if no shortlist parameters were set. Fixed.
CHANGES IN transport VERSION 0.7-0 (2015-10-21)
o There are two new ways for computing starting solutions in transport.default and transport.pgrid with method="revsimplex", which lead to substantial speed improvements (mainly in transport.pgrid) o Several minor bugfixes
o transport.pgrid, transport.default When method="revsimplex" is chosen, transport.pgrid can now start from a solution that is based on the optimal transport between two coarsened problems. This "multiscale" behaviour is invoked automatically if p>1, the grid is 2-dimensional, of a certain minimal size, and has an even number of vertices in each direction (for p=1 use the control parameter nscales as in previous versions). Both transport.pgrid and transport.default can also be started from a solution based on the "Modified Row Minimum Rule" (newly implemented in C Code). This is the default behaviour now for transport.default, and also for transport.pgrid if the multiscale starting solution described above cannot be computed. To get the behaviour of older versions, say control=list(start="nwcorner") in the transport function.
CHANGES IN transport VERSION 0.6-3 (2014-10-16)
o Minor changes in the documentation
CHANGES IN transport VERSION 0.6-2 (2014-06-21)
o Minor changes in the documentation and a bug fix
o aha In the underlying C code integer overflows were possible (usually without noticable effects on the result). Fixed.
CHANGES IN transport VERSION 0.6-1 (2014-05-30)
o First public release