% \iffalse meta-comment
%
% Copyright 2003 Laurent Nguyen-Ngoc
%
% \fi
%
% \iffalse
%
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{proba}
%<package>     [2003/05/31 The Probability package]
%
%<*driver>
\documentclass{ltxdoc}
\GetFileInfo{proba.sty}
\title{The \textsf{proba} package\thanks{Version \fileversion}}
\author{Laurent Nguyen-Ngoc}
\date{\filedate}
\begin{document}
\maketitle
\DocInput{proba.dtx}
\RecordChanges
\PrintChanges
\end{document}
%</driver>
%
%\fi
%
% \CheckSum{230}
% \changes{1.0}{2003/05/31}{Initial version}
% \changes{1.01}{2003/07/26}{Added indicator function}
% \section{Introduction}
%
% The |proba| package provides some shortcuts to mathematical symbols 
% commonly used when writing articles about probability theory. You should 
% be aware that some of those shortcuts may intersect with other package 
% commands, or worse attempt to redefine commands defined elsewhere.
%
% In fact, I have not tried to really look at the number of packages that 
% already exist.
%
% The shortcuts are defined with some default symbols associated to them, 
% but can easily be customized. In fact, it happens quite often that one 
% needs the same sort of symbol, just with a different letter, in the same 
% document, and the shortcuts are defined in such a way to accomodate with 
% this need.
%
% \StopEventually{}
%
% \section{Implementation}
% In this section we shall describe the syntax of the commands, as well as 
% the implementation.
%
% \subsection{Sets}
%
% We define the set symbols as blackboard letters as provided by the 
% |amsfonts| package. For those symbols as well as for others, the 
% |amsfonts| package is therefore required.
%    \begin{macrocode}
\RequirePackage{amsfonts}
%    \end{macrocode}
% The usual syntax to obtain a set name is |\<Capital Letter>|. More 
% precisely:
%    \begin{macrocode}
\DeclareRobustCommand{\A}[0]{\mathbb{A}}
\DeclareRobustCommand{\B}[0]{\mathbb{B}}
\DeclareRobustCommand{\C}[0]{\mathbb{C}}
\DeclareRobustCommand{\D}[0]{\mathbb{D}}
\DeclareRobustCommand{\E}[0]{\mathbb{E}}
\DeclareRobustCommand{\F}[0]{\mathbb{F}}
\DeclareRobustCommand{\G}[0]{\mathbb{G}}
\DeclareRobustCommand{\H}[0]{\mathbb{H}}
\DeclareRobustCommand{\I}[0]{\mathbb{I}}
\DeclareRobustCommand{\J}[0]{\mathbb{J}}
\DeclareRobustCommand{\K}[0]{\mathbb{K}}
\DeclareRobustCommand{\L}[0]{\mathbb{L}}
\DeclareRobustCommand{\M}[0]{\mathbb{M}}
\DeclareRobustCommand{\N}[0]{\mathbb{N}}
\DeclareRobustCommand{\O}[0]{\mathbb{O}}
\DeclareRobustCommand{\P}[0]{\mathbb{P}}
\DeclareRobustCommand{\Q}[0]{\mathbb{Q}}
\DeclareRobustCommand{\R}[0]{\mathbb{R}}
\DeclareRobustCommand{\S}[0]{\mathbb{S}}
\DeclareRobustCommand{\T}[0]{\mathbb{T}}
\DeclareRobustCommand{\U}[0]{\mathbb{U}}
\DeclareRobustCommand{\V}[0]{\mathbb{V}}
\DeclareRobustCommand{\W}[0]{\mathbb{W}}
\DeclareRobustCommand{\X}[0]{\mathbb{X}}
\DeclareRobustCommand{\Y}[0]{\mathbb{Y}}
\DeclareRobustCommand{\Z}[0]{\mathbb{Z}}
%    \end{macrocode}
% Note that the |\mathbb| command ensures that those shortcuts to sets
% can be used in math mode only.
%
% \subsection{$\sigma$-fields and filtrations}
%
% In probability, the $\sigma$-fields and filtrations are commonly
% designated by letters in calligraphic style. Since such symbols are often
% needed in a probability-related document, we provide shortcuts to them.
% The usual syntax in this case is |\cal<Capital Letter>|.
%    \begin{macrocode}
\DeclareRobustCommand{\calA}[0]{{\mathcal A}}
\DeclareRobustCommand{\calB}[0]{{\mathcal B}}
\DeclareRobustCommand{\calC}[0]{{\mathcal C}}
\DeclareRobustCommand{\calD}[0]{{\mathcal D}}
\DeclareRobustCommand{\calE}[0]{{\mathcal E}}
\DeclareRobustCommand{\calF}[0]{{\mathcal F}}
\DeclareRobustCommand{\calG}[0]{{\mathcal G}}
\DeclareRobustCommand{\calH}[0]{{\mathcal H}}
\DeclareRobustCommand{\calI}[0]{{\mathcal I}}
\DeclareRobustCommand{\calJ}[0]{{\mathcal J}}
\DeclareRobustCommand{\calK}[0]{{\mathcal K}}
\DeclareRobustCommand{\calL}[0]{{\mathcal L}}
\DeclareRobustCommand{\calM}[0]{{\mathcal M}}
\DeclareRobustCommand{\calN}[0]{{\mathcal N}}
\DeclareRobustCommand{\calO}[0]{{\mathcal O}}
\DeclareRobustCommand{\calP}[0]{{\mathcal P}}
\DeclareRobustCommand{\calQ}[0]{{\mathcal Q}}
\DeclareRobustCommand{\calR}[0]{{\mathcal R}}
\DeclareRobustCommand{\calS}[0]{{\mathcal S}}
\DeclareRobustCommand{\calT}[0]{{\mathcal T}}
\DeclareRobustCommand{\calU}[0]{{\mathcal U}}
\DeclareRobustCommand{\calV}[0]{{\mathcal V}}
\DeclareRobustCommand{\calW}[0]{{\mathcal W}}
\DeclareRobustCommand{\calX}[0]{{\mathcal X}}
\DeclareRobustCommand{\calY}[0]{{\mathcal Y}}
\DeclareRobustCommand{\calZ}[0]{{\mathcal Z}}
%    \end{macrocode}
%
% \subsection{Probability symbols}
%
% Now we deal with symbols more directly related to probability.
% Probability laws and expectations are often denoted by blackboard
% letters. Although shortcuts to such letters have already been defined
% in the set shortcuts, new ones are introduced that also handle 
% any delimiters needed.
%
% \subsubsection{Elementary probability}
% First some shortcuts to symbols that are used at all levels of 
% probability theory.
%
% \begin{macro}{\prob}
% First we define a simple |\prob| shortcut that simply produces a 
% blackboard capital P by default, but whose optional argument makes it 
% easy to switch to a different letter.
%    \begin{macrocode}
\DeclareRobustCommand{\prob}[1][P]{\ensuremath {\mathbb{#1}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\probX}
% Our next command defines a proability and takes as an argument the event 
% in the probability. Again, P is the default probability symbol, but any 
% letter can override it as an optional argument.
%    \begin{macrocode}
\DeclareRobustCommand{\probX}[2][{\mathbb{P}}]{\ensuremath{ {#1}\left[ {#2} \right]}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\cprobX}
% |\cprobX| offers a shortcut to type conditional probability. It takes 3 
% arguments: the first one is the symbol to be used as the probability, 
% the second one is the event and the last one is the conditioning.
%    \begin{macrocode}
\DeclareRobustCommand{\probCX}[3][{\mathbb{P}}]{\ensuremath{ {#1}\left[ {#2} \big| {#3} \right]}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\EX}
% Now are defined the expectation related symbols. We begin by a simple 
% expectation that takes care of delimiters.
%    \begin{macrocode}
\DeclareRobustCommand{\EX}[2][{\mathbb{E}}]{\ensuremath {#1}\left[ {#2} \right]}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\cEX}
% Just like for probabilities, a conditional version of the expectation is 
% provided.
%    \begin{macrocode}
\DeclareRobustCommand{\cEX}[3][{\mathbb{E}}]{\ensuremath {#1}\left[ {#2} \big| {#3} \right]}
%    \end{macrocode}
% \end{macro}
%
%Ê\begin{macro}{\Var}
% Also a math operator is defined for the variance. 
% This simple version has just an optional argument that goes as a 
% subscript to ``Var''.
%    \begin{macrocode}
\DeclareRobustCommand{\Var}[1][]{\ensuremath{\mathrm{Var[#1]}}}
%    \end{macrocode}
% \end{macro}
%
%Ê\begin{macro}{\VarX}
% Now we take care of delimiters for what is inside the variance.
%    \begin{macrocode}
\DeclareRobustCommand{\VarX}[2][]{\ensuremath{\mathrm{Var}_{#1}\left[ {#2} \right]}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\cVarX}
% A conditional variance command is also provided, although less often
% used.
%    \begin{macrocode}
\DeclareRobustCommand{\cVarX}[3][]{\ensuremath \mathrm{Var}_{#1}\left[ {#2} \big| {#3} \right]}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\eqlaw}
% A shortcut for equality in law is provided.
%    \begin{macrocode}
\DeclareRobustCommand{\eqlaw}[0]{\mathop{\stackrel{(d)}{=}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\tolaw}
% |\tolaw| is a shortcut to a symbol for convergence in law.
%    \begin{macrocode}
\DeclareRobustCommand{\tolaw}[0]{\mathop{\stackrel{(d)}{\longrightarrow}}}
%    \end{macrocode}
% \end{macro}
%
% \subsubsection{Stochastic processes}
%
% Some notation is customary when dealing with stochastic processes. Note 
% that the same notation is sometimes used also in other parts of 
% mathematics.
%
% \begin{macro}{\qvar}
% The quadratic variation of two processes arises quite often. The command 
% |\qvar|Êgives the right bracket of two processes.
%    \begin{macrocode}
\DeclareRobustCommand{\qvar}[2]{\ensuremath{\left[ {#1},{#2} \right]}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\cqvar}
% Obviously, a shortcut for the conditional quadratic variation, or oblique
% bracket is also provided.
%    \begin{macrocode}
\DeclareRobustCommand{\cqvar}[2]{\ensuremath{\langle {#1},\,{#2} \rangle}}
%    \end{macrocode}
% \end{macro}
%
%
% \subsection{Miscellany}
% Some miscellaneous symbols or functions defined here.
%
% \begin{macro}{\1}
% First, an indicator function, that prints a bold 1 and puts curly
% braces.
%    \begin{macrocode}
\DeclareRobustCommand{\1}[1]{\ensuremath \mathbf{1}_{\{#1\}}}
%    \end{macrocode}
% \end{macro}
% \Finale
