-
Notifications
You must be signed in to change notification settings - Fork 1
/
MA22004-—-Statistics-II.tex
5224 lines (4116 loc) · 221 KB
/
MA22004-—-Statistics-II.tex
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
%
\documentclass[
a4paper,
DIV=11,
numbers=noendperiod,
oneside]{scrreprt}
\usepackage{amsmath,amssymb}
\usepackage{iftex}
\ifPDFTeX
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
\usepackage{lmodern}
\ifPDFTeX\else
% xetex/luatex font selection
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\setcounter{secnumdepth}{5}
% Make \paragraph and \subparagraph free-standing
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\usepackage{framed}
\definecolor{shadecolor}{RGB}{241,243,245}
\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.40,0.45,0.13}{#1}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\BuiltInTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.13,0.47,0.30}{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{\textit{#1}}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{\textit{#1}}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\ExtensionTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.28,0.35,0.67}{#1}}
\newcommand{\ImportTok}[1]{\textcolor[rgb]{0.00,0.46,0.62}{#1}}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\NormalTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.68,0.00,0.00}{#1}}
\newcommand{\RegionMarkerTok}[1]{\textcolor[rgb]{0.00,0.23,0.31}{#1}}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{#1}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.13,0.47,0.30}{#1}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.13,0.47,0.30}{#1}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.07,0.07,0.07}{#1}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.13,0.47,0.30}{#1}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.37,0.37,0.37}{\textit{#1}}}
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}\usepackage{longtable,booktabs,array}
\usepackage{calc} % for calculating minipage widths
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
% definitions for citeproc citations
\NewDocumentCommand\citeproctext{}{}
\NewDocumentCommand\citeproc{mm}{%
\begingroup\def\citeproctext{#2}\cite{#1}\endgroup}
\makeatletter
% allow citations to break across lines
\let\@cite@ofmt\@firstofone
% avoid brackets around text for \cite:
\def\@biblabel#1{}
\def\@cite#1#2{{#1\if@tempswa , #2\fi}}
\makeatother
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newenvironment{CSLReferences}[2] % #1 hanging-indent, #2 entry-spacing
{\begin{list}{}{%
\setlength{\itemindent}{0pt}
\setlength{\leftmargin}{0pt}
\setlength{\parsep}{0pt}
% turn on hanging indent if param 1 is 1
\ifodd #1
\setlength{\leftmargin}{\cslhangindent}
\setlength{\itemindent}{-1\cslhangindent}
\fi
% set entry spacing
\setlength{\itemsep}{#2\baselineskip}}}
{\end{list}}
\usepackage{calc}
\newcommand{\CSLBlock}[1]{\hfill\break\parbox[t]{\linewidth}{\strut\ignorespaces#1\strut}}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{\strut#1\strut}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{\strut#1\strut}}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
\usepackage{unicode-math}%
\setmathfont{XITS Math}%
\usepackage{fontspec}%
\setmainfont[Ligatures ={Common, TeX}, Scale=1, RawFeature={+cpsp}]{XITS}
%Numbers={Lining,Proportional},Ligatures ={Common, TeX},RawFeature={+tnum,+cpsp,+frac},
\setsansfont[RawFeature={+cpsp},Scale=MatchLowercase]{Helvetica Neue}%
\setmonofont[Scale=0.78]{MesloLGS NF}%
\usepackage[a4paper,%
margin=2.5cm,%
bottom=3cm,%
top=3cm]{geometry}%
\usepackage{afterpage}% for "\afterpage"
\usepackage{xcolor}%
\definecolor{dundeeblue}{HTML}{4365E2}%
\usepackage{pagecolor}% With option pagecolor={somecolor or none}
%% For nice tables
\usepackage{booktabs}%
\usepackage{longtable}%
\usepackage{array}%
\usepackage{multirow}%
\usepackage{wrapfig}%
\usepackage{float}%
\usepackage{colortbl}%
%\usepackage{pdflscape}%
\usepackage{tabu}%
%\usepackage{threeparttable}%
%\usepackage{threeparttablex}%
%\usepackage[normalem]{ulem}%
\usepackage{makecell}%
%% Wrap long output lines
\usepackage{listings}%
\lstset{breaklines=true}%
\usepackage{enumitem}%
\setlist[description]{style=nextline}%
%% For nice info boxes
\usepackage{fontawesome5}%
\usepackage{awesomebox}%
\usepackage{siunitx}%
\newcolumntype{d}{S[table-format=3.2]}%
\renewcommand{\bibname}{References}%
%\usepackage[colorlinks]{hyperref}%
\usepackage{titling}%
%\setlength{\droptitle}{8cm}
\pretitle{\newpagecolor{dundeeblue}\afterpage{\restorepagecolor} \vfill \begin{flushleft}
\fontsize{68pt}{62pt} \color{white}\sffamily\bfseries\selectfont }
\posttitle{\end{flushleft}}
\preauthor{\vspace{2.5cm} \begin{flushleft} \fontsize{18pt}{14pt} \color{white}\sffamily\selectfont}
\postauthor{$\quad\bullet\quad$ehall001@dundee.ac.uk\end{flushleft}}
\predate{\begin{flushleft} \fontsize{18pt}{14pt} \color{white}\sffamily\selectfont}
\postdate{\\ \vspace{1cm}\includegraphics[width=10cm]{assets/images/rev_logo.pdf}\end{flushleft}}
%%% BEGIN SHORTCUTS
\DeclareMathOperator{\E}{\mathbf{E}}%
\DeclareMathOperator{\Var}{Var}%
\DeclareMathOperator{\Cov}{Cov}%
\DeclareMathOperator{\corr}{corr}%
\DeclareMathOperator{\sd}{sd}%
\newcommand{\se}{\mathsf{se}}%
%%% END SHORTCUTS
%% Change chapter to Topic
\makeatletter
\renewcommand{\@chapapp}{Topic}
\makeatother
\usepackage{tocbibind}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{multirow}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{colortbl}
\usepackage{pdflscape}
\usepackage{tabu}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage[normalem]{ulem}
\usepackage{makecell}
\usepackage{xcolor}
\KOMAoption{captions}{tableheading}
\makeatletter
\@ifpackageloaded{tcolorbox}{}{\usepackage[skins,breakable]{tcolorbox}}
\@ifpackageloaded{fontawesome5}{}{\usepackage{fontawesome5}}
\definecolor{quarto-callout-color}{HTML}{909090}
\definecolor{quarto-callout-note-color}{HTML}{0758E5}
\definecolor{quarto-callout-important-color}{HTML}{CC1914}
\definecolor{quarto-callout-warning-color}{HTML}{EB9113}
\definecolor{quarto-callout-tip-color}{HTML}{00A047}
\definecolor{quarto-callout-caution-color}{HTML}{FC5300}
\definecolor{quarto-callout-color-frame}{HTML}{acacac}
\definecolor{quarto-callout-note-color-frame}{HTML}{4582ec}
\definecolor{quarto-callout-important-color-frame}{HTML}{d9534f}
\definecolor{quarto-callout-warning-color-frame}{HTML}{f0ad4e}
\definecolor{quarto-callout-tip-color-frame}{HTML}{02b875}
\definecolor{quarto-callout-caution-color-frame}{HTML}{fd7e14}
\makeatother
\makeatletter
\@ifpackageloaded{caption}{}{\usepackage{caption}}
\AtBeginDocument{%
\ifdefined\contentsname
\renewcommand*\contentsname{Table of contents}
\else
\newcommand\contentsname{Table of contents}
\fi
\ifdefined\listfigurename
\renewcommand*\listfigurename{List of Figures}
\else
\newcommand\listfigurename{List of Figures}
\fi
\ifdefined\listtablename
\renewcommand*\listtablename{List of Tables}
\else
\newcommand\listtablename{List of Tables}
\fi
\ifdefined\figurename
\renewcommand*\figurename{Figure}
\else
\newcommand\figurename{Figure}
\fi
\ifdefined\tablename
\renewcommand*\tablename{Table}
\else
\newcommand\tablename{Table}
\fi
}
\@ifpackageloaded{float}{}{\usepackage{float}}
\floatstyle{ruled}
\@ifundefined{c@chapter}{\newfloat{codelisting}{h}{lop}}{\newfloat{codelisting}{h}{lop}[chapter]}
\floatname{codelisting}{Listing}
\newcommand*\listoflistings{\listof{codelisting}{List of Listings}}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{exercise}{Exercise}[chapter]
\theoremstyle{definition}
\newtheorem{example}{Example}[chapter]
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[chapter]
\theoremstyle{plain}
\newtheorem{proposition}{Proposition}[chapter]
\theoremstyle{definition}
\newtheorem{definition}{Definition}[chapter]
\theoremstyle{remark}
\AtBeginDocument{\renewcommand*{\proofname}{Proof}}
\newtheorem*{remark}{Remark}
\newtheorem*{solution}{Solution}
\newtheorem{refremark}{Remark}[chapter]
\newtheorem{refsolution}{Solution}[chapter]
\makeatother
\makeatletter
\makeatother
\makeatletter
\@ifpackageloaded{caption}{}{\usepackage{caption}}
\@ifpackageloaded{subcaption}{}{\usepackage{subcaption}}
\makeatother
\newcounter{quartocalloutnteno}
\newcommand{\quartocalloutnte}[1]{\refstepcounter{quartocalloutnteno}\label{#1}}
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
\usepackage{bookmark}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same} % disable monospaced font for URLs
\hypersetup{
pdftitle={MA22004 --- Statistics II},
pdfauthor={Dr Eric Hall},
colorlinks=true,
linkcolor={blue},
filecolor={Maroon},
citecolor={Blue},
urlcolor={Blue},
pdfcreator={LaTeX via pandoc}}
\title{MA22004 --- Statistics II}
\author{Dr Eric Hall}
\date{2024-09-13}
\begin{document}
\maketitle
\renewcommand*\contentsname{Table of contents}
{
\hypersetup{linkcolor=}
\setcounter{tocdepth}{2}
\tableofcontents
}
\chapter*{Welcome}\label{welcome}
\addcontentsline{toc}{chapter}{Welcome}
\markboth{Welcome}{Welcome}
Welcome to MA22004 Statistics II at the University of Dundee.
This module covers the basics of statistical inference including point
estimation, interval estimation, hypothesis testing, linear regression,
and simple goodness-of-fit tests. The appendix contains a list of
curated content for your to investigate.
These notes are available at
\href{https://dundeemath.github.io/MA22004/}{dundeemath.github.io/MA22004/}
and also as a PDF (visit the page and click on the PDF icon to
download).
\section*{Licence}\label{licence}
\addcontentsline{toc}{section}{Licence}
\markright{Licence}
\includegraphics{index_files/mediabag/88x31.png}
This work is licensed under a
\href{http://creativecommons.org/licenses/by-nc/4.0/}{Creative Commons
Attribution-NonCommercial 4.0 International License}.
\part{Module Introduction}
\chapter*{About Your Instructor}\label{about-your-instructor}
\addcontentsline{toc}{chapter}{About Your Instructor}
\markboth{About Your Instructor}{About Your Instructor}
Hi, folks!
\includegraphics[width=2in,height=\textheight]{assets/images/Eric_Hall_small.jpg}
I'm Eric---your instructor for MA22004 this semester. I am a new Baxter
Fellow in Applied Mathematics at Dundee, and my research focuses on
uncertainty quantification and predictive modelling.
Originally from the US, I graduated from the University of Pennsylvania
with a BA in Mathematics. I wrote my PhD in Probability and Stochastic
Analysis at the University of Edinburgh. Math and stats have opened up
some exciting doors for me, and I've had the opportunity to undertake
postdoctoral work at KTH Stockholm, the University of Massachusetts
Amherst, and RWTH Aachen University. I'm very excited to be at Dundee
and back in Scotland. I'm even more excited to be teaching you
statistics this semester!
Eric Hall
Dundee, 2024
\chapter*{Lab Guide}\label{lab-guide}
\addcontentsline{toc}{chapter}{Lab Guide}
\markboth{Lab Guide}{Lab Guide}
You will learn about the statistical programming language \texttt{R} and
the software RStudio by working through seven interactive lab tutorials
and completing lab reports. The lab reports should answer the exercise
questions at the end of each tutorial.
Tutorials and all associated materials (templates, data sets, further
instructions, etc.) are available as an \texttt{R} package at the GitHub
repository \texttt{dundeemath/MA22004labs} (i.e.,
\url{https://github.com/dundeemath/MA22004labs}).
Instructions on how to install and access the interactive lab tutorials
can be found at:
\begin{itemize}
\tightlist
\item
\url{https://dundeemath.github.io/MA22004labs/}.
\end{itemize}
The following section contains details about writing lab reports.
\chapter*{Writing Lab Reports}\label{writing-lab-reports}
\addcontentsline{toc}{chapter}{Writing Lab Reports}
\markboth{Writing Lab Reports}{Writing Lab Reports}
\section*{Assessment Criteria}\label{w-assess}
\addcontentsline{toc}{section}{Assessment Criteria}
\markright{Assessment Criteria}
There are seven interactive lab tutorials with accompanying exercises.
Each lab tutorial specifies how marks are allocated across the exercises
(a maximum of 20 marks available for each lab report).
\begin{tcolorbox}[enhanced jigsaw, coltitle=black, titlerule=0mm, rightrule=.15mm, colframe=quarto-callout-important-color-frame, opacityback=0, breakable, colbacktitle=quarto-callout-important-color!10!white, toprule=.15mm, opacitybacktitle=0.6, arc=.35mm, left=2mm, bottomtitle=1mm, title=\textcolor{quarto-callout-important-color}{\faExclamation}\hspace{0.5em}{Important}, toptitle=1mm, bottomrule=.15mm, leftrule=.75mm, colback=white]
Marks are awarded for both \textbf{content} and \textbf{presentation}.
\end{tcolorbox}
\section*{Content}\label{w-content}
\addcontentsline{toc}{section}{Content}
\markright{Content}
Please work through the interactive tutorial for each lab. Your lab
report should answer the exercises found at the end of each tutorial.
\section*{Presentation}\label{w-present}
\addcontentsline{toc}{section}{Presentation}
\markright{Presentation}
Please use Quarto to create your lab report. Further instructions on
using Quarto for creating \emph{reproducible} lab reports that combine
data analysis and text can be found in Lab 1. This set of lecture notes
was authored using Quarto; you can see the source code in the GitHub
repository \url{https://github.com/dundeemath/MA22004}.
\subsection*{Plots}\label{w-plots}
\addcontentsline{toc}{subsection}{Plots}
Plots should be neat and legible, with appropriate aesthetic elements.
Please use \texttt{ggplot} for creating plots and visualisations. Each
plot should be annotated with titles, axis labels, and legends as
appropriate. Plot aesthetics should be distinguished, e.g.~using colours
or line styles that are identified using a legend. Important data points
and coordinates should be annotated using labels.
\subsection*{Mathematical formulas}\label{w-math}
\addcontentsline{toc}{subsection}{Mathematical formulas}
Mathematical formulas should follow the same style rules as the lecture
notes. Formulas can be included in Quarto documents using {\LaTeX}
syntax. There should be appropriate spacing around operators and equals
signs, e.g.~\(a + b = c\). For punctuation, formulas are treated as part
of the text, so they often need to end with a full stop or comma.
Important formulas can appear ``displayed'' on their own line (with line
spacing above and below them), e.g., \[A=πr^2\,.\]
\subsection*{Structure}\label{w-structure}
\addcontentsline{toc}{subsection}{Structure}
Structure should be logical and clear. Organise your writing with
suitable headings and sub-headings. For example, provide a solution to
each exercise under its own heading.
\subsection*{Writing}\label{w-eng}
\addcontentsline{toc}{subsection}{Writing}
Writing should follow the usual rules of good written English, including
writing complete sentences and paragraphs that get to the point quickly.
Your tone and language should be similar to lecture notes or scientific
journal articles. Formal writing does not require unnecessary words,
long words or monotonous use of passive voice. I will reward concise and
clear communication, so please do not write, ``Upon carefully analysing
the aforementioned equations, the following mathematical solution was
found,'' when ``The solution is'' conveys the same thing.
\subsection*{Formatting}\label{w-format}
\addcontentsline{toc}{subsection}{Formatting}
Formatting should rely on the \emph{MA22004 Lab Report} template. This
is available in the \texttt{MA22004labs} package, and further
instructions can be found in Lab 1.
\part{Lecture Notes}
\chapter*{Preliminaries}\label{preliminaries}
\addcontentsline{toc}{chapter}{Preliminaries}
\markboth{Preliminaries}{Preliminaries}
This section contains a list of abbreviations, comment on notation, and
a (very quick) review of probability.
\section*{Abbreviations}\label{abbreviations}
\addcontentsline{toc}{section}{Abbreviations}
\markright{Abbreviations}
In Table~\ref{tbl-abbrev} we list abbreviations used throughout these
lecture notes. These abbreviations are pretty standdard and you might
encounter them outside the module in other references.
\begin{longtable}[t]{ll}
\caption{\label{tbl-abbrev}Commonly used abbreviations.}
\tabularnewline
\toprule
Abbreviation & Expanded\\
\midrule
\endfirsthead
\multicolumn{2}{@{}l}{\textit{(continued)}}\\
\toprule
Abbreviation & Expanded\\
\midrule
\endhead
\endfoot
\bottomrule
\endlastfoot
\cellcolor{gray!10}{pdf} & \cellcolor{gray!10}{probability density function}\\
cdf & cumulative distribution function\\
\cellcolor{gray!10}{rv} & \cellcolor{gray!10}{random variable}\\
iid & independent and identically distributed\\
\cellcolor{gray!10}{obs} & \cellcolor{gray!10}{observations}\\
\addlinespace
CI & confidence interval\\
\cellcolor{gray!10}{df} & \cellcolor{gray!10}{degrees of freedom}\\*
\end{longtable}
\section*{Notation}\label{notation}
\addcontentsline{toc}{section}{Notation}
\markright{Notation}
Uppercase roman letters, e.g., \(X,\) will typically denote random
variables (rvs); lower case letters, e.g., \(x,\) will represent a
particular value (observation) of a rv. Rvs have probability
distributions. Distributions are typically characterised by
\emph{parameters} that describe population characteristics. In the
present module, we will adopt the (frequentists) view that parameters
are fixed real numbers that are often unknown and must be estimated from
data. Statistical inference is a tool that will help us to do this.
\begin{tcolorbox}[enhanced jigsaw, coltitle=black, titlerule=0mm, rightrule=.15mm, colframe=quarto-callout-warning-color-frame, opacityback=0, breakable, colbacktitle=quarto-callout-warning-color!10!white, toprule=.15mm, opacitybacktitle=0.6, arc=.35mm, left=2mm, bottomtitle=1mm, title=\textcolor{quarto-callout-warning-color}{\faExclamationTriangle}\hspace{0.5em}{Variables and parameters}, toptitle=1mm, bottomrule=.15mm, leftrule=.75mm, colback=white]
Statistical models comprise both rvs and parameters. Be careful not to
confuse them!
\end{tcolorbox}
For a random variable \(X\) that has a distribution \(F\) depending on a
set of parameters \(\Theta,\) we will write \(X \sim F(\Theta)\).
\begin{tcolorbox}[enhanced jigsaw, coltitle=black, titlerule=0mm, rightrule=.15mm, colframe=quarto-callout-warning-color-frame, opacityback=0, breakable, colbacktitle=quarto-callout-warning-color!10!white, toprule=.15mm, opacitybacktitle=0.6, arc=.35mm, left=2mm, bottomtitle=1mm, title=\textcolor{quarto-callout-warning-color}{\faExclamationTriangle}\hspace{0.5em}{Specifying a probability distribution}, toptitle=1mm, bottomrule=.15mm, leftrule=.75mm, colback=white]
We write \(X \sim F(\Theta)\) to indicate \(X\) has distribution
function \(F(\Theta)\). This is \textbf{not} read as ``\(X\) is
approximately \(F(\Theta)\)''!
\end{tcolorbox}
\section*{Sample space, events,
probabilities}\label{sample-space-events-probabilities}
\addcontentsline{toc}{section}{Sample space, events, probabilities}
\markright{Sample space, events, probabilities}
A sample space \(\Omega\) is a set of possible outcomes of an
experiment. Points \(\omega \in \Omega\) are sample outcomes or
realizations. Subsets \(A \subset \Omega\) are called events.
\begin{example}[Sample
space]\protect\hypertarget{exm-sample-space}{}\label{exm-sample-space}
Consider an experiment where we measure the petal widths from a randomly
sampled cyclamen flowers. Before we observe the petal width, there is
uncertainty that we can model using a sample space of events. The sample
space is \(\Omega = (0, \infty),\) since measurements of length should
be positive (practically, the lengths will have a finite size, too).
Each \(\omega \in \Omega\) is a measurement of petal width for a
cyclamen flower. Consider an event \(A = (5, 12]\); this is the event
that the petal width is larger than \(5\) but less than or equal to
\(12\). Remember, we use probability to model uncertainty \emph{before}
we observe the petal width --- after we take a measurement, the petal
width is no longer uncertain (we have collected a statistic).
\end{example}
As sample spaces and events are described using sets, we recall the
following notations, definitions, and laws about set theory. Let \(A,\)
\(B,\) and \(A_1, A_2, \dots\) be events in a sample space \(\Omega\).
\begin{itemize}
\item
complement: \(A^c = \{ \omega \in \Omega: \omega \notin A\}\).
\item
null event: \(\emptyset = \Omega^c\).
\item
intersection:
\(A \cap B = \{\omega \in \Omega : \omega \in A \text{ and } \omega \in B\}\).
In particular, for \(A_1, A_2, \dots,\) then
\[\bigcap_{i=1}^\infty A_i = \{\omega \in \Omega : \omega \in A_i \text{ for all } i \}\,.\]
\item
difference:
\(A \setminus B = \{\omega \in \Omega : \omega \in A, \omega \notin B\}\).
\item
size: \(|A|\) denotes the number of elements in \(A\).
\item
disjoint: \(A_i \cap A_j = \emptyset,\) for \(i\neq j\).
\item
partition: disjoint \(A_1, A_2, \dots\) such that
\(\bigcup_{i=1}^\infty A_i = \Omega\).
\item
indicator:
\(I_A(\omega) = I(\omega \in A) = \{1 \text{ if } \omega \in A; 0 \text{ if } \omega \notin A\}\).
\item
monotone increasing: \(A_1 \subset A_2 \subset \dots\) and define
limit \[\lim_{n \to \infty}A_n = \bigcup_{i=1}^\infty A_i\,.\]
\item
monotone decreasing: \(A_1 \supset A_2 \supset \dots\) and define
limit \[\lim_{n \to \infty} A_n = \bigcap_{i=1}^\infty A_i\,.\]
\item
distributive laws: \[A\cap (B\cup C) = (A\cap B) \cup (A \cap C)\,,\]
\[A\cup(B\cap C) = (A \cup B) \cap (A\cup C)\,.\]
\item
De Morgan's laws: \[(A \cap B)^c = A^c \cup B^c\,,\]
\[(A\cup B)^c = A^c \cap B^c\,.\]
\end{itemize}
We assign probabilities to events in our sample space.
\begin{definition}[Probability
distribution]\protect\hypertarget{def-prob}{}\label{def-prob}
A probability distribution is a function \(P : \Omega \to \mathbf{R}\)
satisfying three axioms:
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\(P(A) \geq 0\) for every \(A \subset \Omega\) (positivity),
\item
\(P(\Omega) = 1\) (totality),
\item
if \(A_1, A_2, \dots\) are disjoint subsets of \(\Omega,\) then
\[P(\cup_{i=1}^\infty A_i) = \sum_{i=1}^\infty P(A_i)\,.\]
\end{enumerate}
\end{definition}
\begin{tcolorbox}[enhanced jigsaw, coltitle=black, titlerule=0mm, rightrule=.15mm, colframe=quarto-callout-tip-color-frame, opacityback=0, breakable, colbacktitle=quarto-callout-tip-color!10!white, toprule=.15mm, opacitybacktitle=0.6, arc=.35mm, left=2mm, bottomtitle=1mm, title=\textcolor{quarto-callout-tip-color}{\faLightbulb}\hspace{0.5em}{Perspectives}, toptitle=1mm, bottomrule=.15mm, leftrule=.75mm, colback=white]
We can interpret \(P(A)\) as representing:
\begin{itemize}
\tightlist
\item
\textbf{frequency}, i.e., the long-run proportion of times \(A\) is
true (the \emph{frequentist perspective}),
\item
\textbf{degrees of belief}, i.e, as a measure of the observer's
strength of belief that \(A\) is true (the \emph{Bayesian
perspective}).
\end{itemize}
\end{tcolorbox}
\begin{theorem}[PIE]\protect\hypertarget{thm-pie}{}\label{thm-pie}
The principal of inclusion-exclusion,
\[P(A\cup B) = P(A) + P(B) - P(A\cap B)\,.\]
\end{theorem}
Theorem~\ref{thm-pie} follows from the definition of a probability
distributions and facts about set theory.
\begin{definition}[Probability of an
event]\protect\hypertarget{def-prob-finite}{}\label{def-prob-finite}
For events \(A\) from finite sample spaces \(\Omega,\) we assign
probabilities according to: \[P(A) = \frac{|A|}{|\Omega|} \,.\]
\end{definition}
For finite sample spaces, we assign probabilities according to their
long-run frequency of occurring. For an event \(A,\) this is the ratio
of the size of \(A\) (number of ways \(A\) can happen) to the size of
\(\Omega\) (number of total outcomes).
\begin{definition}[Independent
events]\protect\hypertarget{def-indep}{}\label{def-indep}
Events \(A\) and \(B\) are independent, i.e.,
\(A \perp \!\!\! \perp B,\) iff \(P(A\cap B) = P(A)P(B)\).
\end{definition}
That is, events \(A\) and \(B\) are independent if and only if the
probability of \(A\) and \(B\) occurring is equal to the the probability
\(A\) occurring times the probability of \(B\) occurring.
\begin{definition}[Conditional
probability]\protect\hypertarget{def-cond-prob}{}\label{def-cond-prob}
If \(P(B) > 0,\) then \[P(A \mid B) = \frac{P(A \cap B)}{P(B)}\,.\]
\end{definition}
Note that:
\begin{itemize}
\tightlist
\item
\(P(\cdot \mid B)\) satisfies the axioms of probability, for fixed
\(B,\)
\item
in general, \(P(A \mid \cdot)\) is not a probability for fixed \(A,\)
and,
\item
in general, \(P(A\mid B) \neq P(B \mid A)\).
\end{itemize}
\begin{theorem}[Bayes
Theorem]\protect\hypertarget{thm-bayes}{}\label{thm-bayes}
Let events \(A_1, \dots, A_k\) partition \(\Omega,\) with
\(P(A_i) > 0\).
If \(P(B) > 0,\) then
\[P(A_i \mid B) = \frac{P(B\mid A_i) P(A_i)}{\sum_j P(B \mid A_j) P(A_j)}\,.\]
\end{theorem}
Generally, it is not feasible to assign probabilities to \emph{all}
subsets of \(\Omega\) (e.g., if \Omega is infinite). In that case, we
restrict to our attention to a \(\sigma\)-algebra \(\mathcal{A}\) (also
called, \(\sigma\)-field), which is a collection of sets satisfying:
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\(\emptyset \in \mathcal{A},\)
\item
if \(A_1, A_2, \dots, \in \mathcal{A}\) then
\(\cup_{i = 1}^\infty A_i \in \mathcal{A},\)
3.\(A\in \mathcal{A} \implies A^c \in \mathcal{A}\).
\end{enumerate}
Sets in \(\mathcal{A}\) are said to be \emph{measurable} and
\((\Omega, \mathcal{A})\) is a measure space. If \(P\) is a probability
defined on \(\mathcal{A},\) then \((\Omega, \mathcal{A}, P)\) is called
a \emph{probability space}.
E.g., when \(\Omega \equiv \mathbf{R},\) we take \(\mathcal{A}\) to be
the smallest \(\sigma\)-field containing all open subsets of
\(\mathbf{R},\) which is called the Borel \(\sigma\)-field. If you find
these details interesting, take: MA42008 Mathematical Statistics!
\section*{Random variables}\label{random-variables}
\addcontentsline{toc}{section}{Random variables}
\markright{Random variables}
\begin{tcolorbox}[enhanced jigsaw, coltitle=black, titlerule=0mm, rightrule=.15mm, colframe=quarto-callout-tip-color-frame, opacityback=0, breakable, colbacktitle=quarto-callout-tip-color!10!white, toprule=.15mm, opacitybacktitle=0.6, arc=.35mm, left=2mm, bottomtitle=1mm, title=\textcolor{quarto-callout-tip-color}{\faLightbulb}\hspace{0.5em}{How do we link sample spaces and events to data?}, toptitle=1mm, bottomrule=.15mm, leftrule=.75mm, colback=white]
We use random variables to link sample spaces and events to data.
\end{tcolorbox}
\begin{definition}[Random
variables]\protect\hypertarget{def-rv}{}\label{def-rv}
A random variable (rv) is a mapping \(X : \Omega \to \mathbf{R}\) that
maps \(\omega \in \Omega \mapsto X(\omega)\).
\end{definition}
\begin{example}[]\protect\hypertarget{exm-rv-1}{}\label{exm-rv-1}
Consider a coin flipping experiment where you flip a fair coin eight
times. Let \(X\) be the number of heads in the sequence. If three heads
occur, e.g., \(\omega = HTTTTTHH,\) then \(X(\omega) = 3\).
\end{example}
\begin{example}[]\protect\hypertarget{exm-rv-2}{}\label{exm-rv-2}
Consider an experiment where you draw a point a random from the unit
disk. Then \(\Omega = \{(x,y) : x^2 + y^2 \leq 1\}\) and a typical
outcome will be the pair \(\omega = (x,y)\). Some random variables to
consider are \(X(\omega) = x,\) \(Y(\omega) = y,\) \(Z(\omega) = x+y,\)
and \(W(\omega) = \sqrt{x^2 + y^2}\).
\end{example}
\begin{definition}[Assigning probabilities to
rvs]\protect\hypertarget{def-prob-rv}{}\label{def-prob-rv}
Given \(X\) and \(A \subset \mathbf{R},\) we define
\[X^{-1}(A) = \{\omega \in \Omega : X(\omega) \in A\}\] and let
\[P(X \in A) = P(X^{-1}(A)) = P(\{\omega \in \Omega : X(\omega) \in A\})\,,\]
e.g.,
\(P(X=x) = P(X^{-1}(x)) = P(\{\omega \in \Omega : X(\omega) = x\})\).
\end{definition}
\begin{tcolorbox}[enhanced jigsaw, coltitle=black, titlerule=0mm, rightrule=.15mm, colframe=quarto-callout-warning-color-frame, opacityback=0, breakable, colbacktitle=quarto-callout-warning-color!10!white, toprule=.15mm, opacitybacktitle=0.6, arc=.35mm, left=2mm, bottomtitle=1mm, title=\textcolor{quarto-callout-warning-color}{\faExclamationTriangle}\hspace{0.5em}{Observations vs rvs}, toptitle=1mm, bottomrule=.15mm, leftrule=.75mm, colback=white]
\(X\) denotes a rv and \(x\) denotes a particular value of \(X\).
\end{tcolorbox}
\begin{tcolorbox}[enhanced jigsaw, coltitle=black, titlerule=0mm, rightrule=.15mm, colframe=quarto-callout-important-color-frame, opacityback=0, breakable, colbacktitle=quarto-callout-important-color!10!white, toprule=.15mm, opacitybacktitle=0.6, arc=.35mm, left=2mm, bottomtitle=1mm, title=\textcolor{quarto-callout-important-color}{\faExclamation}\hspace{0.5em}{We measure probabilities of events}, toptitle=1mm, bottomrule=.15mm, leftrule=.75mm, colback=white]
A rv \(X\) by itself is not an event. You would never write \(P(X),\)
would you!?
\end{tcolorbox}
\begin{example}[]\protect\hypertarget{exm-rv-3}{}\label{exm-rv-3}
Consider a coin flipping experiment where you flip a fair coin twice.
Let \(X\) be the number of heads. Then
\[P(X=0) = P(\{TT\}) = \frac{1}{4}\,,\]
\[P(X=1) = P(\{HT\} \cup \{TH\}) = P(\{HT\}) + P(\{TH\}) = \frac{1}{2}\,,\]
\[P(X=2) = P(\{HH\}) = \frac{1}{4}\,.\]
\end{example}
\begin{definition}[Cdf]\protect\hypertarget{def-cdf}{}\label{def-cdf}
The cumulative distribution function (cdf),
\(F_X:\mathbf{R} \to [0,1],\) is defined by \(F_X(x) = P(X \leq x)\).
\end{definition}
Figure~\ref{fig-eg-cdf-coin-flip-plot} displays the cdf for the coin
flip experiment considered in Example~\ref{exm-rv-3}. The cdf \(F_X(x)\)
jumps at \(x = 0,\) \(x=1,\) and \(x=2\). The height of the jumps are
given by \(P(X=x)\). We observe as well that \(F_X(x) = 0\) for \(x<0,\)
as no probability has been accumulated; recall that probabilities are
always non-negative, so a function that accumulates probability will
always be non-negative. Further, \(F_X(x) = 1\) for \(x \geq 2,\) as all
the probability has been accumulated; remember that the total
probability that can be assigned over the whole sample space must sum to
one.
\begin{figure}
\centering{
\includegraphics{00-prelim_files/figure-pdf/fig-eg-cdf-coin-flip-plot-1.pdf}
}
\caption{\label{fig-eg-cdf-coin-flip-plot}The cdf for the two coin flip
example.}
\end{figure}%
Note that a cdf completely determines the distribution of a random
variable. This statement is captured in
Theorem~\ref{thm-cdf-determines-dist}.
\begin{theorem}[]\protect\hypertarget{thm-cdf-determines-dist}{}\label{thm-cdf-determines-dist}
Let \(X\) have cdf \(F\) and \(Y\) have cdf \(G\). If \(F(x) = G(x)\)
for all \(x,\) then \(P(X \in A)= P(Y \in A) \forall A \in \mathbf{R}\).
\end{theorem}
Since cdfs determine or characterize a probability distribution, it is
useful to know the key properties of cdfs, which are listed below in
Theorem~\ref{thm-cdf-properties}.
\begin{theorem}[Properties of
cdfs]\protect\hypertarget{thm-cdf-properties}{}\label{thm-cdf-properties}
\(F : \mathbf{R} \to [0,1]\) is a cdf for some \(P\) iff,
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\(F\) is nondecreasing (i.e.,
\(x_1 < x_2 \implies F(x_1) \leq F(x_2)\)),
\item
\(F\) is normalized to \([0,1]\) (i.e.,
\(\lim_{x \to -\infty} F(x) = 0\) and
\(\lim_{x \to \infty} F(x) = 1\)),
\item
\(F\) is right-continuous (i.e., \(F(x) = F(x^*) \forall x\) where
\(F(x^*) = \lim_{y > x; y \to x} F(y)\)).
\end{enumerate}
\end{theorem}
For a rv \(X\) we say \(X\) is \emph{discrete} if it assumes at most a
\emph{countable} number of (discrete) values. For a discrete sample
space, the collection of all probabilities of \(X(\omega)\) gives us a
probability distribution.
\begin{definition}[Pmf]\protect\hypertarget{def-pmf}{}\label{def-pmf}
A pdf for a discrete rv \(X\) is \(f_X(x) = P(X = x)\). Since this
density function places a ``point mass'' at each \(x,\) it is sometimes
referred to as a probability mass function (pmf).
\end{definition}
Figure~\ref{fig-eg-pmf-histogram} displays the pmf for the coin flip
experiment considered in Example~\ref{exm-rv-3}. The pmf is a histogram
with point masses at \(x = 0,\) \(x=1,\) and \(x=2\). The mass placed at
these points is given by \(P(X = x)\). Since the pmf is a pdf for a
discrete random variable, recall from the axioms of probability that the
pmf therefore satisfies \(f(x) \geq 0,\) \(\forall x \in \mathbf{R},\)
and \(\sum_i f(x_i) = 1\). This fact can be observed in
Figure~\ref{fig-eg-pmf-histogram}:
\(f_X(0) + f_X(1) + f_X(2) = 0.25 + 0.5 + 0.25 = 1\).
\begin{figure}
\centering{
\includegraphics{00-prelim_files/figure-pdf/fig-eg-pmf-histogram-1.pdf}
}
\caption{\label{fig-eg-pmf-histogram}The histogram (pmf) for the two
coin flip example.}
\end{figure}%
A rv \(X\) is \emph{continuous} if there exists a continuous function
\(f_X\) such that,
\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
\(f_X(x) \geq 0 \forall x,\)
\item
\(\int_{-\infty}^\infty f_X(x) dx = 1\) and
\item
\(P(a < X < b) = \int_a^b f_X(x) dx,\) for \(a\leq b\).
\end{enumerate}
\begin{definition}[Pdf]\protect\hypertarget{def-pdf}{}\label{def-pdf}
A \(f_X\) satisfying the three properties above is a pdf for the
continous rv \(X\).
\end{definition}
\begin{tcolorbox}[enhanced jigsaw, coltitle=black, titlerule=0mm, rightrule=.15mm, colframe=quarto-callout-important-color-frame, opacityback=0, breakable, colbacktitle=quarto-callout-important-color!10!white, toprule=.15mm, opacitybacktitle=0.6, arc=.35mm, left=2mm, bottomtitle=1mm, title=\textcolor{quarto-callout-important-color}{\faExclamation}\hspace{0.5em}{Events of probability zero}, toptitle=1mm, bottomrule=.15mm, leftrule=.75mm, colback=white]
If \(X\) is continuous, then \(P(X = x) = 0\) for every \(x\). That is,
\[
P(a \leq X \leq b) = P(a < X \leq b) = P(a \leq X < b) = P(a < X < b),.
\]