PoissonKernelTest#

class QuadratiK.poisson_kernel_test.PoissonKernelTest(rho, num_iter=300, quantile=0.95, random_state=None, n_jobs=8)#

Class for Poisson kernel-based quadratic distance test of Uniformity on the Sphere

Parameters#

rhofloat

The value of concentration parameter used for the Poisson kernel function.

num_iterint, optional

Number of iterations for critical value estimation of U-statistic.

quantilefloat, optional

The quantile to use for critical value estimation

random_stateint, None, optional.

Seed for random number generation. Defaults to None

n_jobsint, optional.

n_jobs specifies the maximum number of concurrently running workers. If 1 is given, no joblib parallelism is used at all, which is useful for debugging. For more information on joblib n_jobs refer to - https://joblib.readthedocs.io/en/latest/generated/joblib.Parallel.html. Defaults to 8.

Attributes#

test_type_str

The type of test performed on the data

execution_timefloat

Time taken for the test method to execute

u_statistic_h0_boolean

A logical value indicating whether or not the null hypothesis is rejected according to Un

u_statistic_un_float

The value of the U-statistic.

u_statistic_cv_float

The empirical critical value for Un

v_statistic_h0_boolean

A logical value indicating whether or not the null hypothesis is rejected according to Vn.

v_statistic_vn_float

The value of the V-statistic.

v_statistic_cv_float

The critical value for Vn computed following the asymptotic distribution.

References#

Ding Y., Markatou M., Saraceno G. (2023). “Poisson Kernel-Based Tests for Uniformity on the d-Dimensional Sphere.” Statistica Sinica. doi: doi:10.5705/ss.202022.0347

Examples#

>>> from QuadratiK.tools import sample_hypersphere
>>> from QuadratiK.poisson_kernel_test import PoissonKernelTest
>>> np.random.seed(42)
>>> X = sample_hypersphere(100,3, random_state=42)
>>> unif_test = PoissonKernelTest(rho = 0.7, random_state=42).test(X)
>>> print("Execution time: {:.3f} seconds".format(unif_test.execution_time))
>>> print("U Statistic Results")
>>> print("H0 is rejected : {}".format(unif_test.u_statistic_h0_))
>>> print("Un Statistic : {}".format(unif_test.u_statistic_un_))
>>> print("Critical Value : {}".format(unif_test.u_statistic_cv_))
>>> print("V Statistic Results")
>>> print("H0 is rejected : {}".format(unif_test.v_statistic_h0_))
>>> print("Vn Statistic : {}".format(unif_test.v_statistic_vn_))
>>> print("Critical Value : {}".format(unif_test.v_statistic_cv_))
... Execution time: 0.181 seconds
... U Statistic Results
... H0 is rejected : False
... Un Statistic : 1.6156682048968174
... Critical Value : 0.06155875299050079
... V Statistic Results
... H0 is rejected : False
... Vn Statistic : 22.83255917641962
... Critical Value : 23.229486935225513

Methods

PoissonKernelTest.stats()

Function to generate descriptive statistics.

PoissonKernelTest.summary([print_fmt])

Summary function generates a table for the poisson kernel test results and the summary statistics.

PoissonKernelTest.test(x)

Performs the Poisson kernel-based quadratic distance Goodness-of-fit tests for Uniformity for spherical data using the Poisson kernel with concentration parameter \(rho\)


PoissonKernelTest.stats()#

Function to generate descriptive statistics.

Returns#

summary_stats_dfpandas.DataFrame

Dataframe of descriptive statistics

PoissonKernelTest.summary(print_fmt='simple_grid')#

Summary function generates a table for the poisson kernel test results and the summary statistics.

Parameters#

print_fmtstr, optional.

Used for printing the output in the desired format. Supports all available options in tabulate, see here: https://pypi.org/project/tabulate/. Defaults to “simple_grid”.

Returns#

summarystr

A string formatted in the desired output format with the kernel test results and summary statistics.

PoissonKernelTest.test(x)#

Performs the Poisson kernel-based quadratic distance Goodness-of-fit tests for Uniformity for spherical data using the Poisson kernel with concentration parameter \(rho\)

Parameters#

xnumpy.ndarray, pandas.DataFrame

a numeric d-dim matrix of data points on the Sphere \(S^{(d-1)}\).

Returns#

selfobject

Fitted estimator