# A Review on Local Failure Probability Sensitivity Analysis
## 3 Local RSA in the Original Input Space
### Score Function Method with Advanced Sampling Techniques
#### 3.3.2 Score Function Method with Importance Sampling  
The score function method is, by definition, already an importance sampling (IS) technique, since a density is added in the sensitivity integral. Nevertheless, if this density is selected as \(f_{\mathbf{Z}}\), then the resulting MC estimate is not very efficient, as most of the observations will not be in the failure domain. Suppose the failure probability is estimated in the IS context with an auxiliary density \(h\). The resulting failure probability estimate is written \(\hat{P}_{f}^{\text{IS}}\). This auxiliary density \(h\) is supposed to be capable of generating more observations in the failure domain. Using the same density \(h\), the sensitivity of the failure probability can be estimated as  
\[\frac{\partial P_{f}(\theta)}{\partial\theta_{\ell}}=\int_{\mathbb{R}^{d}} \mathbb{I}_{D_{f_{\mathbf{Z}}}}(\mathbf{z})\frac{1}{h(\mathbf{z})}\frac{ \partial f_{\mathbf{Z}}(\mathbf{z};\theta)}{\partial\theta_{\ell}}h(\mathbf{z })\,\mathrm{d}\mathbf{z}=\mathbb{E}_{h}\big{[}\mathbb{I}_{D_{f_{\mathbf{Z}}}}( \mathbf{Z})Q_{h}(\mathbf{Z})\big{]},\]  
where \(Q_{h}(\cdot)=(1/h)\times(\partial f_{\mathbf{Z}}(\cdot;\theta)/\partial\theta _{\ell})=(f_{\mathbf{Z}}/h)\times(\partial\text{ln}(f_{\mathbf{Z}}(\cdot; \theta))/\partial\theta_{\ell})\). The IS sensitivity estimate is then written  
\[\frac{\widehat{\partial P_{f}(\theta)}}{\partial\theta_{\ell}}^{\text{IS}}= \frac{1}{N}\sum_{j=1}^{N}\mathbb{I}_{D_{f_{\mathbf{Z}}}}\left(\mathbf{Z}^{(j) }\right)Q_{h}\left(\mathbf{Z}^{(j)}\right),\]  
where the random variables \(\mathbf{Z}^{(j)}\) are iid with density \(h\) and are the same observations used for the estimation of \(\hat{P}_{f}^{\text{IS}}\). The simulation budget is kept constant as the score function \(Q_{h}\) does not depend on the costly limit state function \(g\). The IS sensitivity estimate is then unbiased, and its variance, as well as the mean square error, is written  
\[\
abla\text{ar}\left(\widehat{\frac{\partial P_{f}(\theta)}{\partial\theta_{ \ell}}}^{\text{IS}}\right)=\text{E}_{\text{mse}}^{\text{IS}}=\frac{1}{N} \left(\mathbb{E}_{h}\big{[}\mathbb{I}_{D_{f_{\mathbf{Z}}}}(\mathbf{Z})Q_{h}( \mathbf{Z})^{2}\big{]}-\left(\frac{\partial P_{f}(\theta)}{\partial\theta_{ \ell}}\right)^{2}\right).\]  
Using the same computations as in [20], it is possible to derive an upper for the \(\text{E}_{\text{mse}}^{\text{IS}}\) as such  
\[\text{E}_{\text{mse}}^{\text{IS}}\leq\frac{1}{N}\left(\sqrt{P_{f}}\sqrt{ \mathbb{E}_{h}\Bigg{[}\left(\frac{f_{\mathbf{Z}}(\mathbf{Z})}{h(\mathbf{Z})} \right)^{3}\!Q(\mathbf{Z})^{4}\Bigg{]}}-\left(\frac{\partial P_{f}(\theta)}{ \partial\theta_{\ell}}\right)^{2}\right).\]  
Therefore, we notice that compared to the formula Equation (8) the likelihood ratio \(f_{\mathbf{Z}}/h\) to the power 3 is introduced in the expected value. The convergence of \(\text{E}_{\text{mse}}^{\text{IS}}\) is thus greatly affected by the choice of the auxiliary density \(h\). The use of another IS auxiliary density than \(f_{\mathbf{Z}}\) in the score function framework was initiated by [PERSON] in [11, 17] where an adaptive importance sampling scheme is presented and the resulting auxiliary density \(h\) is close to \(h_{\text{opt}}=\mathbb{I}_{D_{f_{\mathbf{Z}}}}f_{\mathbf{Z}}/P_{f}\). Later in [27], the authors developed a simulation method combining the SS framework and the IS technique to build the failure probability estimate, along with the sensitivity estimate with the score function method. Indeed, instead of estimating each intermediate failure probability \(\mathbb{E}_{f_{\mathbf{Z}}|_{i-1}}\big{[}\mathbb{I}_{F_{i}}(\mathbf{Z})\big{]}\) and intermediate sensitivity \(\mathbb{E}_{f_{\mathbf{Z}}|_{i-1}}\big{[}\mathbb{I}_{F_{i}}(\mathbf{Z})Q_{i} (\mathbf{Z})\big{]}\) of the SS framework with crude MC estimates, they employ the IS technique. The samples drawn by IS are then iid and the variance of both the final failure probability estimate and its sensitivity can be derived.