Skip to contents

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.

Usage

norm_energy(x, min_energy = -7, q = 1)

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).

Value

A numeric vector of normalized energy values.

Examples

# Generate random energy values
x <- runif(n = 100, min = -11, max = 0)
# Normalize the energy values
norm_energy(x)
#>   [1] 0.0000000 0.0000000 0.0000000 1.0811420 0.0000000 1.3845202 2.6943816
#>   [8] 1.1094402 0.0000000 1.9633541 1.7582626 0.0000000 0.0000000 2.1334769
#>  [15] 5.3759993 3.0002508 0.0000000 0.0000000 0.0000000 0.0000000 0.5809605
#>  [22] 0.0000000 3.1763567 0.1118413 1.4658960 0.0000000 6.1583792 1.7289254
#>  [29] 0.0000000 0.0000000 7.0000000 0.0000000 0.0000000 3.7368619 1.8432438
#>  [36] 0.0000000 5.9695994 0.0000000 1.5632755 0.0000000 3.1969100 4.8476089
#>  [43] 4.9428020 4.1457761 0.0000000 4.0182657 5.4651457 0.9182832 0.0000000
#>  [50] 6.0003541 1.1718340 0.0000000 5.6358062 3.5998753 0.0000000 0.0000000
#>  [57] 0.0000000 0.0000000 0.0257006 0.0000000 4.1415158 6.4389581 0.0000000
#>  [64] 0.0000000 6.9726246 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
#>  [71] 0.0000000 3.1374177 6.5651625 2.0075307 0.0000000 0.0000000 0.0000000
#>  [78] 1.3728656 0.0000000 5.4883894 3.8409082 0.0000000 0.0000000 2.6148937
#>  [85] 0.0000000 2.1507387 2.5160018 0.0000000 6.6070144 0.0000000 6.0956915
#>  [92] 0.0000000 6.2422288 0.0000000 0.0000000 0.0000000 6.7285125 0.0000000
#>  [99] 0.0000000 5.0393907