text:
\documentclass[a4paper]{article}

\input{temp}

\setcounter{section}{-1}

\begin{document}

\title{Advanced Financial Models}

\maketitle

\newpage

\tableofcontents

\newpage

\section{Introduction}

$www.staslab.cam.ac.uk/~mike/AFM/$ for course material. However lecture notes only come after lectures, so taking notes is still necessary..

$m.tehranchi@statslab.cam.ac.uk$

Assumptions for this course:\\
No dividends, zero tick size (continuous), no transaction costs, no short-selling constraints, infinitely divisible assets, no bid-ask spread, infinite market depth, agents have preferences for expected utility.

\newpage

\section{Discrete time models}

We'll assume there are $n$ assets with price $P_t^i$ at time $t$ for asset $i$. Apparently $P_t^i$ is a random variable on some probability space $(\Omega,\mathcal{F},\P)$.

We'll use the notation $P=(P_t^1,...,P_t^n)_{t \geq 0}$ which is a $n$-dimensional stochastic process.

Information available at time $t$ is modelled by a $\sigma$-algebra $\mathcal{F}_t \subseteq \mathcal{F}$.

The assumption will be $\mathcal{F}_s \subseteq \mathcal{F}_t$ for $s \leq t$ (in other words, $\mathcal{F}$ is a filtration):

\begin{defi} (Filtration)\\
A \emph{Filtration} is a collection of $\sigma$-algebra $(\mathcal{F}_t)_{t \geq 0}$ such that $\mathcal{F}_s \subseteq \mathcal{F}_t$ for $s \leq t$.
\end{defi}

We'll assume that $\mathcal{F}_0$ is trivial, i.e. if $A$ is $\mathcal{F}_0$ measure then $\mathbb{P} = 0$ or $1$. As a result $P_0^1,...,P_0^n$ are constants.

We assume that $(P_t)_{t \geq 0}$ is adapted to the filtration, i.e. $P_t$ is $\mathcal{F}_t$-measurable for all $t \geq 0$. Usually we assume the filtration is generated by $P$ itself (so all the information is in the price).

Let $c_t$ be the amount consumed at time $t$ which will be a $\mathcal{F}_t$-measurable scalar, $H_t = (H_t^1,...,H_t^n)$ be the vector of portfolio weights, so $H_t^i$ is the number of shares held at $(t-1,t]$ (remember we are in discrete time), which will be $\mathcal{F}_{t-1}$-measurable. $(c_t)_{t \geq 0}$ is adapted ($\mathcal{F}_t$-measurable), $(H_t)_{t \geq 1}$ is predictable/previsible ($\mathcal{F}_{t-1}$-measurable, $n$-dimensional.

\begin{defi}
The process $(c,H)$ is self-financing if $H_t\cdot P_t = c_t+H_{t+1} \cdot P_t$ for all $t \geq 1$.
\end{defi}

For example, $X_0$ be the initial wealth, $X_0-c_0$ is the post-consumption wealth ($=H_1 \cdot P_0$), $X_1=H_1 \cdot P_1$ is the pre-consumption wealth at time 1, $X_1-c_1$ is the post consumption wealth (which is $H_2\cdot P_1$. In other words, at any specific time, consumption takes place and then price updates.

Background assumption on behaviour of an agent:\\
Say $c^2$ is preffered to $c^1$ iff $\E U(c_0^1,c_1^1,...) < \E U(c_0^2,c_1^2,...)$ where $U$ is some investor utility function, which is increasing in all $c_i$, concave (so risk-avert)

\begin{defi}
An arbitrage is a self-financing investment-consumption strategy $(c,H)$ such that there exists a non-random time $T>0$ s.t. $c_0 = -H_1 \cdot P_0$, $c_t = (H_t - H_{t+1}) \cdot P_t$ for $1 \leq t \leq T-1$, and $c_T =H_T \cdot P_T$ (in words, with initial wealth $X_0 = 0$ and post-consumption wealth at $T$ $X_T-C_T=0$), that $\P(c_t \geq 0)$ for all $0 \leq t \leq T) = 1$, and $\P(c_t > 0$ for some $0 \leq t \leq T) > 0$.
\end{defi}

Suppose $(c^1,H^1)$ is self-financing with iniital wealth $X_0$, $(c^2,H^2) = (c^1,H^1) + (c,H)$, where $(c,H)$ is an arbitrage. Then $c^2$ is preferred to $c^1$.

The inverstor who believes there is an arbitrage would have no optimal investment-consumption policy.

Even further background assumption: the market is in equillibrium (supply = demand).

\begin{defi}
Given the market model, a martingale deflator is positive adapted process $(Y_t)_{t \geq 0}$ such that $(Y_t \cdot P_t)_{t \geq 0}$ is a martingale.
\end{defi}

\begin{thm} (First fundamental theorem of asset pricing)\\
The market has no arbitrage if and only if there exists a martingale deflator.
\end{thm}

\begin{defi}
Given an $(\Omega,\mathcal{F},\P)$-integrable $X$ ($\E|X| < \infty$), and $\mathcal{G} \subseteq \mathcal{F}$) a sub-$\sigma$-algebra of $\mathcal{F}$, a conditional expectation of $X$ given $\mathcal{G}$ is an integrable $Y$ that is $\mathcal{G}$-measurable and such that $\E(X 1_G) = \E(Y 1_G)$ for all $G \in \mathcal{G}$.
\end{defi}

\begin{thm}
The conditional expectations exist and are unique in the sense that, if $Y^1,Y^2$ are both conditional expecations, then $Y^1=Y^2$ almost surely.
\end{thm}

We'll use the notation $Y = \E(X|\mathcal{G})$.

\begin{eg}
Let $(G_n)_n$ be a partition of $\Omega$, $\mathcal{G} = \sigma({G_n})$. Then $\E(X|\mathcal{G})(\omega) = \frac{\E(X1_{G_n})}{\P(G_n)} = \E(X|G_n)$ if $\omega \in G_n$ and $\P(G_n)>0$, or anything else if $\P(G_n) = 0$ is a valid conditional expectation.
\end{eg}

\begin{thm}
    Suppose we have a probability space $(\Omega,\mathcal{F},\P)$ with $\mathcal{G} \subseteq \mathcal{F}$ a sub-$\sigma$-algebra, and assume all conditional expectations we need exist, i.e. all random variables are integrable.\\
    $\bullet$ 1. Linearity: $\E(aX+bY|\mathcal{G}) = a\E(X|\mathcal{G})+b\E(Y|\mathcal{G})$ $\forall a,b \in \R$;\\
    $\bullet$ 2. Positivity: If $X \geq 0$ a.s., then $\E(X|\mathcal{G}) \geq 0$ a.s.; furthermore, if $\E(X|\mathcal{G}) = 0$ a.s., then $X=0$ a.s..\\
    $\bullet$ 3. Jensen's inequality: If $f$ is convex, then $\E(f(X)|\mathcal{G}) \geq f(\E(X|\mathcal{G}))$ a.s. (here we obviously assume $f$ is integrable).\\
    $\bullet$ 4. Monotone convergence: If $X_n \geq 0$ $\forall n$ a.s. and $X_n \nearrow X$ a.s., then $\E(X_n | \mathcal{G}) \nearrow \E(X|\mathcal{G})$.\\
    $\bullet$ 5. Fatou's lemma: If $X_n \geq 0$, then $\liminf \E(X_n|\mathcal{G}) \geq \E(\liminf X_n|\mathcal{G})$.\\
    $\bullet$ 6. Dominated convergence: If $\E (\sup |X_n|) < \infty$ and $X_n \to X$ a.s., then $\E(X_n | \mathcal{G}) \to \E(X|\mathcal{G})$ a.s..\\
    The derivation of the above are similar to that of normal expectations. Now let's introduce something that's only for conditional expectations:\\
    $\bullet$ 7. If $X$ and $\mathcal{G}$ are \emph{independent}, i.e. $\{X \leq x\}$ and $G$ are independent for all $x \in \R$, $G \in \mathcal{G}$, then $\E(X|\mathcal{G}) = \E(X)$.\\
    $\bullet$ 8. Slot property: If $X$ and $XY$ are integrable, $Y$ is $\mathcal{G}$-measurable, then $\E(XY|\mathcal{G}) = Y\E(X|\mathcal{G})$. In particular, $\E(Y|\mathcal{G}) = Y$.\\
    $\bullet$ 9. Tower property: If $\mathcal{H} \subseteq \mathcal{G} \subseteq \mathcal{F}$, then
    \begin{equation*}
        \begin{aligned}
            \E\left(E(X|\mathcal{G})|\mathcal{H}\right) = \E\left(\E(X|\mathcal{H})|\mathcal{G}\right) = \E(X|\mathcal{H})
        \end{aligned}
    \end{equation*}
\end{thm}

\begin{defi}
    Given $(\Omega,\mathcal{F},\P)$ and filtration $(\mathcal{F}_t)_{t \geq 0}$, a martingale $\mathcal{M} =(\mathcal{M}_t)_{t \geq 0}$ is an adapted process (i.e. $\mathcal{M}_t is \mathcal{F}_t$-measurable), and integrable process (i.e $\E(|\mathcal{M}_t)<\infty \forall t$), and $\E(\mathcal{M}_t|\mathcal{F_s}) =\mathcal{M}_s$ for $0 \leq s \leq t$.
\end{defi}

\begin{rem}
    This definition is the same in both discrete and continuous time.
\end{rem}

\begin{prop}
In discrete time, an integrable adapted process $(\mathcal{M}_t)_{t \geq 0}$ is a martingale iff $\E(\mathcal{M}_{t+1}|\mathcal{F}_t) = \mathcal{M}_t$ for all $t \geq 0$.
\begin{proof}
    If $\mathcal{M}$ is a martingale then this condition holds trivially by definition.\\
    Now suppose $\E(\mathcal{M}_{t+1}|\mathcal{F}_t) = \mathcal{M}_t$ $\forall t \geq 0$, we claim $\E(\mathcal{M}_T | \mathcal{F}_t) = \mathcal{M}_t$ for all $T \geq t$. Prove by induction:\\
    This is true for $T=t+1$. Now $\E(\mathcal{M}_{T+1}|\mathcal{F}_t) = \E(\E(\mathcal{M}_{T+1}|\mathcal{F}_T)|\mathcal{F}_t) = \E(\mathcal{M}_T|\mathcal{F}_t)$ by tower property, so done.
\end{proof}
\end{prop}

\begin{eg}
    1. (Forward construction) Given $\xi_1,\xi_2,...$ independent and integrable, $\E(\xi_n)=0 \forall n$, $S_0=0$ and $S_t = \xi_1+...+\xi_t$ for $t \geq 1$. Then $(S_t)_{t \geq 0}$ is a martingale (relative to the filtration generated by $\xi_i$ ,i.e. $\mathcal{F} =\sigma(\xi_1,...\xi_t)$).
    \begin{proof}
        Adaptedness and integrability are easy (measurability and integrability are preserved by additions);\\
        Now
        \begin{equation*}
            \begin{aligned}
                \E(S_{t+1}|\mathcal{F}_t) &= \E(S_t+\xi_{t+1} | \mathcal{F}_t)\\
                &= \E(S_t|\mathcal{F}_t) + \E(\xi_{t+1}|\mathcal{F}_t)\\
                &= S_t+\E(\xi_{t+1}) = S_t
            \end{aligned}
        \end{equation*}
        we've used that $S_t$ is $\mathcal{F}_t$-measurable and the independence of $\xi_i$.
    \end{proof}

    2. (Backward construction) Given $X$ integrable, and a filtration $(\mathcal{F}_t)_{t \geq 0}$, let
    \begin{equation*}
        \begin{aligned}
            M_t = \E(X|\mathcal{F}_t)
        \end{aligned}
    \end{equation*}
    then $(M_t)_{t \geq 0}$ is a martingale.
    \begin{proof}
        As before we don'e have to do adaptedness and integrability as conditional expectations are integrable and adapted. Now
        \begin{equation*}
            \begin{aligned}
                \E(M_t | \mathcal{F}_s) = \E(\E(X|\mathcal{F}_t)|\mathcal{F}_s) = \E(X|\mathcal{F}_s) = M_s \forall t>s
            \end{aligned}
        \end{equation*}
        by tower property.
    \end{proof}
\end{eg}

\end{document}


text:
\documentclass[%
 reprint, %two colums
%preprint, %single column
%superscriptaddress,
%groupedaddress,
%unsortedaddress,
%runinaddress,
%frontmatterverbose,
%showpacs,preprintnumbers,
%nofootinbib,
%nobibnotes,
%bibnotes,
 amsmath,amssymb,
 aps,
 pra,
%prb,
%rmp,
%prstab,
%prstper,
%floatfix,
]{revtex4-1}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}% Include figure files
\usepackage{listings} % Include source code
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
\usepackage{hyperref}% add hypertext capabilities
\usepackage{float}%use figure with borders

\begin{document}

\title{Team Eugenio 4635 Engineering Documentation \\ FRC 2015 Recycle Rush}

\author{Mario Gutiérrez}
\email{mgutierrez@gmail.com}
\affiliation{Monterrey Institute of Technology\\}

\author{Antonio Torres}
\email{atorres@gmail.com}
\affiliation{Monterrey Institute of Technology\\}

\date{\today}

% make the title area
\maketitle

\section*{Introduction}
This document explains all the engineering related work done by Team Eugenio 4635 during the build season of the First Robotics Competition 2015 challenge Recycle Rush.

Here are some examples on how to use \LaTeX :
\begin{itemize}
\item Here's a bullet.
\item Here's another one.
\end{itemize}

This is how you place a table:
\begin{tabular}{ l c r }
  1 & 2 & 3 \\
  4 & 5 & 6 \\
  7 & 8 & 9 \\
\end{tabular}

You can insert code like this:
\begin{lstlisting}[language=Java]
for(int i=0; i<10; i++){
   System.out.println("Hello World");
}
\end{lstlisting}

Here's a figure:
\begin{figure}[H]
    \includegraphics[width = \columnwidth]{RecycleRush}
    \caption{Caption goes here.}
\end{figure}

This is how you insert a hyperlink \href{http://google.com}{link to Google.com}

\section{Task Definition}
Definition of the specific tasks in which the team was working on during the build season, and the tasks that they will have to accomplish during the regional.

\section{Planning and Design}
Description of the team's organizational structure and the individual engineering roles taken by the team members. General description about the robot's design focusing on functionality. Include schedules and deadlines. Relate every taken decision about the design with some goal relevant to the task.

\subsection{Hardware}
Detailed description about the robot's mechanical and electrical systems, including all physical components and some arguments that justify the decision of implementing those systems over any other one. Also include diagrams that show the robot's mechanisms and circuits.

\subsection{Software}
Detailed description about the robot's programming, including the code's general structure and some arguments that justify the implementation of the techniques or paradigms present in that code.

\section{Development}
Description about the process of actually making the robot. Justify the hardware and software tools that were used. State some of the main challenges and the way you managed to overcome them.

\section{Evaluation}
Evaluate the engineering team's outcome and its overall performance. Give the specifications and capabilities of the robot. State the team's strengths, weakness, opportunities, and threats (SWOT).

\section{Conclusion}
See you at the competition!

\section{Appendix}
Some text for the appendix.

\section*{Acknowledgments}
The authors would like to thank Pablo Brubeck for being such a great guy.

\bibliographystyle{unsrt}
\bibliography{bibliography}

\end{document}

ext: tex


text:
\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{center}
\textbf{\huge{Week 3}}
\end{center}
\subsection{Joint Entropy in multiple RV's}

$$H(X_1, \cdots, X_n)= \sum_{ (x_1, \cdots, x_n) \in supp(P_{X_1, \cdots, X_n})} P(x_1, \cdots, x_n) \log_2 \frac{1}{P(x_1, \cdots, x_n)}$$

Where $P_{X,Y} := \mathcal{X} \times \mathcal{Y} \rightarrow \text{Cartesian Product}$.

$\mathcal{X} \times \mathcal{Y} := \{ (x,y): x \in \mathcal{X}, y\in \mathcal{Y}\} $

\subsection{Conditional Joint Entropy}
$$H(X,Y/U,V):= \sum_{(u,v) \in supp(P_{U,V})} P_{U,V}(u,v)H(X,Y/U=u,V=v) $$
where,
$$ H(X,Y/U=u,V=v) = \sum_{(x,y) \in supp(P_{X,Y/U=u,V=v})} P(x,y/u,v) \log_2 \frac{1}{P(x,y/u,v)}$$

This can be extended to any number of variables before and after the conditioning.

eg: $P(x_1,x_2,x_3/y_1,y_2)= P(x_1,x_2/x_3,y_1,y_2)+ P(x_3/x_1,x_2,y_1,y_2)$.
\section{Chain Rule for Joint Entropy}

Lemma:
\begin{multline}
    H(X_1, \cdots, X_n)= H(X_1)+ H(X_2 / X_1)+ H(X_3/ X_1, X_2)+ \cdots \\ + H(X_n/ X_1, \cdots, X_n) =  \sum_{i=1}^{n} H(X_i/ X_{i-1},\cdots, X_1)
\end{multline}
Proof:
\begin{align*}
    P(x_1,\cdots,x_n)&=P(x_1)P(x_2,\cdots,x_n/x_1) \\
    &= P(x_1)P(x_2/x_1)P(x_3,\cdots,x_n/x_1,x_2) \\
    &= P(x_1)P(x_2/x_1)P(x_3/x_1,x_2)P(x_4,\cdots,x_n/x_1,x_2,x_3) \\
    &= P(x_1)P(x_2/x_1)P(x_3/x_1,x_2)\cdots P(x_n/x_1,\cdots,x_{n-1}) \\
    &= \prod_{i=1}^{n} P(x_i / x_{i-1}, \cdots, x_1)
\end{align*}
We can substitute this value in the definition for joint entropy and expand, giving us the final result.
\begin{align*}
    H(X_1,\cdots, X_n) &= - \sum_{x_1,\cdots,x_n} P(x_1,\cdots,x_n) \log \prod_{i=1}^{n} P(x_i / x_{i-1}, \cdots, x_1) \\
    &= - \sum_{x_1,\cdots,x_n} \sum_{i=1}^{n} P(x_1,\cdots,x_n) \log P(x_i / x_{i-1}, \cdots, x_1) \\
    &= - \sum_{i=1}^{n} \sum_{x_1,\cdots,x_n} P(x_1,\cdots,x_n) \log P(x_i / x_{i-1}, \cdots, x_1) \\
    &= \sum_{i=1}^{n} H(X_i/ X_{i-1},\cdots, X_1)
\end{align*}
%use definition of joint entropy to complete the proof.

\section{Mutual Information}

We know that the average uncertainity in $X$ is known as entropy of $X$, and it is given as $H(X)$.
If an observer($RX$) sees $X$, the uncertainity in $X$ would become 0 i.e $H(X/X)$.

Hence the reduction in average uncertainity of $X$ achieved by observing $X$ is $H(X)-H(X/X)=H(X)$.

Suppose $X,\, Y$ are related to each other and the observer knows it's joint probability distribution $P(x,y)=P(X=x,Y=y) \; \forall \;  x,y$.

The ``reduction in uncertainity of X after observing Y'', ``information gained about X after observing Y'' or ``mutual information between X \& Y'' is:
$$I(X;Y):=H(X)-H(X/Y)$$
By symmetry it follows that:
$$I(X;Y)=H(Y)-H(Y/X)=H(X)+H(Y)-H(X,Y)$$

\begin{enumerate}
    \item $ I(X;Y) \leq \text{min} (H(X),H(Y))$

    Information gained depends on the quantized observation.

    \item $I(X;Y) \geq 0$

    Proof:
    \begin{align*}
        I(X;Y) &= H(X)-H(X/Y) \\
        &= - \sum_{x \in supp(P_X)} P(x)\log(P(x) - \left( - \sum_{x,y \in supp P_{X,Y}} P(x,y) \log (x/y)\right) \\
        &= - \sum_{x,y} P(x,y)\log P(x) + \sum_{x,y} P(x,y)\log P(x/y) \\
        &= \sum_{x,y} P(x,y)\log \frac{P(x/y)}{P(x)} \\
        &= \sum_{x} \sum_{y} P(x,y)\log \frac{P(x,y)}{P(x)P(y)} \\
        &= D(P(x,y)||P(x)P(y))
    \end{align*}
    As we know that the relative entropy of 2 probability distributions is positive, the proof is complete.
\end{enumerate}

\section{Information Theory}

\begin{itemize}
    \item Efficient source representation.(using some random variable or sequence of R.V's)(data compression and source coding)
    \item High rate and high fidelity.(low probability of error)(channel coding)
\end{itemize}

\subsection{Source Coding}

Suppose we have $X \in \{ a,b\}$, a binary source with probability distribution $P_X$. And an observer observes one instance of $X$, then wants to store(or communicate) it through a noise-free medium, which can carry or store only $\{ 0,1 \}$(bits).

But the reciever already knows $P_X$ and it so happens that:
$$ P_X(b)=1 \quad P_X(a)=0$$

Then RX doesn't need to read/recieve the encoded value to know $X$. It can simply declare the value of $X$ to be $b$ and it will be correct/error-free with probability 1.

We need a 0-length code as code is not required at all.

Suppose we allow a small probability of error $\Rightarrow P(\text{error}) \leq \epsilon, \quad \epsilon \in [0,1)$.

Then we could have length = 0 \& $P(\text{error}) \leq \epsilon$, if we let

$ P_X(b)=1-\epsilon, P_X(a)=\epsilon $.

\end{document}