Creates a two-dimensional visualization of the multiplicative effects (U and V) from an AME or LAME model. These latent factors capture network structure beyond what is explained by covariates and additive effects, including clustering, transitivity, and other higher-order dependencies.
uv_plot(
fit = NULL,
Y = NULL,
U = NULL,
V = NULL,
row.names = NULL,
col.names = NULL,
layout = c("circle", "biplot"),
vscale = 0.8,
show.edges = FALSE,
edge.alpha = 0.3,
node.size = "magnitude",
label.nodes = TRUE,
label.size = 3,
show.usernames = NULL,
sender.color = "darkred",
receiver.color = "darkblue",
colors = NULL,
title = NULL,
time_point = NULL,
plot_type = c("snapshot", "trajectory", "faceted"),
show_arrows = TRUE,
highlight = NULL
)A ggplot2 object that can be further customized
An object of class "ame" or "lame" containing multiplicative effects, or a network matrix Y if U and V are provided separately
Network matrix (only needed if fit is not provided)
Matrix of sender latent factors (extracted from fit if not provided)
Matrix of receiver latent factors (extracted from fit if not provided)
Names for row nodes (defaults to rownames of Y or U)
Names for column nodes (defaults to colnames of Y or V)
Character string specifying layout: "circle" (default) or "biplot"
Scaling factor for V positions relative to U (default 0.8)
Logical; if TRUE, show network edges (default FALSE)
Transparency for edges (default 0.3)
Size of nodes, or "degree" to scale by degree (default 3)
Logical; if TRUE, show node labels (default TRUE)
Size of node labels (default 3)
Integer: number of top-degree nodes to label, or NULL for default behavior
Color for sender/row nodes (default "darkred")
Color for receiver/column nodes (default "darkblue")
Optional vector of colors for nodes (e.g., for communities)
Optional title for the plot
For dynamic UV, which time point to plot (default: last). Can be numeric index or "average" for time-averaged positions
For dynamic UV: "snapshot" (single time), "trajectory" (evolution), "faceted" (grid of time points). For static UV, this is ignored.
For trajectory plots, whether to show directional arrows
Optional character vector of actor names to highlight on a
plot_type = "trajectory" plot. Highlighted actors are coloured
with the colour-blind-safe Okabe-Ito palette; all other actors are
rendered in grey at lower alpha. Ignored for static or snapshot plots.
Cassy Dorff, Shahryar Minhas, Tosin Salau
The multiplicative effects in AME models provide a low-rank representation of network structure through latent factors:
Sender-specific latent positions (row factors)
Receiver-specific latent positions (column factors)
Captures dyad-specific effects beyond additive terms
The visualization can show:
Default layout placing nodes on a circle with latent positions shown as deviations
Shows U and V positions directly in latent space
Optional display of actual network ties
Interpretation:
Nodes close together in latent space tend to have similar connection patterns
The distance between sender position (U) and receiver position (V) relates to the likelihood of a tie
Clustering in the latent space indicates community structure
# \donttest{
# Fit an AME model with multiplicative effects
data(YX_nrm)
fit <- ame(YX_nrm$Y, Xdyad = YX_nrm$X, R = 2,
nscan = 100, burn = 10, odens = 1, verbose = FALSE)
# Basic visualization
uv_plot(fit)
# Use biplot layout
uv_plot(fit, layout = "biplot")
# }
Run the code above in your browser using DataLab