-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reoccuring problem with gof-function #19
Comments
Okay, so I have tried a few things now, and it seems that de-installing R and re-installing it, altogether with installing btergm from install_github("leifeld/btergm") does the trick. However, after I close and restart R, the error occurs again when I am running the code and loading btergm from the library. So the problem might be caused by reloading the package with library("btergm") after I closed and restarted R. But I have no idea why this is. Furthermore, the gof-function is also not working with nodefactor. I hope this information is helpful. |
It sounds to me like you keep installing an old version of Alternatively, if you keep running into problems with your local installation, you may want to use RStudio Cloud, where you can install the relevant packages in an online instance of RStudio. I sometimes recommend this to users whose local installation seems to cause problems. |
Closing because no further response. Please feel free to open a new issue if there are still any problems. |
Hello, I experienced a similar problem as Laupheim while using the gof function in btergm. Whatever gof statistics I requested, the gof() function only ever outputs geodesic distances, the FPR/TPR and Modularity (walktrap) statistics. I already de- and reinstalled R (newest release 4.3.2) and reinstalled btergm (packageVersion("btergm") =‘1.10.11’) via install_github("leifeld/btergm"). I would be super grateful for any tips on how to solve this, thank you! Here are 3 requests as examples:
Starting GOF assessment on a single computing core.... Initial dimensions of the network and covariates: Same dimensions but different labels across networks within time steps. All nodes are retained. Number of nodes per time step after adjustment: Dimensions of the network and covariates after adjustment: No 'target' network(s) provided. Using networks on the left-hand side of the model formula as observed networks. Simulating 100 networks from the following formula: ... 6 networks from which simulations are drawn were provided. Skipping statistic for the following reason: Error in 0:(nrow(mat) - 2): Argument der Länge 0 Skipping statistic for the following reason: Error in idegree(0:(nrow(mat) - 1)): konnte Funktion "idegree" nicht finden I then tried a less computationally demanding one just to see how it'd turn out. Starting GOF assessment using parallel processing on 2 cores.... No covariates provided. All networks are conformable. No 'target' network(s) provided. Using networks on the left-hand side of the model formula as observed networks. Simulating 10 networks from the following formula: Simulating 10 networks from the following formula: Simulating 10 networks from the following formula: Simulating 10 networks from the following formula: Simulating 10 networks from the following formula: Simulating 10 networks from the following formula: 6 networks from which simulations are drawn were provided. Skipping statistic for the following reason: Error in 0:(nrow(mat) - 2): Argument der Länge 0 Skipping statistic for the following reason: Error in idegree(0:(nrow(mat) - 1)): konnte Funktion "idegree" nicht finden
Starting GOF assessment using parallel processing on 2 cores.... No covariates provided. All networks are conformable. No 'target' network(s) provided. Using networks on the left-hand side of the model formula as observed networks. Simulating 25 networks from the following formula: Simulating 25 networks from the following formula: Simulating 25 networks from the following formula: Simulating 25 networks from the following formula: Simulating 25 networks from the following formula: Simulating 25 networks from the following formula: 6 networks from which simulations are drawn were provided. Skipping statistic for the following reason: Error in 0:(nrow(mat) - 2): Argument der Länge 0 |
Can you provide a minimal, self-contained, reproducible example? Then I can try to diagnose the problem. Thanks. |
Sorry for having forgotten to report back on this issue. After a day, the gof() function worked for me again so it skipped my mind. Now I want to document my observations and troubleshooting approaches in case anyone else runs into the same problem. For me, the bug kept reoccurrin in the past year. Sometimes btergm::gof() works just fine, sometimes it kept refusing to output specific stats saying it could not find the function for the stat or that some argument had length 0. Mostly, the stats concerned were esp, dsp or degree related. Other stats were outputted reliably, such as triads or prroc. My initial troubleshooting approaches were based on Laupheim's and Philip's suggestions:
Sometimes the problem vanished without doing anything, sometimes it was solved after trying one or all of the approaches outlined, and sometimes nothing seemed to help. Sometimes, just waiting a few days and the problem disappeared by itself, or sometimes simply using another computer works. A few days ago, I noticed the following: If anyone else stumbles upon this issue, I hope the approaches suggested help. Usually, just waiting for a few days helps - though I was never able to find out why. |
A few thoughts on possible reasons and things to try: Have you tried loading the statnet package followed by btergm at the beginning of the script? It could be that loading one of the statnet sub-packages, like network or sna, after btergm masks these functions. Have you been using another package with the same function names? Maybe igraph masks some functions, not sure. In the past, I noticed some weirdness with the version of the ergm package. There was some bug in one of the previous ergm versions, and depending on which version precisely was installed, btergm gof worked or failed. It needs to have the most recent version. If you find out precisely under which conditions it happens or if you can even provide a reliable example, I would be grateful because that would allow me to investigate and fix the problem. Thanks. |
Thank you for your answer. I investigated some more, following your suggestions. A few findings:
Also, this message sometimes appears when trying to use btergm::gof() after having loaded Hmisc (but not always):
OR this:
Hope this helps. |
Hello,
unfortunately the gof-function is not working again. I used the updated version of btergm today. Here is what I got when I runned the script altogether with the data that I have send some days ago for error replication:
Starting GOF assessment on a single computing core....
No 'target' network(s) provided. Using networks on the left-hand side of the model formula as observed networks.
Simulating 50 networks from the following formula:
networks[[1]] ~ edges + mutual + twopath + ctriple + nodeocov("Psychological Safety") + nodeicov("Psychological Safety") + nodeocov("Psychological Empowerment") + nodeicov("Psychological Empowerment") + offset(edgecov(offsmat[[1]]))
Simulating 50 networks from the following formula:
networks[[2]] ~ edges + mutual + twopath + ctriple + nodeocov("Psychological Safety") + nodeicov("Psychological Safety") + nodeocov("Psychological Empowerment") + nodeicov("Psychological Empowerment") + offset(edgecov(offsmat[[2]]))
Simulating 50 networks from the following formula:
networks[[3]] ~ edges + mutual + twopath + ctriple + nodeocov("Psychological Safety") + nodeicov("Psychological Safety") + nodeocov("Psychological Empowerment") + nodeicov("Psychological Empowerment") + offset(edgecov(offsmat[[3]]))
3 networks from which simulations are drawn were provided.
Processing statistic: Triad census
Skipping statistic for the following reason: Error in 0:(nrow(mat) - 2): Argument der Länge 0
Processing statistic: Modularity (fast & greedy)
Processing statistic: Tie prediction
Since I have got a proper output 3 days ago with the same data and code script, I do not think that the problem is caused by either of it.
The text was updated successfully, but these errors were encountered: