sstn | R Documentation |
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 compares it to the characteristic function of the standard normal distribution. A Monte Carlo procedure is used to obtain the empirical distribution of the test statistic under the null hypothesis.
sstn(
x,
B = 500,
grid_length = 10,
t_max = 4,
M_max = 100,
beta = 0.5,
seed = NULL,
verbose = TRUE
)
x |
Numeric vector of observations |
B |
Integer. Number of Monte Carlo samples. Default is 500. |
grid_length |
Integer. Number of grid points |
t_max |
Positive numeric. Upper bound of the grid |
M_max |
Integer. Maximum number of iterations |
beta |
Positive numeric. Weighting parameter in the discrepancy measure.
Controls the decay rate of the exponential weight |
seed |
Optional integer. Random seed for reproducibility of Monte Carlo samples. Default is NULL (no fixed seed). |
verbose |
Logical. If TRUE (default), prints a summary of the test results
including the number of summands, test statistic, and |
An invisible list with the following components:
test_statistic |
Numeric. The observed value |
null_distribution |
Numeric vector of length |
number_summands |
Integer. The determined number of summands |
p_value |
Numeric. The |
Akin Anarat akin.anarat@hhu.de
Anarat A. and Schwender, H. (2025). A normality test based on self-similarity. Submitted.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.