statnet / ergm.multi

Fit, Simulate and Diagnose Exponential-Family Models for Multiple or Multilayer Networks
Other
14 stars 1 forks source link

"R session aborted" when using gofN() #30

Closed liluqi1991 closed 1 month ago

liluqi1991 commented 1 month ago

Hello, I have been using ergm.multi in my manuscript and a reviewer has requested a diagnostic analysis. However, whenever I employ _Layer()_ to define a multilayer network, the “R Session Aborted” error occurs after executing gofN(). I have noticed that in Krivitsky’s study (2020, https://doi.org/10.1007/s11336-020-09720-7), the goodness-of-fit assessment for the Lazega example was successfully conducted, and it is likely that the model was specified using Layer(). I would greatly appreciate any assistance in solving this issue.

library(ergm.multi)
data(florentine)

# Work:
flo <- Networks(m = flomarriage, b = flobusiness)
fit <- ergm(flo~N(~edges))
gof<-gofN(fit)

# Not work (R session aborted):
flo <- Layer(m = flomarriage, b = flobusiness)
fit <- ergm(flo ~ L(~edges, ~m)+L(~edges, ~b))
gof<-gofN(fit)

image

krivit commented 1 month ago

gofN() is for samples of networks. It doesn't work for multilayer models, nor should it, since layers are generally not independent. Diagnostics for multilayer models are on the roadmap, but it'll be a while yet.

krivit commented 1 month ago

To add to this, the diagnostics for the paper were done using bespoke code, and I haven't had a chance to make it general.

krivit commented 1 month ago

And thank you, @liluqi1991, for flagging this issue.

liluqi1991 commented 1 month ago

And thank you, @liluqi1991, for flagging this issue.

Thank you very much for your reply.