View source: R/multiness_sim.R
multiness_sim | R Documentation |
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)
n |
A positive integer, the number of nodes. |
m |
A positive integer, the number of layers. |
d1 |
A non-negative integer, the number of common latent dimensions. |
d2 |
A non-negative integer, the number of individual latent dimensions. |
model |
A string which provides choice of model,
either |
sigma |
A positive scalar or numeric vector of length |
self_loops |
A Boolean, if |
opts |
A list, containing additional optional arguments:
|
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.
A list is returned with the realizations of the latent dimensions and the multiplex network:
A |
An array of dimension n \times n \times m, the realized multiplex network. |
V |
A matrix of dimension n \times d1, the realized common
latent positions. If |
U |
An array of dimension n \times d2 \times m, the realized
individual latent positions. If |
P |
If specified, an array of dimension n \times n \times m, the expected multiplex network. |
density |
If specified and |
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.