From af7c6de4db9981ac814362c441fbac22c8faa2d7 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 24 Nov 2022 09:02:26 +0100 Subject: Start online docs of the development version --- docs/dev/reference/ilr.html | 235 ++++++++++++++++++-------------------------- 1 file changed, 97 insertions(+), 138 deletions(-) (limited to 'docs/dev/reference/ilr.html') diff --git a/docs/dev/reference/ilr.html b/docs/dev/reference/ilr.html index 452647d6..c1396303 100644 --- a/docs/dev/reference/ilr.html +++ b/docs/dev/reference/ilr.html @@ -1,68 +1,13 @@ - - - - - - - -Function to perform isometric log-ratio transformation — ilr • mkin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function to perform isometric log-ratio transformation — ilr • mkin + + - - - - -
-
- -
- -
+
@@ -149,86 +94,100 @@ transformations." /> transformations.

-
ilr(x)
-
-invilr(x)
+
+
ilr(x)
+
+invilr(x)
+
-

Arguments

- - - - - - -
x

A numeric vector. Naturally, the forward transformation is only -sensible for vectors with all elements being greater than zero.

+
+

Arguments

+
x
+

A numeric vector. Naturally, the forward transformation is only +sensible for vectors with all elements being greater than zero.

-

Value

+
+
+

Value

+ -

The result of the forward or backward transformation. The returned +

The result of the forward or backward transformation. The returned components always sum to 1 for the case of the inverse log-ratio transformation.

-

References

- +
+
+

References

Peter Filzmoser, Karel Hron (2008) Outlier Detection for Compositional Data Using Robust Methods. Math Geosci 40 233-248

-

See also

- -

Another implementation can be found in R package +

+
+

See also

+

Another implementation can be found in R package robCompositions.

-

Author

- +
+
+

Author

René Lehmann and Johannes Ranke

+
-

Examples

-
-# Order matters -ilr(c(0.1, 1, 10)) -
#> [1] -1.628174 -2.820079
ilr(c(10, 1, 0.1)) -
#> [1] 1.628174 2.820079
# Equal entries give ilr transformations with zeros as elements -ilr(c(3, 3, 3)) -
#> [1] 0 0
# Almost equal entries give small numbers -ilr(c(0.3, 0.4, 0.3)) -
#> [1] -0.2034219 0.1174457
# Only the ratio between the numbers counts, not their sum -invilr(ilr(c(0.7, 0.29, 0.01))) -
#> [1] 0.70 0.29 0.01
invilr(ilr(2.1 * c(0.7, 0.29, 0.01))) -
#> [1] 0.70 0.29 0.01
# Inverse transformation of larger numbers gives unequal elements -invilr(-10) -
#> [1] 7.213536e-07 9.999993e-01
invilr(c(-10, 0)) -
#> [1] 7.207415e-07 9.991507e-01 8.486044e-04
# The sum of the elements of the inverse ilr is 1 -sum(invilr(c(-10, 0))) -
#> [1] 1
# This is why we do not need all elements of the inverse transformation to go back: -a <- c(0.1, 0.3, 0.5) -b <- invilr(a) -length(b) # Four elements -
#> [1] 4
ilr(c(b[1:3], 1 - sum(b[1:3]))) # Gives c(0.1, 0.3, 0.5) -
#> [1] 0.1 0.3 0.5
-
+
+

Examples

+

+# Order matters
+ilr(c(0.1, 1, 10))
+#> [1] -1.628174 -2.820079
+ilr(c(10, 1, 0.1))
+#> [1] 1.628174 2.820079
+# Equal entries give ilr transformations with zeros as elements
+ilr(c(3, 3, 3))
+#> [1] 0 0
+# Almost equal entries give small numbers
+ilr(c(0.3, 0.4, 0.3))
+#> [1] -0.2034219  0.1174457
+# Only the ratio between the numbers counts, not their sum
+invilr(ilr(c(0.7, 0.29, 0.01)))
+#> [1] 0.70 0.29 0.01
+invilr(ilr(2.1 * c(0.7, 0.29, 0.01)))
+#> [1] 0.70 0.29 0.01
+# Inverse transformation of larger numbers gives unequal elements
+invilr(-10)
+#> [1] 7.213536e-07 9.999993e-01
+invilr(c(-10, 0))
+#> [1] 7.207415e-07 9.991507e-01 8.486044e-04
+# The sum of the elements of the inverse ilr is 1
+sum(invilr(c(-10, 0)))
+#> [1] 1
+# This is why we do not need all elements of the inverse transformation to go back:
+a <- c(0.1, 0.3, 0.5)
+b <- invilr(a)
+length(b) # Four elements
+#> [1] 4
+ilr(c(b[1:3], 1 - sum(b[1:3]))) # Gives c(0.1, 0.3, 0.5)
+#> [1] 0.1 0.3 0.5
+
+
+
+
-
- - + + -- cgit v1.2.1