# Software for Flexible Bayesian Modeling

Version of 2003-06-29. Copyright (c) 1995-2003 by Radford M. Neal

Index to documentation for software that implements flexible Bayesian models based on neural networks, Gaussian processes, mixtures, and Dirichlet diffusion trees, and that demonstrates various Markov chain Monte Carlo methods.

## Introduction, overview, and examples:

- Copyright and contact information
- Facilities provided by this software
- Installing the software
- Overview of the software
- Introduction to the examples
- Examples of Markov chain sampling for simple distributions
  - Sampling from a univariate normal distribution
  - Sampling from a ring distribution in three dimensions
  - Sampling from a funnel distribution in ten dimensions
- Examples of circularly-coupled Markov chain sampling
- Examples of Markov chain sampling for simple Bayesian models
  - A linear regression model
  - Modeling real-valued data with a t-distribution
  - Modeling probabilities for categorical data
  - A random effects model
- Examples of flexible Bayesian regression and classification models based on neural networks and Gaussian processes
  - A simple regression problem
  - A problem with a binary response
  - A three-way classification problem
  - A regression problem with outliers
- Examples of Bayesian mixture models and Dirichlet diffusion tree models
  - A probability estimation problem with binary data
  - A bivariate density estimation problem
  - Building an additive model using two diffusion trees
- Examples of Bayesian neural network survival models
- Examples of learning with gradient descent, early stopping & ensembles
- Hints and warnings
- Guide to further documentation
- Acknowledgements

## Notes on the present release and past releases:

- Release of 2003-06-29
- Release of 2001-08-31
- Release of 2000-08-21
- Release of 1999-12-06
- Release of 1999-03-13
- Release of 1998-09-01
- Release of 1998-08-02
- Release of 1997-07-22
- Release of 1997-01-18
- Release of 1996-08-26
- Release of 1995-08-09

## Alphabetical index within directories:

       ........ UTIL .........     ..... MC .....    .... DIST .....   ... BVG ...

       calc         model-spec     mc                dist              bvg
       data-spec    numin          mc-ais            dist-display      bvg-initial
       extract      prior          mc-quantities     dist-est          bvg-mc
       find-min     quantities     mc-spec           dist-gen          bvg-plt
       formula      rand-seed      mc-temp-filter    dist-initial      bvg-spec
       grid         series         mc-temp-sched     dist-mc
       log          xxx-hist       xxx-circ          dist-quantities
       log-append   xxx-plt        xxx-genp          dist-spec
       log-copy     xxx-tbl        xxx-grad-test     dist-stepsizes
       log-equal                   xxx-mc
       log-last                    xxx-stepsizes
       log-records                 xxx-wrap
       log-types

       .... NET .....     .... GP .....    .... MIX .....    .... DFT ....

       net                gp               mix               dft
       net-approx         gp-cov           mix-cases         dft-cases
       net-dvar           gp-display       mix-display       dft-dendrogram
       net-display        gp-eigen         mix-gen           dft-display
       net-eval           gp-eval          mix-mc            dft-gen
       net-gd             gp-gen           mix-pred          dft-mc
       net-gen            gp-mc            mix-quantities    dft-pred
       net-hist           gp-pred          mix-spec          dft-quantities
       net-mc             gp-quantities                      dft-spec
       net-plt            gp-spec
       net-pred
       net-quantities
       net-rej
       net-spec
       net-tbl

A more detailed index is given below, with the most important documentation files marked with an asterisk.

## Generic utility programs [util]:

      * log             Facilities for handling log files
        log-types       Types of log file records used by various programs

        log-copy        Copy part of a log file to a new log file
        log-append      Append records from one log file to the end of another
        log-last        Display the index of the last record in a log file
        log-records     List all records in a log file
        log-equal       Check if records in log files match

        formula         Syntax for arithmetic formulas
        calc            Simple calculator program

      * data-spec       Specify data sets for training and testing
      * numin           Facilities for input of numeric data

      * model-spec      Specify model for targets
      * prior           Meaning and syntax of prior specifications

        find-min        Find entry with minimum value (for cross validation)

        grid            Output a grid of points
        extract         Extract items at random from a data file

      * rand-seed       Specify a random number seed

      * quantities      Numeric quantities obtainable from log files

      * xxx-plt         Write quantities from log files, suitable for plotting
        xxx-tbl         Write quantities from log files in a tabular form
        xxx-hist        Build a histogram for a quantity using data from log files

      * series          Analyse stationary time series data

## Markov chain Monte Carlo facilities [mc]:

      * mc              Programs and modules supporting Markov chain Monte Carlo
      * mc-spec         Specify how to do the Markov chain simulation
      * xxx-mc          Run a Markov chain simulation
      * xxx-circ        Do a circularly-coupled simulation
      * xxx-wrap        Create wrapped-around chain from existing simulation run

      * mc-quantities   Quantities from log files relating to Monte Carlo

        mc-temp-sched   Specify temperature schedule for tempering methods
        mc-temp-filter  Copy only iterations at a given temperature
        mc-ais          Monitor annealed importance sampling (AIS) runs

        xxx-grad-test   Test the correctness of the energy gradient computations
        xxx-stepsizes   Display and evaluate stepsizes used for dynamics
        xxx-genp        Generate random momentum variables

## Markov chain sampling for a specified distribution [dist]:

      * dist            Markov chain sampling for a specified distribution
      * dist-spec       Specify a distribution to sample from

        dist-initial    Specify initial state for Markov chain
        dist-stepsizes  Display, evaluate, or set stepsizes used for dynamics
      * dist-mc         Do Markov chain sampling for the specified distribution
        dist-gen        Generate values for state variables from the prior

        dist-display    Print state variables at a specified iteration
      * dist-quantities Quantities defined for a specified distribution

      * dist-est        Estimate the expectation of some function of state

## Markov chain sampling for a bivariate Gaussian [bvg]:

        bvg             Demo of Markov chain sampling from a bivariate Gaussian
        bvg-spec        Specify a bivariate Gaussian distribution to sample from

        bvg-initial     Set initial state for sampling from a bivariate Gaussian
        bvg-mc          Do Markov chain simulation for a bivariate Gaussian

        bvg-plt         Get quantities from a bvg log file, suitable to plot

## Bayesian neural networks [net]:

      * net             Bayesian inference for neural networks using MCMC
      * net-spec        Create a new network, or display existing specifications

      * net-mc          Do Markov chain simulation to sample networks
      * net-gen         Generate networks from the prior, or with fixed values
        net-approx      Specify quadratic approximation to replace log likelihood
        net-gd          Train a network by gradient descent in the error

      * net-display     Print network parameters and/or hyperparameters

      * net-quantities  Quantities from log files relating to networks
      * net-plt         Get quantities from net log files, suitable for plotting
        net-tbl         Get quantities from net log files and output as table
        net-hist        Build histogram for quantity obtained from net log files

      * net-pred        Make predictions for test cases

        net-eval        Evaluate network functions over a grid
        net-dvar        Find the variance of a difference in function values

        net-rej         Generate networks from the posterior by rejection sampling

## Gaussian process models [gp]:

      * gp              Bayesian modelling using Gaussian processes
      * gp-spec         Specify a Gaussian process model, or display existing spec

      * gp-mc           Use Markov chain to sample Gaussian process hyperparameters
      * gp-gen          Generate GP hyperparameters randomly, or fix them

      * gp-display      Print Gaussian process hyperparameters & other information
      * gp-quantities   Quantities from log files relating to Gaussian processes

      * gp-pred         Make predictions for test cases using Gaussian process
        gp-eval         Evaluate function drawn from a Gaussian process over a grid

        gp-cov          Print covariance matrix for a Gaussian process
        gp-eigen        Find eigenvalues/vectors of covariance matrix

## Bayesian inference for mixture models [mix]:

      * mix             Bayesian inference for mixture models
      * mix-spec        Specify a mixture model, or display existing spec

      * mix-mc          Use Markov chain to do sampling for a mixture model
      * mix-gen         Generate hyperparameters randomly, or fix them

      * mix-display     Print mixture model parameters, hyperparameters, etc.
      * mix-quantities  Quantities from log files relating to mixture models

      * mix-pred        Make predictions for tests cases using mixture models
        mix-cases       Generate cases from a mixture model

## Bayesian inference for Dirichlet diffusion tree models [dft]:

      * dft             Bayesian inference for diffusion tree models
      * dft-spec        Specify a diffusion tree model, or display existing spec

      * dft-mc          Use Markov chain to do sampling for a diffusion tree model
      * dft-gen         Generate hyperparameters randomly, or fix them

      * dft-display     Print diffusion tree model parameters, hyperparameters, etc.
        dft-dendrogram  Create Postscript representation of a dendrogram of a tree
      * dft-quantities  Quantities from log files relating to diffusion tree models

      * dft-pred        Make predictions for test cases using diffusion tree model

        dft-cases       Generate cases from a diffusion tree model