Vega Interface

class vega.VegaInterface(main_path)[source]

Main Vega class.

Parse the main config and initialize a correlation item for each component.

If there is data, initialize data and model objects for each component.

Handle the parameter config and call the analysis class.

Parameters:main_path (string) – Path to main.ini config file
bestfit

Access the bestfit results from iminuit.

Returns:Returns the Minimizer class which stores the bestfit values
Return type:Minimizer
chi2(params=None, direct_pk=None)[source]

Compute full chi2 for all components.

Parameters:
  • params (dict, optional) – Computation parameters, by default None
  • direct_pk (1D array or None, optional) – If not None, the full Pk (e.g. from CLASS/CAMB) to be used directly, by default None
Returns:

chi^2

Return type:

float

compute_model(params=None, run_init=True, direct_pk=None)[source]

Compute correlation function model using input parameters.

Parameters:
  • params (dict, optional) – Computation parameters, by default None
  • run_init (boolean, optional) – Whether to run model.init() before computing the model, by default True
  • direct_pk (1D array or None, optional) – If not None, the full Pk (e.g. from CLASS/CAMB) to be used directly, by default None
Returns:

Dictionary of cf models for each component

Return type:

dict

compute_sensitivity(nominal=None, frac=0.1, verbose=True)[source]

Compute the model sensitivity to each floating parameter.

Calculate numerical partial derivatives of the model with respect to each floating pararameter, evaluated at a specified point in parameter space. Calculate Fisher information distributed over bins of (rt,rp). Results are stored in a dictionary attribute named sensitivity with keys nominal, partials, and fisher.

Parameters:
  • nominal (dict or None) – Dictionary of (value,error) tuples for each floating parameter. Uses the results of the last call to minimize when None, or raises a RuntimeError when minimize has not yet been called.
  • frac (float) – Estimate partial derivatives of the likelihood using central finite differences at value +/- frac * error for each floating parameter.
  • verbose (bool) – Print progress of the computation when True.
log_lik(params=None, direct_pk=None)[source]

Compute full log likelihood for all components.

Parameters:
  • params (dict, optional) – Computation parameters, by default None
  • direct_pk (1D array or None, optional) – If not None, the full Pk (e.g. from CLASS/CAMB) to be used directly, by default None
Returns:

log Likelihood

Return type:

float

minimize()[source]

Minimize the chi2 over the sampled parameters.

monte_carlo_sim(params=None, scale=None, seed=0, forecast=False)[source]

Compute Monte Carlo simulations for each Correlation item.

Parameters:
  • params (dict, optional) – Computation parameters, by default None
  • scale (float/dict, optional) – Scaling for the covariance, by default 1.
  • seed (int, optional) – Seed for the random number generator, by default 0
  • forecast (boolean, optional) – Forecast option. If true, we don’t add noise to the mock, by default False
Returns:

Dictionary with MC mocks for each item

Return type:

dict

set_fast_metals()[source]

Activate fast metals. This is automatically called when running the minimizer or the sampler.

class vega.correlation_item.CorrelationItem(config, model_pk=False)[source]

Class for handling the info and config of each correlation function component.

Parameters:config (ConfigParser) – parsed config file
init_broadband(coeff_binning_model)[source]

Initialize the parameters we need to compute the broadband functions

Parameters:
  • bin_size_rp (int) – Size of r parallel bins
  • coeff_binning_model (float) – Ratio of distorted coordinate grid bin size to undistorted bin size
init_metals(tracer_catalog, metal_correlations)[source]

Initialize the metal config.

This should be called from the data object if we have metal matrices.

Parameters:
  • tracer_catalog (dict) – Dictionary containing all tracer objects (metals and the core ones)
  • metal_correlations (list) – list of all metal correlations we need to compute