run_bayesian_inference_gaussian_error_model

pyapprox.bayesian_inference.markov_chain_monte_carlo.run_bayesian_inference_gaussian_error_model(loglike, variables, ndraws, nburn, njobs, algorithm='nuts', get_map=False, print_summary=False, loglike_grad=None, seed=None)[source]

Draw samples from the posterior distribution using Markov Chain Monte Carlo for data that satisfies

\[y=f(z)+\epsilon\]

where \(y\) is a vector of observations, \(z\) are the parameters of a function which are to be inferred, and \(\epsilon\) is Gaussian noise.

Parameters
loglikepyapprox.bayesian_inference.markov_chain_monte_carlo.GaussianLogLike

A log-likelihood function associated with a Gaussian error model

variablespya.IndependentMultivariateRandomVariable

Object containing information of the joint density of the inputs z. This is used to generate random samples from this join density

ndrawsinteger

The number of posterior samples

nburninteger

The number of samples to discard during initialization

njobsinteger

The number of prallel chains

algorithmstring

The MCMC algorithm should be one of

  • ‘nuts’

  • ‘metropolis’

  • ‘smc’

get_mapboolean

If true return the MAP

print_summaryboolean

If true print summary statistics about the posterior samples

loglike_gradcallable

Function with signature

loglikegrad(z) -> np.ndarray (nvars)

where z is a 2D np.ndarray with shape (nvars,nsamples

random_seedint or list of ints

A list is accepted if cores is greater than one. PyMC3 does not produce consistent results by setting numpy.random.seed instead seed must be passed in