The FixNA (Fixed-point algorithm for maximizing the Nonlinear Autocorrelation; Shi et al., 2009) and FixNA2 (Matilainen et al., 2017) methods for blind source separation of time series with stochastic volatility. These methods are alternatives to vSOBI method.
FixNA(X, …)# S3 method for default
FixNA(X, k = 1:12, eps = 1e-06, maxiter = 1000, G = c("pow", "lcosh"),
method = c("FixNA", "FixNA2"),
ordered = FALSE, acfk = NULL, original = TRUE, alpha = 0.05, …)
# S3 method for ts
FixNA(X, …)
# S3 method for xts
FixNA(X, …)
# S3 method for zoo
FixNA(X, …)
A vector of lags. It can be any non-zero positive integer, or a vector consisting of them. Default is 1:12
.
Convergence tolerance.
The maximum number of iterations.
Function \(G(x)\). The choices are "pow"
(default) and "lcosh"
.
The method to be used. The choices are "FixNA"
(default) and "FixNA2"
.
Whether to order components according to their volatility. Default is FALSE
.
A vector of lags to be used in testing the presence of serial autocorrelation. Applicable only if ordered = TRUE
.
Whether to return the original components or their residuals based on ARMA fit. Default is TRUE
, i.e. the original components are returned. Applicable only if ordered = TRUE
.
Alpha level for linear correlation detection. Default is 0.05.
Further arguments to be passed to or from methods.
A list of class 'bssvol', inheriting from class 'bss', containing the following components:
The estimated unmixing matrix. If ordered = TRUE
, the rows are ordered according to the order of the components.
The vector of the used lags.
The estimated sources as time series object standardized to have mean 0 and unit variances. If ordered = TRUE
, then components are ordered according to their volatility. If original = FALSE
, the sources with linear autocorrelation are replaced by their ARMA residuals.
The mean vector of X
.
The ordered original estimated sources as time series object standardized to have mean 0 and unit variances. Returned only if original = FALSE
.
The ARMA fits for the components with linear autocorrelation.
A logical vector. Is TRUE if ARMA fit was done to the corresponding component.
The value of the modified Ljung-Box test statistic for each component.
p-value based on the modified Ljung-Box test statistic for each component.
The value of the volatility clustering test statistic.
p-value based on the volatility clustering test statistic.
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 for method FixNA finds an orthogonal matrix \({\bf U}\) by maximizing $${\bf D}_1({\bf U}) = \sum_{k = 1}^K {\bf D}_{1k}({\bf U})= \sum_{k = 1}^K \sum_{i = 1}^p \frac{1}{T - k}\sum_{t=1}^{T - k}[G({\bf u}_i' {\bf Y}_t) G({\bf u}_i' {\bf Y}_{t + k})]$$ and the algorithm for method FixNA2 finds an orthogonal matrix \({\bf U}\) by maximizing $${\bf D}_2({\bf U}) = \sum_{k = 1}^K {\bf D}_{2k}({\bf U}) $$ $$= \sum_{k = 1}^K \sum_{i = 1}^p\left|\frac{1}{T - k}\sum_{t=1}^{T - k}[G({\bf u}_i' {\bf Y}_t) G({\bf u}_i' {\bf Y}_{t + k})] - \left(\frac{1}{T - k}\right)^2\sum_{t=1}^{T - k}[G({\bf u}_i' {\bf Y}_t)]\sum_{t=1}^{T - k}[G({\bf u}_i' {\bf Y}_{t + k})]\right|.$$ where \(i = 1, \ldots, p\), \(k = 1, \ldots, K\) and \(t = 1, \ldots, T\). For function \(G(x)\) the choices are \(x^2\) and log(cosh(\(x\))).
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}_{mik}\) is a partial derivative of \({\bf D}_{mk}({\bf U})\), for \(m = 1, 2\), with respect to \({\bf u}_i\).
Then \({\bf T}_{mk} = ({\bf T}_{m1k}, \ldots, {\bf T}_{mpk})'\), where \(p\) is the number of columns in \({\bf Y}\), and \({\bf T}_m = \sum_{k = 1}^K {\bf T}_{mk}\).
The update for the orthogonal matrix \({\bf U}_{new} = ({\bf T}_m{\bf T}_m')^{-1/2}{\bf T}_m\) 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
.
Hyv<e4>rinen, A. (2001), Blind Source Separation by Nonstationarity of Variance: A Cumulant-Based Approach, IEEE Transactions on Neural Networks, 12(6): 1471--1474.
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.
Shi, Z., Jiang, Z. and Zhou, F. (2009), Blind Source Separation with Nonlinear Autocorrelation and Non-Gaussianity, Journal of Computational and Applied Mathematics, 223(1): 908--915.
# NOT RUN {
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 <- FixNA(X)
res
coef(res)
plot(res)
head(bss.components(res))
MD(res$W, A) # Minimum Distance Index, should be close to zero
}
# }
Run the code above in your browser using DataLab