calibrate.online.network.missing {changepoints}R Documentation

Calibrate step for online change point detection for network data with missing values.

Description

Calibrate step for online change point detection for network data by controlling the false alarm rate at level alpha.

Usage

calibrate.online.network.missing(
  train_miss_list,
  train_eta_list,
  threshold_len,
  alpha_grid,
  permu_num,
  pi_lb_hat,
  pi_ub_hat,
  rho_hat,
  rank_hat,
  C_lambda = 2/3,
  delta = 5
)

Arguments

train_miss_list

A list of adjacency matrices (with entries being 0 or 1) with missing values being coercing to 0.

train_eta_list

A list of matrices associated with data_incomplete_list, each matrix indicates the missing entries in corresponding adjacency matrix.

threshold_len

An integer scalar of the length of tuned thresholds.

alpha_grid

A numeric vector in (0,1) representing the desired false alarm rate.

permu_num

An integer scalar of number of random permutation for calibration.

pi_lb_hat

A numeric scalar of the lower bound of the missing probability.

pi_ub_hat

A numeric scalar of the upper bound of the missing probability.

rho_hat

A numeric scalar of the sparsity parameter.

rank_hat

An integer scalar of the rank of the underlying graphon matrix.

C_lambda

A numeric scalar of an absolute constant, which is set to be 2/3 by default.

delta

An integer scalar of minimum spacing.

Value

A list with the following structure:

C_lambda

The absolute constant

rho_hat

the (estimated) sparsity parameter

rank_hat

the (estimated) rank of underlying graphon matrix

pi_lb_hat

the (estimated) lower bound of the missing probability

pi_ub_hat

the (estimated) upper bound of the missing probability

thresholds_array

A numeric array of calibrated threshold

Author(s)

Haotian Xu

References

Dubey, Xu and Yu (2021) <arxiv:2110.06450>

See Also

online.network.missing for detecting online change point.

Examples

p = 6 # number of nodes
rho = 0.5 # sparsity parameter
block_num = 3 # number of groups for SBM
train_obs_num = 150 # sample size for each segment
conn1_mat = rho * matrix(c(0.6,1,0.6,1,0.6,0.5,0.6,0.5,0.6), nrow = 3) # connectivity matrix 
set.seed(1)
can_vec = sample(1:p, replace = FALSE) # randomly assign nodes into groups
sbm = simu.SBM(conn1_mat, can_vec, train_obs_num, symm = TRUE, self = TRUE)
train_mat = sbm$obs_mat
train_list = lapply(1:ncol(train_mat), function(t) lowertri2mat(train_mat[,t], p, diag = TRUE))
pi_mat = matrix(0.9, p, p)
train_eta_list = lapply(1:length(train_list), function(t) gen.missing(pi_mat, symm = TRUE))
train_miss_list = lapply(1:length(train_list), function(t) train_eta_list[[t]] * train_list[[t]])
pi_lb_hat = quantile(Reduce("+", train_eta_list)/train_obs_num, 0.05) # estimator of pi_lb
pi_ub_hat = quantile(Reduce("+", train_eta_list)/train_obs_num, 0.95) # estimator of pi_ub
C_lambda = 2/3
lambda = lambda.network.missing(1, length(train_miss_list), length(train_miss_list), 0.05, 
                                rho = 0.509, pi_ub = pi_ub_hat, p, C_lambda)
graphon_miss_impute = softImpute.network.missing(train_miss_list, train_eta_list, lambda, 1)
graphon_miss_hat = graphon_miss_impute$u %*% diag(as.numeric(graphon_miss_impute$d)) %*% 
                   t(graphon_miss_impute$v)
rho_hat = quantile(graphon_miss_hat, 0.95)
rank_hat = sum(graphon_miss_impute$d != 0)
alpha_grid = c(0.05)
permu_num = 10
threshold_len = 30
temp = calibrate.online.network.missing(train_miss_list, train_eta_list, threshold_len, alpha_grid, 
                   permu_num, pi_lb_hat, pi_ub_hat, rho_hat, rank_hat, C_lambda, delta = 5)

[Package changepoints version 1.1.0 Index]