9
$\begingroup$

Problem definition

Consider a polygon with vertices $V_1,\dots,V_n \in \mathbb{R}^2$ and let \begin{equation*} \begin{aligned} z&=\underbrace{\sum_{j=1}^n \left[(V_{j+1}-V_j) \frac{L}{L_j}\left(\alpha-\frac{\tau_{j-1}}{L}\right)+V_j\right] 1_{\left[\frac{\tau_{j-1}}{L},\frac{\tau_j}{L}\right)}(\alpha)}_{\triangleq \psi(\alpha)}\\ \alpha&\sim p_\alpha(\alpha)\triangleq\mathcal{U}(\alpha; [0,1])=1_{[0,1]}(\alpha) \end{aligned} \end{equation*} where

  • $V_{n+1}\triangleq V_1$
  • $L_j \triangleq \lVert V_{j+1}-V_j\rVert$
  • $\tau_{j}\triangleq \sum_{i=1}^j L_j$, $\tau_0\triangleq 0$
  • $L\triangleq \tau_n$
  • $1_S(x)\triangleq 1$ if $x\in S$ and $1_S(x)\triangleq 0$ otherwise

I would like to prove that $z$ is uniformly distributed over the polygon contour $\partial P$. Unfortunately, this is a tricky task that I cannot do by myself.

The tricky part

Note that the map between $z$ and $\alpha$ is in the form $\psi:[0,1]\mapsto \partial P$. The dimension of the domain is 1 while the dimension of the codomain is 2. For this reason, the distribution of the random point $z\in\mathbb{R}^2$ is concentrated over a set of null measure (i.e. a curve, i.e. a set with null area). Hence, it should be impossible to express the distribution of $z$ via a conventional probability density $p_z(z)$.

However, if we pretend that $z$ admits a density and if we pretend that the conventional rule to compute the density of transformed random variables applies, we have \begin{equation*} p_z(z)=\frac{p_\alpha(\alpha)}{\sqrt{\textrm{det} \frac{\partial \psi}{\partial \alpha}'\frac{\partial \psi}{\partial \alpha}}}\Bigg|_{\alpha\triangleq \psi^{-1}(z)}=\frac{1_{[0,1]}(\psi^{-1}(z))}{\left\lVert \frac{\text{d}\psi}{\text{d}\alpha}(\psi^{-1}(z))\right\rVert}=\frac{1}{L} \qquad z\in\partial P \end{equation*} which is constant over $\partial P$. For this reason, I say that $z$ is uniformly distributed over $\partial P$. Note that:

  • the Gramian factor $\sqrt{\textrm{det}\frac{\partial \psi}{\partial \alpha}'\frac{\partial \psi}{\partial \alpha}}$ is a generalization of the conventional Jacobian factor $\left|\textrm{det}\frac{\partial \psi}{\partial \alpha}\right|$. The Gramian factor allows to handle maps between spaces with different dimensions.
  • if $z\in \partial P$ then $\psi^{-1}(z) \in [0,1]$ and $1_{[0,1]}(\psi^{-1}(z))=1$. In that case $p_z(z)=1/L$. Then $p_z(z)$ is prolonged to $z\notin \partial P$ according to $p_z(z)=0$ since the integral must be unitary.

Questions

I'm not an expert in measure theory and real analysis, thus I'm not sure if my arguments make sense or not. Hence, I have the following questions:

  1. Is it formally correct what I have written above?
  2. How do you define a probability distribution over a curve in $\mathbb{R}^2$?
  3. How do you prove that a probability distribution over a curve is uniform?
$\endgroup$

1 Answer 1

10
$\begingroup$

It will be difficult to define densities for arbitrary curves, but rectifiable curves--those that locally have lengths--are quite tractable. Your polygon boundary is such an example.

For the record, the characterization of a rectifiable curve I am using is the following. It must be

a continuous map $\gamma:I\to\mathbb R^n$ where $I\subset \mathbb R$ is a (possibly infinite or bi-infinite) interval and $I$ can be expressed as the union of at most countably many subintervals $[a_j,b_j]$ where $b_j-a_j\gt 0$ and any different pair of such intervals intersect, if at all, on their boundaries; furthermore, on the interior of each such subinterval $\gamma:(a_j,b_j)\to\mathbb R^n$ is differentiable.

There are many subtleties in this. I'll mention just a few that could bite you:

  1. The curve $\gamma$ is not the same as its image $\gamma(I).$ The former is a function while the latter is a subset of $\mathbb R^n.$ Think of $\gamma$ as a record of a trip taken by a particle in space, giving the location at every time from start to finish. Its image $\gamma(I)$ is a map of all locations visited: it has lost all information about time.

  2. The image of $\gamma$ can intersect itself. It can even run back and forth over itself, just like any real trip taken by a person might.

  3. $\gamma^\prime = 0$ is permitted. In the trip analogy these are periods when the particle comes to a standstill (like a car stopping at a stoplight). This allows for curves that have "kinks," cusps, or corners, thereby accommodating polygons, polylines, and more general piecewise-differentiable "arcs."

  4. When $[a_j,b_j]$ intersects $[a_i,b_i],$ there is no requirement for the derivative of $\gamma$ in one interval to have any relationship to its derivative at nearby points in the other interval. This enables the curve to suddenly (discontinuously) change direction.

I will address question #2 first.

Using a base point $t_0\in I,$ we define the (signed) arc length of $\gamma$ to be (for $t\in I$)

$$\phi(t) = \int_{t_0}^t \|\gamma^\prime(t)\|\,\mathrm dt.$$

(This is what your car's odometer does: it integrates the speed $\|\gamma^\prime\|$ as time $t$ goes along, giving the cumulative distance.)

The assumptions imply $\phi$ is a piecewise differentiable strictly increasing map from $I$ to $J = \phi(I) \subseteq \mathbb R.$ Consequently $\phi$ has an inverse with domain $J$ and (due to the conditions on derivatives) $J$ is an interval (it has no gaps).

This all permits us to reparameterize $\gamma$ to unit arc length by setting

$$x(u) = \gamma(\phi^{-1}(u))$$

where now $u\in J.$ This preliminary has arranged to that

The (signed) length of arc between $x(u_1)$ and $x(u_2)$ is $u_2 - u_1.$

The proof uses the usual change-of-variable formula to calculate the integral. Intuitively, $x$ is the same as $\gamma$ except it moves at unit speed. Thus, the elapsed time $u_2-u_1$ is directly proportional to the distance traveled.

Any distribution $F$ on $J$ "pushes forward" to a distribution on $\mathbb R^n.$ Take any box $\mathcal B \subset \mathbb R^n$ and define

$$\Pr(\mathcal B) = {\Pr}_F(x(J)\,\cap\,\mathcal B),$$

the total arc length of $\gamma$ falling within $\mathcal B.$

When $n\gt 1,$ these are all singular distributions: they cannot have densities.

This plot illustrates the construction for a (random) closed loop $\gamma$ of length $7.28$ beginning and ending at the origin in $\mathbb R^2.$ The labels show the points at times $t=0,1,\ldots, 7.$ The density (shown by color) is a scaled Beta$(5,5)$ density on $I.$

enter image description here

NB: The densities accumulate where points overlap. This makes no difference for push-forwards of absolutely continuous densities and the overlaps are transverse, but it will affect singular densities and curves with nonzero-length sections of overlap.

Concerning question #3, the uniform distribution you ask about is the pushforward of the (usual) uniform distribution on the interval $J.$ Your question can be framed as "given a distribution on the curve $\gamma,$ how do I prove it's uniform" and this amounts to proving $F$ is uniform. If I understand your notation correctly, you stipulate that $F$ is uniform, so there's nothing left to prove after you have verified all the conditions in the definition of a rectifiable curve. I leave that to you, because it's straightforward: every piece of your parameterization is linear.

Concerning question #1, I think the basic simplicity of the construction is lost in the baroque notation, but the idea looks correct.

References

Any introductory textbook of differential geometry.

Most textbooks of vector calculus.

Code (because somebody will ask for it).

This R code produces random closed loops you can play with and plot. It is quite general and easily adapted to, say, any polyline or polygonal boundary represented as a sequence of (x,y) coordinates. Because it's just for illustration it doesn't worry about discontinuous derivatives: it will smooth right over them. A simple kluge is to set the vertex counts of "101" to higher values, such as several thousand.

#
# The endpoints of a closed loop begin and end at the same place.
# This function creates them randomly starting at the origin.
#
r <- function(n) {x <- c(0, rnorm(n)); cumsum(x - mean(x[-1]))} 
#
# Make a random closed loop of (x,y) coordinates and times `t`.
#
set.seed(17)
n <- 6
f.x <- splinefun(0:n, r(n))
f.y <- splinefun(0:n, r(n))
X <- data.frame(t = seq(0, n, length.out = 101))
X$x <- f.x(X$t)
X$y <- f.y(X$t)
#
# Arclength reparameterization to length `u`.
#
d <- function(t, f, eps = 1e-4) (f(t + eps/2) - f(t - eps/2)) / eps
df.x <- function(t) d(t, f.x)
df.y <- function(t) d(t, f.y)
speed <- function(t) sqrt(df.x(t)^2 + df.y(t)^2)
phi <- Vectorize(\(t) integrate(speed, min(X$t), t)$value)
u <- splinefun(phi(X$t), X$t)
#
# Define a density function (by arclength).
#
p <- function(t) dbeta(t / diff(range(X$u)), 5, 5) / diff(range(X$u))
X$u <- u(X$t) # Arclength
X$p <- p(X$u) # Pushed-forward density
#
# The point labels.
#
Y <- data.frame(u = seq(min(X$u), max(X$u), 1))
Y$t <- splinefun(X$u, X$t)(Y$u)
Y$x <- f.x(Y$t)
Y$y <- f.y(Y$t)
#
# The plot.
#
library(ggplot2)
ggplot(X, aes(x, y)) + 
  geom_path(aes(color = p), linewidth = 1.8) +
  geom_point(data = Y, alpha = 1/6) + 
  geom_text(aes(label = u), data = Y, size = 6) + 
  scale_color_gradientn(colors = tail(rainbow(13), 10)) + 
  coord_equal() + 
  ggtitle(expression("Image of " * gamma * " With a Pushed-Forward Beta Density")) 
$\endgroup$
5
  • 3
    $\begingroup$ Minor typesetting tip: You can use \| to typeset $\|$ rather than $||$, which has incorrect spacing. $\endgroup$
    – user76284
    Commented Nov 20 at 0:42
  • 1
    $\begingroup$ @whuber, thanks for the code! $\endgroup$
    – Maximilian
    Commented Nov 20 at 14:31
  • 1
    $\begingroup$ @Maximilian You know I had you in mind ;-). $\endgroup$
    – whuber
    Commented Nov 20 at 14:36
  • $\begingroup$ Thank you whuber for your super detailed and nice answer. What I'm doing is the following: I define a uniform distribution on $\alpha$ and then I map on $\mathbb{R}^2$ the random $\alpha$ via $\psi(\alpha)$. For $z=\psi(\alpha)$ and $S\subseteq \mathbb{R}^2$ measurable, what I would like to do is to prove something like $\textrm{Probability}(z\in S) = \textrm{length}(S\cap \partial P)/\textrm{length}(\partial P)$ to prove that $\psi(\alpha)$ is uniformly distributed over the contour $\partial P$. $\endgroup$
    – matteogost
    Commented Nov 22 at 7:01
  • 1
    $\begingroup$ Provided $\psi$ is parameterized by arclength (or, for the purposes of achieving a uniform distribution, at least proportional to arclength), you're good to go. $\endgroup$
    – whuber
    Commented Nov 22 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.