## 2 Variance Reduction in Importance Sampling  
As we know, the Monte Carlo method takes a long time to simulate, especially since the accuracy of this method is not reliable in cases where the probability is extremely small. Consider the general case of estimating the \(d\)-dimensional integral as follows:  
Figure 1: Two-state MMPP.  
\[I_{\phi}=\int_{\mathbb{R}^{d}}\phi(x)f(x)dx\]  
where \(f:\mathbb{R}^{d}\rightarrow\mathbb{R}\) is the probability density function of a random variable \(X\) and \(\phi:\mathbb{R}^{d}\rightarrow\mathbb{R}\) is a positive integral function. Let us consider the simple case when \(\phi=\mathbf{1}_{A}\) with \(A\) is a subset of \(\mathbb{R}^{d}\), as follows:  
\[\mathbf{1}_{A}=\begin{cases}1,&\text{if}\quad X\in A,\\ 0,&\text{if}\quad X\
otin A\end{cases}\]  
Thus, \(I_{\phi}\) is the probability that \(X\in A\) with \(X\) is distributed according to the probability density function \(f\). The Monte Carlo estimation of the integral \(I_{\phi}\) is given by  
\[I_{\phi}^{MC}=\frac{1}{N}\sum_{i=1}^{N}\phi(X_{i})\]  
where \(X_{1},X_{2},\ldots,X_{N}\) are random samples generated by function \(f\). The variance of \(I_{\phi}^{MC}\) is given by  
\[Var(I_{\phi}^{MC})=\frac{1}{N}\left(\int_{\mathbb{R}^{d}}\phi(x)^{2}f(x)dx-I_ {\phi}^{2}\right)\]  
Since \(\phi(x)=\mathbf{1}_{A}\), we have \(\phi(x)^{2}=\phi(x),\forall x\), and  
\[\int_{\mathbb{R}^{d}}\phi(x)^{2}f(x)dx=\int_{\mathbb{R}^{d}}\phi(x)f(x)dx\]  
We have the variance of \(I_{\phi}^{MC}\) only depending on \(N\) and \(I_{\phi}\)  
\[Var(I_{\phi}^{MC})=\frac{1}{N}\left(I_{\phi}-I_{\phi}^{2}\right)\]  
The standard deviation of \(I_{\phi}^{MC}\), \(\sigma_{I_{\phi}^{MC}}\) is given by  
\[\sigma_{I_{\phi}^{MC}}=\frac{1}{\sqrt{N}}\sqrt{\left(I_{\phi}-I_{\phi}^{2} \right)}\]  
When the event \(\{X\in A\}\) is a rare event, the probability \(I_{\phi}\) becomes very small, and the standard deviation of \(I_{\phi}^{MC}\) tends towards \(\sqrt{\frac{I_{\phi}}{N}}\). In this case, unless the sample size \(N\) takes very large values, \(\sqrt{\frac{I_{\phi}}{N}}\) is much larger than \(I_{\phi}\). Therefore, the Monte Carlo estimation is not adapted to estimate such low probabilities.  
The IS technique is the alternative method to reduce the variance of Monte Carlo techniques without increasing the sample size \(N\). In IS simulation, an auxiliary PDF \(h\) is used to generate the samples \(X_{1},X_{2},\ldots,X_{N}\), and then estimate \(I_{\phi}\) as follows:  
\[I_{\phi}^{IS}=\frac{1}{N}\sum_{i=1}^{N}\phi(X_{i})\frac{f(X_{i})}{h(X_{i})}\]  
Then, the expected value of \(I_{\phi}^{IS}\) is given by  
\[E(I_{\phi}^{IS})=\frac{1}{N}\sum_{i=1}^{N}\int_{\mathbb{R}^{d}}\phi(x_{i}) \frac{f(x_{i})}{h(x_{i})}h(x_{i})dx_{i}\]  
The term \(I_{\phi}^{IS}\) is an unbiased estimator of \(I_{\phi}\) since  
\[E(I_{\phi}^{IS})=\int_{\mathbb{R}^{d}}\phi(x)f(x)dx=I_{\phi}\]Denote \(w(X)=\dfrac{f(X)}{h(X)}\); the variance of \(I_{\phi}^{IS}\) given by  
\[Var(I_{\phi}^{IS}) = \dfrac{1}{N}\bigg{(}\int_{\mathbb{R}^{d}}\phi(x)^{2}w(x)^{2}h(x)dx- I_{\phi}^{2}\bigg{)}\] \[= \dfrac{1}{N}(E(\phi(X)^{2}w(X)^{2})-I_{\phi}^{2})\]  
Thus, the variance of the IS estimate notably depends on the choice of \(h\) function. If \(h\) is well chosen, then the variance of the IS estimate can be very low. However, conversely, if \(h\) is chosen and not adapted, the variance of the IS estimate can be higher than the Monte Carlo estimate. Therefore, by choosing the adapted \(h\) function, IS simulation can reduce the variance of Monte Carlo simulation.