View source: R/Functions_LpS.R
lstsp | R Documentation |
Main function for the low-rank plus sparse structure VAR model
lstsp(
data,
lambda.1 = NULL,
mu.1 = NULL,
lambda.1.seq = NULL,
mu.1.seq = NULL,
lambda.2 = NULL,
mu.2 = NULL,
lambda.3 = NULL,
mu.3 = NULL,
alpha_L = 0.25,
omega = NULL,
h = NULL,
step.size = NULL,
tol = 1e-04,
niter = 100,
backtracking = TRUE,
skip = 5,
cv = FALSE,
nfold = NULL,
verbose = FALSE
)
data |
A n by p dataset matrix |
lambda.1 |
tuning parameter for sparse component for the first step |
mu.1 |
tuning parameter for low rank component for the first step |
lambda.1.seq |
a sequence of lambda to the left segment for cross-validation, it's not mandatory to provide |
mu.1.seq |
a sequence of mu to the left segment, low rank component tuning parameter |
lambda.2 |
tuning parameter for sparse for the second step |
mu.2 |
tuning parameter for low rank for the second step |
lambda.3 |
tuning parameter for estimating sparse components |
mu.3 |
tuning parameter for estimating low rank components |
alpha_L |
a positive numeric value, indicating the restricted space of low rank component, default is 0.25 |
omega |
tuning parameter for information criterion, the larger of omega, the fewer final selected change points |
h |
window size of the first rolling window step |
step.size |
rolling step |
tol |
tolerance for the convergence in the second screening step, indicates when to stop |
niter |
the number of iterations required for FISTA algorithm |
backtracking |
A boolean argument to indicate use backtrack to FISTA model |
skip |
The number of observations need to skip near the boundaries |
cv |
A boolean argument, indicates whether the user will apply cross validation to select tuning parameter, default is FALSE |
nfold |
An positive integer, the number of folds for cross validation |
verbose |
If is TRUE, then it will print all information about current step. |
A list object including
the original dataset
the time lag for the time series, in this case, it is 1
Final estimated change points
Final estimated sparse components
Final estimated low rank components
Final estimated model parameter, equals to sum of low rank and sparse components
Running time for the LSTSP algorithm
nob <- 100
p <- 15
brk <- c(50, nob+1)
rank <- c(1, 3)
signals <- c(-0.7, 0.8)
singular_vals <- c(1, 0.75, 0.5)
info_ratio <- rep(0.35, 2)
try <- simu_var(method = "LS", nob = nob, k = p, lags = 1, brk = brk,
sigma = as.matrix(diag(p)), signals = signals,
rank = rank, singular_vals = singular_vals, info_ratio = info_ratio,
sp_pattern = "off-diagonal", spectral_radius = 0.9)
data <- try$series
lambda1 = lambda2 = lambda3 <- c(2.5, 2.5)
mu1 = mu2 = mu3 <- c(15, 15)
fit <- lstsp(data, lambda.1 = lambda1, mu.1 = mu1,
lambda.2 = lambda2, mu.2 = mu2,
lambda.3 = lambda3, mu.3 = mu3, alpha_L = 0.25,
step.size = 5, niter = 20, skip = 5,
cv = FALSE, verbose = FALSE)
summary(fit)
plot(fit, data, display = "cp")
plot(fit, data, display = "param")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.