  We study nonparametric density estimation problems where error is measured in
the Wasserstein distance, a metric on probability distributions popular in many
areas of statistics and machine learning. We give the first minimax-optimal
rates for this problem for general Wasserstein distances, and show that, unlike
classical nonparametric density estimation, these rates depend on whether the
densities in question are bounded below. Motivated by variational problems
involving the Wasserstein distance, we also show how to construct discretely
supported measures, suitable for computational purposes, which achieve the
minimax rates. Our main technical tool is an inequality giving a nearly tight
dual characterization of the Wasserstein distances in terms of Besov norms.
