rp.sample {nortsTest}R Documentation

Generates a test statistics sample of random projections.

Description

Generates a 2k sample of test statistics projecting the stationary process using the random projections procedure.

Usage

rp.sample(y, k = 1, pars1 = c(100,1), pars2 = c(2,7), seed = NULL)

Arguments

y

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

k

an integer that determines the '2k' random projections are used for every type of test. The 'pars1' argument generates the first 'k' projections, and 'pars2' generates the later 'k' projections. By default, k = 1.

pars1

an optional real vector with the shape parameters of the beta distribution used for the first 'k' random projections By default, pars1 = c(100,1) where, shape1 = 100 and shape2 = 1.

pars2

an optional real vector with the shape parameters of the beta distribution used to compute the last 'k' random projections. By default, pars2 = c(2,7) where, shape1 = 2 and shape2 = 7.

seed

An optional seed to use.

Details

The rp.sample function generates '2k' tests statistics by projecting the time series using '2k' stick breaking processes. First, the function samples 'k' stick breaking processes using pars1 argument. Then, projects the time series using the sampled stick processes. Later, applies the Epps statistics to the odd projections and the Lobato and Velasco’s statistics to the even ones. Analogously, the function performs the three steps using also pars2 argument

The function uses beta distributions for generating the '2k' random projections. By default, uses a beta(shape1 = 100,shape = 1) distribution contained in pars1 argument to generate the first 'k' projections. For the later 'k' projections the functions uses a beta(shape1 = 2,shape = 7) distribution contained in pars2 argument.

The test was proposed by Nieto-Reyes, A.,Cuesta-Albertos, J. & Gamboa, F. (2014).

Value

A list with 2 real value vectors:

lobato:

A vector with the Lobato and Velasco's statistics sample.

epps:

A vector with the Epps statistics sample.

Author(s)

Alicia Nieto-Reyes and Asael Alonzo Matamoros

References

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.

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.

See Also

lobato.test, epps.test

Examples

# Generating an stationary ARMA process
y = arima.sim(100,model = list(ar = 0.3))
rp.sample(y)


[Package nortsTest version 1.1.2 Index]