Cvarip2: Computes variance of Haar wavelet coefficients of wavelet...

Cvarip2R Documentation

Computes variance of Haar wavelet coefficients of wavelet periodogram using C code.

Description

Performs precisely the same role as varip2 except it is implemented internally using C code and hence is much faster.

Usage

Cvarip2(i, p, ll, S, Pmat, PsiJL)

Arguments

i

Scale parameter of Haar wavelet analyzing periodogram. Scale 1 is the finest scale.

p

Location parameter of Haar wavelet analyzing periodogram

ll

Scale of the raw wavelet periodogram being analyzed.

S

Estimate of the spectrum, under the assumption of stationarity. So, this is just a vector of (possibly) J scales (which is often the usual spectral estimate averaged over time). Note: that the main calling function, hwtos2, actually passes maxD levels.

Pmat

Matrix version of autocorrelation wavelet computed using the PsiJmat function in wavethresh

PsiJL

True length of the autocorrelation wavelets in the Pmat matrix. This can be obtained simply by using the list version of the ac wavelet (computed by PsiJ) and applying sapply.

Value

The list returned from the .C calling function. The only object of real interest is the ans component which contains the variance.

Author(s)

Guy Nason.

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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/rssb.12015")}

See Also

hwtos2, varip2

Examples

#
# See example from varip2
#
#
my.Pmat <- PsiJmat(-5, filter.number=1, family="DaubExPhase")
my.PsiJ <- PsiJ(-5, filter.number=1, family="DaubExPhase")
my.PsiJL <- sapply(my.PsiJ, "length")
Cvarip2(i=1, p=10, ll=2, S=c(1/2,1/4,1/8,1/16,1/32),
    Pmat=my.Pmat, PsiJL=my.PsiJL)
#
# Gives answer 1.865244, which is the same as given in the example for varip2

locits documentation built on Sept. 8, 2023, 5:07 p.m.