Optimal Transport in Various Forms

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.


News


CHANGES IN transport VERSION 0.9-4  (2017-10-03)

OVERVIEW

o  Compilation with the most recent version of clang resulted in
   an error. Fixed.

CHANGES IN transport VERSION 0.9-3  (2017-09-29)

OVERVIEW

o  Minor change to remove a compiler warning    

CHANGES IN transport VERSION 0.9-2  (2017-09-28)

OVERVIEW

o  Minor changes in Makevars to enable compilation under Windows and
   pass CRAN checks     

CHANGES IN transport VERSION 0.9-1  (2017-09-15)

OVERVIEW

o  Minor bug fixes     

CHANGES IN transport VERSION 0.9-0  (2017-08-24)

OVERVIEW

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)

OVERVIEW

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)

OVERVIEW

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)

OVERVIEW

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)

NEW CLASSES

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.

NEW FUNCTIONS

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.

SIGNIFICANT CHANGES

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).

BUG FIXES

Various smaller bug fixes for special input.

CHANGES IN transport VERSION 0.7-5  (2016-09-28)

OVERVIEW

o  We thank Ramon Diaz-Uriarte for contributions

o  aha can return optimal power diagram now

o  Several minor bug fixes

SIGNIFICANT CHANGES

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.

BUG FIXES

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)

OVERVIEW

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

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)

OVERVIEW

o  We thank Ludo Daemen and Stefan Kain for contributions

o  Minor changes in the documentation and a bug fix

BUG FIXES

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)

OVERVIEW

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

SIGNIFICANT CHANGES

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)

OVERVIEW

o  Minor changes in the documentation

CHANGES IN transport VERSION 0.6-2  (2014-06-21)

OVERVIEW

o  Minor changes in the documentation and a bug fix

BUG FIXES

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)

OVERVIEW

o  First public release

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("transport")

0.9-4 by Dominic Schuhmacher, a year ago


http://www.dominic.schuhmacher.name


Browse source code at https://github.com/cran/transport


Authors: Dominic Schuhmacher [aut, cre] , Björn Bähre [aut] (aha and power diagrams) , Carsten Gottschlich [aut] (simplex and shortlist) , Florian Heinemann [aut] (transport_track) , Bernhard Schmitzer [aut] (shielding) , Timo Wilm [ctb] (wpp)


Documentation:   PDF Manual  


GPL (>= 2) license


Imports grDevices, graphics, stats, Rcpp

Suggests animation, ks

Linking to Rcpp


Imported by epiphy, otinference.


See at CRAN