Re: [graph-tool] how to improve similarity for Ising model and SIS model

2020-05-12 Thread gege
Hi, prof.Peixoto. I reread the paper and found that the existence of edges
depends on their posterior. So should I delete edges whose posteriors are
less than 0.5 before comparing with the original network? 
I'm also wondering how to calculate the inverse temperature for the food web
network. Is it from the simulation or based on a unique property of the
network? 


sincerely, 
Gege Hou



--
Sent from: 
http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] how to improve similarity for Ising model and SIS model

2020-03-24 Thread Tiago de Paula Peixoto
Am 24.03.20 um 09:12 schrieb gege:
> Hi, professor Peixoto. 
> Please forgive me. Comparing carefully, I am still confused about what is
> the difference between the example in the documentation and the SIS model in
> the paper. I only found that the dolphins network is undirected but the
> open-flight network is directed. So should I deal with directed network in a
> different way?  

No, the procedure is exactly the same for directed and undirected networks.

>> In the example in the documentation the time series is copied to an
>> empty graph, which will be the starting point of the reconstruction.
> 
> Should I copy the time series to the open-flight graph directly as
> following?
> 
> "
> ss = [g.own_property(s) for s in ss]
> rstate = gt.EpidemicsBlockState(g, s=ss, beta = None, r=1e-6,
> global_beta=.2,
> state_args=dict(B=1), nested=False)
> "
> Why couldn't I use an empty graph as a starting point?

Of course you could start with an empty graph, this is precisely what is
done in the example in the documentation. You seemed to have interpreted
my statement as the precise opposite of what it said.

Best,
Tiago

-- 
Tiago de Paula Peixoto 
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] how to improve similarity for Ising model and SIS model

2020-03-24 Thread gege
Hi, professor Peixoto. 
Please forgive me. Comparing carefully, I am still confused about what is
the difference between the example in the documentation and the SIS model in
the paper. I only found that the dolphins network is undirected but the
open-flight network is directed. So should I deal with directed network in a
different way?  

>In the example in the documentation the time series is copied to an
>empty graph, which will be the starting point of the reconstruction.

Should I copy the time series to the open-flight graph directly as
following?

"
ss = [g.own_property(s) for s in ss]
rstate = gt.EpidemicsBlockState(g, s=ss, beta = None, r=1e-6,
global_beta=.2,
state_args=dict(B=1), nested=False)
"
Why couldn't I use an empty graph as a starting point?

Sincerely,
Gege Hou






--
Sent from: 
http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] how to improve similarity for Ising model and SIS model

2020-03-23 Thread Tiago de Paula Peixoto
Am 23.03.20 um 15:25 schrieb gege:
> Dear professor Peixoto, 
> Thank you for reply!
> 
>  The dynamic example in the document sets 100 initial infected points and
> iterates for 10 times simultaneously. So the epidemic process is ongoing on
> a network and time T belongs to [0,9]. Then the time series is copied to a
> same but masked network. Am I correct? 

In the example in the documentation the time series is copied to an
empty graph, which will be the starting point of the reconstruction.

> But I still wonder how to control the
> number of infected events per node. I noted that infected nodes are randomly
> selected. 

This is not controlled explicitly; after you generate the time series
you count the number of times each node flipped, and you average.

> Moreover, Should I set like this for the Ising model?
> "
> for i in range(1000):
> si_state = gt.IsingGlauberState(g, beta=.02)
> s = [si_state.get_state().copy()]
> si_state.iterate_async()
> s.append(si_state.get_state().copy())
> # Each time series should be represented as a single vector-valued
> # vertex property map with the states for each note at each time.
> s = gt.group_vector_property(s)
> ss.append(s)
> " 

Since the Ising reconstruction expects uncorrelated samples, I think
it's best to use only one "time series", i.e.

si_state = gt.IsingGlauberState(g, beta=.02)
ss = [si_state.get_state().copy()]

for i in range(1000):
si_state.iterate_async()
ss.append(si_state.get_state().copy())

ss = gt.group_vector_property(ss)

Best,
Tiago

-- 
Tiago de Paula Peixoto 
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] how to improve similarity for Ising model and SIS model

2020-03-23 Thread gege
Dear professor Peixoto, 
Thank you for reply!

 The dynamic example in the document sets 100 initial infected points and
iterates for 10 times simultaneously. So the epidemic process is ongoing on
a network and time T belongs to [0,9]. Then the time series is copied to a
same but masked network. Am I correct? But I still wonder how to control the
number of infected events per node. I noted that infected nodes are randomly
selected. 

Moreover, Should I set like this for the Ising model?
"
for i in range(1000):
si_state = gt.IsingGlauberState(g, beta=.02)
s = [si_state.get_state().copy()]
si_state.iterate_async()
s.append(si_state.get_state().copy())
# Each time series should be represented as a single vector-valued
# vertex property map with the states for each note at each time.
s = gt.group_vector_property(s)
ss.append(s)
" 

sincerely,
Gege Hou




--
Sent from: 
http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] how to improve similarity for Ising model and SIS model

2020-03-23 Thread Tiago de Paula Peixoto
Am 18.03.20 um 03:38 schrieb gege:
> Hi, everyone! 
> I met a problem when I'm learning how to use graph-tool. I read the paper,
> network reconstruction and community detection from dynamics, and I am
> trying to achieve the same result. When I followed the same settings for
> real networks with synthetic dynamics, their similarities were just about
> 0.2. I have a question about how to control the number of infection events
> per node,a, for the first model and the number of micro-state, M, for the
> second model. The whole process is shown as following.

You just copied the example in the documentation and changed the
network. That's a good start, but I recommend trying to understand what
each part does.

In the SIS example, as the comments clearly state, the generated data
correspond to 100 cascades of length 10.

In the Ising model example you sent, you sample M=1000 microstates.

>  Moreover, I also wonder how to do a nested version for the same network. 

Just don't pass nested=False when you created the reconstruction state.

Best,
Tiago

-- 
Tiago de Paula Peixoto 



signature.asc
Description: OpenPGP digital signature
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool