Normalize Energy Values of a Vector
norm_energy.Rd
This function normalizes the energy values of a given vector. The normalization process involves transforming the energy values using the exponential function, followed by a logarithm with base 2. The function then scales the values to lie between a user-specified minimum energy and the q-th quantile of the initial energy values.
Arguments
- x
A numeric vector containing the energy values to be normalized.
- min_energy
A numeric value representing the minimum energy value after normalization. Default is set to -7.
- q
A numeric value between 0 and 1, representing the quantile of the energy values to be used as the maximum after normalization. Default is set to 1 (max).
Examples
# Generate random energy values
x <- runif(n = 100, min = -11, max = 0)
# Normalize the energy values
norm_energy(x)
#> [1] 0.0000000 1.7510064 0.0000000 2.1999360 5.0324659 4.7046640 5.3820270
#> [8] 0.0000000 0.5785698 5.6452978 0.0000000 3.4704537 2.9982590 4.9237030
#> [15] 6.8817897 0.0000000 6.7936218 1.6807474 0.0000000 0.0000000 0.0000000
#> [22] 1.0811420 0.0000000 1.3845202 2.6943816 1.1094402 0.0000000 1.9633541
#> [29] 1.7582626 0.0000000 0.0000000 2.1334769 5.3759993 3.0002508 0.0000000
#> [36] 0.0000000 0.0000000 0.0000000 0.5809605 0.0000000 3.1763567 0.1118413
#> [43] 1.4658960 0.0000000 6.1583792 1.7289254 0.0000000 0.0000000 7.0000000
#> [50] 0.0000000 0.0000000 3.7368619 1.8432438 0.0000000 5.9695994 0.0000000
#> [57] 1.5632755 0.0000000 3.1969100 4.8476089 4.9428020 4.1457761 0.0000000
#> [64] 4.0182657 5.4651457 0.9182832 0.0000000 6.0003541 1.1718340 0.0000000
#> [71] 5.6358062 3.5998753 0.0000000 0.0000000 0.0000000 0.0000000 0.0257006
#> [78] 0.0000000 4.1415158 6.4389581 0.0000000 0.0000000 6.9726246 0.0000000
#> [85] 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 3.1374177 6.5651625
#> [92] 2.0075307 0.0000000 0.0000000 0.0000000 1.3728656 0.0000000 5.4883894
#> [99] 3.8409082 0.0000000