Distribution while fitting weighted SBM

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Distribution while fitting weighted SBM

kicasta
Hi Tiago,

I have a short question regarding your implementation of the weighted SBM
described here:

https://arxiv.org/pdf/1708.01432.pdf
https://graph-tool.skewed.de/static/doc/demos/inference/inference.html#edge-weights-and-covariates

Does your implementation fit one distribution to sample edges per block
combination or one global distribution? And how to retrieve the parameters
of the distribution from a fitted model?

We were trying to fit a model similar to the SBM in graspy used for
simulation:

https://graspy.neurodata.io/tutorials/simulations/sbm.html

There you can choose one distribution per block combination for simulation.
I was figuring that this should also be possible when fitting the model.
Thanks for your help in advance!



--
Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool
Reply | Threaded
Open this post in threaded view
|

Re: Distribution while fitting weighted SBM

Tiago Peixoto
Administrator
Am 04.06.20 um 10:09 schrieb kicasta:

> Hi Tiago,
>
> I have a short question regarding your implementation of the weighted SBM
> described here:
>
> https://arxiv.org/pdf/1708.01432.pdf
> https://graph-tool.skewed.de/static/doc/demos/inference/inference.html#edge-weights-and-covariates
>
> Does your implementation fit one distribution to sample edges per block
> combination or one global distribution?
One distribution per pair of groups (otherwise the covariates and the
group structure would be completely decoupled, which would be the same
as ignoring them altogether.)

> And how to retrieve the parameters
> of the distribution from a fitted model?

The distributions are "microcanonical", i.e. the parameters are
quantities like the total sum of covariates, which is not allowed to
fluctuate. For example the "exponential" distribution for nonegative
covariates assumes that they are uniformly distributed among all
possibilities that have the exact same sum. This means that the
parameters need not be explicitly encoded. So, in this case, if you want
to extract the parameter of the distribution, you just get the sum of
covariates between any two pairs of groups.

> We were trying to fit a model similar to the SBM in graspy used for
> simulation:
>
> https://graspy.neurodata.io/tutorials/simulations/sbm.html
>
> There you can choose one distribution per block combination for simulation.
> I was figuring that this should also be possible when fitting the model.

Yes, this exactly what is described in the above paper, and what is
implemented in graph-tool.

Best,
Tiago

--
Tiago de Paula Peixoto <[hidden email]>


_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool

signature.asc (849 bytes) Download Attachment
--
Tiago de Paula Peixoto <tiago@skewed.de>
Reply | Threaded
Open this post in threaded view
|

Re: Distribution while fitting weighted SBM

Dominik Schlechtweg
Hi Tiago,

thanks, this is already quite helpful. Short follow-up:

Our final aim is to sample from the fitted model, also according to the inferred edge covariate distributions between groups. Is this somehow possible with graph-tool? (Up to now we were not able to do this.)

Would it, in any case, be valid to retrieve the empirical distributions between each group from the fitted model and to fit a non-microcanonical version of the distributions (like binomial) to the covariates for each group combination, which could then be used to sample a weighted SBM e.g. with graspy? Or do you see a more direct way?

Best,
Dominik

> On Jun 4, 2020, at 11:37, Tiago de Paula Peixoto <[hidden email] <mailto:[hidden email]>> wrote:
>
>     Am 04.06.20 um 10:09 schrieb kicasta:
>
>         Hi Tiago,
>
>         I have a short question regarding your implementation of the weighted SBM
>         described here:
>
>         https://arxiv.org/pdf/1708.01432.pdf
>         https://graph-tool.skewed.de/static/doc/demos/inference/inference.html#edge-weights-and-covariates
>
>         Does your implementation fit one distribution to sample edges per block
>         combination or one global distribution?
>
>
>     One distribution per pair of groups (otherwise the covariates and the
>     group structure would be completely decoupled, which would be the same
>     as ignoring them altogether.)
>
>         And how to retrieve the parameters
>         of the distribution from a fitted model?
>
>
>     The distributions are "microcanonical", i.e. the parameters are
>     quantities like the total sum of covariates, which is not allowed to
>     fluctuate. For example the "exponential" distribution for nonegative
>     covariates assumes that they are uniformly distributed among all
>     possibilities that have the exact same sum. This means that the
>     parameters need not be explicitly encoded. So, in this case, if you want
>     to extract the parameter of the distribution, you just get the sum of
>     covariates between any two pairs of groups.
>
>         We were trying to fit a model similar to the SBM in graspy used for
>         simulation:
>
>         https://graspy.neurodata.io/tutorials/simulations/sbm.html
>
>         There you can choose one distribution per block combination for simulation.
>         I was figuring that this should also be possible when fitting the model.
>
>
>     Yes, this exactly what is described in the above paper, and what is
>     implemented in graph-tool.
>
>     Best,
>     Tiago
>

_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool

0x67336E43281F46CA.asc (693 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Distribution while fitting weighted SBM

Tiago Peixoto
Administrator
Am 04.06.20 um 21:05 schrieb Dominik Schlechtweg:
> Hi Tiago,
>
> thanks, this is already quite helpful. Short follow-up:
>
> Our final aim is to sample from the fitted model, also according to the inferred edge covariate distributions between groups. Is this somehow possible with graph-tool? (Up to now we were not able to do this.)

Not directly, currently graph-tool does not have a function to sample
from the weighted SBM.

If you open a ticket in the website with the feature requiest, I will
implement this when I find the time.

> Would it, in any case, be valid to retrieve the empirical distributions between each group from the fitted model and to fit a non-microcanonical version of the distributions (like binomial) to the covariates for each group combination, which could then be used to sample a weighted SBM e.g. with graspy? Or do you see a more direct way?

It would be valid as a reasonable approximation, since the models become
equivalent as the number of edges becomes sufficiently large.

Best,
Tiago

--
Tiago de Paula Peixoto <[hidden email]>


_______________________________________________
graph-tool mailing list
[hidden email]
https://lists.skewed.de/mailman/listinfo/graph-tool

signature.asc (849 bytes) Download Attachment
--
Tiago de Paula Peixoto <tiago@skewed.de>