slpm_gen: slpm_gen

Description Usage Arguments Value Examples

Description

Generates the adjacency matrix adj of a SparseLPM by sampling both the data and model parameters from the posterior distribution.

Usage

1
slpm_gen(M, N, K, hyper_pars = NULL)

Arguments

M

Number of rows of adj.

N

Number of cols of adj.

K

Number of latent dimensions of the SparseLPM.

hyper_pars

A list defining the hyperparameters of the model. If left as NULL all the hyperparameters are initialised to 1. Otherwise, the list should contain three vectors of K positive values denoted delta, a_gamma and b_gamma, respectively.

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

1
2
set.seed(12345)
network <- slpm_gen(M = 10, N = 8, K = 2)

SparseLPM documentation built on May 2, 2019, 3:31 a.m.