rdpg_snapshot_bs {fase}R Documentation

Simulate binary edge networks with B-spline latent processes

Description

rdpg_snapshot_bs simulates a realization of a functional network with Bernoulli edges, according to an inner product latent process model. The latent processes are generated from a BB-spline basis with equally spaced knots.

Usage

rdpg_snapshot_bs(n,d,m,self_loops=TRUE,
                 spline_design,process_options)

Arguments

n

A positive integer, the number of nodes.

d

A positive integer, the number of latent space dimensions.

m

A positive integer, the number of snapshots. If this argument is not specified, it is determined from the snapshot index vector spline_design$x_vec.

self_loops

A Boolean, if FALSE, all diagonal adjacency matrix entries are set to zero. Defaults to TRUE.

spline_design

A list, describing the BB-spline design:

q

A positive integer, the dimension of the BB-spline basis. Must be at least 4 and at most m.

x_vec

A vector, the snapshot evaluation indices for the data. Defaults to an equally spaced sequence of length m from 0 to 1.

x_max

A scalar, the maximum of the index space. Defaults to max(spline_design$x_vec).

x_min

A scalar, the minimum of the index space. Defaults to min(spline_design$x_vec).

process_options

A list, containing additional optional arguments:

alpha_coord

A positive scalar, or a vector of length dd. If it is a vector, it corresponds to the Dirichlet parameter of the basis coordinates. If is is a scalar, the basis coordinates have Dirichlet parameter rep(alpha_coord,d). Defaults to 0.1.

density

A scalar between 0 and 1, which controls the approximate overall edge density of the resulting multiplex matrix. Defaults to 1/d. If specified larger than 1/d, this argument is reset to 1/d and a warning is given.

Details

The spline design of the functional network data (snapshot indices, basis dimension) is generated using the information provided in spline_design, producing a qq-dimensional cubic BB-spline basis with equally spaced knots.

The (q×dq \times d) latent process basis coordinates WiW_i for each node are generated as qq iid Dirichlet random variables with dd-dimensional parameter process_options$alpha_coord or rep(process_options$alpha_coord,d) depending on the dimension of process_options$alpha_coord. Roughly, smaller values of process_options$alpha_coord will tend to generate latent positions closer to the corners of the simplex.

WiW_i is then rescaled so the overall network density is approximately process_options$density, and the Euclidean norm of zi(x)z_i(x) never exceeds 1. If the density requested is too high, it will revert to the maximum density under this model (1/d1/d). Then each latent process is given by

zi(x)=WiTB(x).z_{i}(x) = W_i^{T}B(x).

The n×nn \times n symmetric adjacency matrix for snapshot k=1,...,mk=1,...,m has independent Bernoulli entries with mean

E([Ak]ij)=zi(xk)Tzj(xk)E([A_k]_{ij}) = z_i(x_k)^{T}z_j(x_k)

for iji \leq j (or i<ji < j with no self loops).

Value

A list is returned with the realizations of the basis coordinates, spline design, and the multiplex network snapshots:

A

An array of dimension n×n×mn \times n \times m, the realized functional network data.

W

An array of dimension n×q×dn \times q \times d, the realized basis coordinates.

spline_design

A list, describing the BB-spline design:

type

The string 'bs'.

q

A positive integer, the dimension of the BB-spline basis.

x_vec

A vector, the snapshot evaluation indices for the data.

x_max

A scalar, the maximum of the index space.

x_min

A scalar, the minimum of the index space.

spline_matrix

An m×qm \times q matrix, the B-spline basis evaluated at the snapshot indices.

Examples


# Bernoulli edge data with B-spline latent processes, Dirichlet coordinates
# NOTE: for B-splines, x_max and x_min do not need to coincide with the
# max and min snapshot times.

data <- rdpg_snapshot_bs(n=100,d=10,
                         self_loops=FALSE,
                         spline_design=list(q=8,
                                            x_vec=seq(-1,1,length.out=50),
                                            x_min=-1.1,x_max=1.1),
                         process_options=list(alpha_coord=.2,
                         density=1/10))


[Package fase version 1.0.1 Index]