Skip to content

Commit

Permalink
updated montecarlo
Browse files Browse the repository at this point in the history
  • Loading branch information
victorballester7 committed Oct 26, 2023
1 parent 528772a commit 38af371
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 7 deletions.
1 change: 1 addition & 0 deletions .vscode/ltex.hiddenFalsePositives.en-US.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@
{"rule":"SENTENCE_WHITESPACE","sentence":"^\\QLp. spaces.\\E$"}
{"rule":"COMMA_COMPOUND_SENTENCE","sentence":"^\\QWe will denote \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q and we will say that \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q is the Fourier series of \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q.\\E$"}
{"rule":"ENGLISH_WORD_REPEAT_BEGINNING_RULE","sentence":"^\\QThen \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q is a continuous square-integrable martingale with: \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q Let \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q be a Brownian motion.\\E$"}
{"rule":"ENGLISH_WORD_REPEAT_BEGINNING_RULE","sentence":"^\\QThen, for \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q: \\E(?:Dummy|Ina|Jimmy-)[0-9]+$"}
72 changes: 65 additions & 7 deletions Mathematics/5th/Montecarlo_methods/Montecarlo_methods.tex
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@
where $\vf{b}:\RR^d\to\RR^d$ and $\vf{\sigma}:\RR^d\to\mathcal{M}_{d\times d}(\RR)$ are Lipschitz continuous.
\subsubsection{Exact simulation}
\begin{proposition}
To simulate a sample $(\vf{B}_{t_1},\dots,\vf{B}_{t_n})$ of a $d$-dimensional Brownian motions, we can use the following algorithm:
To simulate a sample $(\vf{B}_{t_1},\dots,\vf{B}_{t_m})$ of a $d$-dimensional Brownian motions, we can use the following algorithm:
\begin{enumerate}
\item Generate $(\vf{Z}_1,\dots,\vf{Z}_n)$ \iid $N_d(0,\vf{I}_d)$.
\item Set $\vf{B}_{t_0}:=0$ and for all $0\leq i\leq n-1$, set:
\item Generate $(\vf{Z}_1,\dots,\vf{Z}_m)$ \iid $N_d(0,\vf{I}_d)$.
\item Set $\vf{B}_{t_0}:=0$ and for all $0\leq i\leq m-1$, set:
$$
\vf{B}_{t_{i+1}}=\vf{B}_{t_i}+\sqrt{t_{i+1}-t_i}\vf{Z}_{i+1}
$$
Expand All @@ -311,7 +311,7 @@
\vf{X}_{t+h} & =\vf{X}_t+\int_t^{t+h}\vf{b}(\vf{X}_s)\dd{s}+\int_t^{t+h}\vf{\sigma}(\vf{X}_s)\dd{\vf{B}_s} \\
& \approx \vf{X}_t+h\vf{b}(\vf{X}_t)+\vf{\sigma}(\vf{X}_t)(\vf{B}_{t+h}-\vf{B}_t)
\end{align*}
More generally, if we want to obtain the solution at $(t_1,\dots,t_n)$, we can use the following algorithm. Set $\vf{\tilde{X}}_0:=\vf{x}_0$ and for all $0\leq i\leq n-1$, set:
More generally, if we want to obtain the solution at $(t_1,\dots,t_n)$, we can use the following algorithm. Set $\vf{\tilde{X}}_0:=\vf{x}_0$ and for all $0\leq i\leq m-1$, set:
$$
\vf{\tilde{X}}_{t_{i+1}}=\vf{\tilde{X}}_{t_i}+(t_{i+1}-t_i)\vf{b}(\vf{\tilde{X}}_{t_i})+\vf{\sigma}(\vf{\tilde{X}}_{t_i})(\vf{B}_{t_{i+1}}-\vf{B}_{t_i})
$$
Expand All @@ -322,11 +322,69 @@
\begin{remark}
Trying to build an implicit Euler scheme for SDEs is much more complicated than for ODEs, as we need to ensure that the process is still adapted.
\end{remark}
\begin{theorem}
Let $\vf{X}$ be the solution to \mcref{MM:SDE} and $\vf{\tilde{X}}$ be the solution to the Euler scheme. Then, for $p\geq 1$:
\begin{definition}
Let $\vf{X}$ be the solution to \mcref{MM:SDE}. We define the \emph{continuous Euler scheme} as:
$$
\vf{\tilde{X}}_t:=\vf{x}_0+\int_0^t\vf{b}(\vf{X}_{\phi_s})\dd{s}+\int_0^t\vf{\sigma}(\vf{X}_{\phi_s})\dd{\vf{B}_s}
$$
where $\phi_s:=\max\{ t_i: t_i< s\}$.
\end{definition}
\begin{lemma}
Let $X$ be the solution to \mcref{MM:SDE} with $d=1$ and $\tilde{X}$ be the solution to the Euler scheme. Then, for $p\geq 1$:
$$
\sup_{n\in\NN}\Exp\left( \sup_{0\leq t\leq T}\abs{\tilde{X}_t}^p\right)<\infty
$$
\Exp\left(\sup_{0\leq t\leq T}\norm{\vf{X}_t-\vf{\tilde{X}}_t}_p\right)\leq C_p h
\end{lemma}
\begin{lemma}
Let $X$ be the solution to \mcref{MM:SDE} with $d=1$ and $\tilde{X}$ be the solution to the Euler scheme. Then, for $p\geq 1$:
$$
\max_{i=0,\ldots,m-1}{\Exp\left(\sup_{t_i\leq t\leq t_{i+1}}\abs{X_t-\tilde{X}_{\phi_t}}^p\right)}^\frac{1}{p}\leq \frac{C}{\sqrt{m}}
$$
\end{lemma}
\begin{theorem}[Strong error of the Euler scheme]
Let $X$ be the solution to \mcref{MM:SDE} with $d=1$ and $\tilde{X}$ be the solution to the Euler scheme. Then, for $p\geq 1$:
$$
{\Exp\left(\sup_{0\leq t\leq T}\abs{X_t-\tilde{X}_t}^p\right)}^{1/p}\leq \frac{C}{\sqrt{m}}
$$
\end{theorem}
\begin{theorem}[Weak error of the Euler scheme]
If $\vf{b},\vf\sigma\in \mathcal{C}^\infty(\RR^d)$ with bounded derivatives and either one of the following conditions holds:
\begin{itemize}
\item $g\in \mathcal{C}^\infty_\text{b}(\RR^d)$
\item $g$ is measurable with polynomial growth and $\vf\sigma$ is uniformly elliptic, i.e.\ $\exists\lambda>0$ such that $\forall \vf{x},\vf\xi\in\RR^d$ we have:
$$
\transpose{\vf\xi}(\vf{\sigma}\transpose{\vf{\sigma}})(\vf{x})\vf\xi\geq \lambda\norm{\vf\xi}^2
$$
\end{itemize}
Then:
$$
\abs{\Exp(g(\tilde{X}_T))- \Exp(g(X_T))}\leq \frac{C}{m}
$$
where $T$ is the final time of the simulation.
\end{theorem}
\begin{remark}
We can write the error taking in the Montecarlo estimation using the Euler scheme as:
\begin{multline*}
\frac{1}{n}\sum_{i=1}^n g(\tilde{X}_T^{(i)})-\Exp(g(X_T))=\\=\frac{1}{n}\sum_{i=1}^n g(\tilde{X}_T^{(i)})-\Exp(g(\tilde{X}_T))+\Exp(g(\tilde{X}_T))-\Exp(g(X_T))
\end{multline*}
where $\tilde{X}_T^{(i)}$ are \iid copies of $\tilde{X}_T$. This error consists in two terms:
\begin{itemize}
\item The statistical error: $$\frac{1}{n}\sum_{i=1}^n g(\tilde{X}_T^{(i)})-\Exp(g(\tilde{X}_T))\sim \frac{1}{\sqrt{n}}$$
\item The discretization error:$$\Exp(g(\tilde{X}_T))-\Exp(g(X_T))\sim \frac{1}{m}$$
\end{itemize}
This suggests choosing $m\sim \sqrt{n}$. However, confidence intervals are of little interest in this setting as the amplitude of the bias is similar to the length of the confidence interval. Thus, we have no control on the error a posteriori. We conclude that it is best to be in between the setting $\sqrt{n}\ll m$ to have meaningful confidence intervals and $\sqrt{n}\sim m$ for efficiency, say $n^{\frac{1}{2}+\delta}\sim m$ for $\delta>0$ small.
\end{remark}
\begin{corollary}[Romberg Extrapolation]
The \emph{Romberg Extrapolation} consists in the following result:
$$
\Exp\left(2g(\tilde{X}_T)-g(\tilde{X}_T)\right)-\Exp(g(X_T))= \frac{C}{m^2}+\o{\frac{1}{m^2}}
$$
This suggests using the estimator for $\Exp(g(X_T))$:
$$
\frac{1}{n}\sum_{i=1}^n\left(2 g(\tilde{X}_T^{(i)})-g(\tilde{X}_T^{(i)})\right)
$$
where $\tilde{X}_T^{(i)}$ are \iid copies of $\tilde{X}_T$.
\end{corollary}
\subsection{Brownian bridge approach}
\end{multicols}
\end{document}

0 comments on commit 38af371

Please sign in to comment.