Skip to content

Effective-DOF and segmental-coupling metrics (multi-marker coordination) #358

Closed

Description

@alexarje

Candidate from the stillstanding study (identity/coordination.py): inter-segment correlations along the shared sway axis, effective degrees-of-freedom via variance fraction of the first PCA component across markers, and head:hip amplitude ratio (inverted-pendulum test). Needs a full read of the source before porting; flagged borderline-general in the 2026-07 survey.

🤖 Generated with Claude Code

Activity

  1. alexarje commented on Aug 24, 2026

    @alexarje
    ContributorAuthor

    Implemented in micromotion, not here: markers are that package's domain under the four-toolbox rule, and musicalgestures/_posture.py has been a pure re-export shim since 2026-07-29. Same shape as #356.

    fourMs/micromotion#3, merged — shared_axis_projection and segmental_coordination in micromotion/posture.py, reachable from MGT through the existing _posture re-export.

    One of the three metrics already existed. effective_dimensionality computes the participation ratio the effective-DOF measure wants, and called with rank=False it reproduces the still-standing analysis's pc1 and eff_dof on all 81 sessions to 1e-10 — so it is called, not copied.

    What was missing was the projection. principal_axis_projection gives each marker its own axis, and two markers swaying at right angles, each on its own axis, correlate perfectly while sharing no direction of motion. Correlating segments only means something once they are on one shared axis, taken from a named reference marker because the axis is anatomical.

    Verified against the study that asked for it: correlations reproduce to 4e-16 on every session it produced a number for, and the amplitude ratio to 4e-16 on the 79 of 81 sessions where both hip markers are present throughout. The two that differ are exactly the two with frames where one hip drops out — a caller-side construction choice, and both are reachable.

    Three things the study code did not do: correlations are pairwise-complete and each carries its own n (np.corrcoef returns NaN on one missing sample, which silently dropped 1–2 sessions per pair under a heading reporting a single N); mask makes the reference-marker masking a decision rather than an accident; and reduce keeps a derived marker wanted only for a ratio out of the dimensionality reduction, which moved eff_dof by 0.16 when it crept in.

    No body-part taxonomy is built in — "inverted pendulum" is an interpretation of a ratio above one, not something this computes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions