Learn R Programming

hwwntest (version 1.3.2)

hwwntest-package: tools:::Rd_package_title("hwwntest")

Description

tools:::Rd_package_description("hwwntest")

Arguments

Author

tools:::Rd_package_author("hwwntest")

Maintainer: tools:::Rd_package_maintainer("hwwntest")

Details

The DESCRIPTION file: tools:::Rd_package_DESCRIPTION("hwwntest") tools:::Rd_package_indices("hwwntest")

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.

References

Nason, G.P. and Savchev, D. (2014) White noise testing using wavelets. Stat, 3, 351-362. tools:::Rd_expr_doi("10.1002/sta4.69")

See Also

hwwn.test

Examples

Run this code
 # 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

Run the code above in your browser using DataLab