With larger, more complex network structures with epidemic models, it is
generally useful to reduce the memory footprint of the fitted TERGM model
object (estimated with netest). This utility function removes
all but the bare essentials needed for simulating a network model with
netsim.
Specifically, the function removes:
environment(object$constraints)
environment(object$coef.diss$dissolution)
environment(object$formation)
When edapprox = TRUE in the netest call, also
removes environment(object$formula).
When edapprox = FALSE, also removes all but formation and
dissolution from environment(object$formula), as well as
environment(environment(object$formula)$formation) and
environment(environment(object$formula)$dissolution).
If as.networkLite = TRUE, converts object$newnetwork to a
networkLite object. If keep.fit = FALSE, removes fit (if
present) from object.
For the output to be usable in netsim simulation, there should
not be substitutions in the formulas, other than formation and
dissolution in object$formula when edapprox = FALSE.