# Estimating Tail Probabilities of Random Sums of Phase-Type Scale Mixture Random Variables +
## 3 Simulation Methods
### Asmussen-Kroese-Type Algorithm
#### 3.1.1 Exponential Twisting  
The exponential twisting method is asymptotically optimal for tail probabilities of random sums with light-tailed summands ([14]). **Definition 1**. : _The estimator \(\widehat{\ell}(u)\) generated using the probability measure \(\mathbb{P}\) is said to be an asymptotically optimal estimator of \(\mathbb{E}_{\mathbb{P}}[\widehat{\ell}(u)]\) if and only if_  
\[\log\!\left(\sqrt{\mathbb{E}_{\mathbb{P}}[\widehat{\ell}(u)^{2}]}\right)/\log \!\left(\mathbb{E}_{\mathbb{P}}[\widehat{\ell}(u)]\right)\sim 1.\]  
The method is specified as follows:  
Define an exponential family of PDFs \(\{f_{\theta},\theta\in\Theta\}\) based on the original PDF of any random variable \(X,f\), via  
\[f_{\theta}(x)=\frac{\mathrm{e}^{\theta x}}{M_{X}(\theta)}\,f(x)=\mathrm{e}^{ \theta x-\ln M_{X}(\theta)}\,f(x)\,,\]  
where \(M_{X}(\theta)=\int\mathrm{e}^{\theta x}f(x)\mathrm{d}x\) is the MGF of \(X\). The likelihood ratio of a single element associated with this change of measure (i.e., using measure \(f_{\theta}(x)\mathrm{d}x\) instead of \(f(x)\mathrm{d}x\)) is  
\[\frac{f(X)}{f_{\theta}(X)}=\mathrm{e}^{-\theta X+\zeta(\theta)}\,,\]  
where \(\zeta(\theta)=\ln M_{X}(\theta)\) is the cumulant function of \(X\). Then, the twisted mean is \(\mu_{\theta}=\mathbb{E}_{\theta}[X]=\zeta^{\prime}(\theta)\) ([15]). The selection of a proper twisting parameter \(\theta\) is a key aspect in the implementation of this method. For dealing with the random sum (1), we select the twisting parameter \(\theta\) such that the changed mean of the random sum is equal to the threshold, that is, \(\mathbb{E}_{\theta}[S_{N}|N=n]=u\). Note that \(\mathbb{E}_{\theta}[\sum_{i=1}^{N}Z_{i}|N=n]=n\,\mathbb{E}[W]\,\mathbb{E}_{ \theta}[X]\). For the case of conditioning on light-tailed scaling random variables, we combine the estimator (3) with the above importance sampling method, and arrive at the following estimator for a single replicate:  
\[\widehat{\ell}_{\mathrm{ConAK1+FS}}(u)=N\,\overline{F}\!\left(\frac{Z_{N-1}^ {\star}\vee(u-S_{N-1})}{W_{N}}\right)\times\frac{h(W_{N})}{h_{\theta}(W_{N})}\,, \tag{5}\]  
where \(W_{N}\) is a generic copy of the scaling random variable, and \(h\) is the PDF of \(W_{N}\). We further combine the estimators (3) and (5) with a control variate for \(N\) to improve the efficiency, which is based on the subexponential asymptotics \(\lim_{u\to\infty}\frac{\mathbb{P}(S_{N}>u)}{\mathbb{E}[N]\mathbb{E}(u)}=1\):  
\[\widehat{\ell}_{\mathrm{ConAK1+CS}}(u)=N\,\overline{F}\!\left(\frac{Z_{N-1}^ {\star}\vee(u-S_{N-1})}{W_{N}}\right)-(N-\mathbb{E}[N])\,\overline{F}\!\left( \frac{u}{W_{N}}\right), \tag{6}\]  
\[\widehat{\ell}_{\mathrm{ConAK1+FS+CV}}(u)=N\overline{F}\!\left(\frac{Z_{N-1}^ {\star}\vee(u-S_{N-1})}{W_{N}}\right)\times\frac{h(W_{N})}{h_{\theta}(W_{N})} -(N-\mathbb{E}[N])\,\overline{F}\!\left(\frac{u}{W_{N}}\right)\times\frac{h(W_ {N})}{h_{\theta}(W_{N})}\,. \tag{7}\]  
For the case of conditioning on the PH random variables, we combine the estimator (4) with the above importance sampling method for both light- and heavy-tailed scaling distributions, and arrive at the following estimator for a single replicate:  
\[\widehat{\ell}_{\mathrm{ConAK2+FS}}(u)=N\,\overline{H}\!\left(\frac{Z_{N-1}^ {\star}\vee(u-S_{N-1})}{X_{N}}\right)\times\frac{f(X_{N})}{f_{\theta}(X_{N})}\,. \tag{8}\]  
where \(X_{N}\) is a generic copy of the PH random variable, and \(f\) is the PDF of \(X_{N}\). We further combine the estimators (4) and (8) with a control variate for \(N\) to improve the efficiency, which is based on the same subexponential asymptotics as in (6):  
\[\widehat{\ell}_{\mathrm{ConAK2+CV}}(u)=N\,\overline{H}\!\left(\frac{Z_{N-1}^ {\star}\vee(u-S_{N-1})}{X_{N}}\right)-(N-\mathbb{E}[N])\,\overline{H}\!\left( \frac{u}{X_{N}}\right), \tag{9}\]\[\widehat{\ell}_{\text{ConAK2+IS+CV}}(u)=N\overline{H}\!\left(\frac{Z_{N-1}^{\star} \vee(u-S_{N-1})}{X_{N}}\right)\times\frac{f(X_{N})}{f_{\theta}(X_{N})}-(N- \mathbb{E}[N])\,\overline{H}\!\left(\frac{u}{X_{N}}\right)\times\frac{f(X_{N})} {f_{\theta}(X_{N})}\,. \tag{10}\]