adjacency.plot: Heatmap plot of the reorganized adjacency matrices associated...

View source: R/plot.R

adjacency.plotR Documentation

Heatmap plot of the reorganized adjacency matrices associated to a dynamic stochastic block model.

Description

Heatmap plot of the adjacency matrices with rows/columns reorganized according to the group membership associated to a dynamic stochastic block model.

Usage

adjacency.plot(dynsbm, Y, present=NULL, col=heat.colors(9))

Arguments

dynsbm

An object of class dynsbm retrieved with the function select.dynsbm.

Y

An object of class array of dimension (T x N x N) containing T adjacency matrices of size (N x N), where N is the number of nodes in the network and T is the number of time points.

present

NULL or an object of class matrix of size (N x T) containing the presence/absence (coded with 1/0 respectively) of each N nodes at each of the T time points. When set to NULL, this object is deduced from Y.

col

A list of colors such as that generated by rainbow, heat.colors, topo.colors, terrain.colors or similar functions.

Details

The T adjacency matrices are represented. The row/lines are reordered following the group membership (nodes of group 1 followed by nodes of group 2 and so on). Red lines correspond to group delineation.

The reordering is independent for each time step. The adjacency matrices do not contain the row/columns corresponding to absent nodes.

If dynsbm was estimated with edge.type=="binary", the matrices cells are colored in white for value O or in the first color of the col argument vector for value 1. If dynsbm was estimated with edge.type=="discrete" or edge.type=="continuous", the matrices cells are colored with a colored gradient for value >0.

Value

No return value, called for plotting.

Author(s)

Authors: Catherine Matias, Vincent Miele

Maintainer: Vincent Miele <vincent.miele@univ-lyon1.fr>

References

Catherine Matias and Vincent Miele, Statistical clustering of temporal networks through a dynamic stochastic block model, Journal of the Royal Statistical Society: Series B (2017) http://dx.doi.org/10.1111/rssb.12200 http://arxiv.org/abs/1506.07464

Vincent Miele and Catherine Matias, Revealing the hidden structure of dynamic ecological networks, Royal Society Open Science (2017) http://dx.doi.org/10.1098/rsos.170251 https://arxiv.org/abs/1701.01355

Examples

####################
## 1 - binary case
data(simdataT5Q4N40binary)

## estimation for Q=1..5 groups
## better to use nstart>1 starting points
## but estimation can take 1-2 minutes
list.dynsbm <- select.dynsbm(simdataT5Q4N40binary, 
				Qmin=1, Qmax=5, edge.type="binary", nstart=1)

## selection of Q=4
dynsbm <- list.dynsbm[[4]]

## plotting intra/inter connectivity patterns
adjacency.plot(dynsbm, simdataT5Q4N40binary)

####################
## 2 - continuous case
data(simdataT5Q4N40continuous)

## estimation for Q=1..5 groups
## better to use nstart>1 starting points
## but estimation can take 1-2 minutes
list.dynsbm <- select.dynsbm(simdataT5Q4N40continuous, 
				Qmin=1, Qmax=5, edge.type="continuous", nstart=1)
						
## selection of Q=4
dynsbm <- list.dynsbm[[4]]

## plotting intra/inter connectivity patterns
adjacency.plot(dynsbm, simdataT5Q4N40continuous)

####################
## 3 - discrete case
data(simdataT5Q4N40discrete)

## estimation for Q=1..5 groups
## better to use nstart>1 starting points
## but estimation can take 1-2 minutes
list.dynsbm <- select.dynsbm(simdataT5Q4N40discrete, 
				Qmin=1, Qmax=5, edge.type="discrete", K=4, nstart=1)
									
## selection of Q=4
dynsbm <- list.dynsbm[[4]]

## plotting intra/inter connectivity patterns
adjacency.plot(dynsbm, simdataT5Q4N40discrete)

dynsbm documentation built on June 8, 2025, 11 a.m.