Learn R Programming

statGraph (version 0.5.1)

graph.acf: Auto Correlation Function Estimation for Graphs

Description

The function graph.acf computes estimates of the autocorrelation function for graphs.

Usage

graph.acf(G, plot = TRUE)

Value

An object of class acf.

Arguments

G

a list of undirected graphs (igraph type) or their adjacency matrices. The adjacency matrix of an unweighted graph contains only 0s and 1s, while the weighted graph may have nonnegative real values that correspond to the weights of the edges.

plot

logical. If TRUE (default) the graph.acf is plotted.

References

Fujita, A., Takahashi, D. Y., Balardin, J. B., Vidal, M. C. and Sato, J. R. (2017) Correlation between graphs with an application to brain network analysis. _Computational Statistics & Data Analysis_ *109*, 76-92.

Examples

Run this code
set.seed(1)
G <- list()
p <- array(0, 100)
p[1:3] <- rnorm(3)
for (t in 4:100) {
  p[t] <- 0.5*p[t-3] + rnorm(1)
}
ma <- max(p)
mi <- min(p)
p <- (p - mi)/(ma-mi)
for (t in 1:100) {
  G[[t]] <- igraph::sample_gnp(100, p[t])
}
graph.acf(G, plot=TRUE)

Run the code above in your browser using DataLab