Description Usage Arguments Details Value References Examples
View source: R/DNCRPackageRCode.R
Perform dynamic network clustering. Either variational Bayes or a Gibbs sampler may be implemented. Setting M=0
performs variational Bayes with no clustering. Returns posterior parameters (if method="VB"
) or approximate posterior samples (if method="Gibbs"
), as well as the MAP estimates, which may be extracted through dncObj$pm
.
1 2 3 |
Y |
Dynamic network data. This should be in the form of a n x n x T array of 1's and 0's. Each slice corresponds to a single time point. |
M |
Number of communities (may be zero). |
p |
Dimension of the latent space. |
method |
Method of estimation, either "VB" for variational Bayes, or "Gibbs" for a Gibbs sampler. |
init |
(Use of this argument is not recommended) Initial values of the parameters. A named list containing |
hyperparms |
Hyperparameters. A named list with |
Missing |
A matrix whose rows correspond to missing dyads. |
controls |
A list of values to control the algorithm.
|
This function performs community detection according to the model
logit(P(Y_{ijt} =1)) = α + s_j X_{it}'X_{jt}
,
π(X_{it}|Z_{it}=m) = N(r_{i}*u_{m},τ_{i}^{-1}I_p).
While the latent positions, X_{it}'s, live in a p-dim Euclidean space, it is more natural to conceptualize these as living on a (hyper-) sphere with the magnitude of the X_{it}'s as attached attributes that reflect the actors' individual tendency to send and receive edges.
If M=0
, then the prior on X_{it} is given by
π(X_{i1}) = N(0,σ^2 I_p)
π(X_{it}|X_{i(t-1)}) = N(X_{i(t-1)},τ_i^{-1} I_p)
The variational Bayes approach is typically faster than the Gibbs sampler, but tends to underestimate the spread of the posterior.
Currently, only VB is implemented when M=0
(no clustering), hence method
will be ignored if M=0
.
Ignorable missing data can be estimated within the Gibbs sampler (not using the VB algorithm) by adding the extra step of drawing the missing edges given the latent positions and the model parameters at each iteration.
Using the init
is, in general, strongly discouraged, as this may have a non-negligible negative affect on the performance of the VB or the length of the chain needed to reach convergence. Unless otherwise specified, both the initialization scheme and the hyperparameters are chosen according to Sewell and Chen (2016).
An object of class dnc
, for which other methods exist (e.g., methods(class="dnc")
).
If method="VB"
and M=0
,
The estimation algorithm
The original data
A p x T x n array: Posterior mean of the latent positions
A (Tp) x p x n array: Posterior covariance matrices of the latent positions. The covariance matrix for X_{it} is dncObj$Sig[(t-1)*p,,i]
Scalar: Posterior shape parameter for σ^2 in inverse gamma distribution (if M=0
).
Scalar: Posterior scale parameter for σ^2 in inverse gamma distribution (if M=0
).
A n x 1 vector: Posterior mean parameter for the r_i's in truncated normal distribution (if M>0
).
A n x 1 vector: Posterior variance parameter for the r_i's in truncated normal distribution (if M>0
).
A n x 1 vector: Posterior first moment for the r_i's (if M>0
).
A n x 1 vector: Posterior second moment for the r_i's (if M>0
).
A n x 1 vector: Posterior shape parameter for the τ_i's in gamma distribution.
A n x 1 vector: Posterior scale parameter for the τ_i's in gamma distribution.
Scalar: Posterior mean for α.
Scalar: Posterior variance for α.
A n x 1 vector: Posterior mean parameter for the s_j's in truncated normal distribution.
A n x 1 vector: Posterior variance parameter for the s_j's in truncated normal distribution.
A n x 1 vector: Posterior first moment for the s_j's.
A n x 1 vector: Posterior second moment for the s_j's.
A M x p matrix: Posterior mean directions for the M
clusters/communities, i.e., for the u_m's (if M>0
).
A M x 1 vector: Posterior concentration parameters for the M
clusters/communities, i.e., for the u_m's (if M>0
).
A n x T matrix: Cluster assignments based on the maximum posterior probabilities, computed marginally at each time point (if M>0
).
A n x M matrix: Posterior probabilities of community assignment for each actor at the first observed time point (if M>0
).
A (MT) x M x n array: Posterior transition probability matrices; π(Z_{itk}=1|Z_{i(t-1)h}=1,Y)= dncObj$Bithk[(t-1)*M+h,k,i]
. Ignore first M
lines (internal use only). (if M>0
).
A T x M x n array: Marginal posterior probabilities of community assignments, i.e., π(Z_{itk}=1|Y)= dncObj$Bitbar[t,k,i]
(if M>0
).
A (M+1) x M matrix: Posterior concentration parameters for β_0 (row 1) and for β_m, m>1 (rows 2 to M+1) in Dirichlet distribution (if M>0
).
If method="Gibbs"
,
The estimation algorithm
The original data
A p x T x n x nDraws
array: Posterior samples for the latent positions.
A n x nDraws
matrix: Posterior samples for the r_i's.
A n x nDraws
matrix: Posterior samples for the τ_i's.
A nDraws
x 1 vector: Posterior samples for α.
A n x nDraws
matrix: Posterior samples for the τ_i's.
A M x p x nDraws
array: Posterior draws for the communities, i.e., the u_m's.
A n x T x nDraws
array: Posterior draws for the community assignments for each actor at each time point.
A (M+1) x M x n array: Posterior draws for beta_0 (row 1) and β_m, m>1 (rows 2 to M+1).
A (burnin
+nDraws
) x 1 vector: Posterior values for all iterations of the Gibbs sampler.
A matrix of four columns: The row, column, and time for each missing dyad, as well as the posterior probability that the dyad equals one.
Additionally, each dnc
class object comes with a $pm
value, which is a list of the MAP estimates for alpha
, X
, s
, tau
, r
, u
, Z
, and beta
.
Sewell, D. K., and Chen, Y. (2016). Latent Space Approaches to Community Detection in Dynamic Networks. Bayesian Analysis. doi: 10.1214/16-BA1000. http://projecteuclid.org/euclid.ba/1461603847
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.