A scalar holding the \(L^2\) Wasserstein distance between d1 and d2.
Arguments
d1, d2
Lists holding the density functions or quantile functions of the two distributions.
Each list consists of two numeric vectors x and y of the same length,
where x holds the support grid and y holds the values of the function.
Note that the type of functions representing the distributions in d1 and d2
should be the same---either both are density functions, or both are quantile functions.
If both are quantile functions, all elements in d1$x and d2$x must be between 0 and 1.
d1$x and d2$x may have different lengths.
fctn_type
Character vector of length 1 holding the function type in d1 and d2
representing the distributions: "density" (default), "quantile".
optns
A list of control parameters specified by list(name=value).
Details
Available control options are:
nqSup
A scalar giving the length of the support grid of quantile functions based on which the \(L^2\) Wasserstein distance (i.e., the \(L^2\) distance between the quantile functions) is computed. Default is 201.