py21cmmc.cosmoHammer.HDFStorage#

class py21cmmc.cosmoHammer.HDFStorage(filename, name)[source]#

A HDF Storage utility, based on the HDFBackend from emcee v3.0.0.

Methods

__init__(filename, name)

get_blobs(**kwargs)

Get the chain of blobs for each sample in the chain.

get_chain(**kwargs)

Get the stored chain of MCMC samples.

get_last_sample()

Access the most recent sample in the chain.

get_log_prob(**kwargs)

Get the chain of log probabilities evaluated at the MCMC samples.

get_trialled_log_prob(**kwargs)

Get the chain of log probabilities evaluated as trials of the MCMC.

get_trials(**kwargs)

Get the stored chain of trials.

get_value(name[, flat, thin, discard])

Get a particular kind of entry from the backend file.

grow(ngrow, blobs)

Expand the storage space by some number of samples.

open([mode])

Open the backend file.

reset(nwalkers, params)

Clear the state of the chain and empty the backend.

save_step(coords, log_prob, blobs, truepos, ...)

Save a step to the file.

Attributes

accepted

Number of acceptances for each walker.

accepted_array

An array of bools representing whether parameter proposals were accepted.

blob_names

Names for each of the arbitrary blobs.

has_blobs

Whether this file has blobs in it.

initialized

Whether the file object has been initialized.

iteration

The iteration the chain is currently at.

param_guess

An initial guess for the parameters.

param_names

The parameter names.

random_state

The defining random state of the process.

shape

Tuple of (nwalkers, ndim).

size

The length of the chain.