nested_sampling.NestedSampling

class nested_sampling.NestedSampling(replicas, mc_walker, stepsize=0.1, nproc=1, verbose=True, max_stepsize=0.5, iprint=1, cpfile=None, cpfreq=10000, cpstart=False, dispatcher_URI=None, serializer='pickle')[source]

the main class for implementing nested sampling

Parameters :

replicas : list

list of objects of type Replica

mc_walker: callable

class of type MonteCarloWalker or similar. It performs a Monte Carlo walk to sample phase space. It should return an object with attributes x, energy, nsteps, naccept, etc.

nproc : int

number of processors to use for parallel nested sampling

verbose : bool

print status messages

iprint : int

if verbose is true, then status messages will be printed every iprint iterations

cpfile: str

checkpoint file name

cpfreq: int

checkpointing frequency in number of steps

cpstart: bool

start calculation from checkpoint binary file

dispatcher_URI: str

address (URI) of dispatcher (required for distributed parallelisation)

serializer: str

choice of serializer

Attributes

———-

nreplicas : integer

number of replicas

stepsize : float

starting stepsize. It is then adapted to meet some target MC acceptance by default 0.5

max_energies : list

array of stored energies (at each step the highest energy configuration is stored and replaced by a valid configuration)

store_all_energies: bool

store the energy of all the nproc replicas replaced when running NS in parallel

Methods

add_new_replicas(rlist) add new replicas the the list and keep the list sorted
adjust_step_size(results) Adjust the stepsize to keep the acceptance ratio at a good value ..
collectresults()
do_monte_carlo_chain(configs, Emax) from an initial configuration do a monte carlo walk
get_starting_configurations(Emax) return nproc replicas to be used as starting configurations
get_starting_configurations_from_replicas() use existing replicas as starting configurations
one_iteration() do one iteration of the nested sampling algorithm
pop_replicas() remove the replicas with the largest energies and store them in the max_energies array
sort_replicas() sorts the replicas in decreasing order of energy

Previous topic

nested_sampling.run_nested_sampling

Next topic

nested_sampling.NestedSampling.add_new_replicas