<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[11pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{lscape}
\textwidth=7in  \textheight=15in
\hoffset=-1in \voffset=-1.25in
%\pagestyle{empty}
\newcommand{\boxspace}{\parbox{1.42in}}
\newcommand{\hhspace}{\hspace{0.02in}}
%
\newcommand{\bboxspace}{\parbox{2.0in}}
\newcommand{\hhhspace}{\hspace{0.05in}}
\input{tcilatex}
\begin{document}
\begin{flushright}
Numerical Methods of SDEs-Dr. Ra$\acute{\textrm{u}}$l Tempone\\
Homework\:$\#4$\\
\end{flushright}

\begin{description}
\item[Exercise 1] \textit{The following stochastic volatility model [FPSS00] generalizes the well known Black-Scholes geometric Brownian motion model [BS73], improving some aspects of option pricing.}
\\
\textit{A simplified version of the model reads}

\begin{eqnarray}
	dS(t) &amp;=&amp; rS(t)dt +  e^{Y(t)}S(t)dW(t) \label{eq:sde1}
	\\
	dY(t) &amp;=&amp; \left( -\alpha(1+Y(t)) + 0.4 \sqrt{\alpha}\sqrt{1-\rho^2}\right) dt + 0.4\sqrt{\alpha}d\widehat{Z}(t), \label{eq:sde2}
	\end{eqnarray}

where $W$ and $Z$ are independent Wiener process and 

\begin{eqnarray}
	\widehat{Z}(t) &amp; \equiv &amp; \rho\,W(t) +  \sqrt{1-\rho^2}Z(t)
\end{eqnarray}

\textbf{Note:}  The correlation coefficient is $\rho=-0.3$.
\vspace{.25in}
\\
To solve the SDE (\ref{eq:sde1}), define the following:
\begin{equation}
		f(x) = \log(x) \label{eq:log}
\end{equation}

Solving the SDE (\ref{eq:sde1}) by It$\hat{\textrm{o}}$ formula:
\begin{eqnarray}
		d\log S_t &amp;=&amp; \dfrac{1}{S_t}dS_t - \dfrac{1}{2S^2_t} (dS_t)^2 \nonumber
		\\
		&amp;=&amp; r\,dt +e^{Y_t}d\,W_t - \dfrac{1}{2}e^{2Y_t}d_t \nonumber
		\\
		&amp;=&amp; \left(r-\dfrac{1}{2}e^{2Y_t}\right)\,dt +e^{Y_t}d\,W_t \label{eq:dlogs}
\end{eqnarray}

Integrating (\ref{eq:dlogs}), obtain the following:
\begin{eqnarray}
		\log S_t &amp;=&amp; \log S_0 + \int^t_0(r-\dfrac{1}{2}e^{2Y_s})\,ds + \int^t_0 e^{Y_s}d\,W_s  \nonumber
		\\
		S_t &amp;=&amp; S_0 e^{\int^t_0 (r - \frac{1}{2}e^{2Y_s})ds + \int^t_o e^{Y_s}d\,W_s } \label{eq:expS}
\end{eqnarray}


\newpage
Solving the SDE (\ref{eq:sde2}):
\begin{eqnarray}
	dY_t &amp;=&amp; \left( -\alpha(1+Y_t) + 0.4 \sqrt{\alpha}\sqrt{1-\rho^2}\right) dt + 0.4\sqrt{\alpha}d\widehat{Z}_t \nonumber
	\\	&amp;=&amp; \left( -\alpha\,Y_t + \underbrace{0.4 \sqrt{\alpha}\sqrt{1-\rho^2}-\alpha}_{= M}\right) dt + \underbrace{0.4\sqrt{\alpha}}_{\sigma}d\widehat{Z}_t \nonumber
	\\
	&amp;=&amp;  (-\alpha Y_t + M) dt + \sigma\,d\widehat{Z}_t \nonumber
	\\
	&amp;=&amp;  -\alpha\left(Y_t - \dfrac{M}{\alpha}\right) dt + \sigma\,d\widehat{Z}_t  \hspace{.25in} \alpha \neq 0 \label{eq:sde3}
	\end{eqnarray}
	
Define the following:
\begin{eqnarray}
		X_t = Y_t - \dfrac{M}{\alpha} \label{eq:sde4}
\end{eqnarray}


Rewriting (\ref{eq:sde3}) by substituting (\ref{eq:sde4}), obtain the following:

\begin{eqnarray}
		dX_t = -\alpha\,X_t\,dt+ \sigma\,d\widehat{Z}_t \label{eq:sde5}
\end{eqnarray}


To solve (\ref{eq:sde5}) use the following integrating factor:
\begin{eqnarray}
		V_t =  e^{\alpha\,t}X_t   \label{eq:int1}
\end{eqnarray}


Differentiating (\ref{eq:int1}) and subsituting (\ref{eq:sde5}) obtain:
\begin{eqnarray}
		dV_t &amp;=&amp;  d(e^{\alpha\,t}X_t)   \nonumber
		\\
			&amp;=&amp; \alpha e^{\alpha\,t}X_tdt + e^{\alpha\,t}\underbrace{dX_t}_{=(\ref{eq:sde5})} \nonumber
			\\
			&amp;=&amp; \alpha e^{\alpha\,t}X_tdt - e^{\alpha\,t}\alpha\,X_tdt + e^{\alpha\,t}\sigma\,d\widehat{Z}_t  
			\nonumber
			\\
			dV_t &amp;=&amp; e^{\alpha\,t}\sigma\,d\widehat{Z}_t\label{eq:V}
\end{eqnarray}


From (\ref{eq:V}), as well as using (\ref{eq:int1}), obtain an equation for $X_t$.
\begin{eqnarray}
		\underbrace{V_t}_{(\ref{eq:int1})} &amp;=&amp;  V_0 + \int^s_0 e^{\alpha\,s}\sigma\,d\widehat{Z}_s   \nonumber
		\\
		e^{\alpha\,t}X_t	&amp;=&amp; X_0 + \int^t_0 e^{\alpha\,s}\sigma\,d\widehat{Z}_s \nonumber
			\\
		X_t	&amp;=&amp; X_0e^{-\alpha\,t} + \int^t_0 e^{-\alpha\,(t-s)}\sigma\,d\widehat{Z}_s   \label{eq:X}
\end{eqnarray}


From (\ref{eq:sde4}), and substituting into above, we obtain an equation for $Y_t$.
\begin{eqnarray}
		\underbrace{X_t}_{(\ref{eq:X})} &amp;=&amp;  X_0e^{-\alpha\,t} + \int^t_0 e^{-\alpha\,(t-s)}\sigma\,d\widehat{Z}_s \nonumber
		\\
		Y_t -\dfrac{M}{\alpha} &amp;=&amp;  \left(Y_0-\dfrac{M}{\alpha}\right)e^{-\alpha\,t} + \int^t_0 e^{-\alpha\,(t-s)}\sigma\,d\widehat{Z}_s \nonumber
		\\
		Y_t  &amp;=&amp;  \left(Y_0-\dfrac{M}{\alpha}\right)e^{-\alpha\,t} + \dfrac{M}{\alpha}+ \int^t_0 e^{-\alpha\,(t-s)}\sigma\,d\widehat{Z}_s \label{eq:Y}
\end{eqnarray}



\newpage

\textit{Compare the following explicit and implicit method for the computation of the option value below.}
\vspace{.5cm}
\\
\underline{\textbf{Explicit Method:}  }
\begin{eqnarray}
	S_{n+1} - S_{n} &amp;=&amp; rS_{n}\,\Delta\,t + e^{Y_n}S_{n}\,\Delta\,W_n, \nonumber
	\\
		Y_{n+1} - Y_{n} &amp;=&amp; \left( -\alpha(1+\underbrace{Y_n}) + 0.4 \sqrt{\alpha}\sqrt{1-\rho^2}\right)\Delta\,t + 0.4\sqrt{\alpha}\,\Delta\,\widehat{Z}_n \nonumber
		\\
		\widehat{Z}_n &amp; = &amp; \rho\,W_n +  \sqrt{1-\rho^2}Z_n \nonumber
\end{eqnarray}
\vspace{.25cm}
\\
\textbf{Inside the code:} Explicit method
\begin{verbatim}
    S1(n+1) = (1+ dt*r + dW(n)*exp(V(n)))*S1(n);
    V(n+1) = V(n)+(-alpha*V(n)-alpha+tmp*sqrt(1-rho^2))*dt + tmp * dhZ(n);
\end{verbatim}
\vspace{.25in}

\underline{\textbf{Implicit Method:}  }
\begin{eqnarray}
	S_{n+1} - S_{n} &amp;=&amp; rS_{n}\,\Delta\,t + e^{Y_n}S_{n}\,\Delta\,W_n, \nonumber
	\\
		Y_{n+1} - Y_{n} &amp;=&amp; \left( -\alpha(1+\underbrace{Y_{n+1}}) + 0.4 \sqrt{\alpha}\sqrt{1-\rho^2}\right)\Delta\,t + 0.4\sqrt{\alpha}\,\Delta\,\widehat{Z}_n \nonumber
		\\
		\widehat{Z}_n &amp; = &amp; \rho\,W_n +  \sqrt{1-\rho^2}Z_n \nonumber
\end{eqnarray}
\vspace{.25cm}
\\
\textbf{Inside the code:} Implicit method
\begin{verbatim}
    S(n+1) = (1+ dt*r + dW(n)*exp(Y(n)))*S(n);
    Y(n+1) = (Y(n) + (-alpha+tmp*sqrt(1-rho^2))*dt + tmp * dhZ(n))/(1+alpha*dt);
\end{verbatim}


\textbf{Recall:}  The implicit Euler is absolutely stable; the explicit Euler method is not.  


\textbf{Computation of the option value.}  Use $\alpha = 200 ,r = 0.04, T=\frac{3}{4}$ and $S_0=K=100.$ 	
\begin{eqnarray}
	V_T &amp;=&amp;  e^{-rT}\mathrm{E}[\max(S_T-K, 0)]
\end{eqnarray}


		
\newpage
\begin{description}
\item[a.]  \textit{Motivate which above numerical methods is best in this case.  Provide a numerical approximation, based on uniform time steps, to the option value with accuracy TOL=$10^{-2}$.}
\vspace{.25in}
\\
\textbf{Setup for numerical approximation:}  
\vspace{.25cm}
\\
\underline{Pseudocode}
\\
Selection of $\Delta t$ and $M$
\begin{itemize}
	\item choose $\Delta t$, fix $M=10^3$
 \\
  \textbf{while } 	E$[g(X_{\Delta t}- g(X_{\frac{\Delta t}{2}})] + \dfrac{C\sigma_{\textrm{error}}}{\sqrt{M}} &gt; \dfrac{1}{3}\textrm{TOL}$
  \\
	\textbf{output:} $\Delta t = \Delta t^*$
	\vspace{.15in}
	\\
	\item choose $M$, fix $\Delta t^*$
	 \\
  \textbf{while } 	$\widehat{\sigma}^2$ = $E(g(X)^2)-E(g(X))^2 $
  \\
  	\textbf{check: }	$|\textrm{error}_{statistical}|  &lt; \dfrac{C_{\alpha}\widehat{\sigma}}{\sqrt{M}} \leq \dfrac{2}{3}\textrm{TOL}$
	\\
\end{itemize}



\newpage

\item[b.]  \textit{In the limit $\alpha \rightarrow \infty$ one obtains the results from geometric Brownian motion.  Can you verify this by numerical experiments?}
	\end{description}
Note:  In geometric Brownian motion with constant volatity, we can compute the value of the option exactly using the the Black-Scholes formula.   The numerical results obtained approach this thoerotical price.  
\vspace{.25in}
\\
From (\ref{eq:Y}), let the limit $\alpha \rightarrow \infty$, 
\begin{eqnarray}
		Y_t  &amp;=&amp;  \left(Y_0-\dfrac{M}{\alpha}\right)e^{-\alpha\,t} + \dfrac{M}{\alpha}+ \int^s_0 e^{-\alpha\,(t-s)}\sigma\,d\widehat{Z}_s \nonumber
\end{eqnarray}
\begin{eqnarray}
		\lim_{\alpha \rightarrow \infty} \dfrac{Y_0}{e^{\alpha\,t}}  &amp;=&amp;  0   \nonumber
		\\
		\, \nonumber
		\\
		\lim_{\alpha \rightarrow \infty} -\dfrac{0.4\sqrt{\alpha}\sqrt{1-\rho^2}+\alpha}{\alpha\,e^{\alpha\,t}}  &amp;=&amp;  0   \nonumber
		\\
		\, \nonumber
		\\
		\lim_{\alpha \rightarrow \infty} \dfrac{0.4\sqrt{\alpha}\sqrt{1-\rho^2}-\alpha}{\alpha}  &amp;=&amp;  -1   \label{eq:mean}
		\\
		\, \nonumber
		\\
		\lim_{\alpha \rightarrow \infty} -\dfrac{0.4\sqrt{\alpha}}{e^{\alpha\,(t-s)}}  &amp;=&amp;  0 \nonumber  		
\end{eqnarray}
\vspace{.25in}
\\
From above, (\ref{eq:mean}),  we obtain as $\alpha \rightarrow \infty$, $Y_t \rightarrow -1$.  
\vspace{.25in}
\\
However, when we calculate the $Var(Y_t)$, we see that similiar behavior as above (\ref{eq:mean}), does not occur:
\vspace{.15in}
\\ 
\begin{eqnarray}
		 E\left[\int^{t}_0 \sqrt{\alpha}\,e^{-\alpha (t-s)} d\widehat{Z}_s\right]^2 &amp;=&amp; \int^{t}_0 \alpha e^{-2\alpha (t-s)} ds \nonumber
		 \\
		 &amp;=&amp; \dfrac{e^{-2\alpha (t-s)}}{2\alpha}\alpha \bigg{|}^t_0 \nonumber
		 \\
		 &amp;=&amp; \dfrac{1}{2} - \dfrac{e^{-2\alpha t}}{2} \label{eq:varY}
\end{eqnarray}


Therefore, from(\ref{eq:varY}), let the limit $\alpha \rightarrow \infty$, obtain:
\begin{eqnarray}
		\lim_{\alpha \rightarrow \infty} E\left[\int^{t}_0 \sqrt{\alpha}\,e^{-\alpha (t-s)} d\widehat{Z}_s\right]^2 &amp;=&amp;  \lim_{\alpha \rightarrow \infty} \left(\dfrac{1}{2} - \underbrace{\dfrac{e^{-2\alpha t}}{2}}_{=0} \right) \nonumber
		 \\
		 &amp;=&amp; \dfrac{1}{2}
\end{eqnarray}

\newpage

Using this results, we can see that the volatilty from  (\ref{eq:sde1}):
\begin{eqnarray}
 e^{Y_t} \rightarrow e^{-1} \hspace{.33cm} \textrm{as} \hspace{.33cm} \alpha \rightarrow \infty \hspace{.25cm} \nonumber
\end{eqnarray}



From (\ref{eq:expS}), as limit $\alpha \rightarrow \infty$
\begin{eqnarray}
			S_t &amp;=&amp; S_0 e^{\int^t_0 (r - \frac{1}{2}e^{2Y_s})ds + \int^t_o e^{Y_s}d\,W_s } \nonumber
		\\
		\, \nonumber
		\\
		&amp;=&amp; S_0\:exp\left\{\int^t_0\left(r - \dfrac{1}{2e^2}\right)ds + \int^t_0 \frac{1}{e}\,dW_s \right\} \nonumber
		\\
		&amp;=&amp; S_0\:exp\left\{\left(r - \dfrac{1}{2e^2}\right)t + \frac{1}{e}W_t\right\}
\end{eqnarray}


\newpage

\begin{itemize}
	\item  \textbf{Figure one:}  Histogram: Option Prices  
\end{itemize}
	\begin{flushleft}
\pdfimage width 20cm {sde_hw7_hist.png}
	\end{flushleft}

\newpage
\begin{itemize}
	\item  \textbf{Figure two:}  Numerical Solutions  
\end{itemize}
	\begin{flushleft}
\pdfimage width 17cm {sde_hw7_1.png}
	\end{flushleft}

\newpage
\begin{itemize}
	\item  \textbf{Figure three:}  Convergence of option price 
\end{itemize}
	\begin{flushleft}
\pdfimage width 17cm {sde_hw7_2.png}
	\end{flushleft}


\newpage
\begin{itemize}
	\item  \textbf{Figure four:}  Time discretization error 
\end{itemize}
	\begin{flushleft}
\pdfimage width 20cm {timesteps.png}
	\end{flushleft}


\end{description}
\end{document}</pre></body></html>