pathsig.projections.lyndon#

pathsig.projections.lyndon(depth, path_dim, full_levels=())#

Projection selecting Lyndon-word coordinates up to the specified depth.

Parameters:
  • depth (int) – Maximum word length (signature level) to include.

  • path_dim (int) – Path dimension (alphabet size).

  • full_levels (iterable of int) – (optional) Levels in \(\{1,2,\ldots,\mathrm{depth}\}\) that should be included in full in addition to the Lyndon coordinates.

Returns:

Projection object to be used with pathsig.Signature and pathsig.LogSignature.

Return type:

Projection

Notes

Lyndon words form a canonical generating set for the truncated tensor algebra up to level depth, so every coordinate of the truncated signature can be expressed as a polynomial in the Lyndon coordinates. Moreover, Lyndon words index a basis of the free Lie algebra, so the truncated log-signature is linear in these coordinates. For this reason, the Lyndon projection is typically the default choice for log-signature computations.

Examples

import pathsig

proj = pathsig.projections.lyndon(depth=5, path_dim=8)
sig_size = proj.sig_size  # output feature dimension

sig = pathsig.Signature(depth=5, projection=proj)
logsig = pathsig.LogSignature(depth=5, projection=proj)