Description Usage Arguments Details Examples
Refits a TERGM estimated with netest
using the edges
dissolution approximation that had residual biased estimates.
1 2 3 4 5 6 7 8 9 10 11 | netest_refit_abc(
est,
nsims,
ncores,
nsteps,
coefs.vec,
targets.vec,
prior.min = 0,
prior.max = 0,
p_acc_min = 0.1
)
|
est |
An object of class |
nsims |
Number of simulations per sequential ABC wave (more = fewer waves required for convergence). |
ncores |
Number of cores for each wave of simulations. |
nsteps |
Number of time steps to simulate the TERGM for each refitting. |
coefs.vec |
Integer vector of coefficient position to refit. Implicit default is the full coefficient vector, but use this to subset fitting to selected coefficients. |
targets.vec |
Integer vector of target statistic position to fit to. Implicit default is the full target stats vector, but use this to subset fitting to selected targets. |
prior.min |
Absolute lower bound of adjustment to be made across all model coefficients. |
prior.max |
Absolute upper bound of adjustment to be made across all model coefficients. |
p_acc_min |
Convergence threshold for ABC waves, as a proportion of simulations accepted (range from 0 to 1, with lower = greater precision). |
Fitting an TERGM in netest
can be accelerated with the
edges-dissolution approximation method (edapprox = TRUE
), but this
sometimes results in bias (poor fit to the target statistics) when the mean
network degree is high, mean duration is short, or other combinations. All of
this poor fit is revealed with model diagnostics in netdx
. If
the approximation method does not work, then the immediate next step is to
try fitting a full TERGM without the approximation (edapprox = FALSE
).
This is often successful must has challenges with larger and more complex
network models, particularly those with longer durations. Therefore, this
function provides an alternative approach using approximate Bayesian
computation (ABC) methods. This function simply wraps a commonly used
sequential ABC approach and does the additional coefficient adjustment
automatically. It may not work for all models, and there is no guarantee of
model convergence or even improvement from the original fit; one should
evaluate that fit with an additional round of model diagnostics after the
ABC algorithm completes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Not run:
# Original fit with edges dissolution approximation: High mean degree and
# short duration often leads to poor performance of the approximation method
nw <- network_initialize(1000)
formation <- ~edges + concurrent
target.stats <- c(1*(1000/2), 250)
coef.diss <- dissolution_coefs(dissolution = ~offset(edges), duration = 10)
est <- netest(nw, formation, target.stats, coef.diss)
# Diagnostics will show bias here
dx <- netdx(est, nsims = 10, nsteps = 300, ncores = 4)
print(dx)
# Refit the model with Bayesian ABC, with uniform prior adjustments applying
# to all model coefficients
est_new <- netest_refit_abc(est, nsims = 10, ncores = 5, nsteps = 300,
prior.min = -0.5, prior.max = 0)
# Raw output from EasyABC
est_new$refit
# Compare old and new coefficient values
est$coef.form
est_new$coef.form
# Rerun diagnostics to evaluate fit (no guarantee that ABC works)
dx_new <- netdx(est_new, nsims = 10, nsteps = 300, ncores = 4)
dx_new
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.