Type: | Package |
Title: | Kernel-Embedding-of-Probability Test for Elliptical Distribution |
URL: | https://github.com/tyy20/KEPTED |
BugReports: | https://github.com/tyy20/KEPTED/issues |
Version: | 0.2.0 |
Maintainer: | Yin Tang <yqt5219@psu.edu> |
Description: | Provides an implementation of a kernel-embedding of probability test for elliptical distribution. This is an asymptotic test for elliptical distribution under general alternatives, and the location and shape parameters are assumed to be unknown. Some side-products are posted, including the transformation between rectangular and polar coordinates and two product-type kernel functions. See Tang and Li (2024) <doi:10.48550/arXiv.2306.10594> for details. |
Encoding: | UTF-8 |
License: | BSD_3_clause + file LICENSE |
Imports: | expm, CompQuadForm, cubature, stats |
RoxygenNote: | 7.3.1 |
Suggests: | knitr, rmarkdown, testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2024-04-12 02:10:39 UTC; yintang |
Author: | Yin Tang [aut, cre], Bing Li [cph, aut] |
Repository: | CRAN |
Date/Publication: | 2024-04-13 05:50:07 UTC |
KEPTED: Kernel-Embedding-of-Probability Test for Elliptical Distribution
Description
Provides an implementation of a kernel-embedding of probability test for elliptical distribution. This is an asymptotic test for elliptical distribution under general alternatives, and the location and shape parameters are assumed to be unknown. Some side-products are posted, including the transformation between rectangular and polar coordinates and two product-type kernel functions. See Tang and Li (2024) doi:10.48550/arXiv.2306.10594 for details.
Author(s)
Maintainer: Yin Tang yqt5219@psu.edu
Authors:
Bing Li bxl9@psu.edu [copyright holder]
See Also
Useful links:
Kernel embedding of probability test for elliptical distribution
Description
This function gives a test on whether the data is elliptically distributed based on kernel embedding of probability. See Tang and Li (2024) for details. Gaussian kernels and product-type inverse quadratic kernels are considered.
Usage
EllKEPT(
X,
eps = 1e-06,
kerU = "Gaussian",
kerTheta = "Gaussian",
gamma.U = 0,
gamma.Theta = 0
)
Arguments
X |
A matrix with n rows and d columns. |
eps |
The regularization constant added to the diagonal to avoid
singularity. Default value is |
kerU |
The type of kernel function on |
kerTheta |
The type of kernel function on |
gamma.U |
The tuning parameter |
gamma.Theta |
The tuning parameter |
Details
The Gaussian kernel is defined as k(z1,z2)=exp(-gamma*||z1-z2||^2), and the
Product-type Inverse-Quadratic (PIQ
) kernel is defines as
k(z1,z2)=Prod_j(1/(1+gamma*(z1_j-z2_j)^2)). The recommended procedure of
selecting tuning parameter is given as in the simulation section of Tang and
Li (2023+), where we set
1/sqrt(gamma)=(n(n-1)/2)^(-1)*sum_{1<=i<j<=n}||Z_i-Z_j||.
Value
A list of the following:
stat |
The value of the test statistic. |
pval |
The p-value of the test. |
lambda |
The |
gamma.U |
The tuning parameter |
gamma.Theta |
The tuning parameter |
Note
In the arguments, eps
refers to a regularization constant added to
the diagonal. When the dimension is high, we recommend increasing eps
to avoid singularity.
References
Tang, Y. and Li, B. (2024), “A nonparametric test for elliptical distribution based on kernel embedding of probabilities,” https://arxiv.org/abs/2306.10594
Examples
set.seed(313)
n=50
d=3
## Null Hypothesis
X=matrix(rnorm(n*d),nrow=n,ncol=d)
EllKEPT(X)
## Alternative Hypothesis
X=matrix(rchisq(n*d,2)-2,nrow=n,ncol=d)
EllKEPT(X)
Provides an implementation of a kernel-embedding of probability test for elliptical distribution. This is an asymptotic test for elliptical distribution under general alternatives, and the location and shape parameters are assumed to be unknown. Some side-products are posted, including the transformation between rectangular and polar coordinates and two product-type kernel functions.
Description
Provides an implementation of a kernel-embedding of probability test for elliptical distribution. This is an asymptotic test for elliptical distribution under general alternatives, and the location and shape parameters are assumed to be unknown. Some side-products are posted, including the transformation between rectangular and polar coordinates and two product-type kernel functions.
Author(s)
Yin Tang yqt5219@psu.edu Bing Li bxl9@psu.edu
References
Tang, Y. and Li, B. (2024), “A nonparametric test for elliptical distribution based on kernel embedding of probabilities,” https://arxiv.org/abs/2306.10594
Polar to rectangular coordinates
Description
Given a polar coordinate representation (R,Theta)
of a
d
-dimensional vector X
, where R
is the length of
X
and the (d-1)
-dimensional vector Theta
contains the
d-1
angles of X
, this function compute X
in its
rectangular coordinate representation.
Usage
Polar2Rec(R, Theta)
Arguments
R |
The length of |
Theta |
A vector of length |
Details
The formula corresponds to v=rho(theta) as in Lemma 1 of Tang and Li (2024).
See also Anderson (2003).
Note that when d=2
, V
will be (sin(Theta),cos(Theta))
.
Value
A list of the following:
X |
A vector in rectangular coordinate. |
V |
The directional vector of |
References
Tang, Y. and Li, B. (2024), “A nonparametric test for elliptical distribution based on kernel embedding of probabilities,” https://arxiv.org/abs/2306.10594 Anderson, T. W. (2003). An Introduction to Multivariate Statistical Analysis. John Wiley & Suns, Inc. Huboken, New Jersey.
Examples
R=2
Theta=c(pi/6,pi/3)
Polar2Rec(R,Theta)
Derivative of the polar coordinate transformation
Description
This function compute the Jacobian matrix of the polar transformation theta=g(v), i.e., the transformation from the the rectangular coordinate representation of the directional vector to its angular representation.
Usage
PolarDerivative(v)
Arguments
v |
A |
Details
See Lemma 3 of Tang and Li (2024).
Value
The Jacobian matrix of the polar transformation theta=g(v), with
d-1
rows and d
columns.
References
Tang, Y. and Li, B. (2024), “A nonparametric test for elliptical distribution based on kernel embedding of probabilities,” https://arxiv.org/abs/2306.10594
Examples
X=c(3,1,3)
V=X/sqrt(sum(X^2))
PolarDerivative(V)
Rectangular to polar coordinates
Description
Given a d
-dimensional vector X
in rectangular coordinate, this
function compute its polar coordinate (R,Theta)
, where R
is the
length of X
and the (d-1)
-dimensional vector Theta
contains the d-1
angles of X
.
Usage
Rec2Polar(X)
Arguments
X |
A vector in rectangular coordinate. Suppose the dimension of
|
Details
The formula corresponds to theta=g(v) as in Lemma 1 of Tang and Li (2024).
See also Anderson (2003).
Note that when d=2
, V
will be (sin(Theta),cos(Theta))
.
Value
A list of the following:
R |
The length of |
Theta |
A vector of length |
References
Tang, Y. and Li, B. (2024), “A nonparametric test for elliptical distribution based on kernel embedding of probabilities,” https://arxiv.org/abs/2306.10594 Anderson, T. W. (2003). An Introduction to Multivariate Statistical Analysis. John Wiley & Suns, Inc. Huboken, New Jersey.
Examples
X=c(3,1,3)
Rec2Polar(X)
Gaussian kernel computation
Description
Computing the values of Gaussian kernel functions.
Usage
kerGauss(gamma, z1, z2)
Arguments
gamma |
A number, the bandwidth parameter in the Gaussian kernel. |
z1 |
A vector, the first input of the Gaussian kernel. |
z2 |
A vector, the second input of the Gaussian kernel. |
Details
The Gaussian kernel is defined as k(z1,z2)=exp(-gamma*||z1-z2||^2).
Value
A number, the value of the Gaussian kernel function.
Examples
gamma=0.02
z1=c(3,1,3)
z2=c(8,1,9)
kerGauss(gamma,z1,z2)
Product-type Inverse-Quadratic (PIQ) kernel computation
Description
Computing the values of Product-type Inverse-Quadratic (PIQ) kernel functions.
Usage
kerPIQ(gamma, z1, z2)
Arguments
gamma |
A number, the bandwidth parameter in the PIQ kernel. |
z1 |
A vector, the first input of the PIQ kernel. |
z2 |
A vector, the second input of the PIQ kernel. |
Details
The Product-type Inverse-Quadratic (PIQ) kernel is defined as k(z1,z2)=Prod_j(1/(1+gamma*(z1_j-z2_j)^2)).
Value
A number, the value of the PIQ kernel function.
Examples
gamma=0.02
z1=c(3,1,3)
z2=c(8,1,9)
kerPIQ(gamma,z1,z2)