  Avikainen showed that, for any $p,q \in [1,\infty)$, and any function $f$ of
bounded variation in $\mathbb{R}$, it holds that
$\mathbb{E}[|f(X)-f(\widehat{X})|^{q}] \leq C(p,q)
\mathbb{E}[|X-\widehat{X}|^{p}]^{\frac{1}{p+1}}$, where $X$ is a
one-dimensional random variable with a bounded density, and $\widehat{X}$ is an
arbitrary random variable. In this article, we will provide multi-dimensional
versions of this estimate for functions of bounded variation in
$\mathbb{R}^{d}$, Orlicz--Sobolev spaces, Sobolev spaces with variable
exponents, and fractional Sobolev spaces. The main idea of our arguments is to
use the Hardy--Littlewood maximal estimates and pointwise characterizations of
these function spaces. We apply our main results to analyze the numerical
approximation for some irregular functionals of the solution of stochastic
differential equations.
