bsmart.scans.MultiNest
MultiNest scan
Written by M. Goodsell
Shamelessly adapted from parts of PyMultiNest by Johannes Buchner https://johannesbuchner.github.io/PyMultiNest
Based on MultiNest (and using the library) from: https://github.com/farhanferoz/MultiNest
- Requires:
MultiNest (built with MPI if required) [Optional] mpi4py (for MPI operation)
For variables we require a range, e.g.:
- “Variables”: {
“lambda”: { “RANGE”: [0.01,1.0] } },
Various possibilities for likelihood functions are provided: GAUSS, BIAS, SIGMA, USER, LOGUSER or “OFF” for observables that should not be taken into account for the likelihood calculation (but the user wants to retain them in the summary file for other purposes). These are set by providing e.g.:
- “Observables”: {
- “mh”{ “SLHA”: [“MASS”, [25]], “SCALING”: “GAUSS”,
“MEAN”: 125.0, “VARIANCE”:3.0
}
or “SCALING”:”BIAS”, or “SCALING”:”OFF”
It is not necessary to specify the scaling explicitly: gaussian is taken by default
We take a uniform prior on all variables. This could be easily modified if there are convenient choices.
The MultiNest output files are stored in RunName/MultiNest
It is up to you to read them!!!
The raw points will as usual be retained in the Spectrum_Files directory if so desired, and merged if “Merge Results” is True:
- “Setup”{
“Type” : “MultiNest”, “Merge Results” : “True”, “MultiNestLib”: ‘/path/to/MultiNest/lib’ …
}
Note that
Can run either with or without MPI:
For MPI runs, you should run
mpiexec -n <ncores> BSMArt <json file>
or, slightly safer:
mpiexec -n <ncores> python3 -m mpi4py BSMArt <json file>
Information
BSMArt Name: MultiNest
- Requires:
numpy
mpi4py
Settings:
MultiNestLib: Path to MultiNest library
RunName: String
Live Points: Int
Points: Int
Sampling Efficiency: Float
Evidence Tolerance: Float
- class bsmart.scans.MultiNest.NewScan(inputs, log)[source]
Bases:
ScanScanner class for MultiNest Scans
- likelihoodfns
self.likelihoodfns=[] for o in self.inputs[‘Observables’]:
#self.header.append(o) obs=self.inputs[‘Observables’][o] scaling=’GAUSS’ if ‘SCALING’ in obs:
scaling=obs[‘SCALING’]
- if ‘MEAN’ in obs:
tmean = obs[‘MEAN’]
- else:
tmean=0.0
- if ‘VARIANCE’ in obs:
tvar = obs[‘VARIANCE’]
- else:
tvar = 0.0
self.likelihoodfns.append(FuncMe(scaling,tmean,tvar))