public class ShannonEntropy
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
base_log
Base when computing the logarithms.
|
Constructor and Description |
---|
ShannonEntropy() |
Modifier and Type | Method and Description |
---|---|
static double |
conditionalEntropy(double[] pmf,
double[][] matrix_W)
Calculates the conditional entropy of a channel matrix
given an input PMF.
|
static double |
conditionalEntropy(ProbDist pd,
Channel channel)
Calculates the conditional entropy of a channel
given an input probability distribution.
|
static double |
D(double[] p,
double[] q)
Calculates the relative entropy of two PMFs p and q.
|
static double |
entropy(double[] pmf)
Calculates the entropy of a PMF array.
|
static double |
entropy(ProbDist pd)
Calculates the entropy of a probability distribution.
|
static double |
H(double[] pmf)
Calculates the entropy of a PMF array.
|
static double |
H(double[] pmf,
double[][] W)
Calculates the conditional entropy of a channel matrix
given an input PMF.
|
static double |
H(ProbDist pd)
Calculates the entropy of a probability distribution.
|
static double |
H(ProbDist pd,
Channel channel)
Calculates the conditional entropy of a channel
given an input probability distribution.
|
static double |
I(double[] Q,
double[][] W)
Calculates mutual information between
an input PMF and a channel matrix.
|
static double |
I(ProbDist pd,
Channel channel)
Calculates mutual information between
an input PMF and a channel matrix.
|
static double |
jointEntropy(double[][] p)
Calculates the joint entropy of X and Y
where p(x,y) = p[x_index][y_index].
|
static double |
KullbackLeibler(double[] p,
double[] q)
Calculates the relative entropy of two PMFs p and q.
|
static double |
MIuniformInput(double[][] W)
Calculates the mutual information given an uniform input distribution.
|
static double |
mutualInformation(double[] Q,
double[][] W)
Calculates mutual information between
an input PMF and a channel matrix.
|
static double |
mutualInformation(ProbDist pd,
Channel channel)
Calculates mutual information between
an input PMF and a channel matrix.
|
static double |
relativeEntropy(double[] p,
double[] q)
Calculates the relative entropy of two PMFs p and q.
|
public static final int base_log
public static double conditionalEntropy(double[] pmf, double[][] matrix_W)
pmf
- PMF arraymatrix_W
- channel matrix arraypublic static double conditionalEntropy(ProbDist pd, Channel channel)
pd
- input probability distributionchannel
- channelpublic static double D(double[] p, double[] q) throws java.lang.ArithmeticException
p
- PMF arrayq
- PMF arrayjava.lang.ArithmeticException
- Exception occured by division by zeropublic static double entropy(double[] pmf)
pmf
- PMF arraypublic static double entropy(ProbDist pd)
pd
- probability distributionpublic static double H(double[] pmf)
pmf
- PMF arraypublic static double H(double[] pmf, double[][] W)
pmf
- PMF arrayW
- channel matrix arraypublic static double H(ProbDist pd)
pd
- probability distributionpublic static double H(ProbDist pd, Channel channel)
pd
- input probability distributionchannel
- channelpublic static double I(double[] Q, double[][] W)
Q
- input PMF arrayW
- channel matrixpublic static double I(ProbDist pd, Channel channel)
pd
- input probability distributionchannel
- channelpublic static double jointEntropy(double[][] p)
p
- the joint probability of X and Ypublic static double KullbackLeibler(double[] p, double[] q) throws java.lang.ArithmeticException
p
- PMF arrayq
- PMF arrayjava.lang.ArithmeticException
- Exception occured by division by zeropublic static double MIuniformInput(double[][] W)
W
- channel matrixpublic static double mutualInformation(double[] Q, double[][] W)
Q
- input PMF arrayW
- channel matrixpublic static double mutualInformation(ProbDist pd, Channel channel)
pd
- input probability distributionchannel
- channelpublic static double relativeEntropy(double[] p, double[] q) throws java.lang.ArithmeticException
p
- PMF arrayq
- PMF arrayjava.lang.ArithmeticException
- Exception occured by division by zero