summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/proba/proba.dtx
blob: a585c5463e29216d5da04d4db4b961f2641fcf2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
% \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