Package gmisclib :: Module mcmc :: Class BootStepper
[frames] | no frames]

Class BootStepper

source code


The BootStepper class is the primary interface. It implements a Bootstrap Markov Chain Monte Carlo stepper. The class instance stores the necessary state information, and each call to step() takes another step.

Instance Methods
 
__init__(self, lop, v, strategy='intermediate', maxArchSize=None, parallelSizeDiv=1)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
step(self)
In subclasses, this takes a step and returns 0 or 1, depending on whether the step was accepted or not.
source code
 
status(self)
Provides some printable status information in a=v; format.
source code
 
stepV(self) source code
 
step_boot(self) source code
 
step_probe(self) source code
 
reset_adjusters(self) source code
 
ergodic(self)
A crude measure of how ergodic the MCMC is.
source code
 
set_strategy(self, ss) source code
 
set_sort_strategy(self, ss) source code
position_base
current(self)
Returns: the current position. (Inherited from gmisclib.mcmc.stepper)
source code
 
needs_a_reset(self)
Decides if we we need a reset. (Inherited from gmisclib.mcmc.stepper)
source code
numpy.ndarray
prms(self)
Returns: The current parameters (Inherited from gmisclib.mcmc.stepper)
source code
 
reset(self)
Called internally to mark when the optimization has found a new minimum. (Inherited from gmisclib.mcmc.stepper)
source code
int
reset_id(self)
Use this to tell if the stepper has been reset since you last looked at it. (Inherited from gmisclib.mcmc.stepper)
source code

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

Class Variables
  F = 0.234
F is the targeted step acceptance rate.
  alpha = 0.1
How rapidly should one expand the archive after a reset?
  PBootLim = 0.9
PBootLim Limits the probability of taking a bootstrap step.
  SSAMPLE = 'sample'
Sampling mode
  SUPHILL = 'hillclimb'
Go straight uphill
  SANNEAL = 'intermediate'
Simulated annealing
  SSAUTO = 'intermediate'
  SSNEVER = 'sample'
  SSLOW = 'intermediate'
  SSALWAYS = 'hillclimb'
Instance Variables
  np
The number of parameters:
  np_eff
In a multiprocessor situation, np_eff tells you how much data do you need to store locally, so that the overall group of processors stores enough variety of data.
  acceptable
Acceptable is a function that decides whether or not a step is OK. (Inherited from gmisclib.mcmc.stepper)
  last_failed
It should reflect the success or failure of the most recently completed step. (Inherited from gmisclib.mcmc.stepper)
Properties

Inherited from object: __class__

Method Details

__init__(self, lop, v, strategy='intermediate', maxArchSize=None, parallelSizeDiv=1)
(Constructor)

source code 

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

Parameters:
  • maxArchSize - How many position vectors can be stored. This is normally used to (loosely) enforce a memory limitation for large jobs.
  • parallelSizeDiv - For use when there are several cooperating MCMC processes that share data. When >1, this allows each process to have smaller stored lists. Normally, parallelSizeDiv is between 1 and the number of cooperating processes.
  • lop (list of a class derived from position_base.) - These are a list of starting postions that should be evaluated first and used as the basis for further exploration.
  • v - A covariance matrix for non-bootstrap steps. Mostly, the system takes bootstrap steps that are adaptively derived from previous steps. However, to generate the list of previous steps, it needs a way to generate steps ab initio. So, v is used to get things going. v is also used occasionally thereafter, just to make sure the stepper doesn't get trapped in some subspace.
  • strategy (One of SSAMPLE, SUPHILL, or SANNEAL.)
Overrides: object.__init__

step(self)

source code 

In subclasses, this takes a step and returns 0 or 1, depending on whether the step was accepted or not.

Overrides: stepper.step
(inherited documentation)

status(self)

source code 

Provides some printable status information in a=v; format.

Overrides: stepper.status
(inherited documentation)

ergodic(self)

source code 

A crude measure of how ergodic the MCMC is.

Returns:
The inverse of how many steps it takes to cross the minimum in the slowest direction. Or zero, if it is too soon after some major violation of the MCMC assumptions.

Class Variable Details

F

F is the targeted step acceptance rate. This is from G. O. Roberts, A. Gelman, and W. Gilks (1997) "Weak convergence and optimal scaling of random walk Metropolis algorithm." Ann. Applied. Probability, 7, p. 110-120 and also from G. O. Roberts and J. S. Rosenthal (2001) "Optimal scaling of various Metropolis-Hastings algorithms." Statistical Sci. 16, pp. 351-367.

Value:
0.234

PBootLim

PBootLim Limits the probability of taking a bootstrap step. This, if the optimization collapses into a subspace, some other kind of step will eventually get it out.

Value:
0.9