Clarity and consistency

This commit is contained in:
2026-07-02 22:37:22 +03:00
parent 32aa829603
commit a82885fe2d
+22 -22
View File
@@ -525,27 +525,27 @@ Importantly, we must save the calculation of $\tau$ for the backward derivation,
Firstly, for the true population, we calculate the derivatives.
\[
\dfrac{\partial \hat{F}_1(\hat{F}_0^{-1}(\alpha))}{\partial f_{\theta}(x_i)} =
\frac{\partial \sum_{x_j \in \mathcal{B}_1} (\sigma_1(f_{\theta}(x_j) - \tau))}{\partial f_{\theta}(x_i)}
\dfrac{\partial \hat{F}_1(\hat{F}_0^{-1}(\alpha))}{\partial f_{\theta}(\mathbf{x}_i)} =
\frac{\partial \sum_{\mathbf{x}_j \in \mathcal{B}_1} (\sigma_1(f_{\theta}(\mathbf{x}_j) - \tau))}{\partial f_{\theta}(\mathbf{x}_i)}
\]
\[
= \frac{\partial \left(\sum_{x_j \in \mathcal{B}_1 ; j \neq i} \frac{1}{|\mathcal{B}_1|}(\sigma_1(f_{\theta}(x_j) - \tau)) + \frac{1}{|\mathcal{B}_1|}\sigma_1(f_{\theta}(x_i) - \tau)\right)}{\partial f_{\theta}(x_i)}
= \frac{\partial \left(\sum_{\mathbf{x}_j \in \mathcal{B}_1 ; j \neq i} \frac{1}{|\mathcal{B}_1|}(\sigma_1(f_{\theta}(\mathbf{x}_j) - \tau)) + \frac{1}{|\mathcal{B}_1|}\sigma_1(f_{\theta}(\mathbf{x}_i) - \tau)\right)}{\partial f_{\theta}(\mathbf{x}_i)}
\]
\[
= \frac{1}{|\mathcal{B}_1|}\sigma_1'(f_{\theta}(x_i) - \tau)
= \frac{1}{|\mathcal{B}_1|}\sigma_1'(f_{\theta}(\mathbf{x}_i) - \tau)
\]
Now, for the false population. As stated in the roll framework equation above (TODO LINK) we must first compute the derivation w.r.t the threshold $\tau = \hat{F}_{0}^{-1}(\alpha)$:
Now, for the false population. As stated in the roll framework equation above (TODO LINK) we must first compute the derivative w.r.t the threshold $\tau = \hat{F}_{0}^{-1}(\alpha)$:
\[
\frac{\partial \hat{F}_1(\hat{F}_0^{-1}(\alpha))}{\partial \hat{F}_0^{-1}(\alpha)} = \frac{\partial \sum_{x_j \in \mathcal{B}_1} (\sigma_1(f_{\theta}(x_j) - \tau))}{\partial \tau}
\frac{\partial \hat{F}_1(\hat{F}_0^{-1}(\alpha))}{\partial \hat{F}_0^{-1}(\alpha)} = \frac{\partial \sum_{\mathbf{x}_j \in \mathcal{B}_1} (\sigma_1(f_{\theta}(\mathbf{x}_j) - \tau))}{\partial \tau}
\]
\[
= -\frac{1}{|\mathcal{B}_1|}\sum_{x_i \in \mathcal{B}_1}\sigma_1'(f_{\theta}(x_i) - \tau)
= -\frac{1}{|\mathcal{B}_1|}\sum_{\mathbf{x}_i \in \mathcal{B}_1}\sigma_1'(f_{\theta}(\mathbf{x}_i) - \tau)
\]
At this point, we must calculate the derivative of the threshold w.r.t each score from the false population.
@@ -558,56 +558,56 @@ In order to derive this, we can utilize our earlier computation, along with the
f'(x) = \frac{1}{f^{-1}'(f(x))}
\]
This equation shows the relationship between a function's derivative and it's inverse. It shows that we may use the derivative of the
This equation shows the relationship between a function's derivative and its inverse. It shows that we may use the derivative of the
inverse function. However, in order to do this, we must first define what is the inverse we are looking for.
As a reminder we are trying to calculate $\frac{\partial \hat{F}_0^{-1}(\alpha ; X_0)}{\partial f_\theta(\mathbf{x}_i)}$. That is, we have a fuction that takes $\alpha, \mathbf{X}_0$ as parameters and calculates
our threshold $\tau$. We are trying to calculate the derivative of this function w.r.t $x_i$.
As a reminder we are trying to calculate $\frac{\partial \hat{F}_0^{-1}(\alpha ; \mathcal{B}_0)}{\partial f_\theta(\mathbf{x}_i)}$. That is, we have a function that takes $\alpha, \mathcal{B}_0$ as parameters and calculates
our threshold $\tau$. We are trying to calculate the derivative of this function w.r.t $\mathbf{x}_i$.
Therefor, we must inverse the function in order to calculate $x_i$ given $\alpha, \tau$ and all $X_0 \backslash \{x_i\}$.
Therefore, we must invert the function in order to calculate $\mathbf{x}_i$ given $\alpha, \tau$ and all $\mathcal{B}_0 \backslash \{\mathbf{x}_i\}$.
This inverse equation is given by:
\[
\sigma^{-1}\left( |\mathcal{B}_0|\cdot\alpha - \sum_{x_j \in \mathcal{B}_0 ; j \neq i}\sigma(\tau - f_{\theta}(\mathbf{x}_j))\right) + \tau
\sigma^{-1}\left( |\mathcal{B}_0|\cdot\alpha - \sum_{\mathbf{x}_j \in \mathcal{B}_0 ; j \neq i}\sigma(\tau - f_{\theta}(\mathbf{x}_j))\right) + \tau
\]
This is the inverse function given, and so we must calculate:
Applying the inverse derivative rule to this inverse:
\[
\frac{\partial \hat{F}_0^{-1}(\alpha ; X_0)}{\partial f_\theta(\mathbf{x}_i)} = \frac{1}{\frac{\partial \sigma^{-1}\left( |\mathcal{B}_0|\cdot \alpha - \sum_{x_j \in \mathcal{B}_0 ; j \neq i}\sigma(\tau - f_{\theta}(x_j))\right) + \tau}{\partial \tau}}
\frac{\partial \hat{F}_0^{-1}(\alpha ; \mathcal{B}_0)}{\partial f_\theta(\mathbf{x}_i)} = \frac{1}{\frac{\partial \sigma^{-1}\left( |\mathcal{B}_0|\cdot \alpha - \sum_{\mathbf{x}_j \in \mathcal{B}_0 ; j \neq i}\sigma(\tau - f_{\theta}(\mathbf{x}_j))\right) + \tau}{\partial \tau}}
\]
Applying the chain rule:
\[
= \frac{1}{\sigma^{-1}'\left( |\mathcal{B}_0|\cdot \alpha - \sum_{x_j \in \mathcal{B}_0 ; j \neq i}\sigma(\tau - f_{\theta}(x_j))\right)\cdot\left( \sum_{x_j \in \mathcal{B}_0 ; j \neq i}\sigma'(\tau - f_{\theta}(\mathbf{x}_j))\right) + 1}
= \frac{1}{\sigma^{-1}'\left( |\mathcal{B}_0|\cdot \alpha - \sum_{\mathbf{x}_j \in \mathcal{B}_0 ; j \neq i}\sigma(\tau - f_{\theta}(\mathbf{x}_j))\right)\cdot\left( \sum_{\mathbf{x}_j \in \mathcal{B}_0 ; j \neq i}\sigma'(\tau - f_{\theta}(\mathbf{x}_j))\right) + 1}
\]
Remembering the calculation of $\alpha$ we get:
\[
\alpha = \sum_{x_i \in \mathcal{B}_0}\sigma(\tau - f_{\theta}(x_j)) \Rightarrow
\alpha = \sum_{\mathbf{x}_j \in \mathcal{B}_0}\sigma(\tau - f_{\theta}(\mathbf{x}_j)) \Rightarrow
\]
\[
|\mathcal{B}_0|\cdot \alpha - \sum_{x_j \in \mathcal{B}_0 ; j \neq i}\sigma(\tau - f_{\theta}(x_j)) = \sigma(\tau - f_{\theta}(x_i))
|\mathcal{B}_0|\cdot \alpha - \sum_{\mathbf{x}_j \in \mathcal{B}_0 ; j \neq i}\sigma(\tau - f_{\theta}(\mathbf{x}_j)) = \sigma(\tau - f_{\theta}(\mathbf{x}_i))
\]
Therefor, our derivative to calculate from before is equal to:
Therefore, our derivative to calculate from before is equal to:
\[
\frac{\partial \hat{F}_0^{-1}(\alpha ; X_0)}{\partial f_\theta(\mathbf{x}_i)} = \frac{1}{\sigma^{-1}'\left( \sigma(\tau - f_{\theta}(x_i) \right)\cdot\left( \sum_{x_j \in \mathcal{B}_0 ; j \neq i}\sigma'(\tau - f_{\theta}(\mathbf{x}_j))\right) \right) + 1 }
\frac{\partial \hat{F}_0^{-1}(\alpha ; \mathcal{B}_0)}{\partial f_\theta(\mathbf{x}_i)} = \frac{1}{\sigma^{-1}'\left( \sigma(\tau - f_{\theta}(\mathbf{x}_i)) \right)\cdot\left( \sum_{\mathbf{x}_j \in \mathcal{B}_0 ; j \neq i}\sigma'(\tau - f_{\theta}(\mathbf{x}_j))\right) + 1 }
\]
And remembering our chain rule, we note that $\frac{1}{\sigma^{-1}'(\sigma(\tau - f_{\theta}(x_i)))} = \sigma'(\tau - f_{\theta}(x_i))$
Recalling the inverse derivative identity $\frac{1}{(f^{-1})'(f(x))} = f'(x)$, we note that $\frac{1}{\sigma^{-1}'(\sigma(\tau - f_{\theta}(\mathbf{x}_i)))} = \sigma'(\tau - f_{\theta}(\mathbf{x}_i))$.
And so:
Therefore:
\[
\frac{\partial \hat{F}_0^{-1}(\alpha ; X_0)}{\partial f_\theta(\mathbf{x}_i)} = \frac{\sigma'(\tau - f_{\theta}(x_i))}{\left( \sum_{x_j \in \mathcal{B}_0 ; j \neq i}\sigma'(\tau - f_{\theta}(\mathbf{x}_j))\right) + 1}
\frac{\partial \hat{F}_0^{-1}(\alpha ; \mathcal{B}_0)}{\partial f_\theta(\mathbf{x}_i)} = \frac{\sigma'(\tau - f_{\theta}(\mathbf{x}_i))}{\left( \sum_{\mathbf{x}_j \in \mathcal{B}_0 ; j \neq i}\sigma'(\tau - f_{\theta}(\mathbf{x}_j))\right) + 1}
\]
Which we can plug back into the ROLL derivation framework.