.. libpgm documentation master file, created by sphinx-quickstart on Tue Aug 7 11:49:49 2012. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to libpgm! ================== libpgm is an endeavor to make Bayesian probability graphs easy to use. The effort originates from Daphne Koller and Nir Friedman's *Probabilistic Graphical Models* (2009), which provides an in-depth study of probabilistic graphical models and their applications. libpgm was developed at CyberPoint Labs during the Summer of 2012 by Charles Cabot working under the direction of James Ulrich and Mark Raugas. It is provided free of use in accordance with the New BSD License:: Copyright (c) 2012, CyberPoint International, LLC All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the CyberPoint International, LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CYBERPOINT INTERNATIONAL, LLC BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Install from pypi at `http://pypi.python.org/pypi/libpgm `_ or download a tarball `here `_. Documentation ------------- The library consists of a series of importable modules, which either represent types of Bayesian graphs, contain methods to operate on them, or both. The methods' individual documentation pages are found below: .. toctree:: dictionary graphskeleton orderedskeleton nodedata discretebayesiannetwork hybayesiannetwork lgbayesiannetwork dyndiscbayesiannetwork tablecpdfactorization tablecpdfactor sampleaggregator pgmlearner CPDtypes Note that `numpy `_, `scipy `_, and Python 2.7 are required for this library. Capabilities ------------ Briefly, the capabilities of this library are: - Sampling - Forward sampling in a discrete-CPD Bayesian network - Forward sampling in a linear Gaussian-CPD Bayesian network - Forward sampling in a hybrid (any CPD type) Bayesian network - Forward sampling in a dynamic 2-TBN Bayesian network - Gibbs sampling in a discrete-CPD Bayesian network (given evidence) - Deterministic Inference - Compute the probability distribution over a specific node or nodes in a discrete-CPD Bayesian network (given evidence, if present) - Compute the exact probability of an outcome in a discrete-CPD Bayesian network (given evidence, if present) - Approximative Inference - Compute the approximate probability distribution by generating samples - Learning - Learn the CPDs of a discrete-CPD Bayesian network, given data and a structure - Learn the structure of a discrete Bayesian network, given only data - Learn the CPDs of a linear Gaussian Bayesian network, given data and a structure - Learn the strcutre of a linear Gaussian Bayesian network, given only data - Learn entire Bayesian networks (structures and parameters) from data Input files ----------- Because Bayesian probability graphs are large and contain a lot of data, the library works with .txt files as inputs. The formatting used is JavaScript Object Notation (JSON), with some flexibility (the :doc:`dictionary` module has the capacity to transform python-style dicts to JSON, for instance). Internally, the library stores these files as *json* objects from python's `json `_ library. For examples of the formatting, and of the particular data required for each different Bayesian network type, see the example input files below: .. toctree:: unittestdict unittestlgdict unittesthdict unittestdyndict Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search`