Exponential random graph models (ERGMs)

Dear all,

I would like to ask for your help. Is there any function within igraph to implement the ergm model in python. If not, is there any way to do this?

There isn’t.

I do not know if there are other packages in Python for sampling from ERG models. You’d have to search for this yourself.

It is certainly not a simple task, and to gain reasonable efficiency, a separate implementation would be needed for each constraint. Even using the R package is fussy and doesn’t always converge easily.

Because of these issues, ERG models are unlikely to be ever included in igraph (except perhaps very specific constraints). This is the domain of specialized packages.

@Peter , I’m not aware of any actively developed ERGM implementation in Python. Still, you may try using R package ergm, part of Statnet (https://statnet.org/), using e.g. Rpy2 or other interfaces (c.f. python - How do Rpy2, pyrserve and PypeR compare? - Stack Overflow). Bear in mind what @szhorvat said – from numerical standpoint it is not your everyday OLS regression…

Dear Szhorvat,

Thanks so much for your kind reply and suggestion.

Best regards,

Peter

Dear mbojan,

Well received with your helpful reply. I would like to use Rpy2 for my projects. Thanks again.

Best regards,

Peter