question: public static double P ( double Y [ ] [ ] , int j , int v , int k , int w ) { int N = Y . length ; double p = 0.0001 ; for ( int i = 0 ; i < N ; i ++ ) { if ( ( ( int ) Math . round ( Y [ i ] [ j ] ) == v ) && ( ( int ) Math . round ( Y [ i ] [ k ] ) == w ) ) p += 1.0 ; } return p / N ; }
target:  P - Empirical joint. Multi-target friendly.