Description Usage Arguments Details Value Author(s) References Examples
View source: R/select.dynsbm.R
Estimation of dynamic stockastic block models for different number of groups. Each model combines a stochastic block model (SBM) for its static part with independent Markov chains for the evolution of the nodes groups through time.
1 2 3 4 5 6 7 
Y 
An object of class 
present 

Qmin 
Minimum number of groups >1. 
Qmax 
Maximum number of groups. 
edge.type 
Type of adjacency matrices. This should be (an unambiguous abbreviation of) one of 
K 
Only if 
directed 
If 
self.loop 
If 
nb.cores 
Number of cores to use, i.e. how many child processes and how many threads will be run simultaneously during the initialization and the estimation steps respectively. 
iter.max 
Maximal number of algorithm iterations. 
nstart 
Number of starting points for the iterative estimation algorithm. See the "Details" section. 
perturbation.rate 
Rate of perturbation (in [0,1], see 
fixed.param 
If 
bipartition 

plot 
Display a plot with the loglikelihood and the ICL criteria if 
This function deals with binary or weighted dynamic/temporal/evolving networks (with discrete or continuous edges).
The adjacency matrices must be coded with 0/1 in the binary
case,
with 0/y where y belongs to the set 1,..,K in the discrete
case
or with 0/y where y is numeric, must be positive and is supposed to fit a gaussian mixture in
the continuous
case.
Presence/absence information allows to model node's arrival or
departure, birth or death, or simply enables to specify missing data
(as absent nodes). If this information is missing (NULL), the presence/absence is deduced automatically from Y
by searching for nodes that do not participate in any edges (lines/columns of O in Y
) and declaring them as absent.
This function does not support the existence of nodes that are never present (error message in this case).
The estimation algorithm is iterative and rely on a starting point. Therefore, it is possible to start the algorithm many times with 'nstart' starting points.
The first starting point is obtained with an adhoc use of the kmeans
function.
The follwing starting point are obtained by perturbating the first one (see perturbation.rate
).
The greater nstart
, the more accurate the results.
To select the best number of groups, the "elbow" method consists in finding the point where the slope of the loglikelihood is decreasing (i.e. the loglikelihood is reaching a plateau).
If edge.type=="binary"
, the ICL criteria (plotted in red) has
to be used : the best number of nodes is supposed to maximize the ICL
criteria.
This function has been extended to the case of bipartite networks. In
this case, despite Y
has to be of dimension (T x N x N), it is
possible to give a bipartition of the nodes into two disjoint
sets. For statistical reasons, fixed.param
is automatically set
to TRUE
. Given the total number of groups Q between Qmin and
Qmax, there is Q/2 groups for each set of nodes (when Q is odd,
there is floor(Q/2)+1 groups for the largest set of nodes);
however, there is no guaranty that the final groups are
coherent with the bipartition, i.e. that any group is composed by
nodes of one of the two sets (if not, a warning message is generated).
Returns a list of dynsbm
objects. Each object of class dynsbm
is a list
with the following components:
transition 
The Markov chain transition 
membership 
An object of class 
beta 
An object of class 
gamma 
Only if 
mu/sigma 
Only 
loglikelihood 
Completed data loglikelihood. 
iter 
Number of used algorithm iterations. 
directed 
Specifies whether the model is build for directed networks. 
self.loop 
Specifies whether the model allows selfloops. 
Authors: Catherine Matias, Vincent Miele
Maintainer: Vincent Miele <vincent.miele@univlyon1.fr>
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  data(simdataT5Q4N40binary)
## estimation for Q=1..6 groups
list.dynsbm < select.dynsbm(simdataT5Q4N40binary,
Qmin=1, Qmax=6, edge.type="binary", nstart=1)
## Not run:
## better to use nstart>1 starting points
## but estimation can take 12 minutes
list.dynsbm < select.dynsbm(simdataT5Q4N40binary,
Qmin=1, Qmax=6, edge.type="binary", nstart=25)
## End(Not run)
## selection of Q=4
dynsbm < list.dynsbm[[4]]
## plotting intra/inter connectivity patterns
connectivity.plot(dynsbm, simdataT5Q4N40binary)
## plotting switches between groups
alluvial.plot(dynsbm)


Default style:

$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"

[1] "checking edges"
Updated styles:
$`T11`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T12`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T13`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T14`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T21`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T22`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T23`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T24`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T31`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T32`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T33`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T34`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T41`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T42`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T43`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T44`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T51`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T52`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T53`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T54`
$col
[1] "gray47"
$lty
[1] 0
$textcol
[1] "black"
$nodestyle
[1] "regular"
$srt
[1] "90"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T11>T21`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T12>T22`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T12>T24`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T13>T23`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T14>T22`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T14>T24`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T21>T31`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T22>T32`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T23>T33`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T23>T34`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T24>T33`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T24>T34`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T31>T41`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T31>T43`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T32>T42`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T33>T41`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T33>T43`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T34>T44`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T41>T51`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T42>T52`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T43>T53`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"
$`T44>T54`
$nodestyle
[1] "regular"
$col
[1] "grey"
$srt
[1] "90"
$lty
[1] 1
$textcol
[1] "black"
$textcex
[1] 1
$edgecol
[1] "gradient"
$edgestyle
[1] "sin"
attr(,"class")
[1] "list" "riverplotStyle"

[1] "calculating sizes"
$lefts
T11 T12 T13 T14 T21 T22 T23 T24 T31 T32 T33 T34 T41 T42 T43 T44
0.00 0.00 0.00 0.00 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45
T51 T52 T53 T54
0.45 0.45 0.45 0.45
$rights
T11 T12 T13 T14 T21 T22 T23 T24 T31 T32 T33 T34 T41 T42 T43 T44
0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45
T51 T52 T53 T54
0.00 0.00 0.00 0.00
$sizey
T11 T12 T13 T14 T21 T22 T23 T24 T31 T32 T33 T34 T41 T42 T43 T44
0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45 0.45
T51 T52 T53 T54
0.45 0.45 0.45 0.45
[1] "calculating positions"
[1] 0.18
ID x y
T11 T11 1 1
T12 T12 1 2
T13 T13 1 3
T14 T14 1 4
T21 T21 2 1
T22 T22 2 2
T23 T23 2 3
T24 T24 2 4
T31 T31 3 1
T32 T32 3 2
T33 T33 3 3
T34 T34 3 4
T41 T41 4 1
T42 T42 4 2
T43 T43 4 3
T44 T44 4 4
T51 T51 5 1
T52 T52 5 2
T53 T53 5 3
T54 T54 5 4
[1] "done"
[1] "drawing edges"
[1] "drawing nodes"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.