\documentclass{article}
\newsavebox{\oldepsilon}
\savebox{\oldepsilon}{\ensuremath{\epsilon}}
\usepackage[minionint,mathlf,textlf]{MinionPro} % To gussy up a bit
\renewcommand*{\epsilon}{\usebox{\oldepsilon}}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx} % For .eps inclusion
%\usepackage{indentfirst} % Controls indentation
\usepackage[compact]{titlesec} % For regulating spacing before section titles
\usepackage{adjustbox} % For vertically-aligned side-by-side minipages
\usepackage{array, amsmath,  mhchem}
\usepackage[hidelinks]{hyperref}
\usepackage{courier, subcaption}
\usepackage{multirow, enumerate}
\usepackage[autolinebreaks,framed,numbered]{mcode}
\usepackage{float}
\restylefloat{table}

\pagenumbering{gobble}
\setlength\parindent{0 cm}
\renewcommand{\arraystretch}{1.2}
\begin{document}
\large

MCB 135 Problem Set 9 \hfill Due Wedesday, April 22, 2015 at 2:30 PM

\section*{Problem 1: Bicoid gradient scaling (40 points)}

The generic reaction-diffusion equation for a system with one component and one spatial dimension is\footnote{$\nabla^2$ is the Laplace operator. In one dimension, it is simply the second spatial derivative, $\partial_{xx}$. On the Cartesian plane, it is the sum of the two spatial derivatives, $\partial_{xx} + \partial_{yy}$.}:
\[ \frac{\partial}{\partial t} c(x,t) = f\left[ c(x,t) \right] + D \nabla^2  c(x,t) \]
When simulating such systems, we consider only a finite number of points on a one-dimensional grid.
\begin{enumerate}[a)]
\item Show, using the definition of the derivative, that the Laplacian term can be approximated on a grid with spacing $h$:
\[  \nabla^2 c(x,t) \approx  \frac{c(x-h,t) + c(x+h,t) - 2 \, c(x,t)}{h^2} \]
\end{enumerate}
We will model Bicoid reaction and diffusion in one dimension (representing the A-P axis of the embryo). Since Bicoid diffuses through the cytoplasm, it should not be able to ``exit" the embryo at either end: the boundaries of our grid must therefore be reflective. Unfortunately, the MATLAB function which implements the discrete Laplacian, \mcode{del2()}, does not handle these boundary conditions.
\begin{enumerate}[a)]
\setcounter{enumi}{1}
\item Write a function to estimate the discrete Laplacian on a grid with reflective boundaries at either end. The Turing pattern example script in the Lecture 29 notes, which implements the discrete Laplacian on a torus, may be a helpful starting point.
\item Suppose that the Bicoid protein gradient is established over the course of two hours in a 500 $\mu$m embryo according to the reaction-diffusion equation:
\[  \frac{\partial}{\partial t} c(x,t) =  \alpha \, \delta_k(x) - \beta \, c(x,t) + D \frac{\partial^2}{\partial x^2}  c(x,t) \]
where $\delta_k(x)$ is the Kronecker delta distribution, $\alpha$ = 10 nM/s is the translation rate, $\beta$ = 1/1800 s$^{-1}$ is the degradation rate, and $D$ = 0.3 $\mu$m$^2$/s is the diffusion rate. Show that the final Bicoid gradient is approximately exponential by simulating the system using  Euler's method and your subroutine from part (b). Assume that no Bicoid protein is present initially and use a step size\footnote{If you do use a different grid spacing, ensure that Bicoid is still synthesized in a 5 $\mu$m region.} of $h$=5 $\mu$m.
\item Repeat for an embryo twice as long, and for a third embryo half as long as the original, maintaining the same step size and synthesis rate. Plot the Bicoid concentration profiles vs. fractional body length on the same axes. Does the concentration profile scale?
\item Implement a gradient scaling mechanism of your choice and demonstrate an improvement by creating a plot similar to part (c) for comparison.
\end{enumerate}

%\section*{Problem 1: Reaction-diffusion in two dimensions (20 points)}
%
%The generic reaction-diffusion equation for a system with one component on the Cartesian plane is:
%\[ \frac{\partial}{\partial t} c(x,y,t) = g\left[ c(x,y,t) \right] + D \left[ \frac{\partial^2}{\partial x^2} +  \frac{\partial^2}{\partial y^2} \right] c(x,y,t) = g(c) + D \nabla^2 c(x,y,t) \]
%where $\nabla^2$ represents the \textit{Laplace operator}. When simulating such systems, we consider only a finite number of points on a two-dimensional grid.
%\begin{enumerate}[a)]
%\item Show, using the definition of the derivative, that the Laplacian term can be approximated on a grid with spacing $h$:
%\[ D \nabla^2 c(x,y,t) \approx  \frac{c(x-h,y,t) + c(x+h,y,t) +  c(x,y-h,t) +  c(x,y+h,t) - 4 c(x,y,t)}{h^2} \]
%\end{enumerate}
%Bicoid protein primarily diffuses through the yolkless cytoplasm near the surface of the fruit fly embryo: a region shaped like a thin ovoid shell. We will approximate this region by a cylindrical shell using a rectangular grid with appropriate boundary properties. The MATLAB function \mcode{del2()} implements the discrete Laplacian but unfortunately will not tolerate these creative boundary conditions.
%\begin{enumerate}[a)]
%\setcounter{enumi}{1}
%\item Write a function to estimate the discrete Laplacian on a grid with reflective boundaries at the left and right. Arrange for continuity under diffusion between the top and bottom row of the grid\footnote{In other words, particles which would diffuse off the left side of the grid instead bounce back to the right, and particles which diffuse off the top row of the grid appear in the bottom row, etc. The Turing pattern example script on the course website, which implements the discrete Laplacian on a torus, may be a helpful starting point.}.
%\item
%\end{enumerate}

\section*{Problem 2: Growing snake (60 points)}

Another Turing pattern mechanism proposed by Gierer and Meinhardt (1972) follows:
\[ \frac{\partial A}{\partial t} = \frac{\alpha \, A^2}{B} - \beta \, A + \epsilon \, D \,  \nabla^2 A \hspace{ 2 cm}  \frac{\partial B}{\partial t} = \gamma \, A^2  - \delta \, B + D \nabla^2 B\]
where all constants are positive.
\begin{enumerate}[a)]
\item Show that the spatially-homogeneous solution for this system is:
\[ (A^*, B^*) = \left( \frac{\alpha \delta}{\beta \gamma}, \frac{\alpha^2 \delta}{\beta^2 \gamma} \right) \]
\item Show that for Turing patterns to arise, the following two conditions must hold:
\[ \delta > \beta \hspace{2 cm} \textrm{ and } \hspace{2 cm} \left( \beta + \delta \, \epsilon \right)^2  > 8 \, \beta \, \delta \, \epsilon \]
\end{enumerate}
Consider the specific case where $\alpha=\beta =\gamma = 1$, $\delta = 1.1$, $\epsilon = 0.12$, and $D=15$. You will use Euler's method to simulate this system on a two-dimensional grid representing the skin of a snake. The left and right boundaries of the grid (the ``head" and ``tail") should be reflective under diffusion, while the top and bottom should wrap around. You may wish to modify the example Turing pattern script on the course website for this purpose.
\begin{enumerate}[a)]
\setcounter{enumi}{3}
\item Simulate this system on a grid with dimensions 5 units x 10 units (a ``baby snake"). Use a step size of one unit; choose the time step and duration appropriately to allow the system to reach its steady-state pattern. Include an image of your results. How many stripes does this snake have?
\item The snake grows up. Repeat the simulation on a grid with dimensions 10 units by 100 units. How many stripes does the snake have now? Include an image of the results.
\item The snake lives large. Repeat on a grid with dimensions 100 units by 100 units. Include an image of the results.
\item Determine which modes are unstable for organisms with the following lengths (i) $L=\sqrt{5^2 + 10^2}$, (ii) $L=\sqrt{10^2 + 100^2}$, and (iii) $L=\sqrt{100^2 + 100^2}$. How are these values reflected in the images you produced in (d-f)? Hint: see Iglesias section 3.3.2 and Figure 3.9 for a worked example.
\end{enumerate}

\end{document}

problem sets/ps9/mcb 135 problem set 9.tex


\chapter{Introduction}
%\addcontentsline{toc}{chapter}{Introduction}
 \section{A few words to set the scene}
In real life, it is not uncommon to have at one's disposal data about a phenomenon occurring through time. It may be as simple as daily rainfall data in a city for the past two years, or it could be the weekly opening prices of a stock for the past decade. \\[4 pt]
Most of the time, people would like to use the data at their disposal to make predictions to answer questions, from the prosaic ones such as 'Will it rain tomorrow ?' to more consequential ones such as 'Will I make a profit if I cling to my shares today and sell them only tomorrow ?'. Of course, those are only vaguely worded questions : it is impossible to answer them satisfactorily without knowing the context, the objectives etc. behind them. \\[4 pt]
Yet, what these questions have in common is that they focus on the normal 'behaviour' that is to be expected in the future. Depending on the specific issue that is considered, the 'average behaviour' may not be the most interesting thing. For instance, suppose that a government wants to build a network of dams\footnote{As was done in The Netherlands beginning in the fifties}. The dams are meant to protect the country from future floods for the next one hundred years, therefore the question that needs to be answered is one of 'worst case event' : "Over the next century, how severe may be the worst flood ?". \\[4 pt]
Extreme events are the kind of events we will be interested in this master thesis project. Although Extreme Value Theory has applications in many fields\footnote{including climate science, seismology, insurance etc.}, we will here apply it more specifically to financial data.

\section{Formalising the settings}
Let $(X_n)_{n \ge 0}$ be a sequence of independent identically distributed random variables with common cumulative distribution function $F_X$. The sequence of maxima is defined by $M_0$=$X_0$ and $\forall n \ge 1$, $M_n = \max_{0 \le i \le n}(X_i)$. We would like to determine the limiting distribution of the sequence $(M_n)_{n \ge 0}$.\footnote{If we can determine the limiting distribution of the maxima from the data, then we will have a means to make predictions on the occurrence of future extreme events.} This is a matter that will keep us busy quite a long time but the first thing to do is to re-formulate it. \\ [4 pt]
Indeed, let us do a quick and simple computation :\\
\begin{equation}
\begin{aligned}
	F_n(t) &= \Pr(\{M_n \le t\}) \\
              &= \Pr(\{\max_{0 \le i \le n}(X_i) \le t\}) \\
              &= \Pr(\{X_1 \le t\} \cap \cdots \cap \{X_n \le t\}) \\
              &= (F_X(t))^n
\end{aligned}
\end{equation}
Here we see that little information will be drawn from this result by taking the limit $n \longrightarrow +\infty$. The limiting distribution will be degenerate. Indeed, let us consider the upper end-point of $F_X$\footnote{that is the smallest z such that $F_X(z)$ be equal to one. For the Normal distribution, z will be +$\infty$, by contrast for a continuous Uniform Distribution $U([a,b])$ it will be b. The definition, properly speaking, of the upper end-point of $F_X$ is the following : $z^{+} = \inf\{z : F_X(z) \ge 1\}$.}, $z^{+}$. Then,
\begin{equation}
\begin{aligned}
\forall z < z^{+} \lim_{z\to\infty} F_n(z) &= 0 \\
\forall z \ge z^{+} \lim_{z\to\infty} F_n(z) &= 1 \\
\end{aligned}
\end{equation}
\\[4 pt]
It turns out we cannot use the limiting distribution directly. A common approach\footnote{adopted by the mathematicians that laid the grounds of Extreme Value Theory.} is to consider a sequence of the maxima, standardized this time (i.e. centred and rescaled).\\[4 pt]
We will thus consider in all what follows the sequence defined by $(M^{*}_n)_{n \ge 0}$ = $(\frac{M_n - b_n}{a_n})_{n \ge 0}$ where $(a_n)_{n \ge 0}$ and $(b_n)_{n \ge 0}$ are a sequence of real numbers and positive real numbers respectively. Finding a result on whether such a sequence admits a limiting distributions, and the conditions under which the result holds, will be one of our goals.
\paragraph{The two fundamental problems of extreme value theory} More specifically, assuming that there exists a non-degenerate distribution $G$, what may G be ? That is the \textit{\textbf{extremal limit problem}}. Additionally, what conditions do we have to impose on the common distribution of the random variables making up the sample, $F_X$, for the sequence $(M^{*}_n)_{n \ge 0}$ to converge to a non-degenerate distribution function G ? That is the \textit{\textbf{domain of attraction problem}}.