fase_seq {fase} | R Documentation |
Functional adjacency spectral embedding (sequential algorithm)
Description
fase_seq
fits a functional adjacency spectral embedding to snapshots
of (undirected) functional network data, with each
of the latent dimensions fit sequentially. The latent processes are fit
in a spline basis specified by the user, with additional options for
ridge penalization.
Usage
fase_seq(A,d,self_loops,spline_design,lambda,optim_options,output_options)
Arguments
A |
An |
d |
A positive integer, the number of latent space dimensions of the functional embedding. |
self_loops |
A Boolean, if |
spline_design |
A list, containing the spline design information.
For fitting with a
For fitting with a smoothing spline design:
|
lambda |
A positive scalar, the scale factor for the generalized ridge
penalty (see Details). Defaults to |
optim_options |
A list, containing additional optional arguments controlling the gradient descent algorithm.
|
output_options |
A list, containing additional optional arguments controlling
the output of
|
Details
Note that fase_seq
is a wrapper for fase
. When ,
fase_seq
coincides with fase
.
fase_seq
finds a functional adjacency spectral embedding of an
array
of
symmetric adjacency matrices on a common set of nodes, where
each
slice is associated to a scalar index
for
.
Embedding requires the specification of a latent space dimension
and spline design information (with the argument
spline_design
).
fase_seq
can fit latent processes using either a cubic -spline
basis with
equally spaced knots, or a natural cubic spline basis with a second
derivative (generalized ridge) smoothing penalty: a smoothing spline.
To fit with a
-spline design (
spline_design$type = 'bs'
),
one must minimally provide a basis
dimension of at least
4
and at most .
When fitting with a smoothing spline design, the generalized ridge
penalty is scaled by
, where
is specified by the argument
lambda
.
see MacDonald et al., (2022+),
Appendix E for more details.
lambda
can also be used to introduce a ridge penalty on the
basis coordinates when fitting with -splines.
Fitting minimizes a least squares loss,
using gradient descent (Algorithm 1) on the basis coordinates
of each component process
Additional options for the fitting algorithm, including initialization,
can be specified by the argument optim_options
.
For more details on the fitting and initialization algorithms, see
MacDonald et al., (2022+),
Section 3.
By default, fase_seq
will return estimates of the latent processes
evaluated at the snapshot indices as an array, after
performing a Procrustes alignment of the consecutive snapshots.
This extra alignment step can be skipped.
fase_seq
will also return the spline design information used to fit the
embedding, convergence information for gradient descent, and (if specified)
the basis coordinates.
When fitting with -splines,
fase_seq
can return a
network generalized cross validation criterion, described in
MacDonald et al., (2022+),
Section 3.3. This criterion can be minimized to choose appropriate values
for and
.
Value
A list is returned with the functional adjacency spectral embedding, the spline design information, and some additional optimization output:
Z |
An |
W |
For |
spline_design |
A list, describing the spline design:
|
ngcv |
A scalar, the network generalized cross validation criterion
(see Details). Only returned for |
K |
A positive integer, the number of iterations run in gradient descent. |
converged |
An integer convergence code, |
Examples
# Gaussian edge data with sinusoidal latent processes
set.seed(1)
data <- gaussian_snapshot_ss(n=50,d=2,
x_vec=seq(0,1,length.out=50),
self_loops=FALSE,sigma_edge=4)
# fase fit with B-spline design
fit_bs <- fase_seq(data$A,d=2,self_loops=FALSE,
spline_design=list(type='bs',q=9,x_vec=data$spline_design$x_vec),
optim_options=list(eps=1e-4,K_max=40),
output_options=list(return_coords=TRUE))
# fase fit with smoothing spline design
fit_ss <- fase_seq(data$A,d=2,self_loops=FALSE,
spline_design=list(type='ss',x_vec=data$spline_design$x_vec),
lambda=.5,
optim_options=list(eta=1e-4,K_max=40,verbose=FALSE))
#NOTE: both models fit with small optim_options$K_max=40 for demonstration