Push-forward distribution over a meshΒΆ

Let \inputRV be an absolutely continuous random vector with values in \Rset^n, whose support is a domain discretized by a mesh of simplices. Let d \leq n be the intrinsic dimension of the reference mesh and let \outputDim be the output dimension, with \outputDim \geq d.

The map f: \Rset^n \rightarrow \Rset^\outputDim is a P1 field on the reference mesh: its restriction to each simplex is the affine interpolation of the images of the simplex vertices. Such a field is represented by a Field, which stores the reference Mesh and the image of each vertex. On a simplex s with vertices (\vect{v}_0, \dots, \vect{v}_d), a point \inputReal \in s has barycentric coordinates (\lambda_0, \dots, \lambda_d) and

f(\inputReal) = \sum_{k = 0}^d \lambda_k f(\vect{v}_k).

The restriction of f to s is therefore affine, with a constant Jacobian matrix J_s. Its image f(s) is a d-dimensional simplex embedded in \Rset^\outputDim.

The image mesh is the collection of the image simplices. When the map is injective, the distribution of \outputRV = f(\inputRV) is supported by this image mesh. Its density with respect to the d-dimensional measure induced on the image is

f_{\outputRV}(\outputReal) = \sum_{s : \outputReal \in f(s)}
f_{\inputRV}(\inputReal_s(\outputReal))
\sqrt{\frac{\det\left(G^{\mathrm{ref}}_s\right)}
{\det\left(G^{\mathrm{img}}_s\right)}},

where \inputReal_s(\outputReal) is the preimage of \outputReal in the reference simplex s. The matrices G^{\mathrm{ref}}_s and G^{\mathrm{img}}_s are the Gram matrices of the edges of the reference simplex and of its image:

G^{\mathrm{ref}}_s = E_s^T E_s,
\qquad
G^{\mathrm{img}}_s = (J_s E_s)^T (J_s E_s),

with E_s the n \times d matrix whose columns are the edge vectors of the reference simplex. The ratio of the determinants is the inverse of the volume stretching factor of the affine restriction, so that the density integrates to one over the image mesh.

The sum covers all the simplices whose image contains \outputReal: folding maps and self-intersecting meshes are supported. When the Jacobian is singular on a simplex, its image has measure zero and its contribution is discarded, which is the behaviour of the density at a critical point. A point outside the image mesh has zero density.

When \outputDim > d, the image is a d-dimensional subset of \Rset^\outputDim; the density above is still defined with respect to the measure induced on the image mesh, as in the general singular case of the PushForwardDistribution.

The case \outputDim < d is the co-area case: the preimage of a point is a fibre of dimension d - \outputDim, and the density is the integral of the antecedent density along this fibre divided by the corresponding Jacobian. The general co-area formula is given in the documentation of PushForwardDistribution. The PushForwardOverMesh class currently implements this case only for d = 2, ambient dimension n = 2, \outputDim = 1, and a UniformOverMesh antecedent.