Learn R Programming

locits (version 1.4)

varip2: Direct computation of estimate of variance of v_ip, the Haar wavelet coefficients of the periodogram.

Description

Performs a direct computation of an estimate of the variance of the Haar wavelet coefficients of the raw wavelet periodogram of a time series.

Usage

varip2(i, p, ll, S, P)

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,
P
Is an autocorrelation wavelet object, returned by the PsiJ function. The wavelet concerned is the analyzing one underlying the raw wavelet periodogram of the series.

Value

  • A list with the following components:
  • covAAA component of the variance
  • covABA component of the variance
  • covBBA component of the variance
  • ansThe actual variance

Details

Computes the variance of the Haar wavelet coefficients of the raw wavelet periodogram. Note, that this is merely an estimate of the variances.

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.

See Also

Cvarip2,hwtos2, covIwrap

Examples

Run this code
#
# Generate autocorrelation wavelets
#
P1 <- PsiJ(-5, filter.number=1, family="DaubExPhase")
#
#
# Now compute varip2: this is the variance of the Haar wavelet coefficient
# at the finest scale, location 10 and P1 autocorrelation wavelet.
# Note, I've used S to be the exact coefficients which would be for white noise.
# In practice, S would be an *estimate* calculated from the data.
#
varip2(i=1, p=10, ll=2, S=c(1/2, 1/4, 1/8, 1/16, 1/32), P=P1)
#
# Ans component is 1.865244

Run the code above in your browser using DataLab