pint.sampler.EmceeSampler

class pint.sampler.EmceeSampler(nwalkers)[source]

Bases: MCMCSampler

Wrapper class around the emcee sampling package.

This is to let it work within the PINT Fitter framework

Be warned: emcee can only handle double precision. You will never get a longdouble response back.

Methods

chains_to_dict(names)

Convert the sampler chains to a dictionary

get_chain()

A safe method of getting the sampler chain, if it exists

get_initial_pos(fitkeys, fitvals, fiterrs, ...)

Get the initial positions for each walker of the sampler.

initialize_sampler(lnpostfn, ndim)

Initialize the internal sampler data.

is_initalized()

Simple way to check if the EmceeSampler can run yet.

run_mcmc(pos, nsteps)

Wraps around emcee.run_mcmc

is_initalized()[source]

Simple way to check if the EmceeSampler can run yet.

initialize_sampler(lnpostfn, ndim)[source]

Initialize the internal sampler data.

This is usually done after __init__ because ndim and lnpostfn are properties of the Fitter that holds this sampler.

get_initial_pos(fitkeys, fitvals, fiterrs, errfact, **kwargs)[source]

Get the initial positions for each walker of the sampler.

fitkeys, fitvals, fiterrs, and errfact all come from the Fitter, kwargs might contain min/maxMJD in the event of a glep_1 parameter

get_chain()[source]

A safe method of getting the sampler chain, if it exists

chains_to_dict(names)[source]

Convert the sampler chains to a dictionary

run_mcmc(pos, nsteps)[source]

Wraps around emcee.run_mcmc