leifeld / btergm

Temporal Exponential Random Graph Models by Bootstrapped Pseudolikelihood
16 stars 10 forks source link

Support constraints= argument in btergm() and related functions. #25

Open krivit opened 3 years ago

krivit commented 3 years ago

Right now, btergm uses ergm.design(), which is a very crude function, because it only recognises constraints induced by NA. Using the ergm_conlist API might enable it to handle others. For this and other reasons, the use of ergm.design() is discouraged and I hope to deprecate it once no one is using it anymore.

leifeld commented 2 years ago

Thanks, @krivit. I haven't gotten around to it yet, but would like to follow your advice. If you have any suggestions on how to update it, that would be most helpful. I assume you are referring to this part?

nw <- ergm::ergm.getnetwork(form)
model <- ergm::ergm_model(form, nw, initialfit = TRUE)
Clist.miss <- ergm::ergm.design(nw, verbose = FALSE)
control.ergm$init <- c(rep(NA, length(l$rhs.terms) - 1), 1)
pl <- ergm::ergm.pl(nw,
                    Clist.miss,
                    model,
                    theta.offset = c(rep(FALSE, length(l$rhs.terms) - 1), TRUE),
                    verbose = FALSE,
                    control = control.ergm)
krivit commented 2 years ago

Yes, I think so. I think a good prototype to work off for this might be ergm::ergmMPLE().

Can you remind me:

  1. How does btergm() handle missing dyads?
  2. Does it support specifying sufficient statistics directly (a la target.stats= in ergm())?
  3. Do you (or do you want to) support the %ergmlhs% API?

The reason I ask is that there are varying degrees of sophistication with which one can handle constraints.