On 26.04.2018 12:52, Zahra Sheikhbahaee wrote:
> Hi there,
> I am trying to include the edge weights by taking to account an edge covariate matrix for the nested block model inference. Well, Each time I run the code on my data set I get slightly different results both in terms of number of blocks and the nodes in each block.
This is because the inference is made using MCMC, which is a stochastic
algorithm. You have to run it multiple times, and select the result with
largest posterior probability (if you only want a point estimate).
> This is my code:
> state = minimize_nested_blockmodel_dl(
g, state_args=dict(recs=[g.edge_Although it not important for the questions you have raised, it is not very properties["weight"]], rec_types=["discrete- geometric"]))
size(g.edge_properties[" weight"], power=1, log=True),
edge_properties["weight"], 1, 4, power=1, log=True),
useful to post incomplete code. Normally, for troubleshooting purposes, it
is necessary for you to provide a _minimal_ and _self-contained_ program
that anyone could execute and verify the problem you are reporting.
> I appreciate if you explain what your approach would be and how I can run
> graph-tool using the covariance matrix of edges in order to get
> statistically reliable results?
This is covered in detail in the HOWTO:
and also in many papers, e.g.
However, I'm note sure what you mean by "covariance matrix of edges". The
approach in question deals with graphs with edge covariates (a.k.a.
weights). A covariance matrix usually refers to something else.
> Is there also any way to get the full posterior of each node belonging to
> each block?
This is also explained in detail in the HOWTO:
static/doc/demos/inference/ inference.html#sampling-from- the-posterior-distribution
Tiago de Paula Peixoto <email@example.com>
graph-tool mailing list