gSOBI {tsBSS} | R Documentation |
Generalized SOBI
Description
The gSOBI (generalized Second Order Blind Identification) method for the blind source separation (BSS) problem. The method is designed for separating multivariate time series with or without stochastic volatility. The method is a combination of SOBI and vSOBI with G(x) = x^2
as a nonlinearity function.
Usage
gSOBI(X, ...)
## Default S3 method:
gSOBI(X, k1 = 1:12, k2 = 1:3, b = 0.9, eps = 1e-06, maxiter = 1000, ordered = FALSE,
acfk = NULL, original = TRUE, alpha = 0.05, ...)
## S3 method for class 'ts'
gSOBI(X, ...)
## S3 method for class 'xts'
gSOBI(X, ...)
## S3 method for class 'zoo'
gSOBI(X, ...)
Arguments
X |
A numeric matrix or a multivariate time series object of class |
k1 |
A vector of lags for SOBI part. It can be any non-zero positive integer, or a vector consisting of them. Default is |
k2 |
A vector of lags for vSOBI part. It can be any non-zero positive integer, or a vector consisting of them. Default is |
b |
The weight for the SOBI part, |
eps |
Convergence tolerance. |
maxiter |
The maximum number of iterations. |
ordered |
Whether to order components according to their volatility. Default is |
acfk |
A vector of lags to be used in testing the presence of serial autocorrelation. Applicable only if |
original |
Whether to return the original components or their residuals based on ARMA fit. Default is |
alpha |
Alpha level for linear correlation detection. Default is 0.05. |
... |
Further arguments to be passed to or from methods. |
Details
Assume that a p
-variate {\bf Y}
with T
observations is whitened, i.e. {\bf Y}={\bf S}^{-1/2}({\bf X}_t - \frac{1}{T}\sum_{t=1}^T {\bf X}_{t})
, for t = 1, \ldots, T
,
where {\bf S}
is the sample covariance matrix of {\bf X}
. The algorithm finds an orthogonal matrix {\bf U}
by maximizing
{\bf D}({\bf U}) = b\sum_{k_1 = 1}^{K_1} {\bf D}_{k_1}({\bf U}) + (1 - b)\sum_{k_2 = 1}^{K_2} {\bf D}_{k_2}({\bf U}),
where SOBI part
{\bf D}_{k_1} = \sum_{i = 1}^p \left(\frac{1}{T - k_1}\sum_{t=1}^{T - k_1}[({\bf u}_i' {\bf Y}_t) ({\bf u}_i' {\bf Y}_{t + k_1})]\right)^2.
and vSOBI part
{\bf D}_{k_2} = \sum_{i = 1}^p \left(\frac{1}{T - k_2}\sum_{t=1}^{T - k_2}[({\bf u}_i' {\bf Y}_t)^2 ({\bf u}_i' {\bf Y}_{t + k_2})^2] - \left(\frac{1}{T - k_2}\right)^2\sum_{t=1}^{T - k_2}[({\bf u}_i' {\bf Y}_t)^2]\sum_{t=1}^{T - k_2}[({\bf u}_i' {\bf Y}_{t + k_2})^2]\right)^2
where b \in [0, 1].
is a value between 0 and 1, and i = 1, \ldots, p
, k_1 = 1, \ldots, K_1
, k_2 = 1, \ldots, K_2
and t = 1, \ldots, T
The algorithm works iteratively starting with diag(p)
as an initial value for an orthogonal matrix {\bf U} = ({\bf u}_1, {\bf u}_2, \ldots, {\bf u}_p)'
.
Matrix {\bf T}_{ikj}
is a partial derivative of {\bf D}_{kj}({\bf U})
, where j = 1, 2
, with respect to {\bf u}_i
.
Then {\bf T}_{kj} = ({\bf T}_{1kj}, \ldots, {\bf T}_{pkj})'
, where p
is the number of columns in \bf Y
, and {\bf T}_j = \sum_{k_j = 1}^{K_j} {\bf T}_{kj}
, for j = 1, 2
. Finally {\bf T} = b{\bf T}_1 + (1-b){\bf T}_2
.
The update for the orthogonal matrix {\bf U}_{new} = ({\bf TT}')^{-1/2}{\bf T}
is calculated at each iteration step. The algorithm stops when
||{\bf U}_{new} - {\bf U}_{old}||
is less than eps
.
The final unmixing matrix is then {\bf W} = {\bf US}^{-1/2}
.
For ordered = TRUE
the function orders the sources according to their volatility. First a possible linear autocorrelation is removed using auto.arima
. Then a squared autocorrelation test is performed for the sources (or for their residuals, when linear correlation is present). The sources are then put in a decreasing order according to the value of the test statistic of the squared autocorrelation test. For more information, see lbtest
.
Value
A list of class 'bssvol', inheriting from class 'bss', containing the following components:
W |
The estimated unmixing matrix. If |
k1 |
The vector of the used lags for the SOBI part. |
k2 |
The vector of the used lags for the vSOBI part. |
S |
The estimated sources as time series object standardized to have mean 0 and unit variances. If |
MU |
The mean vector of |
If ordered = TRUE
, then also the following components included in the list:
Sraw |
The ordered original estimated sources as time series object standardized to have mean 0 and unit variances. Returned only if |
fits |
The ARMA fits for the components with linear autocorrelation. |
armaeff |
A logical vector. Is TRUE if ARMA fit was done to the corresponding component. |
linTS |
The value of the modified Ljung-Box test statistic for each component. |
linP |
p-value based on the modified Ljung-Box test statistic for each component. |
volTS |
The value of the volatility clustering test statistic. |
volP |
p-value based on the volatility clustering test statistic. |
Author(s)
Markus Matilainen, Jari Miettinen
References
Belouchrani, A., Abed-Meriam, K., Cardoso, J.F. and Moulines, R. (1997), A Blind Source Separation Technique Using Second-Order Statistics, IEEE Transactions on Signal Processing, 434–444.
Matilainen, M., Miettinen, J., Nordhausen, K., Oja, H. and Taskinen, S. (2017), On Independent Component Analysis with Stochastic Volatility Models, Austrian Journal of Statistics, 46(3–4), 57–66.
Miettinen, M., Matilainen, M., Nordhausen, K. and Taskinen, S. (2020), Extracting Conditionally Heteroskedastic Components Using Independent Component Analysis, Journal of Time Series Analysis, 41, 293–311.
See Also
SOBI
, vSOBI
, lbtest
, auto.arima
Examples
if(require("stochvol")) {
n <- 10000
A <- matrix(rnorm(9), 3, 3)
# simulate SV models
s1 <- svsim(n, mu = -10, phi = 0.8, sigma = 0.1)$y
s2 <- svsim(n, mu = -10, phi = 0.9, sigma = 0.2)$y
s3 <- svsim(n, mu = -10, phi = 0.95, sigma = 0.4)$y
# create a daily time series
X <- ts(cbind(s1, s2, s3) %*% t(A), end = c(2015, 338), frequency = 365.25)
res <- gSOBI(X, 1:4, 1:2, 0.99)
res$W
coef(res)
plot(res)
head(bss.components(res))
MD(res$W, A) # Minimum Distance Index, should be close to zero
# xts series as input
library("xts")
data(sample_matrix)
X2 <- as.xts(sample_matrix)
res2 <- gSOBI(X2, 1:4, 1:2, 0.99)
plot(res2, multi.panel = TRUE)
# zoo series as input
X3 <- as.zoo(X)
res3 <- gSOBI(X3, 1:4, 1:2, 0.99)
plot(res3)
}