With this setting of 10, you should never have a leaf with a single point, unless your data set consists of exactly one point.
Because the splits are balanced in size, the previous level must have at more than 10 points. So the minimum size is 5, if you set the maximum to 10 (except if there are less than 5 data points total).
In Mathematica this works:
GPD = ParetoPickandsDistribution[2, 3, .07];
data = RandomVariate[GPD, 10^4];
FindDistributionParameters[data, ParetoPickandsDistribution[mu, sigma, eta]] ->
{mu -> 2.00036, sigma -> 2.96883, eta -> 0.07022}
where mu is the location parameter, sigma the scale parameter, and eta the shape parameter.
FindDistributionParameters can use 5 different methods (see the documentation), but I believe the default is maximum likelihood estimation (MLE). Mathematica has all the tools (Likelihood, LogLikelihood, FindMaximium, Maximize, and ParetoPickandsDistribution for the PDF) to do MLE from scratch, if that's your wont. There is a good explanation of MLE in Wikipedia.
Best Answer
This is implemented in the POT: Python Optimal Transport package, for samples (or, generally, discrete measures): use
ot.wasserstein_1d
. If you want to do it for weighted samples (or general discrete distributions with finite support), you can provide thea
andb
arguments.