This function computes the Kullback-Leibler (KL) divergence between two probability distributions represented by matrices, using a base 10 logarithm. The function calculates KL divergence in both directions (P || Q and Q || P) and handles zero probabilities by replacing them with a minimum value to avoid undefined logarithms.
klPIE(P, Q, min_value = 1e-12)
A named numeric vector with two elements:
The KL divergence from P to Q (P || Q).
The KL divergence from Q to P (Q || P).
A numeric matrix representing the first probability distribution. The entire matrix should sum to 1.
A numeric matrix representing the second probability distribution. The entire matrix should sum to 1.
A numeric value representing the minimum value to replace
any zero probabilities. Defaults to 1e-12
.