View source: R/multiness_fit.R
| multiness_fit | R Documentation |
multiness_fit fits the Gaussian or logistic MultiNeSS model
with various options for parameter tuning.
multiness_fit(A,model,self_loops,refit,tuning,tuning_opts,optim_opts)
A |
An n \times n \times m array containing edge entries for an undirected multiplex network on n nodes and m layers. |
model |
A string which provides choice of model,
either |
self_loops |
A Boolean, if |
refit |
A Boolean, if |
tuning |
A string which provides the tuning method, valid options are
|
tuning_opts |
A list, containing additional optional arguments controlling
parameter tuning. The arguments used depends on the choice of tuning method.
If
If
If
|
optim_opts |
A list, containing additional optional arguments controlling the proximal gradient descent algorithm.
|
A MultiNeSS model is fit to an n \times n \times m array A of
symmetric adjacency matrices on a common set of nodes. Fitting
proceeds by convex proximal gradient descent on the entries of
F = VV^{T} and G_k = U_kU_k^{T}, see
MacDonald et al., (2020),
Section 3.2. Additional optional arguments for
the gradient descent routine can be provided in optim_opts.
refit provides an option
to perform an additional refitting step to debias the eigenvalues
of the estimates, see
MacDonald et al., (2020), Section 3.3.
By default, multiness_fit will return estimates of the matrices
F and G_k. optim_opts$return_posns provides an option
to instead return estimates of latent positions V and U_k
based on the adjacency spectral embedding (if such a factorization exists).
Tuning parameters λ and α_k in the nuclear norm penalty
λ ||F||_* + ∑_k λ α_k ||G_k||_*
are either set by the
user (tuning='fixed'), selected adaptively using a
robust estimator of the
entry-wise variance (tuning='adaptive'), or
selected using edge cross-validation (tuning='cv'). For more details
see MacDonald et al., (2020),
Section 3.4. Additional optional arguments for parameter tuning
can be provided in tuning_opts.
A list is returned with the MultiNeSS model estimates, dimensions of the common and individual latent spaces, and some additional optimization output:
F_hat |
An n \times n matrix estimating the common part of the expected
adjacency matrix, F = VV^{T}. If |
G_hat |
A list of length m, the collection of n \times n matrices
estimating the individual part of each adjacency matrix, G_k = U_kU_k^{T}.
If |
V_hat |
A matrix estimating the common latent positions.
Returned if |
U_hat |
A list of length m, the collection of matrices
estimating the individual latent positions.
Returned if |
d1 |
A non-negative integer, the estimated common dimension of the latent space. |
d2 |
An integer vector of length m, the estimated individual dimension of the latent space for each layer. |
K |
A positive integer, the number of iterations run in proximal gradient descent. |
convergence |
An integer convergence code, |
lambda |
A positive scalar, the tuned λ penalty parameter (see Details). |
alpha |
A numeric vector of length m, the tuned α penalty parameters (see Details). |
# gaussian model data
data1 <- multiness_sim(n=100,m=4,d1=2,d2=2,
model="gaussian")
# multiness_fit with fixed tuning
fit1 <- multiness_fit(A=data1$A,
model="gaussian",
self_loops=TRUE,
refit=FALSE,
tuning="fixed",
tuning_opts=list(lambda=40,alpha=1/2),
optim_opts=list(max_rank=20,verbose=TRUE))
# multiness_fit with adaptive tuning
fit2 <- multiness_fit(A=data1$A,
refit=TRUE,
tuning="adaptive",
tuning_opts=list(layer_wise=FALSE),
optim_opts=list(return_posns=TRUE))
# logistic model data
data2 <- multiness_sim(n=100,m=4,d1=2,d2=2,
model="logistic",
self_loops=FALSE)
# multiness_fit with cv tuning
fit3 <- multiness_fit(A=data2$A,
model="logistic",
self_loops=FALSE,
tuning="cv",
tuning_opts=list(N_cv=2,
penalty_const_vec=c(1,2,2.309,3),
verbose_cv=TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.