# 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.1 Score Function Method with Subset Sampling  
We recall here that the failure probability estimate with subset sampling (SS) [24; 25] has the following expression, with underlined dependence on \(\theta\)\[P_{f}(\mathbf{\theta})=\prod_{i=0}^{q}P_{i}(\mathbf{\theta})\quad\text{ and }\quad\hat{P}_{f}^{\text{SS}}(\mathbf{\theta})=\prod_{i=0}^{q}\hat{P}_{i}^{\text{MC}}( \mathbf{\theta}), \tag{9}\]  
with \(P_{0}(\mathbf{\theta})=\mathbb{P}(F_{0})\) and \(P_{i}(\mathbf{\theta})=\mathbb{P}(F_{i}|F_{i-1})\) for \(i>0\), where \(F_{i}\) are the intermediate failure domains. It is recalled that \(F_{0}\subset F_{1}\subset\ldots\subset F_{q}=D_{f_{\mathbf{Z}}}\)[26]. We assume here that the intermediate failure domains \(F_{0},F_{1},\ldots,F_{q-1}\) are independent of \(\mathbf{\theta}\) and are chosen a priori. As underlined in [27], taking the derivatives of Equation (9) with respect to \(\theta_{\ell}\), for \(\ell=1,\ldots,m\) gives the following equation  
\[\frac{\partial P_{f}(\mathbf{\theta})}{\partial\theta_{\ell}}=\sum_{i=0}^{q}\frac {P_{f}(\mathbf{\theta})}{P_{i}(\mathbf{\theta})}\frac{\partial P_{i}(\mathbf{\theta})}{ \partial\theta_{\ell}}, \tag{10}\]  
where the terms of the sum are defined with the equation  
\[\frac{\partial P_{0}(\mathbf{\theta})}{\partial\theta_{\ell}}=\int_{\mathbb{R}^{d }}\mathbb{I}_{F_{0}}(\mathbf{z})\frac{\partial f_{\mathbf{Z}}(\mathbf{z};\bm {\theta})}{\partial\theta_{\ell}}\,\mathrm{d}\mathbf{z}, \tag{11}\]  
and for \(i>0\)  
\[\frac{\partial P_{i}(\mathbf{\theta})}{\partial\theta_{\ell}}=\int_{\mathbb{R}^{d }}\mathbb{I}_{F_{i}}(\mathbf{z})\frac{\partial f_{\mathbf{Z}}|_{F_{i-1}}( \mathbf{z};\mathbf{\theta})}{\partial\theta_{\ell}}\,\mathrm{d}\mathbf{z}\quad \text{ where }\quad\forall\mathbf{z}\in\mathbb{R}^{d}\quad f_{\mathbf{Z}|F_{i-1}}( \mathbf{z};\mathbf{\theta})=\frac{\mathbb{I}_{F_{i-1}}(\mathbf{z})f_{\mathbf{Z}}( \mathbf{z};\mathbf{\theta})}{\mathbb{P}(F_{i-1})}. \tag{12}\]  
It should be noted that each \(\mathbb{P}(F_{i-1})\) is dependent on \(\mathbf{\theta}\) as well, even if the notation is not explicit. Applying the score function method to the Equations (11) and (12) leads to the final sensitivity estimate  
\[\frac{\partial P_{f}(\mathbf{\theta})}{\partial\theta_{\ell}}=\frac{P_{f}(\mathbf{ \theta})}{P_{0}(\mathbf{\theta})}\mathbb{E}_{f_{\mathbf{Z}}}\big{[}\mathbb{I}_{F_ {0}}(\mathbf{Z})Q(\mathbf{Z})\big{]}+\sum_{i=1}^{q}\frac{P_{f}(\mathbf{\theta})}{P _{i}(\mathbf{\theta})}\mathbb{E}_{f_{\mathbf{Z}|F_{i-1}}}\big{[}\mathbb{I}_{F_{i}} (\mathbf{Z})Q_{i}(\mathbf{Z})\big{]},\]  
where \(Q_{i}=\partial\ln\Big{(}f_{\mathbf{Z}|F_{i-1}}(\cdot;\mathbf{\theta})\Big{)}/ \partial\theta_{\ell}\) for \(i>0\). Those expectations can be evaluated with crude Monte Carlo estimates, reusing the exact same samples generated during the SS procedure  
\[\frac{\widehat{\partial P_{f}(\mathbf{\theta})}^{\text{SS}}}{\partial\theta_{\ell }}=\frac{\hat{P}_{f}^{\text{SS}}(\mathbf{\theta})}{\hat{P}_{0}^{\text{MC}}(\mathbf{ \theta})}\frac{1}{N}\sum_{j=1}^{N}\mathbb{I}_{F_{0}}\Big{(}\mathbf{Z}_{0}^{(j) }\Big{)}Q\Big{(}\mathbf{Z}_{0}^{(j)}\Big{)}+\sum_{i=1}^{q}\frac{\hat{P}_{f}^{ \text{SS}}(\mathbf{\theta})}{\hat{P}_{i}^{\text{MC}}(\mathbf{\theta})}\frac{1}{N}\sum _{j=1}^{N}\mathbb{I}_{F_{i}}\Big{(}\mathbf{Z}_{i}^{(j)}\Big{)}Q_{i}\Big{(} \mathbf{Z}_{i}^{(j)}\Big{)},\]  
where the random variables \(\mathbf{Z}_{0}^{(j)}\) are generated from \(f_{\mathbf{Z}}\) and \(\mathbf{Z}_{i}^{(j)}\) are generated from \(f_{\mathbf{Z}}(\mathbf{z},\cdot|F_{i-1})\), with \(i>0\), see [27] for more details. The simulation budget is therefore constant as the score functions \(Q_{i}\) do not depend on the costly limit state function \(g\). The statistical properties of \(\frac{\widehat{\partial P_{f}(\mathbf{\theta})}^{\text{SS}}}{\partial\theta_{\ell}}\) are quite similar as those of the failure probability estimate \(\hat{P}_{f}^{\text{SS}}\).