rxmc.likelihood_model.UnknownNormalizationModel#
- class rxmc.likelihood_model.UnknownNormalizationModel[source]#
Bases:
ParametricLikelihoodModelA ParametricLikelihoodModel in which the (log of the) multiplicative factor of the model output is a free parameter. In this case, the covariance does not include systematic errors due to the normalization, as the data are explicitly re-normalized.
This corresponds to a statistical model:
\[y_i + \epsilon_i = \rho y_m(x_i, \alpha) + \epsilon_i + \dots\]where $rho$ is a free parameter corresponding to the multiplicative normalization factor. This corresponds to the Kennedy & O’Hagan (2001) treatment of normalization of model output in in ‘Bayesian calibration of computer models’. Here the normalization is not associated with the data, but is a latent parameter which scales the model output to best fit the data.
This should not be confused with UnknownDataNormalizationModel, in which the normalization of the data is a free parameter.
In fact, the confusion between them is related to Peelle’s Pertinent Puzzle, or D’Agostin bias.
- __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, log_rho)Calculate the generalised chi-squared statistic.
covariance(observation, ym, log_rho)Returns the statistical covariance matrix:
log_likelihood(observation, ym, log_rho)Returns the log_likelihood that ym reproduces y, given the covariance
residual(observation, ym, log_rho)Returns the residual between the renormalized model prediction ym and observation.y
- covariance(observation: Observation, ym: ndarray, log_rho: float)[source]#
Returns the statistical covariance matrix:
\[\Sigma_{ij}^{stat} = \sigma^2_{i}^{stat} \delta_{ij}\]where $sigma^2_{i}^{stat}$ is the statistical variance of the i-th observation, (observation.statistical_covariance).
When the normalization is a free parameter, the systematic normalization contribution to the covariance is not included, as the data are explicitly re-normalized.
- Parameters:
observation (Observation) – The observation object containing the observed data.
ym (np.ndarray) – Model prediction for the observation
log_rho (float) – natural log of the multiplicative normalization factor.
- residual(observation: Observation, ym: ndarray, log_rho: float)[source]#
Returns the residual between the renormalized model prediction ym and observation.y
- Parameters:
observation (Observation) – The observation object containing the observed data.
ym (np.ndarray) – Model prediction for the observation.
log_rho (float) – natural log of the multiplicative normalization factor.
- Returns:
np.ndarray – Residual vector.
- chi2(observation: Observation, ym: ndarray, log_rho: float)[source]#
Calculate the generalised chi-squared statistic. This is the square of the Mahalanobis distance between y and ym
- Parameters:
observation (Observation) – The observation object containing the observed data.
ym (np.ndarray) – Model prediction for the observation.
log_rho (float) – natural log of the multiplicative normalization factor.
- Returns:
float – Chi-squared statistic.
- log_likelihood(observation: Observation, ym: ndarray, log_rho: float)[source]#
Returns the log_likelihood that ym reproduces y, given the covariance
- Parameters:
ym (np.ndarray) – Model prediction for the observation.
observation (Observation) – The observation object containing the observed data.
log_rho (float) – natural log of the multiplicative normalization factor.
- Returns:
float