cogwheel.likelihood.marginalization.base.ProposingCoherentScore

class cogwheel.likelihood.marginalization.base.ProposingCoherentScore(*, sky_dict, lookup_table=None, log2n_qmc: int = 11, seed=0, n_qmc_sequences=128, min_n_effective=50, max_log2n_qmc: int = 15, beta_temperature=0.5, learning_rate=0.01, **kwargs)

Bases: BaseCoherentScore

Extends BaseCoherentScore by providing logic to come up with a proposal distribution for the times of arrival at each detector.

Parameters:
beta_temperaturefloat or float array of shape (n_detectors,)

Inverse temperature, tempers the arrival time probability at each detector.

learning_ratefloat

How aggressively to update the following guess for the time- of-arrival proposal.

Methods

get_init_dict

Return dictionary with keyword arguments to __init__.

get_marginalization_info

Return a MarginalizationInfo object with extrinsic parameter integration results.

get_module_name

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

optimize_beta_temperature

Set .beta_temperature, an array of shape (n_det,) with per- detector inverse-temperature values (used to temper the proposal distribution) tuned so as to maximize the efficiency of importance sampling.

reinstantiate

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

to_json

Write class instance to json file.

Attributes

n_qmc_sequences

Number of QMC sequences to alternate between.

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_marginalization_info(d_h_timeseries, h_h, times, lnl_marginalized_threshold=-inf)

Return a MarginalizationInfo object with extrinsic parameter integration results.

Adaptive importance sampling is performed, which requires an initial proposal. This method comes up with a proposal, half based on the d_h timeseries and half based on the adaptions from previous calls to this function. Thus, as a side effect ._t_arrival_prob is updated (if .learning_rate != 0).

get_module_name()

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

property n_qmc_sequences

Number of QMC sequences to alternate between.

optimize_beta_temperature(dh_timeseries, h_h, times, beta_rng=(0.1, 1))

Set .beta_temperature, an array of shape (n_det,) with per- detector inverse-temperature values (used to temper the proposal distribution) tuned so as to maximize the efficiency of importance sampling.

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.