rxmc.likelihood_model.UnknownNormalizationErrorModel#

class rxmc.likelihood_model.UnknownNormalizationErrorModel[source]#

Bases: ParametricLikelihoodModel

A ParametricLikelihoodModel in which the systematic uncertainty of the normalization of the observation is a parameter, $eta$.

This implies the systematic normalization contribution to the covariance takes the form:

\[\Sigma_{ij}^{sys norm} = \eta**2 y_m(x_i, \alpha) y_m(x_j, \alpha)\]

where $eta$ is a free parameter.

__init__()[source]#

Initializes the LikelihoodModel, optionally with a fractional uncorrelated error.

Methods

__init__()

Initializes the LikelihoodModel, optionally with a fractional uncorrelated error.

chi2(observation, ym, *likelihood_params)

Calculate the generalised chi-squared statistic.

covariance(observation, ym, log_eta)

Returns the following covariance matrix:

log_likelihood(observation, ym, ...)

Returns the log likelihood that ym reproduces observation.y

residual(observation, ym)

Return the residual observation.y - ym.

covariance(observation: Observation, ym: ndarray, log_eta: float)[source]#

Returns the following covariance matrix:

\[\Sigma_{ij} = \sigma^2_{i}^{stat} \delta_{ij} + \Sigma_{ij}^{sys} + \gamma^2 y_m^2(x_i, \alpha)\]

where $sigma^2_{i}^{stat}$ is the statistical variance of the i-th observation, (observation.statistical_covariance) and $gamma$ is the fractional uncorrelated error (self.frac_err).

Here, $Sigma_{ij}^{sys}$ is the systematic covariance matrix:

\[\Sigma_{ij}^{sys} = \eta**2 y_m(x_i, \alpha) y_m(x_j, \alpha) + \omega,\]

where $eta$ is the uncertainty in the overall normalization of the observation (y_sys_err_normalization - in this case, this value is a parameter, and corresponding value in observation is ignored) and $omega$ is the uncertainty in the additive normalization to the observation (observation.y_sys_err_offset).

Here, also, $y_m(x_i, alpha)$ is the model prediction for the i-th observation.

Parameters:
  • observation (Observation) – The observation object containing the observed data.

  • ym (np.ndarray) – Model prediction for the observation.

  • log_eta (float) – natual log of the uncertainty in the overall normalization of the observation.

Returns:

np.ndarray – Covariance matrix of the observation.