Given \(f\), and an iid process \(\epsilon \sim N(0,\sigma^2)\), how to approximate \(E_{\epsilon} f(\epsilon)\) ?
Some Ideas:
Define \(X(\epsilon) = U(C(\epsilon))\) where \(U(c)=\frac{c^{1-\gamma}}{1-\gamma}\) and \(C(\epsilon) = e^{\epsilon}\). We want to compute \(E_{\epsilon} X(\epsilon)\) precisely.
How many draws do we need ?
![Monte Carlo estimate of E[X] versus number of draws in a 2x1 layout with empty second panel.](mc_estimates_layout.png)


The decrease in standard deviations is too slow.
Define the Model in Julia
Monte-Carlo estimates for various N:
Monte-Carlo estimates of the variance for various N:
Suppose we want to compute \(\mathbb{E}[\epsilon]\) where \(\epsilon \sim \mathcal{N}(0,\sigma_{\epsilon}^2)\) by averaging \(N\) independent draws \(\epsilon_n\) of \(\epsilon\).
Define \[T_N =\frac{1}{N}\sum_{n=1}^N \epsilon_n\]
The mean of \(T_N\) is 0 (it’s an unbiased estimator).
Let’s compute its variance: \[\mathbb{E}(T_N^2) = \frac{1}{N^2} \sum_{n=1}^N \mathbb{E}\left[ \epsilon_n^2 \right] = \frac{1}{N}\sigma_{\epsilon}^2\]
And the standard deviation: \[s_N = \sigma(T_N^2) = \frac{1}{\sqrt{\color{red} N}} \sigma_{\epsilon}\]
Conclusion: the precision of Monte-Carlo estimates decrease as a square root of the number of experiments.
In the general case, we want to estimate \(\mathbb{E}[f(\epsilon)]\) the Monte-Carlo estimator is: \[T^{MC}_N =\frac{1}{N}\sum_{n=1}^N f(\epsilon_n)\]
It is unbiased: \[E(T_N^{MC}) = E\left[f(\epsilon) \right]\]
It’s variance is
\[E(T_N^{MC}) \propto \frac{1}{\sqrt{N}}\]
Concusion:
Equiprobable discretization
Split the space into \(N\) equiprobable quantiles: \[(I_i=[a_i,a_{i+1}])_{i=1:N}\] such that \(\mathbb{P}(\epsilon \in I_i)=\frac{1}{N}\)
This yields: \(a_1=-\infty, a_{N+1}=\infty, a_i = \xi^{-1}\left(\frac{i-1}{N}\right)\)
Choose the nodes as the median of each interval: \[\mathbb{P}(\epsilon\in[a_i,x_i]) = \mathbb{P}(\epsilon\in[x_i,a_{i+1}])\] This yields: \(\boxed{x_i = \xi^{-1}\left(\frac{i-0.5}{N}\right)}\)
The quantization is simply \((w_i, x_i)_{i=1:N}\) with \(w_i = 1/N\).

Suppose \(f\in \mathcal{F}\) a Banach space of functions with scalar values., \(\epsilon\) a normal gaussian variable (stdev 1).
Define \(I(f) = E_{\epsilon} f(\epsilon)\).
Take a family of polynomials \(P_n\) orthogonal with respect to the weight function \(\mu(u) = e^{-u^2}\), i.e. such that \[\int_{-\infty}^{\infty} P_n(u) P_m(u) \mu(u) du = 0\] for \(n\neq m\). Suppose these polynomials (hermite polynomials) are dense in \(\mathcal{F}\) (they can approximate any function in \(\mathcal{F}\) with arbitrary precision).
Intuition from linear algebra: \(I\) restricted to \(\mathcal{F}_{N-1}\) is a linear form with \(N\) degrees of freedom. Given any \(N\) points \((\epsilon_n)_{n=1:N}\), we can thus find \(N\) weights \((w_n)_{n=1:N}\) such that \[\left.\left(f\rightarrow\sum_{n=1}^N w_n f(\epsilon_n) \right)\right|_{\mathcal{F}_{N-1}}= \left.I\right|_{\mathcal{F}_{N-1}}\]
Gauss quadrature magic (with real nodes and positive weights): there is a unique way to choose \(\epsilon_n\)and \(w_n\) such that \[\left.\left(f\rightarrow\sum_{n=1}^N w_n f(\epsilon_n) \right)\right|_{\mathcal{F}_{2N-1}}= \left.I\right|_{\mathcal{F}_{2N-1}}\]
Same logic can be applied to compute integration with weight function \(w(x)\):
\[\int_a^b f(x) w(x)\]
Use polynomials orthogonal with respect to \(w\):
Beware that gauss-hermite weight are given for the normalized gaussian+ law:
\[\frac{1}{\sqrt{2 \pi \sigma^2}}\int f(x) e^{-\frac{x^2}{2\sigma^2}}dx = {\frac{1}{\sqrt{\pi}}}\int f(u {\sigma \sqrt{2}}) e^{-{u^2}}du \]
Compute
\[\mathbb{E}_{\epsilon}[f(\epsilon)] \approx {\frac{1}{\sqrt{\pi}}}\sum_n w_n f(\epsilon_n {\sigma \sqrt{2}})\]
Reminder: The unconditional distribution of an AR1 is a normal law \(\mathcal{N}(0,\frac{\sigma}{\sqrt{1-\rho^2}})\)
Algorithm:
\[\begin{eqnarray} \pi_{ij} & = & \mathbb{P} \left( y_{t+1}=y_j|y_t=y_i\right)\\ & = & \mathbb{P} \left( |y_{t+1}-y_j| = \inf_k |y_{t+1}-y_k| \left| y_t=y_i \right. \right) \end{eqnarray}\]
Formulas \(\delta=\frac{\overline{x}-\underline{x}}{N-1}\), \(F\) the cdf of \(\mathcal{N}(0,\sigma^2)\), and \(\pi_{ij}\) the transition matrix:
if \(1<j<N\)
\[\pi_{ij} = F\left(\frac{y_j + \delta/2-\rho y_i}{\sigma_{\epsilon}}\right) - F\left(\frac{y_j - \delta/2-\rho y_i}{\sigma_{\epsilon}}\right)\]
if \(j=1\)
\[\pi_{i1} = F\left(\frac{y_1 + \delta/2-\rho y_i}{\sigma_{\epsilon}}\right)\]
if \(j=N\)
\[\pi_{iN} = 1- F\left(\frac{y_N - \delta/2-\rho y_i}{\sigma_{\epsilon}}\right)\]
compare generated stationary moments between discretized process and true AR1:
by looking at the exact ergodic distribution or by doing some simulations
not very precise when then process is very persistent \(\rho\approx 1\)
Procedure converges to Bernouilli distribution.
Moments can be computed in closed form:
Rouwenhorst method performs better for highly correlated processes