multiness_sim simulates a realization of the Gaussian
or logistic MultiNeSS model with Gaussian latent positions.
multiness_sim(n,m,d1,d2,model,sigma,self_loops,opts)A list is returned with the realizations of the latent dimensions and the multiplex network:
An array of dimension \(n \times n \times m\), the realized multiplex network.
A matrix of dimension \(n \times d1\), the realized common
latent positions. If d1=0, returns NULL.
An array of dimension \(n \times d2 \times m\), the realized
individual latent positions. If d2=0, returns NULL.
If specified, an array of dimension \(n \times n \times m\), the expected multiplex network.
If specified and model='logistic', the overall edge density.
A positive integer, the number of nodes.
A positive integer, the number of layers.
A non-negative integer, the number of common latent dimensions.
A non-negative integer, the number of individual latent dimensions.
A string which provides choice of model,
either 'gaussian' or 'logistic'. Defaults to 'gaussian'.
A positive scalar or numeric vector of length m,
the entry-wise standard deviation for the Gaussian noise for all layers
(if a scalar) or for each layer (if a vector). Ignored under the logistic
model. Defaults to 1.
A Boolean, if FALSE, all diagonal entries are set
to zero. Defaults to TRUE.
A list, containing additional optional arguments:
A positive scalar, for the logistic model only, a shift
subtracted from the log-odds of each edge to control overall edge density. Defaults to 0.
A string, valid choices are 'all' or
'U_only' for the Gaussian model; 'all' for the logistic
model. If 'all', \(V\) and \(U_k\); and \(U_k\) and \(U_l\)
(for \(k \neq l\)) have expected canonical correlation approximately equal to
|\(rho\)| (see rho).
If 'U_only', \(U_k\) and \(U_l\) (for \(k \neq l\)) have expected
canonical correlation approximately equal to |\(rho\)| (see rho).
Defaults to 'all'.
A positive scalar, the standard deviation of the entries of
the latent position matrices \(V\) and \(U_k\). Defaults to 1.
A Boolean, if TRUE and model='logistic', the function will return an array containing
the overall edge density. Defaults to FALSE.
A Boolean, if TRUE, the function will return an array containing
the expected adjacency matrices. Defaults to FALSE.
A positive scalar in the interval (-1,1), controls the expected canonical
correlation between latent position matrices (see dependence_type).
Defaults to 0.
The common and individual latent positions, \(V\) and \(U_k\)
respectively, are generated as
Gaussian random variables with standard deviation opts$gamma, and
dependence controlled by the optional
arguments opts$dependence_type and opts$rho.
Under the Gaussian model, the \(n \times n\) adjacency matrix for layer \(k=1,...,m\)
has independent Gaussian entries with standard deviation sigma and
mean given by
$$E(A_k) = VV^{T} + U_kU_k^{T}.$$
Under the logistic model, the \(n \times n\) adjacency matrix for layer \(k=1,...,m\)
has independent Bernoulli entries with mean given by
$$E(A_k) = g(VV^{T} + U_kU_k^{T}),$$
where \(g\) denotes the element-wise application of the inverse logistic
link (expit) function. Under both models, self_loops provides
an option to set the diagonal entries of the adjacency matrices to zero.
# gaussian model, uncorrelated latent positions
data1 <- multiness_sim(n=100,m=4,d1=2,d2=2,
model="gaussian")
# logistic model, correlated latent positions
data2 <- multiness_sim(n=100,m=4,d1=2,d2=2,
model="logistic",
self_loops=FALSE,
opts=list(dependence_type="all",rho=.3,return_density=TRUE))
Run the code above in your browser using DataLab