sim_A {JANE}R Documentation

Simulate unweighted networks from latent space cluster models

Description

Simulate an unweighted network from a D-dimensional latent space cluster model with K clusters and N actors. The squared euclidean distance is used (i.e., dist(U_i,U_j)^2), where U_i and U_j are the respective actor's positions in an unobserved social space.

Usage

sim_A(
  N,
  mus,
  omegas,
  p,
  beta0,
  model,
  precision_R_effects,
  remove_isolates = TRUE
)

Arguments

N

An integer specifying the number of actors in the network.

mus

A numeric K \times D matrix specifying the mean vectors of the multivariate normal distribution for the latent positions of the K clusters.

omegas

A numeric D \times D \times K array specifying the precision matrices of the multivariate normal distribution for the latent positions of the K clusters.

p

A numeric vector of length K specifying the mixture weights of the finite multivariate normal mixture distribution for the latent positions.

beta0

A numeric value specifying the intercept parameter for the logistic regression model.

model

A character string to specify the model to simulate the network from:

  • 'NDH': generates an undirected network with no degree heterogeneity

  • 'RS': generates an undirected network with degree heterogeneity, specifically by including actor specific random sociality effects

  • 'RSR': generates a directed network with degree heterogeneity, specifically by including actor specific random sender and receiver effects

precision_R_effects

Precision parameters for random degree heterogeneity effects:

  • 'NDH': does not apply, can leave as missing

  • 'RS': a numeric value specifying the precision parameter of the normal distribution of the random sociality effect, if missing will generate from a gamma(shape = 1, rate = 1)

  • 'RSR': a numeric matrix specifying the precision matrix of the multivariate normal distribution of the random sender and receiver effects, if missing will generate from a Wishart(df = 3, Sigma = I_2)

remove_isolates

A logical; if TRUE then isolates from the network are removed (default is TRUE).

Value

A list containing the following components:

A

A sparse adjacency matrix of class 'dgCMatrix' representing the simulated network.

Z

A numeric N \times K cluster assignment matrix with rows representing the cluster an actor belongs to (i.e. indicated by a value of 1.0).

U

A numeric N \times D matrix with rows representing an actor's position in a D-dimensional social space.

RE

A numeric N \times 1 matrix representing the actor specific random sociality effect (i.e., s) OR a N \times 2 matrix representing the actor specific random sender and receiver effects (i.e., s and r, respectively).

precision_R_effects

The specific precision_R_effects used to simulate RE.

model

A character string representing the specific model used to simulate the network.

Examples


mus <- matrix(c(-1,-1,1,-1,1,1), 
              nrow = 3,
              ncol = 2, 
              byrow = TRUE)
omegas <- array(c(diag(rep(7,2)),
                  diag(rep(7,2)), 
                  diag(rep(7,2))), 
                  dim = c(2,2,3))
p <- rep(1/3, 3)
beta0 <- 1.0
JANE::sim_A(N = 100L, 
            model = "NDH",
            mus = mus, 
            omegas = omegas, 
            p = p, 
            beta0 = beta0, 
            remove_isolates = TRUE)


[Package JANE version 0.2.1 Index]