API Reference

Independence

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.

MGC([compute_distance])

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.

HHG([compute_distance])

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

CCA()

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

RV()

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

D-Variate

dHsic([compute_kernel, bias])

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

K-Sample

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.

MANOVA()

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

Hotelling()

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

SmoothCFTest([num_randfreq])

Smooth Characteristic Function test statistic and p-value

MeanEmbeddingTest([num_randfreq])

Mean Embedding test statistic and p-value.

FriedmanRafsky(**kwargs)

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

KSampleHHG([compute_distance])

HHG 2-Sample test statistic.

Time-Series

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.

LjungBox([max_lag])

Ljung-Box for Cross Correlation (CorrX) test statistic and p-value.

Discriminability

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

ConditionalDcorr([compute_distance, ...])

Conditional Distance Covariance/Correlation (CDcov/CDcorr) test statistic and p-value.

PartialDcorr([compute_distance, use_cov])

Partial Distance Covariance/Correlation (PDcov/PDcorr) test statistic and p-value.

PartialCorr(**kwargs)

Conditional Pearson's correlation test.

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

Fast Conditional Independence test statistic and p-value

KCI(**kwargs)

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.

Simulations

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.

Conditional Independence Simulations

indep_normal(n[, p, random_state])

Independent standard normal distributions.

indep_lognormal(n[, p, random_state])

Independent lognormal and normal distributions.

indep_binomial(n[, p, random_state])

Independent binomial distributions.

cond_indep_normal(n[, p, random_state])

Conditionally independent normal distributions.

cond_indep_lognormal(n[, p, random_state])

Conditionally independent lognormal and normal distributions.

cond_indep_normal_nonlinear(n[, p, random_state])

Conditionally independent normal distributions.

cond_indep_binomial(n[, p, random_state])

Conditionally independent binomial distributions.

correlated_binomial(n[, p, random_state])

Conditionally dependent binomial distributions.

correlated_normal(n[, p, random_state])

Conditionally dependent normal distributions.

correlated_normal_nonliear(n[, p, random_state])

Conditionally dependent normal distributions with nonlinear dependence.

correlated_lognormal(n[, p, random_state])

Example 5 from [#szekelyPartialDistanceCorrelation2014a]_ \((X, Y, Z) \in \mathbb{R} \times \mathbb{R} \times \mathbb{R}\):

correlated_t_linear(n[, p, random_state])

Conditionally dependent t-distributed data with linear dependence.

correlated_t_quadratic(n[, p, random_state])

Conditionally dependent t-distributed data with quadratic dependence.

correlated_t_nonlinear(n[, p, random_state])

Conditionally dependent t-distributed data with nonlinear dependence.

condi_indep_sim(sim, n, p[, random_state])

Conditional independence simulation generator.

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.

Miscellaneous

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[, z, metric, workers])

Distance matrices for the inputs.

tools.perm_test(calc_stat, x, y[, z, 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

ksample.smoothCF.smooth_cf_distance(difference)

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

ksample.mean_embedding.mean_embed_distance(...)

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

Base Classes

independence.base.IndependenceTest([...])

A base class for an independence test.

d_variate.base.DVariateTest([compute_kernel])

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

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

A base class for a k-sample test.

time_series.base.TimeSeriesTest([...])

A base class for a time-series test.

discrim.base.DiscriminabilityTest()

A base class for a discriminability test.

kgof.base.GofTest(p, alpha)

A base class for a discriminability test.