Utilities – Dimension Reduction

sensorimotor_dependencies.utils.MDS(data, return_matrix=False, return_eigenvalues=False)[source]

Classical multidimensional scaling (MDS) to compute the number of degrees of freedom cf. https://en.wikipedia.org/wiki/Multidimensional_scaling#Classical_multidimensional_scaling

Parameters:
  • data ((n, k) array) – Data points matrix (data points = row vectors in the matrix)
  • return_matrix (bool) – If True, returns the coordinate matrix
  • return_eigenvalues (bool, optional) – Returns the eigenvalues and their ratios \(λ_{i+1}/λ_i\) (False by default).
Returns:

  • nb (int) – Number of non-zero eigenvalues of $$B = X X^T$$ (where \(X\) is the coordinate matrix), thought of as the number of degrees of freedom. The eigenvalues thereof fall into two classes (non-zero and zero eigenvalues) \(V_1\) and \(V_2\), distinguished as follows: > each \(λ ∈ V_1\) has a size closer to other the \(λ\)’s of \(V_1\) than the ones of \(V_2\), and conversely. The boundary between \(V_1\) and \(V_2\) corresponds to the largest ratio \(λ_{i+1}/λ_i\), where the \(λ_i\) are in decreasing order.
  • X ((n, dim_rigid_group) array) – If return_matrix == True: Coordinate matrix.

sensorimotor_dependencies.utils.PCA(data, return_matrix=False, return_eigenvalues=False)[source]

Principal Component Analysis (PCA) to compute the number of degrees of freedom.

Parameters:
  • data ((n, k) array) – Data points matrix (data points = row vectors in the matrix)
  • return_matrix (bool) – If True, returns the matrix of the data points projection on the eigenvectors
  • return_eigenvalues (bool, optional) – Returns the eigenvalues and their ratios \(λ_{i+1}/λ_i\) (False by default).
Returns:

  • nb (int) – Number of non-zero eigenvalues of the covariance matrix, thought of as the number of degrees of freedom. The eigenvalues thereof fall into two classes (non-zero and zero eigenvalues) \(V_1\) and \(V_2\), distinguished as follows: > each \(λ ∈ V_1\) has a size closer to other the \(λ\)’s of \(V_1\) than the ones of \(V_2\), and conversely. The boundary between \(V_1\) and \(V_2\) corresponds to the largest ratio \(λ_{i+1}/λ_i\), where the \(λ_i\) are in decreasing order.
  • Proj ((n, dim_rigid_group) array) – If return_matrix == True: Projection of the data points on the eigenvectors

sensorimotor_dependencies.utils.Rot(euler_angles)[source]

Compute rotation matrix corresponding the given Euler angle cf. https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix