MCMC
- class typhon.retrieval.mcmc.MCMC(vars, y, ly, stats=[])[source]
The MCMC class represents an ongoing MCMC simulation. An MCMC object can be used to run a given number of MC steps, test the results for convergence and perform further calculations if necessary.
- __init__(vars, y, ly, stats=[])[source]
To construct an MCMC object, the user must provide a list of variables, prior distributions and likelihood functions, the measurement vector, a measurement likelihood and optionally a set of stats to evaluate at each step.
- Parameters:
vars – A list of triples (v,l,j) containing a triple of a variable v, a prior likelihood function l so that l(v) yields a value proportional to the logarithm of the prior probability of value of v, and finally a jump function j, so that v_new = j(ws, v_old) yields a new value for the variable v and manipulates the
Workspace
object ws so that a subsequent call to the yCalc WSM will compute the simulated measurement corresponding to the new value v_new of the variable v.y – The measured vector of brightness temperatures which must be consistent with the ARTS WSV y
ly – The measurement likelihood such that ly(y, yf) gives the log of the probability that deviations between y and yf are due to measurement errors.
stats – This is a list of statstics such that for each element s s(ws) is a scalar value computed on a given workspace.
Methods
__init__
(vars, y, ly[, stats])To construct an MCMC object, the user must provide a list of variables, prior distributions and likelihood functions, the measurement vector, a measurement likelihood and optionally a set of stats to evaluate at each step.
eval_l
(ws)Evaluate the likelihood of the current state.
print_log
(step, acceptance)Prints log output to stdout.
run
(ws, n_steps)Run a simulation of n_steps on a given workspace ws starting from start values x0s.
step
(ws, ly_old, lxs_old)The performs a Gibbs step for a given variable.
warm_up
(ws, x0s, n_steps)Run a simulation of n_steps on a given workspace ws starting from start values x0s.