Skip to contents

Generates synthetic network data from a static DBN with fixed A and B influence matrices. Useful for testing model recovery and understanding the data-generating process.

Usage

simulate_static_dbn(
  n = 30,
  n_col = n,
  p = 2,
  time = 50,
  sigma2 = 0.5,
  tau2 = 0.1,
  K = 5,
  return_truth = TRUE,
  seed = NULL,
  symmetric = FALSE
)

Arguments

n

Number of actors (senders). For bipartite networks, this is the number of senders.

n_col

Number of receivers (default: same as n for unipartite)

p

Number of relation types (default: 2)

time

Number of time periods to simulate

sigma2

Process noise variance. Larger values produce noisier networks.

tau2

Prior variance for A and B deviations from the identity matrix. Larger values produce stronger cross-actor influence.

K

Number of ordinal categories for the observed data (default: 5). The continuous latent values are discretized into 1 through K.

return_truth

If TRUE (default), include the true parameters in a $truth sub-list for validation.

seed

Random seed for reproducibility

symmetric

If TRUE, set B = A for symmetric/undirected networks.

Value

A list containing:

Y

Observed ordinal data array [n_row, n_col, p, time]

Z

Continuous latent values (use with family = "gaussian")

Theta

True latent network state at each time point

A

True sender influence matrix

B

True receiver influence matrix

M

True baseline mean array [n_row, n_col, p]

sigma2, tau2, K

True parameter values used in simulation

See also

dbn() for model fitting, simulate_dynamic_dbn() for time-varying version, simulate_test_data() for quick test data

Examples

sim <- simulate_static_dbn(n = 8, time = 5, seed = 42)
dim(sim$Y)    # observed ordinal data
#> [1] 8 8 2 5
dim(sim$Z)    # continuous latent (for gaussian family)
#> [1] 8 8 2 5
dim(sim$A)    # true sender influence matrix
#> [1] 8 8