Description Usage Arguments Details Value Author(s) References See Also Examples
Often one wishes to know whether a time series is consistent with a white noise model. This function tests whether the underlying spectrum of the time series is flat, which is identical to saying that all the autocorrelations of the series are zero (apart from the lag zero autocorrelation which is always one). This test is exact for Gaussian data but will also work well with heavytailed distributions whose periodogram tends to the exponential distribution asymptotically (see accompanying paper for details).
1 2  hwwn.test(x, lowlev = 0, plot.it = FALSE, stopeveryscale = FALSE,
n.cdf.grid = 1000, mc.method = p.adjust.methods, mac.spread=10)

x 
The data set you wish to test. For now, the length of this series has to be a power of two. In theory, it could be any length. 
lowlev 
Specifies the coarsest resolution level of wavelet coefficients computed on the spectrum. Typically, this should be left at one, which is the coarsest that can be achieved an still approximate the CDF 
plot.it 
If 
stopeveryscale 
If 
n.cdf.grid 
The CDF of the Macdonald distribution is evaluated
numerically. This argument controls the resolution of that
grid: it controls the number of grid points there are between

mc.method 
The method of multiple hypothesis comparison.
See 
mac.spread 
The range (from 
The null hypothesis of the test contained in this function is H_0: series is white noise (or constant spectrum) versus H_A: it is not white noise. This test works by assessing whether the spectrum of the underlying series is constant or not. It does this by first computing the periodogram of the sample series. This is a wellstudied estimate of the spectrum. Then it evaluates the constancy of the spectrum by examining the Haar wavelet coefficients of the periodogram. Under normality much is known about the asymptotic distribution of the periodogram and this can be transferred, through some moderately complex distribution theory to the distribution of the Haar wavelet coefficients of the periodogram. Hence, in this situation, we have a good handle on whether a particular wavelet coefficients is too large or to small as we have near theoretical knowledge of their CDF. Since we are testing many wavelet coefficients simultaneously we have to use multiple hypothesis pvalue adjustment techniques, such as Bonferroni to obtain a final pvalue.
An object of class htest
containing the results of
the hypothesis test. Actually a list containing the following
components:
p.val.collector 
All the pvalues for all Haar wavelet coefficients of the periodogram. These are the values before pvalue adjustment for multiple tests. 
p.val.adjust 
The pvalues after adjustment for multiple tests via

p.value 
The pvalue of the test 
method 
Character string describing the test. 
Delyan Savchev and Guy Nason
Nason, G.P. and Savchev, D. (2014) White noise testing using wavelets. Stat, 3, 351362. http://dx.doi.org/10.1002/sta4.69
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39  #
# Invent test data set which IS white noise
#
x < rnorm(128)
#
# Do the test
#
x.wntest < hwwn.test(x)
#
# Print the results
#
#x.wntest
#
# Wavelet Test of White Noise
#
#data:
#pvalue = 0.9606
#
# So pvalue indicates that there is no evidence for rejection of
# H_0: white noise.
#
# Let's do an example using data that is not white noise. E.g. AR(1)
#
x.ar < arima.sim(n=128, model=list(ar=0.8))
#
# Do the test
#
x.ar.wntest < hwwn.test(x.ar)
#
# Print the results
#
print(x.ar.wntest)
#
# Wavelet Test of White Noise
#
#data:
#pvalue < 2.2e16
#
# pvalue is very small. Extremely strong evidence to reject H_0: white noise

Wavelet Test of White Noise
data:
pvalue = 1.061e07
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.