public double empiricalHSICincompleteCholesky(TetradMatrix Gy,TetradMatrix Gx,int m){
  int ky=Gy.columns();
  int kx=Gx.columns();
  TetradMatrix H=KernelUtils.constructH(m);
  TetradMatrix Gcy=H.times(Gy);
  TetradMatrix Gcx=H.times(Gx);
  TetradMatrix Gcyt=Gcy.transpose();
  TetradMatrix A=Gcyt.times(Gcx);
  TetradMatrix B=Gcy.times(A);
  TetradMatrix Gcxt=Gcx.transpose();
  double empHSIC=0.0;
  for (int i=0; i < m; i++) {
    empHSIC+=matrixProductEntry(B,Gcxt,i,i);
  }
  empHSIC/=Math.pow(m - 1,2);
  return empHSIC;
}

public double empiricalHSICincompleteCholesky ( TetradMatrix Gy , TetradMatrix Gx , int m ) { int ky = Gy . columns ( ) ; int kx = Gx . columns ( ) ; TetradMatrix H = KernelUtils . constructH ( m ) ; TetradMatrix Gcy = H . times ( Gy ) ; TetradMatrix Gcx = H . times ( Gx ) ; TetradMatrix Gcyt = Gcy . transpose ( ) ; TetradMatrix A = Gcyt . times ( Gcx ) ; TetradMatrix B = Gcy . times ( A ) ; TetradMatrix Gcxt = Gcx . transpose ( ) ; double empHSIC = 0.0 ; for ( int i = 0 ; i < m ; i ++ ) { empHSIC += matrixProductEntry ( B , Gcxt , i , i ) ; } empHSIC /= Math . pow ( m - 1 , 2 ) ; return empHSIC ; }
empirical unconditional hilbert - schmidt dependence measure for x and y using incomplete cholesky decomposition to approximate gram matrices
