Package csb :: Package statistics :: Package samplers :: Package mc :: Module singlechain :: Class HMCSampler

[frames] | no frames]

# Class HMCSampler

source code

         object --+
                  |
    AbstractSampler --+
                      |
             AbstractMC --+
                          |
      AbstractSingleChainMC --+
                              |
                             HMCSampler

Hamilton Monte Carlo (HMC, also called Hybrid Monte Carlo by the inventors, Duane, Kennedy, Pendleton, Duncan 1987).

Nested Classes
Inherited from `AbstractSampler`: `__metaclass__`

Instance Methods

__init__(self, pdf, state, gradient, timestep, nsteps, mass_matrix=None, integrator=<class 'csb.numeric.integrators.FastLeapFrog'>, temperature=1.0) x.__init__(...) initializes x; see help(type(x)) for signature | source code

Inherited from `AbstractSingleChainMC`: `sample` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables
| __abstractmethods__ = ``frozenset([``])``

Properties
| mass_matrix
| nsteps
| timestep
Inherited from `AbstractSingleChainMC`: `acceptance_rate`, `energy`, `last_move_accepted`, `temperature` Inherited from `AbstractMC`: `state` Inherited from `object`: `__class__`

Method Details

### __init__(self, pdf, state, gradient, timestep, nsteps, mass_matrix=None, integrator=<class 'csb.numeric.integrators.FastLeapFrog'>, temperature=1.0)
(Constructor)

source code

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  - `pdf` (csb.statistics.pdf.AbstractDensity) - Probability density function to be sampled from
  - `state` (State) - Inital state
  - `gradient` (AbstractGradient) - Gradient of the negative log-probability
  - `timestep` (float) - Timestep used for integration
  - `nsteps` (int) - Number of integration steps to be performed in each iteration
  - `mass_matrix` (n-dimensional InvertibleMatrix with n being the dimension of the configuration space, that is, the dimension of the position / momentum vectors) - Mass matrix
  - `integrator` (AbstractIntegrator) - Subclass of AbstractIntegrator to be used for integrating Hamiltionian equations of motion
  - `temperature` (float) - Pseudo-temperature of the Boltzmann ensemble p(x) = 1/N * exp(-1/T * E(x)) with the pseudo-energy defined as E(x) = -log(p(x)) where p(x) is the PDF under consideration
Overrides: object.__init__
  (inherited documentation)

Property Details

### mass_matrix

Get Method:
  unreachable.mass_matrix(self)
Set Method:
  unreachable.mass_matrix(self, value)

### nsteps

Get Method:
  unreachable.nsteps(self)
Set Method:
  unreachable.nsteps(self, value)

### timestep

Get Method:
  unreachable.timestep(self)
Set Method:
  unreachable.timestep(self, value)