mixle.ppl.rough_paths module

Rough paths – the truncated path signature (iterated-integral) transform.

The signature of a path X: [0, T] -> R^d is the sequence of iterated integrals

S(X) = ( 1, {int dX^i}, {int int dX^i dX^j}, … ),

a graded tensor (level k lives in (R^d)^{otimes k}) that characterizes the path up to reparameterization and is the central object of rough-path theory and of signature features in machine learning. For a piecewise-linear path it is computed exactly: each straight segment with increment delta has signature delta^{otimes k} / k! (the tensor exponential), and segments combine by Chen’s identity – the signature of a concatenation is the truncated tensor-algebra product of the segment signatures. The transform therefore satisfies, to machine precision, the closed form on linear paths, Chen’s multiplicativity S(X * Y) = S(X) (x) S(Y), and the factorial bound ||S_k|| <= L^k / k! in the path length L.

Reference: Chen, “Integration of paths” (1958); Lyons, “Differential equations driven by rough signals”, Rev. Mat. Iberoamericana 14 (1998); Lyons, Caruana & Levy, Differential Equations Driven by Rough Paths (2007).

signature_tensor_product(a, b, depth)[source]

Return the truncated tensor-algebra product (a (x) b)_n = sum_{i+j=n} a_i (x) b_j (Chen’s product).

Parameters:
Return type:

list[ndarray]

path_signature(path, depth)[source]

Return the truncated signature of a piecewise-linear path up to level depth.

Parameters:
  • path (Any) – array of shape (n_points, d) – the vertices of a piecewise-linear path in R^d.

  • depth (int) – truncation level M; the signature is returned as a list [S_0, S_1, ..., S_M] where S_0 = 1 (scalar) and S_k has shape (d,) * k.

Returns:

The list of signature tensors. Computed exactly by Chen’s identity over the segments.

Return type:

list[ndarray]

signature_norms(signature)[source]

Return the Hilbert-Schmidt norm of each signature level (level 0 omitted).

Parameters:

signature (list[ndarray])

Return type:

list[float]