songbird icon indicating copy to clipboard operation
songbird copied to clipboard

numerical issues

Open mortonjt opened this issue 6 years ago • 1 comments

Sooner or later, this discussion will pop up.

There will be some numerical issues when converting back and forth between alr and clr coordinates. In otherwords, you shouldn't need to use clr_inv to convert clr to proportions, then to proportions to alr coordinates. It should be one step.

For instance, we know that we can convert from logarithms to alr coordinates as follows

alr(x) = log(x) A

where

A = [[1, 0, ..., 0, -1]
     [0, 1, ..., 0, -1]
     ...
     [0, 0, ..., 1, -1]]

There should correspond an appropriate inv(A) where log(x) = alr(x) A' If we can do this, we can easily convert logs to clr coordinates (since this is just mean centering). The solution needs to be simple and fast (i.e. no matrix inversions or other cubic time crap).

mortonjt avatar Feb 18 '19 17:02 mortonjt

Adding reference to @mortonjt's comment here, which shows some examples of this in the codebase.

fedarko avatar Feb 04 '20 21:02 fedarko