lmc

Logarithmantic Monte Carlo

https://github.com/abmantz/lmc

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    1 of 1 committers (100.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.6%) to scientific vocabulary

Keywords

monte-carlo python sampler
Last synced: 6 months ago · JSON representation

Repository

Logarithmantic Monte Carlo

Basic Info
  • Host: GitHub
  • Owner: abmantz
  • License: lgpl-3.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 918 KB
Statistics
  • Stars: 4
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
monte-carlo python sampler
Created about 9 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.rst

.. image:: https://img.shields.io/badge/ascl-1706.005-blue.svg?colorB=262255
   :alt: ascl:1706.005
   :target: http://ascl.net/1706.005
.. image:: https://img.shields.io/pypi/v/lmc.svg
   :alt: PyPi
   :target: https://pypi.python.org/pypi/lmc
.. image:: https://img.shields.io/pypi/l/lmc.svg
   :alt: LGPL-3.0
   :target: https://www.gnu.org/licenses/lgpl-3.0.txt

=====================================================================================
Logarithmantic Monte Carlo (LMC)
=====================================================================================

----------------------------------------
Python code for Markov Chain Monte Carlo
----------------------------------------

`Logarithmancy `_ (n): divination by means of algorithms

What is this?
=============

``LMC`` (not to be confused with the Large Magellanic Cloud) is a bundle of Python code for performing Markov Chain Monte Carlo, which implements a few different multidimensional proposal strategies and (optionally parallel) adaptation methods. There are similar packages out there, notably `pymc `_ - ``LMC`` exists because I found the alternatives to be too inflexible for the work I was doing at the time. On the off chance that someone else is in the same boat, here it is.

The samplers currently included are Metropolis, slice, and the affine-invariant sampler popularized by `emcee `_ (`Goodman & Weare 2010 `_).

An abridged description of the package (from the `help` function) is copied here::

 The module should be very flexible, but is designed with these things foremost in mind:
  1. use with expensive likelihood calculations which probably have a host of hard-to-modify
     code associated with them.
  2. making it straightforward to break the parameter space into subspaces which can be sampled
     using different proposal methods and at different rates. For example, if changing some
     parameters requires very expensive calulations in the likelihood, the other, faster
     parameters can be sampled at a higher rate. Or, some parameters may lend themselves to
     Gibbs sampling, while others may not, and these can be block updated independently.
  3. keeping the overhead low to facilitate large numbers of parameters. Some of this has been
     lost in the port from C++, but, for example, the package provides automatic tuning of the
     proposal covariance for block updating without needing to store traces of the parameters in
     memory.

 Real-valued parameters are usually assumed, but the framework can be used with other types of 
 parameters, with suitable overloading of classes.

 A byproduct of item (1) is that the user is expected to handle all aspects of the calculation of 
 the posterior. The module doesn't implement assignment of canned, standard priors, or automatic 
 discovery of shortcuts like conjugate Gibbs sampling. The idea is that the user is in the best 
 position to know how the details of the likelihood and priors should be implemented.

 Communication between parallel chains can significantly speed up convergence. In parallel mode, 
 adaptive Updaters use information from all running chains to tune their proposals, rather than 
 only from their own chain. The Gelman-Rubin convergence criterion (ratio of inter- to intra-chain 
 variances) for each free parameter is also calculated. Parallelization is implemented in two ways; 
 see ?Updater for instructions on using each.
  1. Via MPI (using mpi4py). MPI adaptations are synchronous: when a chain reaches a communication
     point, it stops until all chains have caught up.
  2. Via the filesystem. When a chain adapts, it will write its covariance information to a file. It
     will then read in any information from other chains that is present in similar files, and
     incorporate it when tuning. This process is asynchronous; chains will not wait for one another; 
     they will simply adapt using whatever information has been shared at the time. 


Installation
============

Automatic
---------

Install from PyPI by running ``pip install lmc``.

Manual
------

Download ``lmc/lmc.py`` and put it somewhere on your ``PYTHONPATH``. You will need to have the ``numpy`` package installed. The ``mpi4py`` package is optional, but highly recommended.

Usage and Help
==============

Documentation can be found throughout ``lmc.py``, mostly in the form of docstrings, so it's also available through the Python interpreter. There's also a ``help()`` function (near the top of the file, if you're browsing) and an ``example()`` function (near the bottom).

The examples can also be browsed `here `_.

Owner

  • Name: Adam Mantz
  • Login: abmantz
  • Kind: user

GitHub Events

Total
Last Year

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 32
  • Total Committers: 1
  • Avg Commits per committer: 32.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Adam Mantz a****z@s****u 32
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 1
  • Total pull requests: 4
  • Average time to close issues: 28 days
  • Average time to close pull requests: less than a minute
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • abmantz (1)
Pull Request Authors
  • abmantz (4)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 87 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 5
  • Total maintainers: 1
pypi.org: lmc

Logarithmantic Monte Carlo

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 87 Last month
Rankings
Dependent packages count: 7.3%
Dependent repos count: 22.1%
Stargazers count: 23.2%
Average: 24.0%
Forks count: 30.0%
Downloads: 37.6%
Maintainers (1)
Last synced: 6 months ago

Dependencies

setup.py pypi
  • numpy *