Then from an ESS estimate, we can approximate the root means squared error as follows:

rmse_estimate =2/sqrt(ess_estimate)rmse_estimate

[1] 0.03226313

As you can see, this is pessimistic, i.e. the actually error (roughly estimated from our 3 independent runs) seems lower than the estimate derived from the formula \(2/\sqrt{\text{ESS}}\).

Underlying theory

Theorem: From Theorem 2.1 in Agapiou et al. (2017): if \(g\) is such that \(|g(x)| \le 1\) (for example, an indicator function), \[\text{RMSE} := \sqrt{\mathbb{E}(G_M - g^*)^2} \le 2 \sqrt{\frac{\mathbb{E}[W^2]}{M (\mathbb{E}W)^2}} =: \frac{2}{\sqrt{\text{ESS}}},\] where \(W\) is the un-normalized SNIS weight random variable.

Estimating SNIS ESS: compute the average weight and the average squared weights: \[\begin{align*}
\text{SNIS ESS} = \frac{M (\mathbb{E}W)^2}{\mathbb{E}[W^2]} &\approx \text{SNIS ESS estimator} \\
&= \frac{M (\frac{1}{M} \sum_{m=1}^M W^{(m)})^2}{\frac{1}{M} \sum_{m=1}^M (W^{(m)})^2} \\
&= \frac{(\sum_{m=1}^M W^{(m)})^2}{\sum_{m=1}^M (W^{(m)})^2}.
\end{align*}\]