| hwwntest-package {hwwntest} | R Documentation |
Tests of White Noise using Wavelets
Description
Provides methods to test whether time series is consistent with white noise. Two new tests based on Haar wavelets and general wavelets described by Nason and Savchev (2014) <doi:10.1002/sta4.69> are provided and, for comparison purposes this package also implements the B test of Bartlett (1967) <doi:10.2307/2333850>. Functionality is provided to compute an approximation to the theoretical power of the general wavelet test in the case of general ARMA alternatives.
Details
The DESCRIPTION file:
| Package: | hwwntest |
| Type: | Package |
| Title: | Tests of White Noise using Wavelets |
| Version: | 1.3.2 |
| Date: | 2023-09-06 |
| Authors@R: | c(person("Delyan", "Savchev", role=c("aut"),email="madbss@bristol.ac.uk"), person("Guy", "Nason", role=c("aut","cre"), email="g.nason@imperial.ac.uk")) |
| Description: | Provides methods to test whether time series is consistent with white noise. Two new tests based on Haar wavelets and general wavelets described by Nason and Savchev (2014) <doi:10.1002/sta4.69> are provided and, for comparison purposes this package also implements the B test of Bartlett (1967) <doi:10.2307/2333850>. Functionality is provided to compute an approximation to the theoretical power of the general wavelet test in the case of general ARMA alternatives. |
| Depends: | R(>= 3.3) |
| Imports: | parallel, polynom, wavethresh |
| License: | GPL-2 |
| Author: | Delyan Savchev [aut], Guy Nason [aut, cre] |
| Maintainer: | Guy Nason <g.nason@imperial.ac.uk> |
Index of help topics:
Macdonald Compute the Macdonald density function for a
specified parameter value 'm' at a vector of
'x' values.
bartlettB.test Bartlett's B test for white noise
compute.rejection Function to compute empirical size or power for
various tests of white noise.
cumperiod Compute cumulative normalized periodogram.
d00.test Test for white noise based on the coarsest
scale Haar wavelet coefficient of the spectrum.
genwwn.powerplot Plot (approximation) to the theoretical power
of the 'genwwn.test' test for ARMA processes
(including, of course, white noise itself) for
a range of sample sizes.
genwwn.test White noise test using general wavelets.
genwwn.thpower Compute (approximation) to the theoretical
power of the 'genwwn.test' test for ARMA
processes (including, of course, white noise
itself).
hwwn.dw Compute discrete wavelets
hwwn.test Perform a test for white noise on a time
series.
hwwntest-package Tests of White Noise using Wavelets
hywavwn.test Hybrid wavelet test of white noise.
hywn.test Hybrid of Box-Ljung test, Bartlett B test, Haar
wavelet and General wavelet tests.
sqcoefvec Compute coefficients required for approximaing
the wavelet transform using the square of
wavelets.
sqndwd Compute the non-decimated squared wavelet
transform.
sqndwdecomp Brute-force calculation of the non-decimated
squared wavelet transform.
sqwd Compute expansion with respect to squared
wavelets.
Contains a variety of hypothesis tests for white noise data.
The package contains an implementation of Bartlett's B test,
bartlettB.test,
(Kolmogorov-Smirnov test on the cumulative periodogram),
a selection of wavelet-based tests
hwwn.test a test using Haar wavelets,
d00.test a single Haar wavelet coefficient test,
genwwn.test a test using smoother Daubechies
wavelets, a hybrid test hywavwn.test
that uses Haar wavelets at fine scales and general wavelets
at coarse scales and a omnibus test
hywn.test that combines the results of four tests
(hwwn.test, genwwn.test, bartlettB.test
and the Box.test)
The wavelet tests work by examining
the wavelet transform of the regular periodogram
and assess whether it has non-zero coefficients.
If series is H_0: white noise,
then the underlying spectrum is constant (flat) and all true wavelet
coefficients will be zero. Then all periodogram wavelet coefficients
will have true zero mean which can be tested using knowledge of,
or approximation to, the
coefficient distribution.
Author(s)
NA
Maintainer: NA
References
Nason, G.P. and Savchev, D. (2014) White noise testing using wavelets. Stat, 3, 351-362. doi:10.1002/sta4.69
See Also
Examples
# 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:
#p-value = 0.9606
#
# So p-value 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:
#p-value < 2.2e-16
#
# p-value is very small. Extremely strong evidence
# to reject H_0: white noise
#
#
# Let's use one of the other tests: e.g. the general wavelet one
#
x.ar.genwwntest <- genwwn.test(x.ar)
#
# Print the results
#
print(x.ar.genwwntest)
#
#
# Wavelet Test of White Noise
#
# data:
# p-value = 1.181e-10
#
# Again, p-value is very small