method: the structure of time series: "sparse","group sparse", "fLS", "LS"
nob: sample size
k: dimension of transition matrix
lags: lags of VAR time series. Default is 1.
lags_vector: a vector of lags of VAR time series for each segment
brk: a vector of break points with (nob+1) as the last element
sigma: the variance matrix for error term
skip: an argument to control the leading data points to obtain a stationary time series
spectral_radius: to ensure the time series is piecewise stationary.
seed: an argument to control the random seed. Default seed is 1.
sp_density: if we choose random pattern, we should provide the sparsity density for each segment
group_mats: transition matrix for group sparse case
group_index: group index for group lasso.
group_type: type for group lasso: "columnwise", "rowwise". Default is "columnwise".
sparse_mats: transition matrix for sparse case
sp_pattern: a choice of the pattern of sparse component: diagonal, 1-off diagonal, random, custom
rank: if we choose method is low rank plus sparse, we need to provide the ranks for each segment
info_ratio: the information ratio leverages the signal strength from low rank and sparse components
signals: manually setting signal for each segment (including sign)
singular_vals: singular values for the low rank components
Returns
A list object, which contains the followings
series: matrix of timeseries data
noises: matrix of noise term data
sparse_mats: list of sparse matrix in the transition matrix
lowrank_mats: list of low-rank matrix in the transition matrix
Examples
nob <-(10^3*4)# number of time pointsp <-15# number of time series componentsbrk <- c(floor(nob /3), floor(2* nob /3), nob +1)m0 <- length(brk)-1# number of break pointsq.t <-2# the true AR orderm <- m0 +1# number of segmentssp_density <- rep(0.05, m * q.t)# sparsity level (5%)try <- simu_var("sparse", nob = nob, k = p, lags = q.t, brk = brk, sp_pattern ="random", sp_density = sp_density)print(plot_matrix(do.call("cbind", try$model_param), m * q.t))