[statnet_help] Question about Statnet ergm model collapse
陈博川
chenbc20 at mails.tsinghua.edu.cn
Tue Mar 7 04:44:31 PST 2023
Statnet Developer:
Good morning. Thank you so much for your patience to look into my question. I am encountering some questions beyond my capability so I have no choice but to turn to you for help.
I was using ergm model, especially the dependent model, and my original code, which worked well, looked like
"gw1_sup <- ergm(supnet ~ edges + nodefactor("edu") + nodefactor("income") + nodefactor("work") + nodefactor("religious") + nodefactor("gender") + nodecov("age") + edgecov(kin_sup,"kinweight") + gwidegree(.1, T) + gwesp(.1, T) + gwdsp(.1, T), control = control.ergm(MCMC.samplesize = 1e+5, MCMC.burnin = 1e+6, MCMC.interval = 1000, seed = 567), eval.loglik = T, verbose = T) "
but when I turned the categorical variables "edu" and "income" into continuous variables and turn to "nodecov", like
"gw1_sup <- ergm(supnet ~ edges + nodefactor("work") + nodefactor("religious") + nodefactor("gender") + nodecov("edu") + nodecov("income") + nodecov("age") + edgecov(kin_sup,"kinweight") + gwidegree(.1, T) + gwesp(.1, T) + gwdsp(.1, T), control = control.ergm(MCMC.samplesize = 1e+5, MCMC.burnin = 1e+6, MCMC.interval = 1000, seed = 567), eval.loglik = T, verbose = T) "
the model at first run well, but at around 8/9 iteration, it collapsed and report: "Error in T2nullity && verbose : invalid 'x' type in 'x && y'".
I browsed through the internet and some answers said it could be solved by deleting some of the variables, but those variables are important to my research, the only way I can think of is that I could go back to the old way by using nodefatcor for categorical variables.
For a more clear code, you can see the question in github issue: https://github.com/statnet/ergm/issues/519
Thanks for your time and kindness!!! Best regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman13.u.washington.edu/pipermail/statnet_help/attachments/20230307/f14d6e37/attachment.html>
More information about the statnet_help
mailing list