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}$$
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
alphaandbetacoefficients do not differ too much from the guess value, we would like to add a penalization term in the loss function:where the$\boldsymbol{\alpha}$ and $\boldsymbol{\beta}$ represent the vector of $\boldsymbol{c_{NC}}, \boldsymbol{o_{NC}}$ is not yet made explicit.
alphas andbetas (with input and outputalphas andbetas concatenated).I=inferred,G=guess,U=uncertainty. The problem with this expression however is that the dependency of the additional terms on theThese 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}$$