Skip to content

Take into account uncertainty on alpha and beta when learning calibration #419

Description

@RemiLehe

In train_calibration, we minimize a given loss function by tuning the calibration weights and biases, which actually correspond to the normalized calibration coefficients and offsets.

The loss function can thus be written as $\mathcal{L}( \boldsymbol{c_{NC}}, \boldsymbol{o_{NC}} )$, where $\boldsymbol{c_{NC}}$ represents the vector of the normalized calibration (NC) coefficients (input and output coefficients concatenated in a single vector), and $\boldsymbol{o_{NC}}$ represents the vector of the normalized calibration offsets (input and output offsets concatenated in a single vector).

In order to make sure that the inferred alpha and beta coefficients do not differ too much from the guess value, we would like to add a penalization term in the loss function:

$$\mathcal{L}( \boldsymbol{c_{NC}}, \boldsymbol{o_{NC}} ) = RMSE( \boldsymbol{c_{NC}}, \boldsymbol{o_{NC}} ) + \frac{(\boldsymbol{\alpha_I}-\boldsymbol{\alpha_G})^2}{\boldsymbol{\alpha_U}^2} + \frac{(\boldsymbol{\beta_I}-\boldsymbol{\beta_G})^2}{\boldsymbol{\beta_U}^2}$$

where the $\boldsymbol{\alpha}$ and $\boldsymbol{\beta}$ represent the vector of alphas and betas (with input and output alphas and betas concatenated). I=inferred, G=guess, U=uncertainty. The problem with this expression however is that the dependency of the additional terms on the $\boldsymbol{c_{NC}}, \boldsymbol{o_{NC}}$ is not yet made explicit.

These expressions are known:
$$\alpha_I = \frac{1}{c_I} = \frac{1}{c_G c_{CN}}$$
$$\beta_I = o_I = o_G + c_G o_N+ c_G c_N o_{NC} - c_I o_N$$

Hence:
$$\mathcal{L}( \boldsymbol{c_{NC}}, \boldsymbol{o_{NC}} ) = RMSE( \boldsymbol{c_{NC}}, \boldsymbol{o_{NC}} ) + \frac{\left( \frac{1}{\boldsymbol{c_G c_{CN}}} -\boldsymbol{\alpha_G}\right)^2}{\boldsymbol{\alpha_U}^2} + \frac{(\boldsymbol{o_G} + \boldsymbol{c_G o_N}+ \boldsymbol{c_G c_N o_{NC}} - \boldsymbol{c_I o_N} -\boldsymbol{\beta_G})^2}{\boldsymbol{\beta_U}^2}$$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions