Perform Isometric Log-Ratio on barycentric (compositional) data. Parameters ---------- barycentric: ndarray of shape (3, N) Barycentric coordinates. References ---------- "An algebraic method to compute isometric logratio transformation and back transformat
(barycentric)
| 87 | |
| 88 | |
| 89 | def _ilr_transform(barycentric): |
| 90 | """ |
| 91 | Perform Isometric Log-Ratio on barycentric (compositional) data. |
| 92 | |
| 93 | Parameters |
| 94 | ---------- |
| 95 | barycentric: ndarray of shape (3, N) |
| 96 | Barycentric coordinates. |
| 97 | |
| 98 | References |
| 99 | ---------- |
| 100 | "An algebraic method to compute isometric logratio transformation and |
| 101 | back transformation of compositional data", Jarauta-Bragulat, E., |
| 102 | Buenestado, P.; Hervada-Sala, C., in Proc. of the Annual Conf. of the |
| 103 | Intl Assoc for Math Geology, 2003, pp 31-30. |
| 104 | """ |
| 105 | barycentric = np.asarray(barycentric) |
| 106 | x_0 = np.log(barycentric[0] / barycentric[1]) / np.sqrt(2) |
| 107 | x_1 = ( |
| 108 | 1.0 / np.sqrt(6) * np.log(barycentric[0] * barycentric[1] / barycentric[2] ** 2) |
| 109 | ) |
| 110 | ilr_tdata = np.stack((x_0, x_1)) |
| 111 | return ilr_tdata |
| 112 | |
| 113 | |
| 114 | def _ilr_inverse(x): |