cogwheel.likelihood.marginalization.base.BaseCoherentScoreHM

class cogwheel.likelihood.marginalization.base.BaseCoherentScoreHM(*, sky_dict, m_arr, lookup_table=None, log2n_qmc: int = 11, nphi=128, seed=0, n_qmc_sequences=128, min_n_effective=50, max_log2n_qmc: int = 15, **kwargs)

Bases: BaseCoherentScore

With higher order modes it is not possible to marginalize the orbital phase analytically so we use trapezoid quadrature.

BaseCoherentScoreHM provides attributes and methods for doing that.

Attributes:
m_arr
m_inds
mprime_inds
nphi

Number of orbital phase values to integrate over using the trapezoid rule.

Parameters:
sky_dict.skydict.SkyDictionary
m_arrint array

m number of the harmonic modes considered.

lookup_table

Instance of lookup_table.LookupTable

log2n_qmcint

Base-2 logarithm of the number of requested extrinsic parameter samples.

nphiint

Number of orbital phases over which to perform marginalization with trapezoid quadrature rule.

seed{int, None, np.random.RandomState}

For reproducibility of the extrinsic parameter samples.

n_qmc_sequencesint

The coherent score instance will generate n_qmc_sequences QMC sequences and cycle through them in subsequent calls. This alleviates the problem of repeated extrinsic parameter samples, without increasing the computational cost. It can also be used to estimate the uncertainty of the marginalized likelihood computation.

min_n_effectiveint

Minimum effective sample size to use as convergence criterion. The program will try doubling the number of samples from log2n_qmc until a the effective sample size reaches min_n_effective or the number of extrinsic samples reaches 2**max_log2n_qmc.

max_log2n_qmcint

Base-2 logarithm of the maximum number of extrinsic parameter samples to request. The program will try doubling the number of samples from log2n_qmc until a the effective sample size reaches min_n_effective or the number of extrinsic samples reaches 2**max_log2n_qmc.

Methods

get_init_dict

Return dictionary with keyword arguments to __init__.

get_module_name

Name of the module that defines the instance's class.

reinstantiate

Return a new instance of the class, possibly updating init_kwargs.

to_json

Write class instance to json file.

Attributes

DLNL_THRESHOLD

n_qmc_sequences

Number of QMC sequences to alternate between.

nphi

Number of orbital phase values to integrate over using the trapezoid rule.

subclass_registry

get_init_dict(**kwargs)

Return dictionary with keyword arguments to __init__.

Only works if the class stores its init parameters as attributes with the same names. Otherwise, the subclass should override this method.

Parameters:
**kwargs

Allows to manually override some keys. The remaining ones will be read from the instance’s attributes. All keywords must be in the __init__ signature. It’s mostly here to facilitate overriding by subclasses.

get_module_name()

Name of the module that defines the instance’s class.

property n_qmc_sequences

Number of QMC sequences to alternate between.

property nphi

Number of orbital phase values to integrate over using the trapezoid rule. Setting this attribute also defines:

  • ._dh_phasor

  • ._hh_phasor

  • ._phi_ref

reinstantiate(**new_init_kwargs)

Return a new instance of the class, possibly updating init_kwargs.

Values not passed will be taken from the current instance.

to_json(dirname, basename=None, *, dir_permissions=493, file_permissions=420, overwrite=False)

Write class instance to json file.

It can then be loaded with read_json.