leifeld / btergm

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

GOF error #17

Closed PCK1992 closed 4 years ago

PCK1992 commented 4 years ago

Hi, I'm fitting an ergm to a network tried to use the gof function provided in this package. Unfortunately, trying to run the command leaves me with the following error message:


> xergm.common::gof(model0a)

Starting GOF assessment on a single computing core....
Error in adjust(nw.k, nw.j, remove = FALSE, value = 1, returnlabels = TRUE) : 
  At t = 1, there are 103 duplicate target column names.```

Any idea what could cause this behavior?
leifeld commented 4 years ago

It might mean that the first matrix in the list (either the dependent variable or some matrix on the right-hand side of the formula) has duplicate column names. The function tries to adjust the dimensions of all networks to each other if some nodes are missing. To do that, it checks the row and column labels. You could check if that might be the case applying the colnames function to the matrices that go into your model. If that does not help, please feel free to post a working example, which I can use to diagnose the problem.

PCK1992 commented 4 years ago

I think I know what the problem might be:

I am using an external matrix as an edge covariate so basically the ergm formula looks something like this: ergm( net ~ edges ... edgecov(ext_matrix))

with ext_matrix being a square matrix that is not directly stored in the net object. I do not get these errors when I have a network where all information is stored within the network!

leifeld commented 4 years ago

I use external matrices all the time; this cannot be the cause of the problem. Have you tried following my advice above? Can you provide a minimal self-contained example that I can use to look into the problem? Thanks.

leifeld commented 4 years ago

Closing this due to lack of activity. Please feel free to post follow-up questions later.