hyperiax.mcmc package

Submodules

hyperiax.mcmc.fixedparameter module

class hyperiax.mcmc.fixedparameter.FixedParameter(value)

Bases: Parameter

A parameter that is constant regardless of updates. The parameter always have the value passed in the constructor

log_prior()

Logarithm of the prior probability of the parameter

Returns:

  1. as the parameter is fixed

propose(key)

Propose a new value for the parameter

Parameters:

key – A key to sample with

Returns:

Copy of the parameter

update(value, accepted)

Update the parameter. Does nothing as the parameter is fixed, i.e. the new value is discarded

Parameters:
  • value – The new value to update the parameter with

  • accepted – Whether the new value was accepted

hyperiax.mcmc.metropolis_hastings module

hyperiax.mcmc.parameter module

class hyperiax.mcmc.parameter.Parameter(value)

Bases: ABC

Base class for a parameter in a Markov Chain Monte Carlo simulation.

abstract log_prior()

Logarithm of the prior probability of the parameter.

Returns:

The logarithm of the prior probability of the parameter.

abstract propose(key) Parameter

Propose a new parameter given a key

Parameters:

key – the key to generate the parameter with

Returns:

A new parameter proposal

abstract update(value, accepted=True)

Update the value of the parameter, if accepted.

value: The new value of the parameter. accepted: Whether the new value is accepted. Default true.

hyperiax.mcmc.parameterstore module

class hyperiax.mcmc.parameterstore.ParameterStore(params: Dict[str, Parameter])

Bases: object

The parameter store hosts a set of parameters.

log_prior()

Logarithm of the prior probability of the parameters.

Returns:

The logarithm of the prior probability of the parameters.

propose(key) ParameterStore

Propose a new parameter store, containing newly sampled parameters.

Parameters:

key – A key to sample with.

Returns:

The newly sampled parameter store.

values()

Gets the values of the parameters in the store

Returns:

The parameters in a dictionary.

hyperiax.mcmc.plotting module

hyperiax.mcmc.varianceParameter module

Module contents