simu_tbss: Simulation function for TBSS algorithm

simu_tbssR Documentation

Simulation function for TBSS algorithm

Description

Function for deploying simulation using TBSS algorithm

Usage

simu_tbss(
  nreps,
  simu_method = c("sparse", "group sparse", "fLS"),
  nob,
  k,
  lags = 1,
  lags_vector = NULL,
  brk,
  sigma,
  skip = 50,
  group_mats = NULL,
  group_type = c("columnwise", "rowwise"),
  group_index = NULL,
  sparse_mats = NULL,
  sp_density = NULL,
  signals = NULL,
  rank = NULL,
  info_ratio = NULL,
  sp_pattern = c("off-diagonal", "diagoanl", "random"),
  singular_vals = NULL,
  spectral_radius = 0.9,
  est_method = c("sparse", "group sparse", "fLS"),
  q = 1,
  tol = 0.01,
  lambda.1.cv = NULL,
  lambda.2.cv = NULL,
  mu = NULL,
  group.index = NULL,
  group.case = c("columnwise", "rowwise"),
  max.iteration = 100,
  refit = FALSE,
  block.size = NULL,
  blocks = NULL,
  use.BIC = TRUE,
  an.grid = NULL
)

Arguments

nreps

A numeric integer number, indicates the number of simulation replications

simu_method

the structure of time series: "sparse","group sparse", and "fLS"

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

group_mats

transition matrix for group sparse case

group_type

type for group lasso: "columnwise", "rowwise". Default is "columnwise".

group_index

group index for group lasso.

sparse_mats

transition matrix for sparse case

sp_density

if we choose random pattern, we should provide the sparsity density for each segment

signals

manually setting signal for each segment (including sign)

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

sp_pattern

a choice of the pattern of sparse component: diagonal, 1-off diagonal, random, custom

singular_vals

singular values for the low rank components

spectral_radius

to ensure the time series is piecewise stationary.

est_method

method: sparse, group sparse, and fixed low rank plus sparse. Default is sparse

q

the AR order

tol

tolerance for the fused lasso

lambda.1.cv

tuning parameter lambda_1 for fused lasso

lambda.2.cv

tuning parameter lambda_2 for fused lasso

mu

tuning parameter for low rank component, only available when method is set to "fLS"

group.index

group index for group sparse case

group.case

group sparse pattern: column, row.

max.iteration

max number of iteration for the fused lasso

refit

logical; if TRUE, refit the VAR model for parameter estimation. Default is FALSE.

block.size

the block size

blocks

the blocks

use.BIC

use BIC for k-means part

an.grid

a vector of an for grid searching

Value

A S3 object of class, named VARDetect.simu.result

est_cps

A list of estimated change points, including all replications

est_sparse_mats

A list of estimated sparse components for all replications

est_lowrank_mats

A list of estimated low rank components for all replications

est_phi_mats

A list of estimated model parameters, transition matrices for VAR model

running_times

A numeric vector, containing all running times

Examples


nob <- 4000; p <- 15
brk <- c(floor(nob / 3), floor(2 * nob / 3), nob + 1)
m <- length(brk); q.t <- 1
sp_density <- rep(0.05, m * q.t)
signals <- c(-0.6, 0.6, -0.6)
try_simu <- simu_tbss(nreps = 3, simu_method = "sparse", nob = nob, 
                      k = p, lags = q.t, brk = brk, sigma = diag(p), 
                      signals = signals, sp_density = sp_density, 
                      sp_pattern = "random", est_method = "sparse", q = q.t, 
                      refit = TRUE)


VARDetect documentation built on May 10, 2022, 9:07 a.m.