# A Review on Local Failure Probability Sensitivity Analysis
## 3 Local RSA in the Original Input Space
### Statistical Properties of the Score Function Estimate with Crude MC  
In this section, the bias, variance and mean square error of the MC sensitivity estimate are derived. As noted in [20], the crude MC estimate of Equation (6) is unbiased, and its variance is written \[\mathbb{V}\mathrm{ar}\left(\widehat{\frac{\partial P_{f}(\theta)}{\partial\theta_{ \ell}}}^{\mathrm{MC}}\right)=\frac{1}{N}\left(\mathbb{E}_{f_{\mathbf{Z}}}\left[ \mathbb{I}_{D_{f_{\mathbf{Z}}}}(\mathbf{Z})Q(\mathbf{Z})^{2}\right]-\left( \frac{\partial P_{f}(\theta)}{\partial\theta_{\ell}}\right)^{2}\right), \tag{7}\]  
since \(\left(\mathbb{I}_{D_{f_{\mathbf{Z}}}}(\mathbf{z})\right)^{2}=\mathbb{I}_{D_{f _{\mathbf{Z}}}}(\mathbf{z})\) for all \(\mathbf{z}\in\mathbb{R}^{d}\). As the MC sensitivity estimate is unbiased, the expression of its mean square error (mse) \(\mathrm{E}_{\mathrm{mse}}^{\mathrm{MC}}\) is equal to its variance.  
The error estimate is then easy to derive as the quantity \(\mathbb{E}_{f_{\mathbf{Z}}}\left[\mathbb{I}_{D_{f_{\mathbf{Z}}}}(\mathbf{Z}) Q(\mathbf{Z})^{2}\right]\) can be evaluated with a crude MC estimate using the same observations generated to compute both \(P_{f}\) and \(\partial P_{f}(\theta)/\partial\theta_{\ell}\) with the MC method. In the literature, several studies have focused on the expression of the mean square error of estimates obtained with the score function method [21; 22], not necessarily in the failure probability framework. Here, we derive the expression presented in [20], which is fitted to our particular case of \(\mathrm{E}_{\mathrm{mse}}^{\mathrm{MC}}\). The mean square error is bounded with the following inequalities  
\[\frac{1}{N}\left(\frac{1}{P_{f}}-1\right)\left(\frac{\partial P_{f}(\theta)}{ \partial\theta_{\ell}}\right)^{2}\leq\mathrm{E}_{\mathrm{mse}}^{\mathrm{MC}} \leq\frac{1}{N}\left(\sqrt{P_{f}}\sqrt{\mathbb{E}\left[Q(\mathbf{Z})^{4} \right]}-\left(\frac{\partial P_{f}(\theta)}{\partial\theta_{\ell}}\right)^{2 }\right). \tag{8}\]  
The lower bound of Equation (8) is an expression depending on the failure probability and its derivatives; thus, it can be easily derived in practice. The upper bound depends on another quantity: \(\mathbb{E}\left[Q(\mathbf{Z})^{4}\right]\), in addition to \(P_{f}\) and the sensitivity. This quantity can have an analytical expression in very simple cases. Suppose \(\mathbf{Z}\) is a univariate random variable, which follows a normal distribution of mean \(\mu_{\mathbf{Z}}\) and variance \(\sigma_{\mathbf{Z}}^{2}\). We are interested in the derivative of \(P_{f}\) with respect to the mean value \(\mu_{\mathbf{Z}}\). In this scenario, \(\mathbb{E}\left[Q(\mathbf{Z})^{4}\right]=3/\sigma^{4}\)[20] and the right bounds become  
\[\mathrm{E}_{\mathrm{mse}}^{\mathrm{MC}}\leq\frac{1}{N}\left(\frac{\sqrt{3P_{f }}}{\sigma^{2}}-\left(\frac{\partial P_{f}(\theta)}{\partial\mu_{\mathbf{Z}}} \right)^{2}\right).\]  
In the other cases, the analytical expression of \(\mathbb{E}\left[Q(\mathbf{Z})^{4}\right]\) can be more cumbersome, and the quantity is thus estimated with the Monte Carlo method, reusing the same sample once more.  
From the inequality Equation (8), we can conclude that the error, and therefore the variance of the estimate, is proportional to \(1/N\). Consequently, the same variance convergence rate applies for both estimations with the Monte Carlo method of the failure probability \(\hat{P}_{f}^{\mathrm{MC}}\) and its derivatives with respect to distribution parameters: \(\widehat{\frac{\partial P_{f}(\theta)}{\partial\theta_{\ell}}}^{\mathrm{MC}}\)[23].