slpm_gen {SparseLPM} | R Documentation |
slpm_gen
Description
Generates the adjacency matrix adj
of a SparseLPM by sampling both the data and model parameters from the posterior distribution.
Usage
slpm_gen(M, N, K, hyper_pars = NULL)
Arguments
M |
Number of rows of |
N |
Number of cols of |
K |
Number of latent dimensions of the SparseLPM. |
hyper_pars |
A list defining the hyperparameters of the model. If left as |
Value
A list with components:
adj |
Generated adjacency matrix. |
U |
Generated latent positions for senders. |
V |
Generated latent positions for receivers. |
lambda |
Latent variables attached to each of the edges, selecting which dimension determines the edge probability. |
gamma |
Vector of the Gaussian precisions associated to the latent dimensions. |
Examples
set.seed(12345)
network <- slpm_gen(M = 10, N = 8, K = 2)