Search code examples
rpoisson

Error when using Poisson family in ERGMM function of latentnet package


I am using the latentnet package from R to run the ergmm function over my network data. For package details, see here.

Normally, the function uses the Bernoulli family and it runs just perfectly fine. However, when I input a weighed variant of the network and try to use the Poisson family (see families.ergmm for the variants) it gives me the following error:

Error in latent.effect.invariances[[x[["model"]][["familyID"]]]] : subscript out of bounds

I call the function by:

W.fit <- ergmm(W ~ euclidean(d=2), family="Poisson", tofit=c("mle"))

I assume that either the familyID is typed in wrong, or the family does not exist? I know that there is a typo in the families.ergmm package (it says Possion instead of Poisson there), but changing that in my code does not make any difference. EDIT: I noticed that it probably hasn't got anything to do with that Poisson is typed in wrongly, but something else (x is out of bounds?).

Google or anything else cannot get me the answer I am looking for, and the error by R is also not really helpful.

Is there anyone in here who knows what the error is?


Solution

  • I solved this problem by leaving out the tofit parameter. It doesn't skip the Markov Chain Monte Carlo procedure then and everything should work as supposed.