Debian Codegraph @

texmf-dist/source/latex/statmath/statmath.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2018 Sebastian Ankargren
4 % -----------------------------------
5 %
6 % This file may be distributed and/or modified under the
7 % conditions of the LaTeX Project Public License, either version 1.3
8 % of this license or (at your option) any later version.
9 % The latest version of this license is in:
10 %
11 % http://www.latex-project.org/lppl.txt
12 %
13 % and version 1.3 or later is part of all distributions of LaTeX
14 % version 2005/12/01 or later.
15 %
16 % \fi
17 %
18 % \iffalse
19 %<package>\NeedsTeXFormat{LaTeX2e}
20 %<package>\ProvidesPackage{statmath}
21 %<package>[2018/03/08 v0.1 Statistical notation and mathematics]
22 %
23 %<*driver>
24 \documentclass{ltxdoc}
25 \usepackage{statmath}
26 \EnableCrossrefs
27 \CodelineIndex
28 \RecordChanges
29 \begin{document}
30 \DocInput{statmath.dtx}
31 \end{document}
32 %</driver>
33 % \fi
34 %
35 % \CheckSum{0}
36 %
37 % \CharacterTable
38 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
39 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
40 % Digits \0\1\2\3\4\5\6\7\8\9
41 % Exclamation \! Double quote \" Hash (number) \#
42 % Dollar \$ Percent \% Ampersand \&
43 % Acute accent \' Left paren \( Right paren \)
44 % Asterisk \* Plus \+ Comma \,
45 % Minus \- Point \. Solidus \/
46 % Colon \: Semicolon \; Less than \<
47 % Equals \= Greater than \> Question mark \?
48 % Commercial at \@ Left bracket \[ Backslash \\
49 % Right bracket \] Circumflex \^ Underscore \_
50 % Grave accent \` Left brace \{ Vertical bar \|
51 % Right brace \} Tilde \~}
52 %
53 %
54 % \changes{v1.0}{2018/03/08}{Initial version}
55 %
56 % \GetFileInfo{statmath.sty}
57 %
58 % \DoNotIndex{\#}
59 %
60 % \title{The \textsf{statmath} package\thanks{This document
61 % corresponds to \textsf{statmath}~\fileversion,
62 % dated \filedate.}}
63 % \author{Sebastian Ankargren\\ \texttt{[email protected]}}
64 %
65 % \maketitle
66 %
67 % \begin{abstract}
68 % Applied and theoretical papers in statistics usually contain a number of notational conventions which are currently lacking in the popular |amsmath| package. This package provides commands for such standard statistical-mathematical language, including bold Roman and Greek letters, convergence symbols, matrix operations.
69 % \end{abstract}
70 %
71 % \section{Introduction}
72 %
73 % Applied and theoretical papers in statistics usually contain a number of notational conventions which are currently lacking in the popular |amsmath| package. The seasoned \LaTeX{} user will see that the provided commands are simple, almost trivial, but will hopefully offer less cluttered preambles as well as a welcome help for novice users.
74 %
75 % \section{Usage}
76 %
77 % \DescribeMacro{\bfA}
78 % Capital Roman letter: $\bfA$\\
79 % \DescribeMacro{\bfa}
80 % Lower-case Roman letter: $\bfa$\\
81 % \DescribeMacro{\bfGamma}
82 % Capital Greek letter: $\bfGamma$\\
83 % \DescribeMacro{\bfalpha}
84 % Lower-case Greek letter: $\bfalpha$\\
85 % \DescribeMacro{\bfzero}
86 % Bold zero: $\bfzero$\\
87 % \DescribeMacro{\cov}
88 % Covariance: $\cov(X, Y)$\\
89 % \DescribeMacro{\E}
90 % Expectation: $\E(X)$\\
91 % \DescribeMacro{\V}
92 % Variance: $\V(X)$\\
93 % \DescribeMacro{\inas}
94 % Convergence almost surely: $X_n \inas X$\\
95 % \DescribeMacro{\inprob}
96 % Convergence in probability: $X_n \inprob X$\\
97 % \DescribeMacro{\indist}
98 % Convergence in distribution: $X_n \indist X$\\
99 % \DescribeMacro{\plim}
100 % Probability limit: $\plim X_n = X$\\
101 % \DescribeMacro{\tr}
102 % Trace of matrix: $\tr(\bfA)$\\
103 % \DescribeMacro{\vc}
104 % Vectorization of matrix: $\vc(\bfA)$\\
105 % \DescribeMacro{\vcs}
106 % Strict half-vectorization of matrix: $\vcs(\bfA)$\\
107 % \DescribeMacro{\vch}
108 % Half-vectorization of matrix: $\vch(\bfA)$\\
109 % \DescribeMacro{\diag}
110 % Diagonal of matrix: $\diag(\bfA)$\\
111 % \DescribeMacro{\argmin}
112 % Minimize argument: $\hat{\theta}=\argmin_{\theta\in\Theta}f(\theta)$\\
113 % \DescribeMacro{\argmax}
114 % Maximize argument: $\hat{\theta}=\argmax_{\theta\in\Theta}f(\theta)$\\
115 %
116 % \StopEventually{\PrintIndex}
117 %
118 % \section{Implementation}
119 % The default is to use |\mathbf| for Roman letters and |\boldsymbol| for Greek letters. Both can be changed (individually) to |\bm|.
120 % \begin{macrocode}
121 \RequirePackage{amsmath}
122 \RequirePackage{bm}%
123
124 \DeclareOption{abcbm}{%
125 \let\abcbf\bm%
126 }
127 \DeclareOption{greekbm}{%
128 \let\greekbf\bm%
129 }
130 \DeclareOption{abcbf}{%
131 \let\abcbf\mathbf%
132 }
133 \DeclareOption{greekbs}{%
134 \let\greekbf\boldsymbol%
135 }
136
137 \ExecuteOptions{abcbf,greekbs}
138
139 \ProcessOptions\relax
140 % \end{macrocode}
141 % \clearpage
142 % \subsection{Bold letters and symbols}
143 % \begin{macro}{\bfA}
144 % \begin{macro}{\bfB}
145 % \begin{macro}{\bfC}
146 % \begin{macro}{\bfD}
147 % \begin{macro}{\bfE}
148 % \begin{macro}{\bfF}
149 % \begin{macro}{\bfG}
150 % \begin{macro}{\bfH}
151 % \begin{macro}{\bfI}
152 % \begin{macro}{\bfJ}
153 % \begin{macro}{\bfK}
154 % \begin{macro}{\bfL}
155 % \begin{macro}{\bfM}
156 % \begin{macro}{\bfN}
157 % \begin{macro}{\bfO}
158 % \begin{macro}{\bfP}
159 % \begin{macro}{\bfQ}
160 % \begin{macro}{\bfR}
161 % \begin{macro}{\bfS}
162 % \begin{macro}{\bfT}
163 % \begin{macro}{\bfU}
164 % \begin{macro}{\bfV}
165 % \begin{macro}{\bfW}
166 % \begin{macro}{\bfX}
167 % \begin{macro}{\bfY}
168 % \begin{macro}{\bfZ}
169 % Capital letters are obtained by |\bfA|, |\bfB|, etc. The command |\abcbf| is either |\textbf| or |\bm|, depending on options |abcbf| or |abcbm|.
170 % \begin{macrocode}
171 \newcommand{\bfA}{\abcbf A}
172 \newcommand{\bfB}{\abcbf B}
173 \newcommand{\bfC}{\abcbf C}
174 \newcommand{\bfD}{\abcbf D}
175 \newcommand{\bfE}{\abcbf E}
176 \newcommand{\bfF}{\abcbf F}
177 \newcommand{\bfG}{\abcbf G}
178 \newcommand{\bfH}{\abcbf H}
179 \newcommand{\bfI}{\abcbf I}
180 \newcommand{\bfJ}{\abcbf J}
181 \newcommand{\bfK}{\abcbf K}
182 \newcommand{\bfL}{\abcbf L}
183 \newcommand{\bfM}{\abcbf M}
184 \newcommand{\bfN}{\abcbf N}
185 \newcommand{\bfO}{\abcbf O}
186 \newcommand{\bfP}{\abcbf P}
187 \newcommand{\bfQ}{\abcbf Q}
188 \newcommand{\bfR}{\abcbf R}
189 \newcommand{\bfS}{\abcbf S}
190 \newcommand{\bfT}{\abcbf T}
191 \newcommand{\bfU}{\abcbf U}
192 \newcommand{\bfV}{\abcbf V}
193 \newcommand{\bfW}{\abcbf W}
194 \newcommand{\bfX}{\abcbf X}
195 \newcommand{\bfY}{\abcbf Y}
196 \newcommand{\bfZ}{\abcbf Z}
197 % \end{macrocode}
198 % \end{macro}
199 % \end{macro}
200 % \end{macro}
201 % \end{macro}
202 % \end{macro}
203 % \end{macro}
204 % \end{macro}
205 % \end{macro}
206 % \end{macro}
207 % \end{macro}
208 % \end{macro}
209 % \end{macro}
210 % \end{macro}
211 % \end{macro}
212 % \end{macro}
213 % \end{macro}
214 % \end{macro}
215 % \end{macro}
216 % \end{macro}
217 % \end{macro}
218 % \end{macro}
219 % \end{macro}
220 % \end{macro}
221 % \end{macro}
222 % \end{macro}
223 % \end{macro}
224 % \clearpage
225 % \begin{macro}{\bfa}
226 % \begin{macro}{\bfb}
227 % \begin{macro}{\bfc}
228 % \begin{macro}{\bfd}
229 % \begin{macro}{\bfe}
230 % \begin{macro}{\bff}
231 % \begin{macro}{\bfg}
232 % \begin{macro}{\bfh}
233 % \begin{macro}{\bfi}
234 % \begin{macro}{\bfj}
235 % \begin{macro}{\bfk}
236 % \begin{macro}{\bfl}
237 % \begin{macro}{\bfm}
238 % \begin{macro}{\bfn}
239 % \begin{macro}{\bfo}
240 % \begin{macro}{\bfp}
241 % \begin{macro}{\bfq}
242 % \begin{macro}{\bfr}
243 % \begin{macro}{\bfs}
244 % \begin{macro}{\bft}
245 % \begin{macro}{\bfu}
246 % \begin{macro}{\bfv}
247 % \begin{macro}{\bfw}
248 % \begin{macro}{\bfx}
249 % \begin{macro}{\bfy}
250 % \begin{macro}{\bfz}
251 % Lower-case letters are obtained by |\bfa|, |\bfb|, etc. The command |\abcbf| is either |\textbf| or |\bm|, depending on options |abcbf| or |abcbm|.
252 % \begin{macrocode}
253 \newcommand{\bfa}{\abcbf a}
254 \newcommand{\bfb}{\abcbf b}
255 \newcommand{\bfc}{\abcbf c}
256 \newcommand{\bfd}{\abcbf d}
257 \newcommand{\bfe}{\abcbf e}
258 \newcommand{\bff}{\abcbf f}
259 \newcommand{\bfg}{\abcbf g}
260 \newcommand{\bfh}{\abcbf h}
261 \newcommand{\bfi}{\abcbf i}
262 \newcommand{\bfj}{\abcbf j}
263 \newcommand{\bfk}{\abcbf k}
264 \newcommand{\bfl}{\abcbf l}
265 \newcommand{\bfm}{\abcbf m}
266 \newcommand{\bfn}{\abcbf n}
267 \newcommand{\bfo}{\abcbf o}
268 \newcommand{\bfp}{\abcbf p}
269 \newcommand{\bfq}{\abcbf q}
270 \newcommand{\bfr}{\abcbf r}
271 \newcommand{\bfs}{\abcbf s}
272 \newcommand{\bft}{\abcbf t}
273 \newcommand{\bfu}{\abcbf u}
274 \newcommand{\bfv}{\abcbf v}
275 \newcommand{\bfw}{\abcbf w}
276 \newcommand{\bfx}{\abcbf x}
277 \newcommand{\bfy}{\abcbf y}
278 \newcommand{\bfz}{\abcbf z}
279 % \end{macrocode}
280 % \end{macro}
281 % \end{macro}
282 % \end{macro}
283 % \end{macro}
284 % \end{macro}
285 % \end{macro}
286 % \end{macro}
287 % \end{macro}
288 % \end{macro}
289 % \end{macro}
290 % \end{macro}
291 % \end{macro}
292 % \end{macro}
293 % \end{macro}
294 % \end{macro}
295 % \end{macro}
296 % \end{macro}
297 % \end{macro}
298 % \end{macro}
299 % \end{macro}
300 % \end{macro}
301 % \end{macro}
302 % \end{macro}
303 % \end{macro}
304 % \end{macro}
305 % \end{macro}
306 % \clearpage
307 % \begin{macro}{\bfalpha}
308 % \begin{macro}{\bfbeta}
309 % \begin{macro}{\bfdelta}
310 % \begin{macro}{\bfepsilon}
311 % \begin{macro}{\bfvarepsilon}
312 % \begin{macro}{\bfzeta}
313 % \begin{macro}{\bfeta}
314 % \begin{macro}{\bftheta}
315 % \begin{macro}{\bfvartheta}
316 % \begin{macro}{\bfgamma}
317 % \begin{macro}{\bfkappa}
318 % \begin{macro}{\bflambda}
319 % \begin{macro}{\bfmu}
320 % \begin{macro}{\bfnu}
321 % \begin{macro}{\bfxi}
322 % \begin{macro}{\bfpi}
323 % \begin{macro}{\bfvarpi}
324 % \begin{macro}{\bfrho}
325 % \begin{macro}{\bfvarrho}
326 % \begin{macro}{\bfsigma}
327 % \begin{macro}{\bfvarsigma}
328 % \begin{macro}{\bftau}
329 % \begin{macro}{\bfupsilon}
330 % \begin{macro}{\bfphi}
331 % \begin{macro}{\bfvarphi}
332 % \begin{macro}{\bfchi}
333 % \begin{macro}{\bfpsi}
334 % \begin{macro}{\bfomega}
335 % \begin{macro}{\bfiota}
336 % Lower-case Greek letters are obtained by |\bfalpha|, |\bfbeta|, etc. The command |\greekbf| is either |\boldsymbol| or |\bm|, depending on options |greekbs| or |greekbm|.
337 % \begin{macrocode}
338 \newcommand{\bfalpha}{\greekbf \alpha}
339 \newcommand{\bfbeta}{\greekbf \beta}
340 \newcommand{\bfdelta}{\greekbf \delta}
341 \newcommand{\bfepsilon}{\greekbf \epsilon}
342 \newcommand{\bfvarepsilon}{\greekbf \varepsilon}
343 \newcommand{\bfzeta}{\greekbf \zeta}
344 \newcommand{\bfeta}{\greekbf \eta}
345 \newcommand{\bftheta}{\greekbf \theta}
346 \newcommand{\bfvartheta}{\greekbf \vartheta}
347 \newcommand{\bfgamma}{\greekbf \gamma}
348 \newcommand{\bfkappa}{\greekbf \kappa}
349 \newcommand{\bflambda}{\greekbf \lambda}
350 \newcommand{\bfmu}{\greekbf \mu}
351 \newcommand{\bfnu}{\greekbf \nu}
352 \newcommand{\bfxi}{\greekbf \xi}
353 \newcommand{\bfpi}{\greekbf \pi}
354 \newcommand{\bfvarpi}{\greekbf \varpi}
355 \newcommand{\bfrho}{\greekbf \rho}
356 \newcommand{\bfvarrho}{\greekbf \varrho}
357 \newcommand{\bfsigma}{\greekbf \sigma}
358 \newcommand{\bfvarsigma}{\greekbf \varsigma}
359 \newcommand{\bftau}{\greekbf \tau}
360 \newcommand{\bfupsilon}{\greekbf \upsilon}
361 \newcommand{\bfphi}{\greekbf \phi}
362 \newcommand{\bfvarphi}{\greekbf \varphi}
363 \newcommand{\bfchi}{\greekbf \chi}
364 \newcommand{\bfpsi}{\greekbf \psi}
365 \newcommand{\bfomega}{\greekbf \omega}
366 \newcommand{\bfiota}{\greekbf \iota}
367 % \end{macrocode}
368 % \end{macro}
369 % \end{macro}
370 % \end{macro}
371 % \end{macro}
372 % \end{macro}
373 % \end{macro}
374 % \end{macro}
375 % \end{macro}
376 % \end{macro}
377 % \end{macro}
378 % \end{macro}
379 % \end{macro}
380 % \end{macro}
381 % \end{macro}
382 % \end{macro}
383 % \end{macro}
384 % \end{macro}
385 % \end{macro}
386 % \end{macro}
387 % \end{macro}
388 % \end{macro}
389 % \end{macro}
390 % \end{macro}
391 % \end{macro}
392 % \end{macro}
393 % \end{macro}
394 % \end{macro}
395 % \end{macro}
396 % \end{macro}
397 % \begin{macro}{\bfGamma}
398 % \begin{macro}{\bfDelta}
399 % \begin{macro}{\bfTheta}
400 % \begin{macro}{\bfLambda}
401 % \begin{macro}{\bfXi}
402 % \begin{macro}{\bfPi}
403 % \begin{macro}{\bfSigma}
404 % \begin{macro}{\bfUpsilon}
405 % \begin{macro}{\bfPhi}
406 % \begin{macro}{\bfPsi}
407 % \begin{macro}{\bfOmega}
408 % Capital Greek letters are obtained by |\bfGamma|, |\bfDelta|, etc. The command |\greekbf| is either |\boldsymbol| or |\bm|, depending on options |greekbs| or |greekbm|.
409 % \begin{macrocode}
410 \newcommand{\bfGamma}{\greekbf \Gamma}
411 \newcommand{\bfDelta}{\greekbf \Delta}
412 \newcommand{\bfTheta}{\greekbf \Theta}
413 \newcommand{\bfLambda}{\greekbf \Lambda}
414 \newcommand{\bfXi}{\greekbf \Xi}
415 \newcommand{\bfPi}{\greekbf \Pi}
416 \newcommand{\bfSigma}{\greekbf \Sigma}
417 \newcommand{\bfUpsilon}{\greekbf \Upsilon}
418 \newcommand{\bfPhi}{\greekbf \Phi}
419 \newcommand{\bfPsi}{\greekbf \Psi}
420 \newcommand{\bfOmega}{\greekbf \Omega}
421 % \end{macrocode}
422 % \end{macro}
423 % \end{macro}
424 % \end{macro}
425 % \end{macro}
426 % \end{macro}
427 % \end{macro}
428 % \end{macro}
429 % \end{macro}
430 % \end{macro}
431 % \end{macro}
432 % \end{macro}
433 % \begin{macro}{\bfzero}
434 % Bold zero. The command |\greekbf| is either |\boldsymbol| or |\bm|, depending on options |greekbs| or |greekbm|.
435 % \begin{macrocode}
436 \newcommand{\bfzero}{\greekbf 0}
437 % \end{macrocode}
438 % \end{macro}
439 % \subsection{Statistical operators and concepts}
440 % Statistical operators for covariance, expectation and variance.
441 % \begin{macro}{\cov}
442 % \begin{macro}{\E}
443 % \begin{macro}{\V}
444 % \begin{macrocode}
445 \DeclareMathOperator{\cov}{Cov}
446 \DeclareMathOperator{\E}{E}
447 \DeclareMathOperator{\V}{V}
448 % \end{macrocode}
449 % \end{macro}
450 % \end{macro}
451 % \end{macro}
452 % \begin{macro}{\inas}
453 % \begin{macro}{\inprob}
454 % \begin{macro}{\indist}
455 % \begin{macro}{\plim}
456 % \begin{macrocode}
457 \newcommand{\inas}{\overset{a.s.}{\to}}
458 \newcommand{\indist}{\overset{d}{\to}}
459 \newcommand{\inprob}{\overset{p}{\to}}
460 \DeclareMathOperator{\plim}{plim}
461 % \end{macrocode}
462 % \end{macro}
463 % \end{macro}
464 % \end{macro}
465 % \end{macro}
466 % \subsection{Matrix and mathematical operators}
467 % \begin{macro}{\tr}
468 % \begin{macro}{\vc}
469 % \begin{macro}{\vcs}
470 % \begin{macro}{\vch}
471 % \begin{macro}{\diag}
472 % \begin{macrocode}
473 \DeclareMathOperator{\tr}{tr}
474 \DeclareMathOperator{\vc}{vec}
475 \DeclareMathOperator{\vcs}{vecs}
476 \DeclareMathOperator{\vch}{vech}
477 \DeclareMathOperator{\diag}{diag}
478 % \end{macrocode}
479 % \end{macro}
480 % \end{macro}
481 % \end{macro}
482 % \end{macro}
483 % \end{macro}
484 % \begin{macro}{\argmin}
485 % \begin{macro}{\argmax}
486 % \begin{macrocode}
487 \DeclareMathOperator{\argmin}{arg\,min}
488 \DeclareMathOperator{\argmax}{arg\,max}
489 % \end{macrocode}
490 % \end{macro}
491 % \end{macro}
492 %
493 %
494 % \Finale
495 \endinput