normal.test: The normality test for stationary process

View source: R/test.R

normal.testR Documentation

The normality test for stationary process

Description

Perform a normality test. The null hypothesis (H0) is that the given data follows a stationary Gaussian process.

Usage

normal.test(y, normality = c("epps","lobato","vavra","rp","jb","ad","shapiro"),
                    alpha = 0.05)

Arguments

y

a numeric vector or an object of the ts class containing a stationary time series.

normality

A character string naming the desired test for checking normality. Valid values are "epps" for the Epps, "lobato" for Lobato and Velasco's,"vavra" for the Psaradakis and Vávra, "rp" for the random projections, "jb" for the Jarque and Bera, "ad" for Anderson Darling test, and "shapiro" for the Shapiro-Wilk's test. The default value is "epps" test.

alpha

Level of the test, possible values range from 0.01 to 0.1. By default alpha = 0.05

Details

"lobato", "epps", "vavras" and "rp" test are for testing normality in stationary process. "jb", "ad", and "shapiro" tests are for numeric data. In all cases, the alternative hypothesis is that y follows a Gaussian process. By default, alpha = 0.05 is used to select the more likely hypothesis.

Value

A list with class "h.test" containing the following components:

statistic:

the test statistic.

parameter:

the test degrees freedoms.

p.value:

the p-value for the test.

alternative:

a character string describing the alternative hypothesis.

method:

a character string with the test name.

data.name:

a character string giving the name of the data.

Author(s)

Asael Alonzo Matamoros

References

Epps, T.W. (1987). Testing that a stationary time series is Gaussian. The Annals of Statistic. 15(4), 1683-1698.

Lobato, I., & Velasco, C. (2004). A simple test of normality in time series. Journal of econometric theory. 20(4), 671-689.

Psaradakis, Z. & Vávra, M. (2017). A distance test of normality for a wide class of stationary process. Journal of Econometrics and Statistics. 2, 50-60.

Nieto-Reyes, A., Cuesta-Albertos, J. & Gamboa, F. (2014). A random-projection based test of Gaussianity for stationary processes. Computational Statistics & Data Analysis, Elsevier, vol. 75(C), pages 124-141.

Patrick, R. (1982). An extension of Shapiro and Wilk's W test for normality to large samples. Journal of Applied Statistics. 31, 115-124.

Cromwell, J. B., Labys, W. C. & Terraza, M. (1994). Univariate Tests for Time Series Models. Sage, Thousand Oaks, CA. 20-22.

See Also

uroot.test, seasonal.test

Examples

#  stationary  ar process
y = arima.sim(100, model = list(ar = 0.3))
normal.test(y) # epps test

# normal random sample
y = rnorm(100)
normal.test(y, normality = "shapiro")

# exponential random sample
y = rexp(100)
normal.test(y, normality = "ad")


nortsTest documentation built on May 29, 2024, 10:05 a.m.