songbird
songbird copied to clipboard
numerical issues
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).
Adding reference to @mortonjt's comment here, which shows some examples of this in the codebase.