de.jstacs.utils

## Class StatisticalTest

• public class StatisticalTest
extends Object
This class enables the user to compute some divergences. In Latex notation the divergence is

 Y_{\epsilon}(p,q) = \frac{\left[\sum_{i,j} p_{i,j} \cdot \left(\frac{p_{i,j}}{q_{i,j}}\right)^{\epsilon-1}\right] - 1}{\frac{\epsilon(\epsilon-1)}{2}} 

NOTE: There is no checking if the user given matrices and vectors are stochastic.
Author:
Jens Keilwagen
• ### Constructor Summary

Constructors
Constructor and Description
StatisticalTest()
• ### Method Summary

All Methods
Modifier and Type Method and Description
static double getGeneralizedDivergence(double[][] p, double epsilon)
Computes the generalized divergence for two stochastic matrices over the same domain, i.e.
static double getGeneralizedDivergence(double[][] p, double[][] q, double epsilon)
Computes the generalized divergence for two given stochastic matrices over the same domain, i.e.
static double getGeneralizedDivergence(double[][] p, double[] r, double[] s, double epsilon)
Computes the generalized divergence for two stochastic matrices over the same domain, i.e.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### StatisticalTest

public StatisticalTest()
• ### Method Detail

• #### getGeneralizedDivergence

public static double getGeneralizedDivergence(double[][] p,
double[][] q,
double epsilon)
throws IllegalArgumentException
Computes the generalized divergence for two given stochastic matrices over the same domain, i.e. the matrices have to have the same dimensionality.

For epsilon=1 this method returns 2*(mutual information).
Parameters:
p - one stochastic matrix
q - another stochastic matrix
epsilon - the positive divergence parameter
Returns:
the value of the generalized divergence for the two matrices
Throws:
IllegalArgumentException - if some arguments are not correct
• #### getGeneralizedDivergence

public static double getGeneralizedDivergence(double[][] p,
double[] r,
double[] s,
double epsilon)
Computes the generalized divergence for two stochastic matrices over the same domain, i.e. the matrices have to have the same dimensionality. The second matrix is computed as joint probability of the given stochastic vectors.

For epsilon=1 this method returns 2*(mutual information).
Parameters:
p - a stochastic matrix
r - one stochastic vector
s - another stochastic vector
epsilon - the divergence parameter
Returns:
the value of the generalized divergence for two stochastic matrices
• #### getGeneralizedDivergence

public static double getGeneralizedDivergence(double[][] p,
double epsilon)
Computes the generalized divergence for two stochastic matrices over the same domain, i.e. the matrices have to have the same dimensionality. The second matrix is computed as joint probability of the marginal distributions.

For epsilon=1 this method returns 2*(mutual information).
Parameters:
p - a stochastic matrix
epsilon - the divergence parameter
Returns:
the value of the generalized divergence for two stochastic matrices