The function uses AMUSE (Algorithm for Multiple Unknown Signals Extraction) to test whether the last p-k
latent series are pure white noise, assuming a p-variate second-order stationary blind source separation (BSS) model.
Four different bootstrapping strategies are available and the function can be run in parallel.
AMUSEboot(X, …)# S3 method for default
AMUSEboot(X, k, tau = 1, n.boot = 200, s.boot = c("p", "np1", "np2", "np3"),
ncores = NULL, iseed = NULL, …)
# S3 method for ts
AMUSEboot(X, …)
# S3 method for xts
AMUSEboot(X, …)
# S3 method for zoo
AMUSEboot(X, …)
The number of latent series that are not white noise. Can be between \(0\) and \(p-1\).
The lag for the AMUSE autocovariance matrix.
The number of bootstrapping samples.
Bootstrapping strategy to be used. Possible values are "p"
(default), "np1"
, "np2"
, "np3"
. See details for further information.
The number of cores to be used. If NULL
or 1, no parallel computing is used. Otherwise makeCluster
with type = "PSOCK"
is used. It is the users repsonsibilty to choose a reasonable value for ncores
. The function detectCores
might be useful in this context.
If parallel computation is used, the seed passed on to clusterSetRNGStream
. Default is NULL
which means no fixed seed is used.
Further arguments to be passed to or from methods.
A list of class ictest, inheriting from class htest, containing:
The value of the test statistic.
The p-value of the test.
The number of bootstrap samples.
Character string specifying the alternative hypothesis.
The number of latent series that are not white noise used in the testing problem.
The transformation matrix to the latent series.
Multivariate time series with the centered source components.
The underlying eigenvalues of the autocovariance matrix.
The location of the data which was subtracted before calculating AMUSE.
The used lag.
Character string indicating which test was performed.
Character string giving the name of the data.
Character string denoting which bootstrapping test version was used.
AMUSE standardizes X
with \(n\) samples and computes the eigendecomposition of the autocovariance matrix of the standardized data for a chosen lag tau
, yielding a transformation \(\bf W\) giving the latent variables as \({\bf S} = {\bf X} {\bf W}\). Assume, without loss of generality, that the latent components are ordered in decreasing order with respect to the squares of the corresponding eigenvalues of the autocovariance matrix. Under the null hypothesis the final \(p - k\) eigenvalues equal zero, \(\lambda_{p-k} = \cdots = \lambda_{p} = 0\), and their mean square \(m\) can be used as a test statistic in bootstrap-based inference on the true number of latent white noise series.
The function offers four different bootstrapping strategies for generating samples for which the null hypothesis approximately holds, and they are all based on the following general formula:
Decompose the AMUSE-estimated latent series \(\bf S\) into the postulated signal \({\bf S}_1\) and white noise \({\bf S}_2\).
Take \(n\) bootstrap samples \({\bf S}_2^*\) of \({\bf S}_2\), see the different strategies below.
Recombine \(\bf S^* = ({\bf S}_1, {\bf S}_2^*)\) and back-transform \({\bf X}^*= {\bf S}^* {\bf W}^{-1}\).
Compute the test statistic based on \({\bf X}^*\).
Repeat the previous steps n.boot
times.
The four different bootstrapping strategies are:
s.boot = "p"
:
The first strategy is parametric and simply generates all boostrap samples independently and identically from the standard normal distribution.
s.boot = "np1"
:
The second strategy is non-parametric and pools all observed \(n(p - k)\) white noise observations together and draws the bootstrap samples from amongst them.
s.boot = "np2"
:
The third strategy is non-parametric and proceeds otherwise as the second strategy but acts component-wise. That is, for each of the \(p - k\) white noise series it pools the observed \(n\) white noise observations together and draws the bootstrap samples of that particular latent series from amongst them.
s.boot = "np3"
:
The third strategy is non-parametric and instead of drawing the samples univariately as in the second and third strategies, it proceeds by resampling \(n\) vectors of size \(p - k\) from amongst all the observed \(n\) white noise vectors.
The function can be run in parallel by setting ncores
to the desired number of cores (should be less than the number of cores available - 1). When running code in parallel the standard random seed of R is overridden and if a random seed needs to be set it should be passed via the argument iseed
. The argument iseed
has no effect in case ncores
equals 1 (the default value).
Matilainen, M., Nordhausen, K. and Virta, J. (2018), On the Number of Signals in Multivariate Time Series. In Deville, Y., Gannot, S., Mason, R., Plumbley, M.D. and Ward, D. (editors) "International Conference on Latent Variable Analysis and Signal Separation", LNCS 10891, 248--258. Springer, Cham., <doi:10.1007/978-3-319-93764-9_24>.
# NOT RUN {
n <- 1000
A <- matrix(rnorm(16), 4, 4)
s1 <- arima.sim(list(ar = c(0.3, 0.6)), n)
s2 <- arima.sim(list(ma = c(-0.3, 0.3)), n)
s3 <- rnorm(n)
s4 <- rnorm(n)
S <- cbind(s1, s2, s3, s4)
X <- S %*% t(A)
boot_res_1 <- AMUSEboot(X, k = 1)
boot_res_1
boot_res_2 <- AMUSEboot(X, k = 2)
boot_res_2
# Plots of the estimated sources, the last two are white noise
plot(boot_res_2)
# }
Run the code above in your browser using DataLab