Documentation API of the 'jhplot.stat.Entropy' Java class
Entropy
jhplot.stat

## Class Entropy

• `public abstract class Entropyextends Object`
Implements common discrete Shannon Entropy functions. Provides: univariate entropy H(X), conditional entropy H(X|Y), joint entropy H(X,Y). Defaults to log_2, and so the entropy is calculated in bits.
• ### Field Summary

Fields
Modifier and TypeField and Description
`static double``LOG_BASE`
• ### Method Summary

All Methods
Modifier and TypeMethod and Description
`static double``calculateConditionalEntropy(double[] dataVector, double[] conditionVector)`
Calculates the conditional entropy H(X|Y) from two vectors.
`static double``calculateEntropy(double[] dataVector)`
Calculates the univariate entropy H(X) from a vector.
`static double``calculateJointEntropy(double[] firstVector, double[] secondVector)`
Calculates the joint entropy H(X,Y) from two vectors.
• ### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Field Detail

• #### LOG_BASE

`public static double LOG_BASE`
• ### Method Detail

• #### calculateEntropy

`public static double calculateEntropy(double[] dataVector)`
Calculates the univariate entropy H(X) from a vector. Uses histograms to estimate the probability distributions, and thus the entropy. The entropy is bounded 0 ≤ H(X) ≤ log |X|, where log |X| is the log of the number of states in the random variable X.
Parameters:
`dataVector` - Input vector (X). It is discretised to the floor of each value before calculation.
Returns:
The entropy H(X).
• #### calculateConditionalEntropy

`public static double calculateConditionalEntropy(double[] dataVector,                                                 double[] conditionVector)`
Calculates the conditional entropy H(X|Y) from two vectors. X = dataVector, Y = conditionVector. Uses histograms to estimate the probability distributions, and thus the entropy. The conditional entropy is bounded 0 ≤ H(X|Y) ≤ H(X).
Parameters:
`dataVector` - Input vector (X). It is discretised to the floor of each value before calculation.
`conditionVector` - Input vector (Y). It is discretised to the floor of each value before calculation.
Returns:
The conditional entropy H(X|Y).
• #### calculateJointEntropy

`public static double calculateJointEntropy(double[] firstVector,                                           double[] secondVector)`
Calculates the joint entropy H(X,Y) from two vectors. The order of the input vectors is irrelevant. Uses histograms to estimate the probability distributions, and thus the entropy. The joint entropy is bounded 0 ≤ H(X,Y) ≤ log |XY|, where log |XY| is the log of the number of states in the joint random variable XY.
Parameters:
`firstVector` - Input vector. It is discretised to the floor of each value before calculation.
`secondVector` - Input vector. It is discretised to the floor of each value before calculation.
Returns:
The joint entropy H(X,Y).

DMelt 1.2 © DataMelt by jWork.ORG

Entropy
jhplot.stat

## Class Entropy

• `public abstract class Entropyextends Object`
Implements common discrete Shannon Entropy functions. Provides: univariate entropy H(X), conditional entropy H(X|Y), joint entropy H(X,Y). Defaults to log_2, and so the entropy is calculated in bits.

Warning: You cannot see the full API documentation of this class since the access to the DatMelt documentation for third-party Java classes is denied. Guests can only view jhplot Java API. To view the complete description of this class and its methods, please request the full DataMelt membership.

If you are already a full member, please login to the DataMelt member area before visiting this documentation.