Title: Self-Similarity Test for Normality
Version: 1.0.1
Description: Implements the Self-Similarity Test for Normality (SSTN), a new statistical test designed to assess whether a given sample originates from a normal distribution. The method exploits the self-similarity property of the normal characteristic function by iteratively transforming and comparing standardized empirical characteristic functions. The null distribution of the test statistic is obtained via Monte Carlo simulation. Details of the methodology are described in Anarat and Schwender (2026), "A test for normality based on self-similarity", <doi:10.48550/arXiv.2604.03810>.
Imports: MASS
License: GPL-3
VignetteBuilder: knitr
Suggests: knitr, rmarkdown
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.3.3
Depends: R (≥ 3.5)
NeedsCompilation: no
Packaged: 2026-04-11 15:37:44 UTC; Akin
Author: Akin Anarat [aut, cre]
Maintainer: Akin Anarat <akin.anarat@hhu.de>
Repository: CRAN
Date/Publication: 2026-04-11 15:50:02 UTC

Internal calibration data for the SSTN test

Description

These internal data files contain precomputed calibration quantities for the Self-Similarity Test for Normality (SSTN). They include asymptotic calibration values (mu, sigma) and asymptotic null distributions (T), as well as sample size-specific null distributions for the finite-sample regime.

Details

The calibration files were generated by Monte Carlo simulation and are stored as internal package data. They are not intended to be regenerated during ordinary use of the package.

The asymptotic calibration values were obtained from 10,000 Monte Carlo simulations using the functions calibrate_mu_sigma() and simulate_T().

The finite-sample null distributions were obtained from 10,000 Monte Carlo simulations using the function compute_exact_T() for sample sizes n = 2, \dots, 99.

The precomputed calibrations correspond to the default configuration \beta = 2, M = 20, t_{\max} = 4, and H = 100.


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 = FALSE)

Arguments

x

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

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