Learn R Programming

WiSEBoot (version 1.4.0)

WiSEHypothesisTest: WiSE Wavelet Coefficients: Linear Hypothesis Test

Description

Calculate the p-value for a hypothesis test regarding a linear relationship between wavelet coefficients from two data series. See Details for a precise description.

Usage

WiSEHypothesisTest(X, Y, J0, R=100, popParam = c(0, 1), XParam = c(NA, NA), 
                   YParam = c(NA, NA), TauSq = "log", bootDistn = "normal", 
                   wavFam = "DaubLeAsymm", wavFil = 8, wavBC = "periodic", 
                   plot = TRUE, ...)

Arguments

X
vector of equally-spaced data. This must be of length $T=2^J$ where $J>2$ is an integer. It is required that length(X)=length(Y). The vector should contain only numeric values and be non-missing. See the Details section for a description
Y
vector of equally-spaced data. This must be of length $T=2^J$ where $J>2$ is an integer. It is required that length(X)=length(Y). The vector should contain only numeric values and be non-missing. See the Details section for a description
J0
wavelet coefficient threshold level. Allowed values are integers between 0 and $J-2$. Note, $J$ is related to the data series length: $T=2^J$.
R
number of WiSE bootstrap samples. Allowed value is a positive integer. Default is 100.
popParam
hypothesized parameter values. Allowed input is a vector of length 2 which is non-missing and contains numeric entries. The first entry of the vector is the hypothesized value of the population intercept. The second entry of the vector is the hypothesi
XParam
estimated linear parameter values (in time) from X. Allowed input is a vector of length 2 which is completely missing or contains numeric entries. The first entry of the vector is the intercept for X and the second entry is the
YParam
estimated linear parameter values (in time) from Y. Allowed input is a vector of length 2 which is completely missing or contains numeric entries. The first entry of the vector is the intercept for Y and the second entry is the
TauSq
scale parameter for the bootstrap. Allowed values are "log", "log10", "sqrt", "1", or "2/5". The scale parameter is related to the length of the data series. For example, "log" implies a value of the scale paramet
bootDistn
the distribution for the bootstrap. Allowed values are "normal", "uniform", "laplace", "lognormal", "gumbel", "exponential", "t5", "t8", and "t1
wavFam
wavelet family. Allowed values are "DaubLeAsymm" and "DaubExPhase" -- Daubechies Least Asymmetric and Daubechies Extremal Phase. This is the family used within the wavethresh package.
wavFil
wavelet filter number. Allowed values are integers between 4 and 10 when wavFam="DaubLeAsymm" or integers between 1 and 10 when wavFam="DaubExPhase". These correspond to the number of vanishing moments of the wavelet. This is
wavBC
wavelet boundary condition. Allowed values are "periodic" and "symmetric". This is the bc used within the wavethresh package.
plot
logical. If TRUE, a plot of the bootstrap sample of the linear parameters (generated under the null hypothesis) and the estimated parameters from the data is shown.
...
additional graphical arguments. See plot, plot.default.

Value

  • AsymptoticPValuethe asymptotic p-value based upon Hotelling's T^2.
  • BootstrapPValuethe bootstrap p-value.
  • dataSlopethe estimated slope of the wavelet coefficients from the data. In the notation from Details, $b$
  • dataInterceptthe estimated intercept of the wavelet coefficients from the data. In the notation from Details, $a$
  • bootSlopethe estimated slopes of the wavelet coefficients from the bootstrap samples. In the notation from Details, $b*$. This is a vector of length R.
  • bootInterceptthe estimated intercepts of the wavelet coefficients from the bootstrap samples. In the notation from Details, $a*$. This is a vector of length R.
  • YWaveletthe estimated wavelet coefficients from the Y data. In the notation from Details, $g_{yj}$. This is a vector of length $2^(J0 + 1) - 1$. The first entry is the level 0 coefficient, ..., final entries are the level $J0$ coefficients.
  • XWaveletthe estimated wavelet coefficients from the X data. In the notation from Details, $g_{xj}$. This is a vector of length $2^(J0 + 1) - 1$. The first entry is the level 0 coefficient, ..., final entries are the level $J0$ coefficients.
  • bootYWaveletthe estimated wavelet coefficients from the Y bootstrap sample. In the notation from Details, $g*_{yj}$. This is a matrix with R rows and $2^{J0 + 1} - 1$ columns which correspond to the wavelet coefficients. The first column is the level 0 filter coefficient, ..., final columns are the level $J0$ filter coefficients.
  • bootXWaveletthe estimated wavelet coefficients from the X bootstrap sample. In the notation from Details, $g*_{xj}$. This is a matrix with R rows and $2^{J0 + 1} - 1$ columns which correspond to the wavelet coefficients. The first column is the level 0 filter coefficient, ..., final columns are the level $J0$ filter coefficients.

Details

Given 2 vectors of equally-spaced data of length $T=2^J$ for a positive integer, $J$, we assume the following models: $$X = \gamma_{x0} 1 + \gamma_{x1} t + W\gamma_x + e_x$$ $$Y = \gamma_{y0} 1 + \gamma_{y1} t + W\gamma_y + e_y$$ where $Y$ and $X$ are the data vectors, linear parameters in time ($t$) are $\gamma_{x0}, \gamma_{x1}, \gamma_{y0}$ and $\gamma_{y1}$. The $\gamma_x$ and $\gamma_y$ are the wavelet coefficients (scaling and filter) and W is the DWT for a fixed wavelet basis. Note, in many cases of the DWT, the scaling coefficient is equivalent to $\gamma_{x0}, \gamma_{y0}$, and thus, estimated there. In this function, we consider a linear relationship between the wavelet coefficients. Specifically, we hypothesize a relationship $$\gamma_y = \alpha 1 + \beta \gamma_x$$ The null hypothesis is $$H_0: \alpha = m, \beta=n$$ for real numbers $m, n$. The user specifies popParam=c(m, n). The WiSE bootstrap sample is created under the null hypothesis for a set threshold, J0=j. The sampling scheme is described in detail in Braverman et al. The distributon of the bootstrap sample of the parameters allows for calculation of a p-value associated with the null hypothesis. Some notation to aid in understanding outputs: 1) $a, b$: estimates of $\alpha, \beta$ from the data wavelet coefficients 2) $a*, b*$: estimates of $\alpha, \beta$ from the bootstrap wavelet coefficients 3) $g_{xj}, g_{yj}$: estimates of $\gamma_x, \gamma_y$ from the data at the threshold J0=j 4) $g*_{xj}, g*_{yj}$: estimates of $\gamma_x, \gamma_y$ from the bootstrap sample at the threshold J0=j

References

The WiSE bootstrap hypothesis test is implemented as an analysis tool in Braverman, A. et al. "Probabilistic Climate Model Evaluation" (in progress).

See Also

padMatrix, padVector, wavethresh-package

Examples

Run this code
##Test whether \alpha=0 and \beta=1 for AIRS and IPSL Run 1 at 60E
## R=10 bootstrap samples is not recommended.  For demonstration only.
data(CM20N20S60E)
padData <- padMatrix(CM20N20S60E)
hypTest <- WiSEHypothesisTest(padData$xPad[,1], padData$xPad[,2], J0=5, R=10, 
                              XParam=padData$linearParam[,1], YParam=padData$linearParam[,2], 
                              plot=TRUE)

Run the code above in your browser using DataLab