Sampler Classes
This is the API documentation; see also the guide page Sampling.
- class starlord.SamplerEnsemble
Thin wrapper for EMCEE’s EnsembleSampler
- __init__(model_class, constants={}, burn_in=500, thin=1, **init_args)
- Return type:
None
- run(threads=1, **run_args)
- save_corner(filename, **kwargs)
- save_results(filename)
- Parameters:
filename (str)
- summary()
- Return type:
str
- burn_in: int
- property results: object
- property sampler: EnsembleSampler
- thin: int
- class starlord.SamplerNested
Thin wrapper for the Dynesty NestedSampler
- __init__(model_class, constants={}, **init_args)
- Return type:
None
- run(**run_args)
- save_corner(filename, **kwargs)
- save_results(filename)
- Parameters:
filename (str)
- property results: Results
- property sampler: NestedSampler
- starlord.load_to_frame(filename, simplify_names=True, include_outputs=True)
Loads an npz file saved by Starlord into a Pandas Data Frame.
This requires that Pandas is installed, but this is not a required dependency so that is not guaranteed by a standard install.
- Parameters:
filename – The npz file to load in as a string.
simplify_names – Whether to remove grid names at the front of variable names and combine underscores if the resulting resulting name is unambiguous (e.g. “mist__logG__1” becomes “logG_1”.
include_outputs – If true, includes generated outputs; otherwise only the actual model parameters are loaded.
- Returns:
- A Pandas DataFrame with the output samples organized into rows and the parameters
and output variables as the columns. If nested sampling was used, the weights are included as an additional column.
- Raises:
AssertionError – if expected entries in the npz file are missing, implying that the file was not saved by Starlord.