Coder Social home page Coder Social logo

mcmc's Introduction

mcmc ---- Markov Chain Monte Carlo

image

Documentation Status

image

A small program for Markov chain Monte Carlo simulations.

Features

Currently you can run the program from anywhere you like by typing 'python3 path_to_source_code_folder/mcmc.py'. Output files will saved to the folder where you run the command. There are four parameters for this program,

k ---------- the number of nodes

r ---------- the weight coefficient

T ---------- temperature

nsteps ----- number of total steps ( graphs ).

You can modify those parameters in mcmc/mcmc.py

  • Note: The simulations is highly sensitive to temperature. High temperature leads to fast convergence, while less stable distribution, i.e., you will get more kinds of graphs. On the other hand, low temperature causes several times slower convergence and failing in ergodicity assumption.
  • Ergodicity can be verified with smaller number of nodes, e.g., 5 or 6, and a reasonable number of steps.

The program will produce several output files.

The list of all edges will be written into 'edgelist'.

The file 'output' contains number of steps, average degree of node 0, average number of edges, and average max length of all shortest paths from 0, respectively, and they are stored step by step to show the time evolution, which can also be used to check convergence.

The arbitrary graph needed to be drawn is named 'output.png', while most probable one is called 'top.png'. Note that I do not really count whether it is top 1% or not. Instead, I simply draw the one with highest histogram. In general, this range is tighter than 1%.

The sorted histograms are stored in 'sorted_histogram', where the columns are indices, edges and histograms, respectively.

Some summarized information is saved to 'summary' for your convenience.

  • Free software: MIT license

* Documentation: latest .. _latest: http://markov-chain.readthedocs.io/en/latest/

Todo

  • Some improvements on draw.py.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

mcmc's People

Contributors

tautomer avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.