Description Usage Arguments Details Value Examples
Evaluates the expected adjacency matrix for a fitted SparseLPM.
1 | slpm_gof(var_pars)
|
var_pars |
A list defining the variational parameters of the model. See Details for more specific indications. |
The list var_pars
must contain:
M*K
matrix denoting the Gaussian means for senders.
N*K
matrix denoting the Gaussian means for receivers.
M*K
matrix denoting the Gaussian variances for senders.
N*K
matrix denoting the Gaussian variances for receivers.
M*N*K
array representing the soft clustering for the edges. This may be interpreted as the posterior probability that edge ij
is determined by the k
-th latent dimension.
K
dimensional vector containing the variational parameters for the mixing proportions. This may be interpreted as the importance of each of the latent dimensions.
K
dimensional vector containing the shapes of the variational Gamma distributions associated to the precisions.
K
dimensional vector containing the rates of the variational Gamma distributions associated to the precisions.
Note that this function only uses the alphas and the lambdas. Also, to avoid numerical instability, the lambdas are automatically pre-transformed into a hard partitioning using a Maximum A Posterior method.
An adjacency matrix with non-negative entries.
1 2 3 4 5 6 7 8 9 10 | set.seed(12345)
M <- N <- 10
K <- 2
fitted_var_pars <- list()
fitted_var_pars$alpha_u_tilde = matrix(rnorm(M*K),M,K)
fitted_var_pars$alpha_v_tilde = matrix(rnorm(N*K),N,K)
fitted_var_pars$lambda_tilde = array(NA,c(M,N,K))
fitted_var_pars$lambda_tilde[,,1] = matrix(runif(M*N),M,N)
fitted_var_pars$lambda_tilde[,,2] = 1-fitted_var_pars$lambda_tilde[,,1]
expected_adj <- slpm_gof(fitted_var_pars)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.