Skip to contents

Laplacian Eigen Value method by Shenyang Huang, Yasmeen Hitti, Guillaume Rabusseau and Reihaneh Rabbany from their KDD'20 paper Laplacian Change Point Detection for Dynamic Graphs

Usage

lad(matlist, k = NULL, short_win, long_win, alpha = 0.05, from_file = NULL)

Arguments

matlist

The matrix list, where each matrix is an adjacency matrix of the graph.

k

The number of eigen values to connsider

short_win

The length of the shorter windows

long_win

The length of the longer windows

alpha

The threshold to declare anomalies

from_file

This is an additional parameter only if a file needs to be read

Value

An object of class lad. LAD is a window based method. It considers short and a long windows. The lad object has anomalous scores when taking into account short and long windows along with the identified anomalies for both short and long windows.

References

Huang, S., Hitti, Y., Rabusseau, G., & Rabbany, R. (2020). Laplacian Change Point Detection for Dynamic Graphs. Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 349–358. https://doi.org/10.1145/3394486.3403077

Examples

# We generate a series of networks and add an anomaly at 50th network.
set.seed(1)
networks <- list()
p.or.m.seq <- rep(0.05, 50)
p.or.m.seq[20] <- 0.2  # anomalous network at 20
for(i in 1:50){
  gr <- igraph::erdos.renyi.game(100, p.or.m = p.or.m.seq[i])
  networks[[i]] <- igraph::as_adjacency_matrix(gr)
}
ladobj <- lad(networks, k = 6, short_win = 2, long_win = 4)
ladobj
#> $short_scores
#>  [1] 0.000000e+00 0.000000e+00 1.546402e-04 9.599282e-05 8.418244e-04
#>  [6] 0.000000e+00 0.000000e+00 9.127599e-06 0.000000e+00 2.705192e-04
#> [11] 7.436111e-04 0.000000e+00 1.511009e-04 0.000000e+00 6.272677e-04
#> [16] 1.648820e-03 0.000000e+00 2.965420e-05 9.405151e-04 1.320420e-03
#> [21] 0.000000e+00 0.000000e+00 0.000000e+00 5.639345e-04 0.000000e+00
#> [26] 0.000000e+00 8.821683e-05 3.325573e-04 1.675511e-04 0.000000e+00
#> [31] 0.000000e+00 5.481097e-05 0.000000e+00 0.000000e+00 1.288231e-03
#> [36] 0.000000e+00 3.105232e-04 0.000000e+00 1.575809e-03 0.000000e+00
#> [41] 7.137107e-05 7.971083e-04 0.000000e+00 3.838714e-04 3.167192e-03
#> [46] 0.000000e+00 1.162641e-03 7.522517e-05 0.000000e+00 4.884437e-04
#> 
#> $long_scores
#>  [1] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 7.121737e-04
#>  [6] 0.000000e+00 0.000000e+00 8.863660e-05 2.819479e-05 2.052105e-04
#> [11] 3.251741e-04 0.000000e+00 2.083268e-04 0.000000e+00 3.554971e-04
#> [16] 6.156102e-04 0.000000e+00 0.000000e+00 1.723206e-03 0.000000e+00
#> [21] 0.000000e+00 0.000000e+00 0.000000e+00 4.882487e-04 0.000000e+00
#> [26] 3.839949e-04 0.000000e+00 2.770497e-04 2.349510e-04 0.000000e+00
#> [31] 2.222701e-04 0.000000e+00 0.000000e+00 3.102162e-04 8.054500e-04
#> [36] 0.000000e+00 0.000000e+00 0.000000e+00 1.332547e-03 0.000000e+00
#> [41] 1.390599e-05 6.365861e-04 0.000000e+00 1.643987e-04 2.962269e-03
#> [46] 0.000000e+00 0.000000e+00 1.246957e-03 0.000000e+00 0.000000e+00
#> 
#> $short_anomalies
#> [1] 45 16 39
#> 
#> $long_anomalies
#> [1] 45 19 39
#> 
#> $call
#> lad(matlist = networks, k = 6, short_win = 2, long_win = 4)
#> 
#> attr(,"class")
#> [1] "lad"