\documentclass[12pt]{article}
\usepackage{fullpage,amsmath,amsfonts,graphicx}

\begin{document}

\title{Derivatives Lab}
\author{Session 22}
\date{December 5, 2011}
\maketitle

\def\e{\mathrm e}
\def\d{\mathrm d}
Suppose $S_i$ for $i=0,\dots, N$ denotes time series data which
we believe behaves like geometric Brownian motion.  Then estimates for
the parameters $\mu$ and $\sigma$ can be obtained in the following
way. 

Consider the log-returns
\[
  r_i = \ln S_{i+1} - \ln S_i \,,
\]
then compute the sample mean
\[
  \bar r = \frac1N \sum_{i=0}^{N-1} r_i
\]
and sample variance
\[
  \sigma_r^2 = \frac1{N-1}
  \sum_{i=0}^{N-1} (r_i - \bar r)^2 \,.
\]
Then the estimates for $\sigma$ and $\mu$ are given by
\[
  \hat \sigma = \frac{\sigma_r}{\sqrt{\Delta t}} 
  \qquad \text{and} \qquad
  \hat \mu = \frac{\bar r}{\Delta t} + \frac{\hat \sigma^2}2 \,.
\]

\begin{enumerate}
\item Generate a large number of sample geometric Brownian paths with
fixed $\mu$ and $\sigma$.  For each, compute the estimates $\hat \sigma$
and $\hat \mu$.

\begin{enumerate}
\item Draw a histogram (command \texttt{hist}) for the values for the
distribution of $\hat \sigma$ and $\hat \mu$.

\item It is known that the variance of the estimate for $\sigma$ is
approximately
\[
 \operatorname{Var}[\hat \sigma] = \frac{\hat \sigma^2}{2 N} \,.
\]
Does your statistics from part (a) reproduce this result?

\item What is the variance of $\hat \mu$?  Is it large or small?

\end{enumerate}

\item Modify your code in such a way that the number of points on the
geometric Brownian path is $N=2^k+1$ so that the number of log-returns
is a power of two.  Now repeat the estimation of $\sigma$ for a single
geometric path over large time steps of length $2^i \, \Delta t$ where
$i = 0, \dots, k-1$ and $\Delta t$ is the time step of the original
geometric Brownian path.  Plot the $\hat \sigma$ vs.\ the log of the
number of sample points (\texttt{semilogx}).

How does this result change if
\begin{enumerate}
\item you add Gaussian noise to the geometric Brownian motion;
\item you add a high frequency periodic perturbation?
\end{enumerate}

\item Perform a QQ-plot vs.\ the normal distribution for each of the
three cases considered above.

\item Plot the autocorrelation function for each of the three cases
considered above.


\end{enumerate}



\end{document}

