Package gmisclib :: Module mcmc_helper
[frames] | no frames]

Module mcmc_helper

source code

This is a helper module to make use of mcmc.py and mcmc_big.py. It allows you to conveniently run a Monte-Carlo simulation of any kind until it converges (stepper.run_to_bottom) or until it has explored a large chunk of parameter space (stepper.run_to_ergodic).

It also helps you with logging the process.

Classes
  TooManyLoops
  warnevery
  logger_template
  stepper
  step_acceptor
This class defines the annealing schedule when mcmc is used as an optimizer.
Functions
instance of mcmc_mod, typically BootStepper.
make_stepper_from_lov(problem_def, vector_generator, mcmc_mod=<module 'gmisclib.mcmc' from '/scratch/gpk/working_natty/lib/p..., posn_class=<class 'gmisclib.mcmc.position_repeatable'>, n=None)
Returns: A BootStepper, ready to run, from the specified module.
source code
instance of mcmc_mod, typically BootStepper.
make_stepper_from_lop(position_generator, mcmc_mod=<module 'gmisclib.mcmc' from '/scratch/gpk/working_natty/lib/p..., n=None)
Returns: A BootStepper, ready to run, from the specified module.
source code
 
test1() source code
 
test_probe() source code
 
test() source code
Variables
  Debug = 0
  __package__ = 'gmisclib'

Imports: sys, math, random, Thr, numpy, g_implements, mcmc, die


Function Details

make_stepper_from_lov(problem_def, vector_generator, mcmc_mod=<module 'gmisclib.mcmc' from '/scratch/gpk/working_natty/lib/p..., posn_class=<class 'gmisclib.mcmc.position_repeatable'>, n=None)

source code 
Parameters:
  • vector_generator (A sequence of numpy.ndarray, normally a list of them.) - Initial starting points for the optimization.
  • n (None or int) - The minimum number of samples to use. None means number of parameters+2.
Returns: instance of mcmc_mod, typically BootStepper.
A BootStepper, ready to run, from the specified module.

make_stepper_from_lop(position_generator, mcmc_mod=<module 'gmisclib.mcmc' from '/scratch/gpk/working_natty/lib/p..., n=None)

source code 
Parameters:
  • position_generator (A sequence of mcmc.position_base.) - Initial starting points for the optimization.
  • n (None or int) - The minimum number of samples to use. None means number of parameters+2.
Returns: instance of mcmc_mod, typically BootStepper.
A BootStepper, ready to run, from the specified module.