The function dtm
computes the "distance to measure function" on a set of points Grid
, using the uniform empirical measure on a set of points X
. Given a probability measure \(P\), The distance to measure function, for each \(y \in R^d\), is defined by
$$
d_{m0}(y) = \left(\frac{1}{m0}\int_0^{m0} ( G_y^{-1}(u))^{r} du\right)^{1/r},
$$
where \(G_y(t) = P( \Vert X-y \Vert \le t)\), and \(m0 \in (0,1)\) and \(r \in [1,\infty)\) are tuning parameters. As m0
increases, DTM function becomes smoother, so m0
can be understood as a smoothing parameter. r
affects less but also changes DTM function as well. The DTM can be seen as a smoothed version of the distance function. See Details and References.
Given \(X=\{x_1, \dots, x_n\}\), the empirical version of the distance to measure is
$$
\hat d_{m0}(y) = \left(\frac{1}{k} \sum_{x_i \in N_k(y)} \Vert x_i-y \Vert^{r}\right)^{1/r},
$$
where \(k= \lceil m0 * n \rceil\) and \(N_k(y)\) is the set containing the \(k\) nearest neighbors of \(y\) among \(x_1, \ldots, x_n\).