bartlettB.test: Bartlett's B test for white noise

bartlettB.testR Documentation

Bartlett's B test for white noise

Description

Bartlett's test uses the Kolmogorov-Smirnov test applied to the cumulative normalized periodogram.

Usage

bartlettB.test(x, plot.it = FALSE)

Arguments

x

The time series you wish to test, of any length.

plot.it

If TRUE then the normalized cumulative periodogram is plotted along with a straight line that indicates the theoretical line of this object under the null hypothesis. A further plot of the density of the true statistic under the null hypothesis is produced.

Details

This test: (i) computes the periodogram, (ii) derives the normalized cumulative periodogram using the cumperiod function. Under the null hypothesis of white noise the periodogram is a set of iid exponential random variables, asymptotically. So, the cumulative periodogram should look like a straight line at a 45 degree angle. The test statistic is the maximum deviation of the normalized cumulative periodogram and this straight line. The p-value of the test is computed within the function by the b.power function. This is an example of a Kolmogorov-Smirnov statistical test.

Value

An object of class htest. A list containing the following components:

statistic

The value of the Bartlett test statistic.

p.value

The p-value of the test

method

A text string saying what the method was

Note

Code was based on Professor Newton's explanation

Author(s)

G. P. Nason

References

Bartlett, M.S. (1967) Some Remarks on the Analysis of Time-Series. J. R. Statist. Soc. B, 54, 25-38.

https://web.stat.tamu.edu/~jnewton/stat626/topics/topics/topic13.pdf Link to Professor H. Joseph Newton's web page on Bartlett's test

Nason, G.P. and Savchev, D. (2014) White noise testing using wavelets. Stat, 3, 351-362. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/sta4.69")}

See Also

compute.rejection, cumperiod

Examples

#
# Do white noise test on smallish data set
#
x <- rnorm(30)
bartlettB.test(x)
#
# For my realization the answer was:
#
#
#	Bartlett B Test for white noise
#
#data:  
#= 0.3747, p-value = 0.999
#
# So, we accept H_0

hwwntest documentation built on Sept. 13, 2023, 9:06 a.m.