WiSEBoot(X, R=100, XParam = NA, TauSq = "log", bootDistn = "normal", by.row = FALSE,
J0 = NA, wavFam = "DaubLeAsymm", wavFil = 8, wavBC = "periodic")
X
, this should be a vector of length 2. If a matrix is supplied in X
, this should be a matrix with 2 rows and an equal of columns ("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"normal"
, "uniform"
, "laplace"
, "lognormal"
, "gumbel"
, "exponential"
, "t5"
, "t8"
, and "t1
TRUE
, the observations are by row and the columns contain different data series. If FALSE
, the rows contain different data series and the observations are by column.NA
and any integer between 0 and $J-2$ (when the data series is of length $T=2^J$). If a specific integer is given, all wavelet coefficients at levels finer than J0
are s"DaubLeAsymm"
and "DaubExPhase"
-- Daubechies Least Asymmetric and Daubechies Extremal Phase. This is the family
used within the wavethresh
package.wavFam="DaubLeAsymm"
or integers between 1 and 10 when wavFam="DaubExPhase"
. These correspond to the number of vanishing moments of the wavelet. This is "periodic"
and "symmetric"
. This is the bc
used within the wavethresh
package.R
rows. Each row corresponds to a single bootstrap sample estimate of $\gamma_0$. The number of columns in the matrix corresponds to the number of data series supplied to the function (in X
). The order of the data series supplied matches to the order of the columns of BootIntercept
.R
rows. Each row corresponds to a single bootstrap sample estimate of $\gamma_1$. The number of columns in the matrix corresponds to the number of data series supplied to the function (in X
). The order of the data series supplied matches to the order of the columns of BootSlope
.R
(bootstrap sample). The second dimension is the $T=2^J$ (data series length). The order of wavelet coefficients in the second dimension is: scaling level 0, filter level 0 (coarsest), filter level 1, ..., filter level $J-1$ (finest). The third dimension is the number of data series supplied. This array does not contain any boundary coefficients generated using the wavBC="symmetric"
option.BootWavelet
. Thus, the first row contains the scaling coefficient, the second row contains the filter level 0 coefficient, etc. The number of columns matches the number of data series supplied, and are ordered as in X
.padVector
or padMatrix
, to supply the linearParam
estimates and call replaceLinearTrend=FALSE
. If XParam
is NA
, the WiSEBoot
function will estimate $\gamma_0$ and $\gamma_1$ from the supplied data using least squares.
J0
sets the threshold within the wavelet coefficients. Our threshold is defined as the level above which all fine wavelet coefficients are set to 0.
For a single data series, $Y$, the WiSE bootstrap sample is obtained by
1. Find estimates of $\gamma_0$ and $\gamma_1$: $g0$ and $g1$. If supplied, this is linearParam
.
2. Estimate all levels of wavelet coefficients, $\gamma$, using the residuals $r = Y - g0 1 - g1 t$. Call these estimated coefficients $g$.
3. For a set threshold, $J0=j$, set all coefficients in $g$ finer than $j$ to 0. Call this thresholded set of coefficients $g_j$ Perform the inverse wavelet transform with $g_j$. This smooth series may be called $rSmooth$.
4. Calculate the wavelet residuals using $rWave = r - rSmooth$.
5. A single bootstrap sample is defined as $Y^* = g0 1 + g1 t + W g_j + \tau N(0,1) rWave$. $Y^*$ is used to obtain estimates for the un-thresholded wavelet coefficients and linear parameters.padVector
, padMatrix
, wavethresh-package
##R=10 bootstrap samples is not recommended. For demonstration only.
##bootstrap one of the simulated series, threshold level 4 (not the truth)
data(SimulatedSNR15Series)
bootObj <- WiSEBoot(SimulatedSNR15Series[, 3], R=10, J0=4)
#boxplot of the bootstrap intercept and slope estimates (both 0 in truth)
par(mfrow=c(1,2))
boxplot(bootObj$BootIntercept); boxplot(bootObj$BootSlope)
#boxplot of the bootstrap wavelet coefficient estimates, level 1
par(mfrow=c(1,2))
boxplot(bootObj$BootWavelet[ , 3, 1]); boxplot(bootObj$BootWavelet[ , 4, 1])
##See what smooth level the bootstrap chooses (truth is J0=2)
bootObj2 <- WiSEBoot(SimulatedSNR15Series[ ,3], R=10)
bootObj2$MSECriteria
Run the code above in your browser using DataLab