bsmart.scans.MCMC
Simple MCMC scan
Simple MCMC scan implementing the Metropolis-Hastings algorithm
Launches a seperate scan for each core, with the option to merge the results at the end via “Merge Results”:”True” in “Setup”. Of course, will also run in single-core mode.
For variables we require a range and a variance for the jumps:
"Variables": {
"lambda": { "RANGE": [0.01,1.0],
"VARIANCE": 0.2}
},
Several possibilities for likelihood functions are provided – see the BSMlikelihood file.
E.g. gaussian, Log likelihood, “USER”, 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”:”LOG”, or “SCALING”:”OFF”
It is not necessary to specify the scaling explicitly: gaussian is taken by default
The results are summarised in a csv file (or several) in the Results subdirectory of the scan, which contains only the points retained by the scan (along with an ID for each point); the raw points will as usual be retained in the Spectrum_Files directory if so desired.
Information
BSMArt Name: MCMC
- Requires:
numpy
Settings:
Points: Int
Valid Points: Int
Merge Results: Boolean
Initial Sample: Path to initial sample file
Sample LogLike Name: Column name for LogLike (if initial sample and relevant)
Sample NLL Name: Column name for NLL (if initial sample and relevant)
Sample Likelihood Name: Column name for Likelihood (if initial sample and relevant)
- class bsmart.scans.MCMC.NewScan(inputs, log)[source]
Bases:
ScanScanner class for multicore MCMC Scans
- get_previous_sample(sample_file)[source]
Routine to load data from a previous sample and return a couple of numpy arrays of the values
- merge_results
For resuming, or using an initial sample, we need just to have a starting point per core.
The initial sample should also be copied to the results