Bayesian Inference smapler setup module

Functions to start run Bayesian inference by calling UltraNest package

InferenceWorkflow.BayesianSampler.UltranestSampler(parameters, likelihood, prior, step, live_points, max_calls)[source]

UltraNest based nested sampler by given likelihood prior, and parameters.

Parameters:
  • parameters (array) – parameters array that want to be constrained.

  • likelihood (array) – theta as input. likelihood function defined by user.

  • prior (array) – cube as input, prior function defined by user. please check our test_inference.ipynb

  • prior. (to check how to define likelihood and)

  • step (int) – as a step sampler, define this inference want to devided to how many steps.

  • live_points (int) – define how many live points will be used to explore the whole

  • space. (parameters)

  • max_ncalls (int) – define after how many steps the sampler will stop work.

Returns:

equal weighted samples of whole posteior parameter space, this run will generate a dirctory as ‘output’, please check the run# folder, and the chain dirctory, there is a ‘equal_weighted_samples’ file, that is same with flat_samples here. It will be easier to check if you are using clusters to do this inference.

Return type:

flat_samples (array)

InferenceWorkflow.BayesianSampler.UltranestSamplerResume(parameters, likelihood, prior, nsteps, live_points, max_calls)[source]

UltraNest based nested sampler by given likelihood prior, and parameters. (resume true verion could restart you run from your previous stopped results)

Parameters:
  • parameters (array) – parameters array that want to be constrained.

  • likelihood (array) – theta as input. likelihood function defined by user.

  • prior (array) – cube as input, prior function defined by user. please check our test_inference.ipynb

  • prior. (to check how to define likelihood and)

  • step (int) – as a step sampler, define this inference want to devided to how many steps.

  • live_points (int) – define how many live points will be used to explore the whole

  • space. (parameters)

  • max_ncalls (int) – define after how many steps the sampler will stop work.

Returns:

equal weighted samples of whole posteior parameter space, this run will generate a dirctory as ‘output’, please check the run# folder, and the chain dirctory, there is a ‘equal_weighted_samples’ file, that is same with flat_samples here. It will be easier to check if you are using clusters to do this inference.

Return type:

flat_samples (array)