statnet / ergm

Fit, Simulate and Diagnose Exponential-Family Models for Networks
Other
98 stars 37 forks source link

`logLik.ergm` does not pass `basis` to `ergm.bridge.dindstart.llk` #513

Closed chad-klumb closed 1 year ago

chad-klumb commented 1 year ago

Specifically the line

https://github.com/statnet/ergm/blob/20c6c4c18f8803838243a8d08b1c1fa66a50d189/R/logLik.ergm.R#L114

This can lead to issues when basis is passed to ergm, e.g.

require(ergm)
nw <- network(10, directed = FALSE)
e <- ergm(~edges + degree(1), basis = nw)

produces

...
Evaluating log-likelihood at the estimate. Fitting the dyad-independent submodel...
Bridging between the dyad-independent submodel and the full model...
Setting up bridge sampling...
Error in simulate.ergm_model(m, nsim = nsim, seed = seed, coef = coef,  : 
  coef has 3 elements, while the model requires 1 parameters.
chad-klumb commented 1 year ago

turns out there is also a downstream issue with append_rhs.formula, which I will look into now

chad-klumb commented 1 year ago

the append_rhs.formula issue was addressed in 2ad58a772d1eac26dd223fea434b159e1ef55215

statnet/ergm#514 and statnet/tergm#105 should be ready for review now