slpm_nga {SparseLPM} | R Documentation |
slpm_nga
Description
Runs a Natural Gradient Ascent algorithm to maximise the variational objective for a Sparse LPM.
Usage
slpm_nga(X, K, var_pars_init, hyper_pars = NULL, tol = 0.01, n_iter_max = 100000,
natural_gradient = T, learning_rate_factor_up = 2, learning_rate_factor_down = 2,
verbose = F)
Arguments
X |
Rectangular adjacency matrix with non-negative entries. |
K |
The number of latent dimension of the model. |
var_pars_init |
List of variational parameters to be used as starting point for the optimisation. See Details for more specific indications. |
hyper_pars |
List defining the hyperparameters of the model. The list should contain three vectors of |
tol |
Positive number setting the stop condition: the algorithm stops if one entire iteration yields an increase in the objective function smaller than this value. |
n_iter_max |
Maximum number of iterations the algorithm should be run for. |
natural_gradient |
|
learning_rate_factor_up |
Before any natural gradient ascent update, the current step size is multiplied by this number to ensure that the algorithms tries new solutions which are relatively far from the current one. |
learning_rate_factor_down |
During any natural gradient ascent update, if a certain step size leads to a decrease in the objective function, then the step is divided by this number repeatedly until an increase is ensured. |
verbose |
|
Details
var_pars
and var_pars_init
are lists with components:
- alpha_u_tilde
M*K
matrix representing the Gaussian means for the latent positions of senders.- alpha_v_tilde
N*K
matrix representing the Gaussian means for the latent positions of receivers.- beta_u_tilde
M*K
matrix representing the Gaussian variances for the latent positions of senders.- beta_v_tilde
N*K
matrix representing the Gaussian variances for the latent positions of receivers.- lambda_tilde
M*N*K
array with entries corresponding to the posterior probabilities of assigning each edge to each latent dimension.- delta_tilde
Vector of
K
positive values representing the Dirichlet parameters generating the mixing proportions.- a_tilde
Vector of
K
positive values corresponding to the shapes of the variational Gamma distribution on the precisions.- b_tilde
Vector of
K
positive values corresponding to the rates of the variational Gamma distribution on the precisions.
Value
A list with components:
computing_time |
Number of seconds required for the optimisation process. |
var_pars |
List containing the optimal values for the variational parameters. |
learning_rates_u |
Current step-size for the update of the variational parameters of each Gaussian distribution on the latent positions of senders. |
learning_rates_v |
Current step-size for the update of the variational parameters of each Gaussian distribution on the latent positions of receivers. |
elbo_values |
Values of the variational objective at the end of each of the iterations. |
elbo_init |
Value of the variational objective for the initial configuration. |
elbo_final |
Value of the variational objective for the optimal solution found. |
References
Rastelli, R. (2018) "The Sparse Latent Position Model for nonnegative weighted networks", https://arxiv.org/abs/1808.09262
Examples
set.seed(12345)
network <- slpm_gen(M = 15, N = 10, K = 2)
K <- 6
var_pars_init <- slpm_init(X = network$adj, K = K)
res <- slpm_nga(X = network$adj, K = K, var_pars_init = var_pars_init)