autofit.MultiNest

class autofit.MultiNest(name: Optional[str] = None, path_prefix: Optional[str] = None, unique_tag: Optional[str] = None, prior_passer: Optional[autofit.non_linear.abstract_search.PriorPasser] = None, session: Optional[sqlalchemy.orm.session.Session] = None, **kwargs)
__init__(name: Optional[str] = None, path_prefix: Optional[str] = None, unique_tag: Optional[str] = None, prior_passer: Optional[autofit.non_linear.abstract_search.PriorPasser] = None, session: Optional[sqlalchemy.orm.session.Session] = None, **kwargs)

A MultiNest non-linear search.

For a full description of MultiNest and its Python wrapper PyMultiNest, checkout its Github and documentation webpages:

https://github.com/JohannesBuchner/MultiNest https://github.com/JohannesBuchner/PyMultiNest http://johannesbuchner.github.io/PyMultiNest/index.html#

Parameters:
  • name – The name of the search, controlling the last folder results are output.
  • path_prefix – The path of folders prefixing the name folder where results are output.
  • unique_tag – The name of a unique tag for this model-fit, which will be given a unique entry in the sqlite database and also acts as the folder after the path prefix and before the search name.
  • prior_passer – Controls how priors are passed from the results of this NonLinearSearch to a subsequent non-linear search.
  • session – An SQLalchemy session instance so the results of the model-fit are written to an SQLite database.

Methods

__init__(name, path_prefix, unique_tag, …) A MultiNest non-linear search.
copy_with_paths(paths)
fit(model, analysis[, info, pickle_files, …]) Fit a model, M with some function f that takes instances of the class represented by model M and gives a score for their fitness.
fitness_function_from_model_and_analysis(…)
make_pool() Make the pool instance used to parallelize a NonLinearSearch alongside a set of unique ids for every process in the pool.
make_sneaky_pool(fitness_function) Create a pool for multiprocessing that uses slight-of-hand to avoid copying the fitness function between processes multiple times.
optimise(factor, model_approx, status) Perform optimisation for expectation propagation.
perform_update(model, analysis, during_analysis) Perform an update of the NonLinearSearch results, which occurs every iterations_per_update of the non-linear search.
plot_results(samples)
remove_state_files()
samples_from(model) Create a Samples object from this non-linear search’s output files on the hard-disk and model.
samples_via_results_from(model)

Attributes

config_dict_run
config_dict_search
config_dict_settings
config_type
logger
name
paths
samples_cls
timer
samples_from(model: autofit.mapper.prior_model.abstract.AbstractPriorModel)

Create a Samples object from this non-linear search’s output files on the hard-disk and model.

For MulitNest, this requires us to load:

  • The parameter samples, log likelihood values and weight_list from the multinest.txt file.
  • The total number of samples (e.g. accepted + rejected) from resume.dat.
  • The log evidence of the model-fit from the multinestsummary.txt file (if this is not yet estimated a value of -1.0e99 is used.
Parameters:model – The model which generates instances for different points in parameter space. This maps the points from unit cube values to physical values via the priors.