\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{own}
\usepackage{equations}
%\usepackage{psfig}
%\setlength{\textwidth}{6.5in}
%\renewcommand{\baselinestretch}{1.1}
%\renewcommand{\theequation}{\thesection.\arabic{equation}}
% see page 19 of Advanced LaTeX course by Michel Goossens for nifty picture
%\voffset -1in
%\hoffset -1in
\oddsidemargin 0.55625in % Left margin on odd-numbered pages.
\evensidemargin 0in % Left margin on even-numbered pages.
\reversemarginpar % put notes in opposite margin than defaults
\textheight 8.70in
\addtolength{\textheight}{-\baselineskip}
\textwidth 5.98in
\topmargin -.28in % distance from top of page to header - 1in
\headheight 0.5in % height of box containing the header
\headsep \baselineskip % distance between head and body
%\footheight 0.5in % height of foot
\footskip 0.5in % bottom of last line to bottom of foot
\topsep=0in % get rid of extra vertical space in list modes
\partopsep=0in %
\parsep=0.25in %
\parskip 0.1 in
\title{Financial Mathematics and Simulation\\
MATH 6740--1 -- Spring 2011 \\
Homework 1}
\date{Due Date: Thursday, February 24 at 2:00 PM}
\renewcommand{\theenumi}{\alph{enumi}}
\newcommand{\oh}{\frac{1}{2}}
\newcommand{\Xa}{X_1}
\newcommand{\Xb}{X_2}
\newcommand{\Xj}{X_j}
\newcommand{\sigRasy}{\bar{\sigma}_R}
\newcommand{\sigXasy}{\bar{\sigma}_X}
\newcommand{\sigRasysq}{\sigRasy^2}
\newcommand{\sigXasysq}{\sigXasy^2}
\newcommand{\Var}{\,\mathrm{Var}\,}
\newcommand{\Xtarg}{\bar{x}}
\begin{document}
\maketitle
This homework has 140 points plus 35 bonus points available but, as always, homeworks are graded out of 100 points. Full credit will generally be awarded for a solution only if it is both correctly and efficiently presented using the techniques covered in the lecture and readings, and if the reasoning is properly explained. If you used software or simulations in solving a problem, be sure to include your code, simulation results, and/or worksheets documenting your work. If you score more
than 100 points, the extra points do count toward your homework total.
\section{Theoretical Calculations}
\subsection{Conditional Distributions of Partial Sums of Gaussian Random Sequence (15 points)}
Suppose that $ \{X_j\}_{j=1}^{\infty} $ is a sequence of independent, identically distributed Gaussian random variables with mean $ \mu $ and standard deviation $ \sigma $, and define the partial sums $ S_n = \sum_{j=1}^n X_j $. Calculate and simplify the conditional probability density function for $ S_m $ given the value of $ S_n $, where $ n > m $.
\subsection{Angular Distribution of Gaussian Random Variable Pair (20 points)}
\label{sec:angaus}
Suppose that $ \Xa $ and $ \Xb $ are jointly Gaussian random variables with mean $ 0 $ and the same variance $ \sigma^2 $ and correlation coefficient $ \rho $.
\begin{enumerate}
\item (\textbf{10 points}) Derive the joint probability density function of the polar coordinate representation $ (R,\Theta) $, where $ X_1 = R \cos \Theta $ and $ X_2 = R \sin \Theta $.
\item (\textbf{5 points}) Derive the marginal probability density function for the angle variable $ \Theta $. \label{part:theta}
\item (\textbf{5 points}) Calculate the probability that $ X_1 $ and $ X_2 $ will have the same sign. \label{part:sign}
\end{enumerate}
\subsection{Portfolio Rebalancing (55 points plus 30 bonus points)}
A financial trader wants to write a program to maintain a certain balance in a portfolio, for example, that a certain percentage of the value of a portfolio is held in bonds, or in international assets, or real estate, etc. Price fluctuations in the various components of portfolio will cause an initially balanced portfolio to become unbalanced as some components may increase in value relative to others. One could of course simply make frequent trades to bring the portfolio back to perfect balance at certain designated moments of time, but this strategy is usually not adopted because it would require many financial transactions, and every transaction carries a cost. So we instead consider a strategy that tries to bring the portfolio back into balance, but through some smooth, gradual rule that doesn't require as many transactions as a perfect rebalancing strategy. For this problem, we will satisfy ourselves with a model in which time is discretized, so that, at the end of the $n$th time period, the state of the portfolio is denoted by a real variable $ X_n $, which we could be thought of as the fraction of the total portfolio value that is allocated to bonds. During time period $ n+ 1 $, the state of the portfolio changes in two ways: due to rebalancing adjustments (denoted $ R_n$) and due to new price fluctuations $ Z_{n+1} $. We can therefore model the evolution of the portfolio's state
through a stochastic update rule:
\begin{align*}
X_{n+1} = X_{n} + R_n + Z_{n+1}, & \qquad \qquad n=0,1,2,\ldots
\end{align*}
We will model the disturbances $ \{Z_n\}_{n=0}^{\infty} $ as independent, identically distributed Gaussian random variables with mean $0 $ and standard deviation $ \sigma_Z $. Moreover, the rebalancing strategy must obey the causality rule: for each $ n \geq 0 $, $ R_n $ can only depend on $X_0 $, $ X_1$, $X_2,\ldots, X_n $ and $ Z_1 $, $ Z_2, \ldots Z_n $. (The rebalancing strategy cannot look into the future!) A good strategy will minimize the fluctuations in $ X_n $ (the state of the portfolio) as well as in $ R_n $ (so that the transaction costs are not so large). Finally, we assume the initial state of the system $ X_0$ is at the desired value $ \Xtarg $.
\begin{enumerate}
\item (\textbf{5 points}) Explain whether or not the state of the portfolio is a Markov process with respect to the filtration generated by the disturbances $ \{Z_n\}_{n=0}^{\infty} $.
\item (\textbf{5 points}) Explain whether or not $ X_n $ must be a Gaussian random variable.
\item (\textbf{10 points}) Write down a general formula for the variance of $ X_n $ in terms of the statistics of the disturbances and the rebalancing adjustments. At this point, make no assumption about the rebalancing strategy beyond the general condition described above.
\item (\textbf{5 points}) Show that, for $ n \geq 1 $, the standard deviation of $ X_n $ must be at least equal to $ \sigma_Z $, regardless of the rebalancing strategy. \label{part:atleastz}
\item (\textbf{10 points}) Suppose that we maintain the portfolio for a long time so that it settles down into a statistically stationary state, meaning that all \emph{statistics} of (but not necessarily the individual realizations of) $ X_n $ and $ R_n $ approach constant values at large $ n $. In particular, we define
\begin{align*}
\sigRasysq \equiv \lim_{n \rightarrow \infty} \Var (R_n), & \qquad \qquad
\sigXasysq \equiv \lim_{n \rightarrow \infty} \Var (X_n).
\end{align*}
Show that, no matter how the rebalancing strategy is chosen, the following inequality must hold:
\begin{equation}
\sigXasy \geq \oh ( \sigRasy + \sigma_Z^2/ \sigRasy) \label{eq:contineq}
\end{equation}
\label{part:xrineq}
\item (\textbf{10 points}) Suppose the rebalancing strategy is linear and local in time: $ R_n = a(X_n - \Xtarg) $, where $ a $ is a real constant. Calculate the mean state of the portfolio $ \langle X_n \rangle $ as well as the covariance of the state of the portfolio $ \langle (X_n - \langle X_n \rangle) (X_m - \langle X_m \rangle) \rangle $ for all $ m \geq 0 $ and $ n \geq 0 $. You should express your answer explicitly in terms of given parameters of the problem. \label{part:lin}
\item (\textbf{5 points}) For what values of $ a $ does the mean and variance of the portfolio state approach constant values (thereby suggesting a statistically stationary state)? What are these asymptotic values? \label{part:asy}
\item (\textbf{5 points}) Show explicitly using your results from the previous part that for these values of $ a $, the inequality (\ref{eq:contineq}) is satisfied by the local and linear rebalancing strategy. \label{part:verify}
\item (\textbf{15 bonus points}) Strengthen the inequalities in Parts~\ref{part:atleastz} and~\ref{part:xrineq} for situations in which the rebalancing strategy has a time delay of $ D $ time steps, so that the rebalancing adjustment $ R_n $ applied at time $ n $ can depend only on $ X_0 $, $X_1$, $X_2,\ldots X_{n-D} $ and $ Z_1 $, $ Z_2, \ldots Z_{n-D} $.
\item (\textbf{20 bonus points}) Analyze linear rebalancing strategies which are delayed in time in a similar way to how the local in time linear rebalancing strategy was analyzed in Parts~\ref{part:lin}, \ref{part:asy}, and~\ref{part:verify}.
\end{enumerate}
\section{Numerical Computations}
\subsection{Correlated Gaussian Random Variable Simulation (50 points)}
\begin{enumerate}
\item (\textbf{15 points})
Write a code to generate a pair of Gaussian random variables $ \Xa $ and $ \Xb $ with arbitrary means $ \mu_j = \langle \Xj \rangle $, arbitrary positive variances $ \sigma_j^ 2 = \langle (\Xj - \mu_j)^2 \rangle $, and arbitrary correlation coefficient $ -1 \leq \rho \leq 1 $. You should explain your code clearly (through comments in the code or on a separate page), describing how it relates to the theory of simulating random variables developed in the lectures. If you have an algorithm that improves upon the ideas described in class, explain the basis and justification for your method.
You should write your own Gaussian random number generator with two versions: the Box-Muller Method and the Polar Marsaglia Method. You may use existing software for simulating a uniform random number on the unit interval.
\item (\textbf{5 points}) Modify your code to simulate $ N$ independent pairs of Gaussian random variables, with each pair having the statistical properties described above. (In particular, the random variables within each pair are not independent if $ \rho \neq 0 $.) Compare how fast your code can simulate a given number $ N $ of pairs of Gaussian random variables when you use the Box-Muller method as compared to the Polar Marsaglia method. Try a few large values of $ N $, and report the times required for the simulations and the times required per pair of random numbers to be simulated. Comment on the behavior of the algorithms for not-so-large and for large values of $ N $.
\item (\textbf{5 points})
Simulate $N=1000$ pairs of random variables $ \{(X_1^{(n)},X_2^{(n)}\}_{n=1}^{N} $using both versions of your code, and calculate the following statistical estimators:
\begin{itemize}
\item Sample means:
\begin{displaymath}
\hat{\mu}_j = \frac{1}{N} \sum_{n=1}^{N} X_j^{(n)}
\end{displaymath}
\item Sample variances:
\begin{displaymath}
\hat{\sigma}^2_j = \frac{1}{N-1} \sum_{n=1}^{N} (X_j^{(n)} - \hat{\mu}_j)^2
\end{displaymath}
\item Sample covariance:
\begin{displaymath}
\hat{C}_{12} = \frac{1}{N-1} \sum_{n=1}^{N} (X_1^{(n)} - \hat{\mu}_1)(X_2^{(n)} - \hat{\mu}_2)
\end{displaymath}
\end{itemize}
Compare these sample estimators to the correct theoretical values.
You may be puzzled by why the sample variance has $ N-1 $ rather than
$ N$ in the denominator. The reason is statisical: dividing by $ N $
would produce an underestimation bias of the variance. That's because
you're computing the fluctuations from your \emph{sample} mean, but
your \emph{sample} mean is itself a random variable with variance
$ \sigma^2/N$. To correct for this (since you're trying to estimate
the mean-square fluctuations with respect to the \emph{true} mean $
\mu $), the denominator for $ \hat{\sigma}^2 $ is made to be $ N-1 $.
Of course, this makes little practical difference when $N $ is large.
\item (\textbf{10 points})
Assuming your code is working properly, suppose you compile it and send the executable to someone who does not have access to the source code. All she knows is that the code generates
a user-specified $ N $ copies of $ 2 $ random variables, and each pair is generated in an identical fashion, independently of the other pairs. How should she decide based on data from the simulations whether, according to the underlying probability distribution, the random variables within each pair are independent or not? Apply your method for determining dependence/independence to some data generated by your code for cases in which the random variables within the pair are uncorrelated, weakly correlated, and strongly correlated.
\item (\textbf{10 points}) If you worked part~\ref{part:theta} of Problem~\ref{sec:angaus}, verify your theoretical calculation through random variable simulations with your code. To do so, divide the range of the random variable into bins of reasonably small size, and for each bin, calculate the fraction of simulations in which the random variable landed in that bin. This value should be compared against the theoretical probability for the random variable to fall in that bin. One good way to display the comparison is to plot these two sets of values as histograms versus the value of the random variable, with bins identified by their central value. Perform these comparisons for an uncorrelated, weakly correlated, and strongly correlated example.
\item (\textbf{5 points}) If you worked part~\ref{part:sign} of Problem~\ref{sec:angaus}, verify your theoretical answer through random variable simulation for an uncorrelated, a weakly correlated case, and a strongly correlated case.
\end{enumerate}
\end{document}