sstn: Self-Similarity Test for Normality (SSTN)

View source: R/sstn.R

sstnR Documentation

Self-Similarity Test for Normality (SSTN)

Description

The SSTN is a statistical test for assessing whether a given sample originates from a normal distribution. It is based on the iterative application of the empirical characteristic function and comparing these estimated characteristic functions. A Monte Carlo procedure is used to obtain the empirical distribution of the test statistic under the null hypothesis.

Usage

sstn(x, verbose = TRUE)

Arguments

x

Numeric vector of observations (x_1, \dots, x_n) drawn from a distribution with finite variance. Must have length n \ge 3.

verbose

Logical. If TRUE (default), prints a summary of the test results including the number of summands, test statistic, and p-value.

Value

An invisible list with the following components:

test.statistic

Numeric. The observed value of the SSTN test statistic.

method

Character string indicating whether the asymptotic or the finite-sample null distribution was used.

p.value

Numeric. The p-value of the test.

Author(s)

Akin Anarat akin.anarat@hhu.de

References

Anarat, A. and Schwender, H. (2026). A test for normality based on self-similarity. arXiv preprint doi:10.48550/arXiv.2604.03810.

Examples

set.seed(123)
# Sample from standard normal (null hypothesis true)
x <- rnorm(100)
res <- sstn(x)
res$p.value

# Sample from Gamma distribution (null hypothesis false)
y <- rgamma(100, 1)
res2 <- sstn(y)
res2$p.value

sstn documentation built on Aug. 30, 2026, 1:07 a.m.