Skip to contents

This function identifies anomalous networks from a series of temporal networks. It uses graph theoretic features to transform networks to a feature space. This function has parameters for feature computation, scaling, robust PCA and anomaly detection procedures. ADD MORE DESCRIPTION.

Usage

anomalous_networks(
  networks,
  alpha = 0.05,
  dd = 2,
  trim = 0.005,
  na_action = NULL,
  vert_attr = FALSE,
  attr_name = NULL,
  attr_mat = NULL,
  fast = FALSE,
  feature_subset = NULL
)

Arguments

networks

The input series of temporal networks given in a list with each network denoted by its adjacency matrix.

alpha

An anomaly detection parameter. The level of significance for the anomaly detection algorithm lookout. Default is 0.05.

dd

A robust PCA parameter. The number of reduced dimensions in robust PCA. Default is 2.

trim

A scaling parameter. The percentage used to compute trimmed mean and trimmed standard deviation. Default is 0.5 percent.

na_action

The action for NA valued features.

vert_attr

A feature computation parameter. If TRUE the network nodes/vertices have attributes.

attr_name

A feature computation parameter. The name of the network vertex attribute. Only a single attribute can be specified.

attr_mat

A feature computation parameter. If network nodes/vertices have attributes, the list of attribute matrices for each network can be given using this feature.

fast

If set to TRUE will avoid computing time consuming features.

feature_subset

A feature computation parameter. A subset of features to be used for anomaly detection.

Value

Object imported from lookout.

See also

[lookout::lookout()]

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.1, 50)
p.or.m.seq[20] <- 0.3  # anomalous network at 20
for(i in 1:50){
  gr <- igraph::erdos.renyi.game(50, p.or.m = p.or.m.seq[i])
  networks[[i]] <- igraph::as_adjacency_matrix(gr)
}
anomalous_networks(networks, fast = TRUE)
#> Leave-out-out KDE outliers using lookout algorithm
#> 
#> Call: lookout::lookout(X = dfpca[, 1:dd], alpha = alpha)
#> 
#>   Outliers Probability
#> 1       20  0.04172761
#>