-
Notifications
You must be signed in to change notification settings - Fork 97
Review Request: Stollmeier #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for your submission, we'll assign an editor soon and will proceed with review. |
@Fjanks By the way, do you have a link to a free PDF of the original article ? |
@ctb Could you edit this submission ? |
@Fjanks And I forgot, can you add your ORCID id ? (you should be able to update your first post) |
@rougier |
@rougier I can edit! |
I would happily act as a reviewer for this submission. |
@Fjanks perfect ! |
@AdamRTomkins thanks ! |
@AdamRTomkins please go ahead! I'm looking for another reviewer now, but there's no reason not to start :). For your reference, here are reviewer guidelines: https://github.com/ReScience/ReScience/blob/master/reviewer-guidelines.md |
@anyaevostinar has also agreed to review! @rougier do you need to do anything to give her perms? her ORCID is orcid.org/0000-0001-7216-5283 - thanks, Anya! |
@ctb @anyaevostinar Simplest would be to register as reviewer here @ctb Don't forget to update PR labels and information at the start of the htread (reviewer names and date) |
I'm having some problems getting "Preparations" to run. I assumed I should enter:
|
That looks like the compilation of the cython code fails. Did you check whether cython in general works? You could test it with the examples on http://docs.cython.org/en/latest/src/quickstart/build.html. By the way, I saw in the error message that you use python 3. That reminded me that I totally forgot to make the code compatible with python 3, which I did some minutes ago. |
@Fjanks I have gone through the hello world example and the jupyter example in the cython docs and that all works as expected. I've tried again with Python3 and am getting the same:
|
@anyaevostinar My 2 cents but do you have |
If the examples in the cython docs work then I guess that pyximport
If that fails maybe it helps to reinstall pyximport. As an alternative, you can do it completely without pyximport, the algorithms.pyx can also be compiled with distutils in |
@rougier Yes, though here is the full version info: @Fjanks That pyximport code works correctly with only 'unused function' warnings. I'll try without pyximport anyway. |
Thanks for pointing at that part of the code! I think you found the problem. |
Just to add. The code looks really good and it is very easy to tweak it, so I tried to simulate complete graphs of 2, 4 and 8 individuals with no cost and no benefit resulting in expected probabilities of fixation 0.5, 0.25, 0.125. It seems that this basic behaviour is correct. Now I am going to wait till @Fjanks commit the change of random number generation. |
There is a more fundamental randomisation issue in your code: the random
graphs you generate are not uniformly distributed. Basically, you start by
generating a spanning tree for your graph, but the tree you get is biased:
the vertices you add in the beginning will get more edges than ones you add
in the end, meaning that the tree will be, so to speak, closer to being a
"star" than it should be.
One way to get a uniform spanning tree is by doing a random walk on a
complete graph starting from a vertex, and record edges that led to
discovery of new (for the walker) vertices. Once all the vertices are
discovered, the recorded edges will be a truly uniform random spanning tree.
…On Fri, Jun 23, 2017 at 2:02 PM, Fjanks ***@***.***> wrote:
Thanks for pointing at that part of the code! I think you found the
problem.
If I use always the same seed, e.g. seeds = [1 for i in xrange(n_graphs)],
I get results that look very much like yours.
I have to read a bit to understand how to generate random number more
reliably.
—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABN8HO8dMn6vyBv8sQWrPP66xSYIVo95ks5sG7dOgaJpZM4MI6iC>
.
|
@dimpase: Yes, the random graphs generated by create_connected_random_graph(N,k) are biased. I decided to use this algorithm because that is how I understand the description of the random graph generation in the supplementary of the original paper. And if I understood it correctly (their description is not very detailed) only results from this method are comparable to the results in the original paper. |
Ok, I did a bit research on the issue with rand(). As KamilSJaron already mentioned, it is well known that random numbers from rand() have low quality, so I should not have chosen it in the first place. However, a small period, autocorrelation or a non-uniform distribution do not explain KamilSJaron's results, and for the effect I assume to be the root of the problem I did not find a reference. So I made a little test: On my system the first number from rand() varies with different seeds, but on the Mac of a colleague the first number from rand() was the same for different seed values. This effect results in one node of the network being more often chosen as the position of the initial cooperator than the other nodes. Consequently, the average values for the fixation probabilities would require much larger numbers of simulations to approach the expected values. I also added the setup.py and updated the compilation instructions. |
It seems that it was indeed problem of non-random seeding. The simulations look way better now. So far I simulated only few replicates of the fixation probabilities for different cost values and the graph already looks very similar to the one presented in paper (with more noise of course, but it seems that it quickly converge to the presented fixation probabilities). Concerning random numbers, I will just have a comment. You have seeded the generator with hardcoded seed values for every possible value of
The good practise is to allow a seed specified in an argument of the simulator's wrapper and if it is not specified you can generate it using time (not optimal either) or non-seedable generators (like I will get back once I will re-simulate at least couple of the different graphs. |
I managed to reproduce results of @Fjanks (the simulations of 100 individuals). Therefore I believe that @Fjanks successfully reproduced simulations presented in the original paper "A reference implementation of A simple rule for the evolution of cooperation on graphs and social networks.". @ctb I suggest to accept the manuscript. My objections were incorporated already. |
Thanks all! it looks like the new decision should be accept based on #27 (comment) - @anyaevostinar any further thoughts? If not, then I will click the magic "accept" button :) |
@ctb Don't forget to update the post at the top with relevant dates (you'll need them later) |
…ed figures in the article.
Today, while working on another project where I use parts of this code, I discovered a bug in the function create_connected_random_graph(). As a consequence, the average degree of the connected random graphs was slightly smaller than expected. |
Accepted! Please lock this PR @rougier as I do not have permissions? |
I locked it but I think you have permission. |
@ctb Can you handle the publication? |
@khinsen Can you handle the publication? |
@rougier This article is accepted, so "handling" just means the technicalities of publication, right? In that case, yes, I can do that. |
Yes, I think @ctb forgot to do it. It might be easier if we do it now. I'll have more time by next week so I can do it either if your prefer. |
EDITOR This submission has been published and will soon appear at http://rescience.github.io/read/ |
AUTHOR
Dear @ReScience/editors,
I request a review for the following replication:
Original article
Title: A simple rule for the evolution of cooperation on graphs and social networks
Author(s): H. Ohtsuki, C. Hauert, E. Lieberman and M.A. Nowak
Journal (or Conference): Nature
Year: 2006
DOI: 10.1038/nature04605
PDF: http://projects.iq.harvard.edu/files/ped/files/nature06a_0.pdf (SI: http://www.nature.com/nature/journal/v441/n7092/extref/nature04605-s1.pdf)
Replication
Author(s): F. Stollmeier (ORCID: 0000-0003-4858-0895)
Repository: https://github.com/Fjanks/ReScience-submission/tree/STOLLMEIER-2017
PDF: https://github.com/Fjanks/ReScience-submission/blob/STOLLMEIER-2017/article/stollmeier-2017.pdf
Keywords: Evolutionary Game Theory, Networks
Language: English
Domain:
Results
EDITOR
February 24, 2017
Reviewer 1 (@AdamRTomkins)February 27, 2017
February 28, 2017
June 15, 2017
April 19, 2017
July 1, 2017
July 4, 2017