API Reference


MaxMargin(indep_test[, compute_distkern, bias])

Maximal Margin test statistic and p-value.

KMERF([forest, ntrees])

Kernel Mean Embedding Random Forest (KMERF) test statistic and p-value.


Multiscale Graph Correlation (MGC) test statistic and p-value.

Dcorr([compute_distance, bias])

Distance Correlation (Dcorr) test statistic and p-value.

Hsic([compute_kernel, bias])

Hilbert Schmidt Independence Criterion (Hsic) test statistic and p-value.


Heller Heller Gorfine (HHG) test statistic and p-value.


Cannonical Correlation Analysis (CCA) test statistic and p-value.


Rank Value (RV) test statistic and p-value.


Friedman-Rafksy (FR) test statistic and p-value.


dHsic([compute_kernel, bias])

\(d\)-variate Hilbert Schmidt Independence Criterion (dHsic) test statistic and p-value.


KSample(indep_test[, compute_distkern, bias])

Nonparametric K-Sample Testing test statistic and p-value.

Energy([compute_distance, bias])

Energy test statistic and p-value.

MMD([compute_kernel, bias])

Maximum Mean Discrepency (MMD) test statistic and p-value.

DISCO([compute_distance, bias])

Distance Components (DISCO) test statistic and p-value.


Multivariate analysis of variance (MANOVA) test statistic and p-value.


Hotelling \(T^2\) test statistic and p-value.


Smooth Characteristic Function test statistic and p-value


Mean Embedding test statistic and p-value.


HHG 2-Sample test statistic.


MGCX([compute_distance, max_lag])

Cross Multiscale Graph Correlation (MGCX) test statistic and p-value.

DcorrX([compute_distance, max_lag])

Cross Distance Correlation (DcorrX) test statistic and p-value.


DiscrimOneSample([is_dist, remove_isolates])

One Sample Discriminability test statistic and p-value.

DiscrimTwoSample([is_dist, remove_isolates])

Two Sample Discriminability test statistic and p-value.

Conditional Independence

FCIT([model, cv_grid, num_perm, prop_test, ...])

Fast Conditional Independence test statistic and p-value


Kernel Conditional Independence Test Statistic and P-Value.

Kernel Goodness-of-Fit

FSSD(p, k, V[, null_sim, alpha])

Goodness-of-fit test using The Finite Set Stein Discrepancy statistic.


Independence Simulations

linear(n, p[, noise, low, high])

Linear simulation.

exponential(n, p[, noise, low, high])

Exponential simulation.

cubic(n, p[, noise, low, high, cubs, scale])

Cubic simulation.

joint_normal(n, p[, noise])

Joint Normal simulation.

step(n, p[, noise, low, high])

Step simulation.

quadratic(n, p[, noise, low, high])

Quadratic simulation.

w_shaped(n, p[, noise, low, high])

W-Shaped simulation.

spiral(n, p[, noise, low, high])

Spiral simulation.

uncorrelated_bernoulli(n, p[, noise, prob])

Uncorrelated Bernoulli simulation.

logarithmic(n, p[, noise])

Logarithmic simulation.

fourth_root(n, p[, noise, low, high])

Fourth Root simulation.

sin_four_pi(n, p[, noise, low, high])

Sine 4\(\pi\) simulation.

sin_sixteen_pi(n, p[, noise, low, high])

Sine 16\(\pi\) simulation.

square(n, p[, noise, low, high])

Square simulation.

two_parabolas(n, p[, noise, low, high, prob])

Two Parabolas simulation.

circle(n, p[, noise, low, high])

Circle simulation.

ellipse(n, p[, noise, low, high])

Ellipse simulation.

diamond(n, p[, noise, low, high])

Diamond simulation.

multiplicative_noise(n, p)

Multiplicative Noise simulation.

multimodal_independence(n, p[, prob, sep1, sep2])

Multimodal Independence data.

indep_sim(sim, n, p, **kwargs)

Independence simulation generator.

K-Sample Simulations

rot_ksamp(sim, n, p[, k, noise, degree, ...])

Rotates input simulations to produce a k-sample simulation.

gaussian_3samp(n[, epsilon, weight, case])

Generates 3 sample of gaussians corresponding to 5 cases.

Time-Series Simulations

indep_ar(n[, lag, phi, sigma])

2 independent, stationary, autoregressive time series simulation.

cross_corr_ar(n[, lag, phi, sigma])

2 linearly dependent time series simulation.

nonlinear_process(n[, lag, phi, sigma])

2 nonlinearly dependent time series simulation.

ts_sim(sim, n, **kwargs)

Time-series simulation generator.


independence.sim_matrix(model, x)

Computes the similarity matrix from a random forest.

ksample.k_sample_transform(inputs[, test_type])

Computes a k-sample transform of the inputs.

tools.compute_kern(x, y[, metric, workers])

Kernel similarity matrices for the inputs.

tools.multi_compute_kern(*args[, metric, ...])

Kernel similarity matrices for the input matrices.

tools.compute_dist(x, y[, metric, workers])

Distance matrices for the inputs.

tools.perm_test(calc_stat, x, y[, reps, ...])

Permutation test for the p-value of a nonparametric test.

tools.multi_perm_test(calc_stat, *args[, ...])

Permutation test for the p-value of a nonparametric test with multiple variables.

tools.chi2_approx(calc_stat, x, y)

Fast chi-squared approximation for the p-value.

tools.power(test, sim_type[, sim, n, alpha, ...])

Computes empircal power for hypothesis tests


Calculates the Smooth CF test statistic using the vector of differences.


Calculates the Mean Embedding test statistic using the vector of differences.

Base Classes


A base class for an independence test.


A base class for a \(d\)-variate independence test.

ksample.base.KSampleTest([compute_distance, ...])

A base class for a k-sample test.


A base class for a time-series test.


A base class for a discriminability test.

kgof.base.GofTest(p, alpha)

A base class for a discriminability test.