Description Usage Arguments Value References See Also Examples
Let X be a collection of M uncorrelated zero mean Gaussian random variables (RVs). The sum of the squares of the RVs in X will obey a scaled chi-square distribution with M degrees of freedom (DOF). If, however, the original Gaussian RVs are (partially) correlated, we can approximate the distribution of the sum of the squares of (correlated Gaussian) RVs using a scaled chi-square distribution with the DOF adjusted for the correlation in the RVs. These adjusted DOF estimates are known as the equivalent degrees of freedom (EDOF). In the context of unbiased wavelet variance analysis, the EDOF can be used to estimate confidence intervals that are guaranteed to have non-negative bounds.
This program calculates three estimates of the EDOF for each level of a discrete wavelet transform. The three modes are described as follows for the MODWT of an an input sequence X(t):
Large sample approximation that requires an SDF estimation via wavelet coefficients.
n1 = s(j,0)^2 / Aj,
where s(j,tau) is the autocovariance sequence defined by
s(j,tau) = (1 / Mj) * sum[t=0,..., Mj - 1]{d(j,t)}
and d(j,t) are the Mj jth level interior MODWT wavelet coefficients and Aj is defined as
Aj = s(j,0)/2 + sum[tau=1,...,Mj-1]s(j,tau)^2.
Large sample approximation where the SDF is known a priori.
n2 = 2 * (sum[k=1,...,floor((Mj-1)/2)] Cj(f(k)))^2 / sum[k=1,...,floor((Mj-1)/2)] (Cj(f(k)))^2,
where f(k)=k/Mj and Cj = Hj(f) Sx(f) is the product of Daubechies wavelet filter squared gain function and the spectral density function of X(t).
Large sample approximation using a band-pass approximation for the SDF.
n3 = max(Mj/2, 1)
.
See references for more details.
1 2 |
x |
an object of class |
levels |
a vector containing the decomposition levels. Default: when
|
n.fft |
a positive integer (greater than one) defining the number of frequencies to use in evaluating the SDF for
EDOF 2 calculations. The
frequencies are uniformly distributed over the interval [0, Nyquist] ala f=[0, 1/P , 2/P, 3/P, ..., (n.freq-1)/P]
where P=2*(n.freq-1)/sampling.interval. Only used when the input SDF is not |
sampling.interval |
sampling interval of the time series. Default: |
sdf |
a spectral density function of the process corresponding to the input time series.
This input must be a function whose first argument is |
sdfargs |
a list of arguments passed directly to the SDF function ala
|
wavelet |
a character string denoting the filter type.
See |
a list containing the EDOF estimates for modes 1, 2 and 3 as well as the block-dependent unbiased wavelet variance estimates.
D. B. Percival and A. T. Walden, Wavelet Methods for Time Series Analysis, Cambridge University Press, 2000.
wavVar
, wavVarConfidence
, mutilsSDF
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## initialize variables
n.level <- 9
wavelet <- "d6"
N <- 4096
phi <- 0.9
## define input SDF
S <- function(f, phi) 1/(1 + phi^2 - 2*phi*cos(2*pi*f))
sdfarg <- list(phi=phi)
## create series and MODWT
set.seed(100)
x <- rnorm(N)
W <- wavMODWT(x, wavelet=wavelet, n.level=n.level)
## calculate EDOF using the wavTransform object
z1 <- wavEDOF(W, sdf=S, sdfarg=sdfarg)
print(z1)
## calculate EDOF using original time series
z2 <- wavEDOF(x, wavelet=wavelet, levels=seq(n.level), sdf=S, sdfarg=sdfarg)
print(z2)
## compare the two approaches
print(all.equal(z1,z2))
|
$EDOF1
d1 d2 d3 d4 d5 d6 d7
2531.10774 1809.04819 913.66096 429.21140 230.32673 110.38035 33.53655
d8 d9
25.87522 11.39955
$EDOF2
d1 d2 d3 d4 d5 d6
2854.722849 1627.268382 781.241375 381.451301 188.807683 94.354081
d7 d8 d9
45.134301 18.974047 5.219906
$EDOF3
d1 d2 d3 d4 d5 d6
2045.500000 1020.250000 507.625000 251.312500 123.156250 59.078125
d7 d8 d9
27.039062 11.019531 3.009766
$variance.unbiased
d1 d2 d3 d4 d5 d6
0.504909819 0.263174237 0.121538461 0.062628195 0.026776715 0.014814154
d7 d8 d9
0.009611466 0.004053923 0.000457349
$n.coeff
d1 d2 d3 d4 d5 d6 d7 d8 d9
4091 4081 4061 4021 3941 3781 3461 2821 1541
$EDOF1
d1 d2 d3 d4 d5 d6 d7
2531.10774 1809.04819 913.66096 429.21140 230.32673 110.38035 33.53655
d8 d9
25.87522 11.39955
$EDOF2
d1 d2 d3 d4 d5 d6
2854.722849 1627.268382 781.241375 381.451301 188.807683 94.354081
d7 d8 d9
45.134301 18.974047 5.219906
$EDOF3
d1 d2 d3 d4 d5 d6
2045.500000 1020.250000 507.625000 251.312500 123.156250 59.078125
d7 d8 d9
27.039062 11.019531 3.009766
$variance.unbiased
d1 d2 d3 d4 d5 d6
0.504909819 0.263174237 0.121538461 0.062628195 0.026776715 0.014814154
d7 d8 d9
0.009611466 0.004053923 0.000457349
$n.coeff
d1 d2 d3 d4 d5 d6 d7 d8 d9
4091 4081 4061 4021 3941 3781 3461 2821 1541
[1] TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.