Learn R Programming

locits (version 1.7.7)

EstBetaCov: Compute estimate of wavelet periodogram and the estimate's covariance matrix.

Description

An estimate of the wavelet periodogram at a location nz is generated. This is obtained by first computing the empirical raw wavelet periodogram by squaring the results of the nondecimated wavelet transform of the time series. Then a running mean smooth is applied.

Usage

EstBetaCov(x, nz, filter.number = 1, family = "DaubExPhase", smooth.dev = var,
    AutoReflect = TRUE, WPsmooth.type = "RM", binwidth = 0, mkcoefOBJ,
    ThePsiJ, Cverbose = 0, verbose = 0, OPLENGTH = 10^5, ABB.tol = 0.1,
    ABB.plot.it = FALSE, ABB.verbose = 0, ABB.maxits = 10, do.init = TRUE, 
    truedenom=FALSE, ...)

Value

A list with two components:

betahat

A vector of length \(J\) (the number of scales in the wavelet periodogram, which is \(\log_2\) of the number of observations \(T\)

Sigma

A matrix of dimensions \(J\times J\) which is the covariance of \(\hat{\beta}_j\) with \(\hat{\beta}_\ell\).

Arguments

x

The time series for which you wish to have the estimate for.

nz

The time point at which you want the estimate computed at. This is an integer ranging from one up to the length of the time series.

filter.number

The analysis wavelet (the wavelet periodogram is computed using this to form the nondecimated wavelet coefficients)

family

The family of the analysis wavelet.

smooth.dev

The deviance function used in smoothing via the internal call to the ewspec3 function.

AutoReflect

Whether better smoothing is to be obtained by AutoReflection to mitigate the effects of using periodic transforms on non-periodic data. See ewspec3

WPsmooth.type

The type of wavelet periodogram smoothing. For here leave the option at "RM" otherwise unpredictable results can occur

binwidth

The running mean length. If zero then a good bandwidth will be chosen using the AutoBestBW function.

mkcoefOBJ

If this argument is missing then it is computed internally using the mkcoef function which computes discrete wavelets. If this function is going to be repeatedly called then it is more efficient to supply this function with a precomputed version.

ThePsiJ

As for mkcoefOBJ argument but for the autocorrelation wavelet and the function PsiJ.

Cverbose

This function called the C routine CstarIcov if you set Cverbose to true then the routine instructs the C code to produce debugging messages.

verbose

If TRUE then debugging messages from the R code are produced.

OPLENGTH

Subsidiary parameters for potential call to PsiJ function

ABB.tol

Tolerance to be passed to AutoBestBW function.

ABB.plot.it

Argument to be passed to AutoBestBW plot.it argument.

ABB.verbose

Argument to be passed to AutoBestBW verbose argument.

ABB.maxits

Argument to be passed to AutoBestBW maxits argument.

do.init

Initialize stored statistics, for cache hit rate info.

truedenom

If TRUE use the actual number of terms in the sum as the denominator in the formula for the calculation of the covariance of the smoothed periodogram. If FALSE use the (2s+1)

...

Other arguments that are passed to the ewspec3 function.

Author

Guy Nason

Details

First optionally computes a good bandwidth using the AutoBestBW function. Then computes raw wavelet periodogram using ewspec3 using running mean smoothing with the binwidth bandwith (which might be automatically chosen). This computes the estimate of the wavelet periodogram at time nz. The covariance matrix of this estimate is then computed in C using the CstarIcov function and this is returned.

References

Nason, G.P. (2013) A test for second-order stationarity and approximate confidence intervals for localized autocovariances for locally stationary time series. J. R. Statist. Soc. B, 75, 879-904. tools:::Rd_expr_doi("10.1111/rssb.12015")

See Also

AutoBestBW, ewspec3

Examples

Run this code
#
# Small example, not too computationally demanding on white noise
#
myb <- EstBetaCov(rnorm(64), nz=32)
#
# Let's see the results (of my run)
#
if (FALSE) myb$betahat
#[1] 0.8323344 0.7926963 0.7272328 1.3459313 2.1873395 0.8364632
#
# For white noise, these values should be 1 (they're estimates)
if (FALSE) myb$Sigma
#            [,1]        [,2]        [,3]       [,4]        [,5]        [,6]
#[1,] 0.039355673 0.022886994 0.008980497 0.01146325 0.003211176 0.001064377
#[2,] 0.022886994 0.054363333 0.035228164 0.06519112 0.017146883 0.006079162
#[3,] 0.008980497 0.035228164 0.161340373 0.38326812 0.111068916 0.040068318
#[4,] 0.011463247 0.065191118 0.383268115 1.31229598 0.632725858 0.228574601
#[5,] 0.003211176 0.017146883 0.111068916 0.63272586 1.587765187 0.919247252
#[6,] 0.001064377 0.006079162 0.040068318 0.22857460 0.919247252 2.767615374
#
# Here's an example for T (length of series) bigger, T=1024
#
if (FALSE) myb <- EstBetaCov(rnorm(1024), nz=512)
#
# Let's look at results
#
if (FALSE) myb$betahat
# [1] 1.0276157 1.0626069 0.9138419 1.1275545 1.4161028 0.9147333 1.1935089
# [8] 0.6598547 1.1355896 2.3374615
#
# These values (especially for finer scales) are closer to 1
#

Run the code above in your browser using DataLab