Skip to content

Return Singular values (S) from procrustes to assess alignment (rotat… - #70

Open
kbcoulter wants to merge 1 commit into
ohsu-comp-bio:developfrom
kbcoulter:return_singular_values
Open

Return Singular values (S) from procrustes to assess alignment (rotat…#70
kbcoulter wants to merge 1 commit into
ohsu-comp-bio:developfrom
kbcoulter:return_singular_values

Conversation

@kbcoulter

Copy link
Copy Markdown
Contributor

Return Singular values (S) from procrustes and procrustes_scale

The procrustes() function computes R via np.linalg.svd(), but discards the singular values S. These values are helpful for assessing the procrustes solution, specifically in determining the unconstrained dims when a rank-deficient matrix is passed..

Changes

align.py: Changes to procrustes() function(s)

  • procrustes() now returns (R,S) instead of just R
  • procrustes_scale() now returns (R, k, S) instead of just R and vector k

test_align.py: Tests Updated/ Added

  • 3 Existing procrustes tests were updated to unpack R, _
  • 2 New tests for S (necessary?)
    • Added test_procrustes_singular_values_identity: S == [1,1,1] for X=Y=I
    • Added test_procrustes_singular_values_are_sorted_nonnegative: shape/non-negativity/descending-order on junk data

NOTE: This is a breaking signature change when unpacking procrustes

…ion)

-align.py: procrustes function now returns R, S instead of R alone
	- S is the singular values from np.linalg.svd() function, just returned instead of discarded
	- No inference is conducted here... S is simply returned.

-test_align.py: Updated the 3 existing procrustes tests to unpack (R,_), as S is not relavant
	- Added test_procrustes_singular_value_identity: S == [1,1,1] for X=Y=I
	- Added test_procrustes_singular_values_are_sorted_nonnegative: shape/non-negativity/descending-order on some random data

- NOTE: Breaking signature change...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant