This applies the ln function columnwise to the given input matrix and returns the modified matrix. If necessary, columns undergo a linear translation to ensure that all resulting values are >= 0.

apply_ln_transformation(data_matrix)

Arguments

data_matrix

The original data matrix.

Value

The log-transformed data matrix.

Examples

data_matrix <- matrix(1:10, dimnames = list(NULL, 'some_val')) data_matrix
#> some_val #> [1,] 1 #> [2,] 2 #> [3,] 3 #> [4,] 4 #> [5,] 5 #> [6,] 6 #> [7,] 7 #> [8,] 8 #> [9,] 9 #> [10,] 10
autovarCore:::apply_ln_transformation(data_matrix)
#> some_val #> [1,] 0.0000000 #> [2,] 0.6931472 #> [3,] 1.0986123 #> [4,] 1.3862944 #> [5,] 1.6094379 #> [6,] 1.7917595 #> [7,] 1.9459101 #> [8,] 2.0794415 #> [9,] 2.1972246 #> [10,] 2.3025851