pybird.run module

pybird.run.pvalue(minchi2, dof)[source]
class pybird.run.Run(*args, verbose=True)[source]

Bases: object

A class for running cosmological parameter inference with PyBird.

The Run class provides a high-level interface for cosmological parameter inference, handling both minimization and MCMC sampling. It can be initialized either with paths to YAML configuration files or directly with configuration dictionaries.

The class manages: - Cosmological parameter setup and priors - EFT nuisance parameters - Multiple minimization algorithms - Various MCMC samplers - Output file generation and saving - Model debiasing and measurement - Taylor expansion around fiducial cosmology - JAX acceleration if enabled

path_to_output

Directory path for saving output files.

Type:

str

likelihood_config

Configuration for likelihood calculation.

Type:

dict

c

Configuration dictionary with run settings including: free_cosmo_name (list): Names of varying cosmological parameters. fiducial_cosmo (dict): Fiducial cosmological parameters. measure (bool): Whether to compute Fisher matrices. debiasing (bool): Whether to compute debiasing terms. hessian_type (str): Type of Hessian to compute. vectorize (bool): Whether to vectorize calculations. taylor (bool): Whether to use Taylor expansion. jax_jit (bool): Whether to use JAX JIT compilation. order (int): Order of Taylor expansion.

Type:

dict

kwargs

Additional keyword arguments including: boltzmann (str): Choice of Boltzmann solver. free_nuisance_name (list): Names of varying nuisance parameters. fiducial_nuisance (dict): Fiducial nuisance parameters.

Type:

dict

I

Inference instance for parameter estimation.

Type:

Inference

run(minimizers=None, samplers=None, initial_pos=None, samplers_options=None,

set_fake=False, sample_fake=False, output=True, save_to_file=False, hash_file=’runs_output’, verbose=True): Run parameter inference with specified minimizers and/or samplers.

set_header(free_param_name, elapse_time)[source]

Create header for output files with run information.

Examples

# Initialize with YAML config files run = Run(‘path/to/run.yaml’, ‘path/to/likelihood.yaml’, ‘path/to/output’)

# Initialize with dictionaries run = Run(run_config_dict, likelihood_config_dict, ‘path/to/output’)

# Run minimization and sampling results = run.run(minimizers=[‘minuit’], samplers=[‘emcee’])

run(minimizers=None, samplers=None, initial_pos=None, samplers_options=None, return_extras=False, set_fake=False, sample_fake=False, output=True, save_to_file=False, hash_file='runs_output', verbose=True)[source]
set_header(free_param_name, elapse_time)[source]