## 2 p-Refined Multilevel Quasi-Monte Carlo
### The Multilevel and Multilevel Quasi Monte Carlo Methods  
Let \(\mathbb{E}[P_{L}(\mathbf{x}^{(n)})]\), or \(\mathbb{E}[P_{L}]\) for short, be the expected value of a particular quantity of interest \(P\) depending on a set of random variables \(\mathbf{x}_{L}^{(n)}\), discretized on mesh \(L\). The standard MC estimator for \(\mathbb{E}[P_{L}]\) using \(N_{L}\) samples on mesh \(L\), denoted as \(Q_{L}^{\text{MC}}\), can be written as  
\[Q_{L}^{\text{MC}}:=\frac{1}{N_{L}}\sum_{n=1}^{N_{L}}P_{L}(\mathbf{x}_{L}^{(n) })\,. \tag{1}\]  
The MLMC method, on the other hand, starts from a reformulation of \(\mathbb{E}[P_{L}]\) as a telescoping sum. The expected value of the quantity of interest on the finest mesh \(L\) is expressed as the expected value of the quantity of interest on the coarsest mesh, plus a series of correction terms (or _differences_), i.e.,  
\[\mathbb{E}[P_{L}]=\mathbb{E}[P_{0}]+\sum_{\ell=1}^{L}\mathbb{E}[P_{\ell}-P_{ \ell-1}]=\sum_{\ell=0}^{L}\mathbb{E}\left[\Delta P_{\ell}\right], \tag{2}\]  
where we defined \(\Delta P_{\ell}:=P_{\ell}(\mathbf{x}_{\ell})-P_{\ell-1}(\mathbf{x}_{\ell})\) with \(P_{-1}:=0\). Each term on the right-hand side is then estimated separately by a standard MC estimator with \(N_{\ell}\) samples, i.e.,  
\[Q_{L}^{\text{MLMC}}:=\frac{1}{N_{0}}\sum_{n=1}^{N_{0}}P_{0}(\mathbf{x}_{0}^{( n)})+\sum_{\ell=1}^{L}\left\{\frac{1}{N_{\ell}}\sum_{n=1}^{N_{\ell}}\left(P_{ \ell}(\mathbf{x}_{\ell}^{(n)})-P_{\ell-1}(\mathbf{x}_{\ell}^{(n)})\right) \right\}, \tag{3}\]  
where \(Q_{L}^{\text{MLMC}}\) is the MLMC estimator for the expected value \(\mathbb{E}[P_{L}]\), which is a discrete approximation for the expected value of the quantity of interest, \(\mathbb{E}[P]\). The MLMC estimator in Equation (3) can be written as a sum of \(L+1\) estimators for the expected value of the difference on each level, i.e.,  
\[Q_{L}^{\text{MLMC}}=\sum_{\ell=0}^{L}\frac{1}{N_{\ell}}\sum_{n=1}^{N_{\ell}} \Delta P_{\ell}^{(n)}, \tag{4}\]  
where we defined \(\Delta P_{\ell}^{(n)}:=P_{\ell}(\mathbf{x}_{\ell}^{(n)})-P_{\ell-1}(\mathbf{x }_{\ell}^{(n)})\) with \(P_{-1}^{(n)}:=0\). Because of the telescoping sum property, i.e., Equation (2), the MLMC estimator is an unbiased estimator for the quantity of interest on the finest mesh, i.e.,  
\[\mathbb{E}[Q_{L}^{\text{MLMC}}]=\mathbb{E}[P_{L}]. \tag{5}\]  
The error is controlled by imposing a tolerance \(\epsilon^{2}\) on the mean square error (MSE) of the estimator, defined as  
\[\text{MSE}(Q_{L}^{\text{MLMC}}) :=\mathbb{E}\left[\left(Q_{L}^{\text{MLMC}}-\mathbb{E}\left[P \right]\right)^{2}\right] \tag{6}\] \[=\mathbb{V}\left[Q_{L}^{\text{MLMC}}\right]+\left(\mathbb{E} \left[Q_{L}^{\text{MLMC}}\right]-\mathbb{E}\left[P\right]\right)^{2}\] \[=\mathbb{V}\left[Q_{L}^{\text{MLMC}}\right]+\left(\mathbb{E} \left[P_{L}-P\right]\right)^{2}.\]The right-hand side of Equation (6) consists of two parts: the variance of the estimator, \(\mathbb{V}\left[Q_{L}^{\text{MLMC}}\right]\), and the squared bias, \(\left(\mathbb{E}\left[P_{L}-P\right]\right)^{2}\). The stopping criterion for multilevel schemes is typically based on the requirements that both terms are less than \(\epsilon^{2}/2\). The root mean square error (RMSE) is defined as, \(\text{RMSE}(Q_{L}^{\text{MLMC}})=\sqrt{\text{MSE}(Q_{L}^{\text{MLMC}})}\). The variance of the estimator satisfies  
\[\mathbb{V}[Q_{L}^{\text{MLMC}}]=\sum_{\ell=0}^{L}\frac{V_{\ell}}{N_{\ell}}, \tag{7}\]  
with \(V_{\ell}:=\mathbb{V}\left[\Delta P_{\ell}\right]\) the variance of the difference, which is used to determine the number of samples \(N_{\ell}\) needed on each level \(\ell\).