public static double JensenShannonDivergence ( double [ ] p , double [ ] q ) { double [ ] m = new double [ p . length ] ; for ( int i = 0 ; i < m . length ; i ++ ) { m [ i ] = ( p [ i ] + q [ i ] ) / 2 ; } return ( KullbackLeiblerDivergence ( p , m ) + KullbackLeiblerDivergence ( q , m ) ) / 2 ; }
Gets the Jensen Shannon divergence .