/** * Calculates the Hilbert-Schmidt independence criterion (HSIC) for paired arrays of values. HSIC tests if two data sets are statistically independent. * Source: A. Gretton et al. A Kernel Statistical Test of Independence in Advances in Neural Information Processing Systems (2008). * * @method hsic * @memberof ran.test * @param {Array[]} dataSets Array containing the two data sets. * @param {number} [alpha = 0.05] Confidence level. * @returns {{stat: number, passed: boolean}} Object containing the test statistics and whether the data sets passed the null hypothesis that * they are statistically independent. * @throws {Error} If the number of data sets is less than 2. * @throws {Error} If the data sets have different sample size. * @throws {Error} If the sample size is less than 6. * @example * * let sample1 = Array.from({length: 50}, (d, i) => i) * let sample2 = sample1.map(d => d + Math.random() - 0.5) * ran.test.hsic([sample1, sample2]) * // => { stat: 6.197628059960943, passed: false } * * sample1 = ran.core.float(0, 10, 50) * sample2 = ran.core.float(0, 10, 50) * ran.test.hsic([sample1, sample2]) * // => { stat: 0.3876607680368274, passed: true } */ export default function hsic(dataSets: any[][], alpha?: number): { stat: number; passed: boolean; };