Skip to contents

Bootstrap-style analogue of the MCMC gof_plot: draws nsim simulated networks from the fitted ALS model, computes the standard network statistics (sd.rowmean, sd.colmean, dyad.dep, cycle.dep, trans.dep for unipartite; sd.rowmean, sd.colmean, four.cycles for bipartite, replacing the count with weighted four.cycle.dep for Gaussian outcomes) on each replicate, and compares the observed value with the replicates.

Usage

gof_plot.ame_als(fit, nsim = 100, seed = NULL, ...)

Arguments

fit

an ame_als fit.

nsim

integer; number of replicates (default 100).

seed

optional RNG seed.

...

reserved.

Value

A ggplot (or patchwork) object.

Details

A cross-sectional fit gives one histogram per statistic with the observed value overlaid. A longitudinal fit gives, as gof_plot does for an MCMC lame fit, the statistics of every time slice: for each statistic, the observed value in each period against the median and the central 95 percent of the simulated values in that period.

Uses simulate.ame_als for the replicates and is therefore conditional on the fitted estimates: the noise is resampled, but mu, beta, a, b, U, V are held fixed. The MCMC gof_plot.ame also averages over posterior movement in those parameters.

Examples

# \donttest{
set.seed(1)
n <- 12
Y <- matrix(rnorm(n * n), n, n); diag(Y) <- NA
fit <- ame_als(Y, R = 1, family = "normal", verbose = FALSE)
gof_plot(fit, nsim = 20, seed = 1)

# }