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 |

The list `var_pars`

must contain:

- alpha_u_tilde
`M*K`

matrix denoting the Gaussian means for senders.- alpha_v_tilde
`N*K`

matrix denoting the Gaussian means for receivers.- beta_u_tilde
`M*K`

matrix denoting the Gaussian variances for senders.- beta_v_tilde
`N*K`

matrix denoting the Gaussian variances for receivers.- lambda_tilde
`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.- delta_tilde
`K`

dimensional vector containing the variational parameters for the mixing proportions. This may be interpreted as the importance of each of the latent dimensions.- a_tilde
`K`

dimensional vector containing the shapes of the variational Gamma distributions associated to the precisions.- b_tilde
`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)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.