From 8d0545aa1f974bf70d6e6efcc9d809f76d944047 Mon Sep 17 00:00:00 2001 From: Degoot-AM Date: Thu, 18 Jun 2026 11:39:59 +0000 Subject: [PATCH 01/10] update package and renv --- .Rprofile | 1 + .gitignore | 1 + config.yaml | 3 +- renv.lock | 21 +++++++++ renv/.gitignore | 7 +++ renv/activate.R | 2 +- renv/profile | 1 - renv/profiles/lesson-requirements/renv.lock | 48 ++++++++++----------- 8 files changed, 57 insertions(+), 27 deletions(-) create mode 100644 .Rprofile create mode 100644 renv.lock create mode 100644 renv/.gitignore delete mode 100644 renv/profile diff --git a/.Rprofile b/.Rprofile new file mode 100644 index 00000000..81b960f5 --- /dev/null +++ b/.Rprofile @@ -0,0 +1 @@ +source("renv/activate.R") diff --git a/.gitignore b/.gitignore index dd7ae129..f4d68a18 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ instructors/files/*.pdf instructors/*_files/* instructors/files/*_files/* /.quarto/ +.positai diff --git a/config.yaml b/config.yaml index 8c400cc6..22375487 100644 --- a/config.yaml +++ b/config.yaml @@ -26,6 +26,7 @@ created: keywords: 'forecasts, epidemic models, interventions' # Life cycle stage of the lesson +# refer to for details # possible values: pre-alpha, alpha, beta, stable life_cycle: 'pre-alpha' @@ -67,6 +68,7 @@ contact: 'andree.valle-campos@lshtm.ac.uk' episodes: - delays-introduction.Rmd - delays-distribution.Rmd +- introduction-to-probabilities.Rmd # Information for Learners learners: @@ -82,5 +84,4 @@ profiles: # This space below is where custom yaml items (e.g. pinning # sandpaper and varnish versions) should live - varnish: epiverse-trace/varnish@epiversetheme diff --git a/renv.lock b/renv.lock new file mode 100644 index 00000000..bd8b4918 --- /dev/null +++ b/renv.lock @@ -0,0 +1,21 @@ +{ + "R": { + "Version": "4.6.0", + "Repositories": [ + { + "Name": "CRAN", + "URL": "https://cloud.r-project.org" + } + ] + }, + "Packages": { + "renv": { + "Package": "renv", + "Version": "1.2.3", + "OS_type": null, + "NeedsCompilation": "no", + "Repository": "CRAN", + "Source": "Repository" + } + } +} diff --git a/renv/.gitignore b/renv/.gitignore new file mode 100644 index 00000000..0ec0cbba --- /dev/null +++ b/renv/.gitignore @@ -0,0 +1,7 @@ +library/ +local/ +cellar/ +lock/ +python/ +sandbox/ +staging/ diff --git a/renv/activate.R b/renv/activate.R index 20ffd442..8bedf604 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -3,7 +3,7 @@ local({ # the requested version of renv version <- "1.2.3" - attr(version, "md5") <- "1bd9f58e1cfe27ce035933937c6f03de" + attr(version, "md5") <- "59c2d234587132accb321be54c64b7eb" attr(version, "sha") <- NULL # the project directory diff --git a/renv/profile b/renv/profile deleted file mode 100644 index 6d4023b5..00000000 --- a/renv/profile +++ /dev/null @@ -1 +0,0 @@ -lesson-requirements diff --git a/renv/profiles/lesson-requirements/renv.lock b/renv/profiles/lesson-requirements/renv.lock index 3f269874..ae9f9467 100644 --- a/renv/profiles/lesson-requirements/renv.lock +++ b/renv/profiles/lesson-requirements/renv.lock @@ -80,7 +80,7 @@ }, "EpiNow2": { "Package": "EpiNow2", - "Version": "1.8.0", + "Version": "1.9.0", "Source": "Repository", "Type": "Package", "Title": "Estimate and Forecast Real-Time Infection Dynamics", @@ -137,16 +137,16 @@ "rstan (>= 2.26.0)", "StanHeaders (>= 2.26.0)" ], - "Additional_repositories": "https://production.r-multiverse.org/2025-12-15", + "Additional_repositories": "https://production.r-multiverse.org/2026-03-15", "Biarch": "true", "Config/testthat/edition": "3", "Config/Needs/dev": "covr, here, hexSticker, lintr, magick, pkgdown, precommit, styler, usethis", "Encoding": "UTF-8", "Language": "en-GB", "LazyData": "true", - "RoxygenNote": "7.3.3", "SystemRequirements": "GNU make C++17", "VignetteBuilder": "knitr", + "Config/roxygen2/version": "8.0.0", "NeedsCompilation": "yes", "Author": "Sam Abbott [aut] (ORCID: ), Joel Hellewell [aut] (ORCID: ), Katharine Sherratt [aut], Katelyn Gostic [aut], Joe Hickson [aut], Hamada S. Badr [aut] (ORCID: ), Michael DeWitt [aut] (ORCID: ), James M. Azam [aut] (ORCID: ), Adrian Lison [aut] (ORCID: ), Robin Thompson [ctb], Sophie Meakin [ctb], James Munday [ctb], Nikos Bosse [ctb], Paul Mee [ctb], Peter Ellis [ctb], Pietro Monticone [ctb], Lloyd Chapman [ctb], Andrew Johnson [ctb], Kaitlyn Johnson [ctb] (ORCID: ), Adam Howes [ctb] (ORCID: ), Sebastian Funk [aut, cre] (ORCID: )", "Maintainer": "Sebastian Funk ", @@ -382,8 +382,7 @@ "Description": "Provides color schemes for maps (and other graphics) designed by Cynthia Brewer as described at http://colorbrewer2.org.", "License": "Apache License 2.0", "NeedsCompilation": "no", - "Repository": "RSPM", - "Encoding": "UTF-8" + "Repository": "CRAN" }, "Rcpp": { "Package": "Rcpp", @@ -1764,17 +1763,17 @@ }, "dbplyr": { "Package": "dbplyr", - "Version": "2.5.2", + "Version": "2.6.0", "Source": "Repository", "Type": "Package", "Title": "A 'dplyr' Back End for Databases", "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\")), person(\"Maximilian\", \"Girlich\", role = \"aut\"), person(\"Edgar\", \"Ruiz\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", - "Description": "A 'dplyr' back end for databases that allows you to work with remote database tables as if they are in-memory data frames. Basic features works with any database that has a 'DBI' back end; more advanced features require 'SQL' translation to be provided by the package author.", + "Description": "A 'dplyr' back end for databases that allows you to work with remote database tables as if they are in-memory data frames. Basic features work with any database that has a 'DBI' back end; more advanced features require 'SQL' translation to be provided by the package author.", "License": "MIT + file LICENSE", "URL": "https://dbplyr.tidyverse.org/, https://github.com/tidyverse/dbplyr", "BugReports": "https://github.com/tidyverse/dbplyr/issues", "Depends": [ - "R (>= 3.6)" + "R (>= 4.1)" ], "Imports": [ "blob (>= 1.2.0)", @@ -1797,12 +1796,16 @@ "withr (>= 2.5.0)" ], "Suggests": [ + "adbcdrivermanager", + "adbcsqlite", + "adbi", "bit64", "covr", "knitr", "Lahman", "nycflights13", "odbc (>= 1.4.2)", + "RJDBC", "RMariaDB (>= 1.2.2)", "rmarkdown", "RPostgres (>= 1.4.5)", @@ -1816,8 +1819,8 @@ "Config/testthat/parallel": "TRUE", "Encoding": "UTF-8", "Language": "en-gb", - "RoxygenNote": "7.3.3", - "Collate": "'db-sql.R' 'utils-check.R' 'import-standalone-types-check.R' 'import-standalone-obj-type.R' 'utils.R' 'sql.R' 'escape.R' 'translate-sql-cut.R' 'translate-sql-quantile.R' 'translate-sql-string.R' 'translate-sql-paste.R' 'translate-sql-helpers.R' 'translate-sql-window.R' 'translate-sql-conditional.R' 'backend-.R' 'backend-access.R' 'backend-hana.R' 'backend-hive.R' 'backend-impala.R' 'verb-copy-to.R' 'backend-mssql.R' 'backend-mysql.R' 'backend-odbc.R' 'backend-oracle.R' 'backend-postgres.R' 'backend-postgres-old.R' 'backend-redshift.R' 'backend-snowflake.R' 'backend-spark-sql.R' 'backend-sqlite.R' 'backend-teradata.R' 'build-sql.R' 'data-cache.R' 'data-lahman.R' 'data-nycflights13.R' 'db-escape.R' 'db-io.R' 'db.R' 'dbplyr.R' 'explain.R' 'ident.R' 'import-standalone-s3-register.R' 'join-by-compat.R' 'join-cols-compat.R' 'lazy-join-query.R' 'lazy-ops.R' 'lazy-query.R' 'lazy-select-query.R' 'lazy-set-op-query.R' 'memdb.R' 'optimise-utils.R' 'pillar.R' 'progress.R' 'sql-build.R' 'query-join.R' 'query-select.R' 'query-semi-join.R' 'query-set-op.R' 'query.R' 'reexport.R' 'remote.R' 'rows.R' 'schema.R' 'simulate.R' 'sql-clause.R' 'sql-expr.R' 'src-sql.R' 'src_dbi.R' 'table-name.R' 'tbl-lazy.R' 'tbl-sql.R' 'test-frame.R' 'testthat.R' 'tidyeval-across.R' 'tidyeval.R' 'translate-sql.R' 'utils-format.R' 'verb-arrange.R' 'verb-compute.R' 'verb-count.R' 'verb-distinct.R' 'verb-do-query.R' 'verb-do.R' 'verb-expand.R' 'verb-fill.R' 'verb-filter.R' 'verb-group_by.R' 'verb-head.R' 'verb-joins.R' 'verb-mutate.R' 'verb-pivot-longer.R' 'verb-pivot-wider.R' 'verb-pull.R' 'verb-select.R' 'verb-set-ops.R' 'verb-slice.R' 'verb-summarise.R' 'verb-uncount.R' 'verb-window.R' 'zzz.R'", + "Collate": "'verb-copy-inline.R' 'verb-copy-to.R' 'db-sql.R' 'db.R' 'utils-check.R' 'import-standalone-types-check.R' 'import-standalone-obj-type.R' 'utils.R' 'sql.R' 'escape.R' 'translate-sql-cut.R' 'translate-sql-string.R' 'translate-sql-aggregate.R' 'translate-sql-scalar.R' 'translate-sql-helpers.R' 'translate-sql-window.R' 'translate-sql-conditional.R' 'backend-.R' 'backend-access.R' 'backend-adbc.R' 'backend-db2.R' 'backend-hana.R' 'backend-hive.R' 'backend-impala.R' 'backend-jdbc.R' 'backend-mssql.R' 'backend-mysql.R' 'backend-odbc.R' 'backend-oracle.R' 'backend-postgres.R' 'backend-postgres-old.R' 'backend-redshift.R' 'backend-snowflake.R' 'backend-spark-sql.R' 'backend-sqlite.R' 'backend-teradata.R' 'backward-compatibility.R' 'bind-queries.R' 'data-cache.R' 'data-lahman.R' 'data-nycflights13.R' 'db-io.R' 'dbplyr.R' 'ident.R' 'import-standalone-s3-register.R' 'join-by-compat.R' 'join-cols-compat.R' 'lazy-ops.R' 'memdb.R' 'optimise-utils.R' 'progress.R' 'query-base.R' 'query-join.R' 'query-rf-join.R' 'query-select.R' 'query-semi-join.R' 'query-set-op.R' 'query-union.R' 'query.R' 'remote.R' 'rows.R' 'schema.R' 'sql-build.R' 'sql-clause.R' 'sql-dialect.R' 'sql-glue.R' 'sql-quote.R' 'sql-superseded.R' 'src-sql.R' 'src_dbi.R' 'table-name.R' 'tbl-lazy.R' 'tbl-sql.R' 'tidyeval-across.R' 'tidyeval.R' 'translate-sql.R' 'utils-format.R' 'verb-arrange.R' 'verb-collapse.R' 'verb-collect.R' 'verb-compute.R' 'verb-count.R' 'verb-distinct.R' 'verb-do-query.R' 'verb-do.R' 'verb-expand.R' 'verb-explain.R' 'verb-fill.R' 'verb-filter.R' 'verb-group_by.R' 'verb-head.R' 'verb-joins.R' 'verb-mutate.R' 'verb-pivot-longer.R' 'verb-pivot-wider.R' 'verb-pull.R' 'verb-select.R' 'verb-set-ops.R' 'verb-slice.R' 'verb-summarise.R' 'verb-uncount.R' 'verb-window.R' 'with-dialect.R' 'zzz.R'", + "Config/roxygen2/version": "8.0.0", "NeedsCompilation": "no", "Author": "Hadley Wickham [aut, cre], Maximilian Girlich [aut], Edgar Ruiz [aut], Posit Software, PBC [cph, fnd]", "Maintainer": "Hadley Wickham ", @@ -2193,7 +2196,7 @@ "epidemics": { "Package": "epidemics", "Version": "0.4.0.9000", - "Source": "GitHub", + "Source": "Repository", "Title": "Composable Epidemic Scenario Modelling", "Authors@R": "c( person(\"Pratik\", \"Gupte\", , \"pratik.gupte@lshtm.ac.uk\", role = c(\"aut\", \"cph\"), comment = c(ORCID = \"0000-0001-5294-7819\")), person(\"Rosalind\", \"Eggo\", , \"rosalind.eggo@lshtm.ac.uk\", role = c(\"aut\", \"cph\", \"cre\"), comment = c(ORCID = \"0000-0002-0362-6717\")), person(\"Edwin\", \"Van Leeuwen\", , \"edwin.vanleeuwen@ukhsa.gov.uk\", role = c(\"aut\", \"cph\"), comment = c(ORCID = \"0000-0002-2383-5305\")), person(\"Adam\", \"Kucharski\", , \"adam.kucharski@lshtm.ac.uk\", role = c(\"ctb\", \"rev\"), comment = c(ORCID = \"0000-0001-8814-9421\")), person(\"Tim\", \"Taylor\", , \"tim.taylor@hiddenelephants.co.uk\", role = c(\"ctb\", \"rev\"), comment = c(ORCID = \"0000-0002-8587-7113\")), person(\"Banky\", \"Ahadzie\", , \"bahadzie@gmail.com\", role = \"ctb\"), person(\"Alexis\", \"Robert\", , \"alexis.robert@lshtm.ac.uk\", role = \"ctb\", comment = c(ORCID = \"0000-0002-4516-2965\")), person(\"Hugo\", \"Gruson\", , \"hugo.gruson@data.org\", role = \"rev\", comment = c(ORCID = \"0000-0002-4094-1476\")), person(\"Joshua W.\", \"Lambert\", , \"joshua.lambert@lshtm.ac.uk\", role = \"rev\", comment = c(ORCID = \"0000-0001-5218-3046\")), person(\"James M.\", \"Azam\", , \"james.azam@lshtm.ac.uk\", role = \"rev\", comment = c(ORCID = \"0000-0001-5782-7330\")), person(\"Alexis\", \"Robert\", , \"alexis.robert@lshtm.ac.uk\", role = \"rev\", comment = c(ORCID = \"0000-0002-4516-2965\")) )", "Description": "A library of compartmental epidemic models taken from the published literature, and classes to represent affected populations, public health response measures including non-pharmaceutical interventions on social contacts, non-pharmaceutical and pharmaceutical interventions that affect disease transmissibility, vaccination regimes, and disease seasonality, which can be combined to compose epidemic scenario models.", @@ -2241,16 +2244,14 @@ "Language": "en-GB", "Roxygen": "list(markdown = TRUE)", "Config/roxygen2/version": "8.0.0", - "RemoteType": "github", - "RemoteHost": "api.github.com", - "RemoteRepo": "epidemics", - "RemoteUsername": "epiverse-trace", - "RemotePkgRef": "epiverse-trace/epidemics", - "RemoteRef": "HEAD", - "RemoteSha": "516555d78a8aef828ee689eeec2a68ca7fa64daa", + "Repository": "https://epiverse-trace.r-universe.dev", "NeedsCompilation": "yes", "Author": "Pratik Gupte [aut, cph] (ORCID: ), Rosalind Eggo [aut, cph, cre] (ORCID: ), Edwin Van Leeuwen [aut, cph] (ORCID: ), Adam Kucharski [ctb, rev] (ORCID: ), Tim Taylor [ctb, rev] (ORCID: ), Banky Ahadzie [ctb], Alexis Robert [ctb] (ORCID: ), Hugo Gruson [rev] (ORCID: ), Joshua W. Lambert [rev] (ORCID: ), James M. Azam [rev] (ORCID: ), Alexis Robert [rev] (ORCID: )", - "Maintainer": "Rosalind Eggo " + "Maintainer": "Rosalind Eggo ", + "RemoteType": "repository", + "RemoteUrl": "https://github.com/epiverse-trace/epidemics", + "RemoteRef": "HEAD", + "RemoteSha": "516555d78a8aef828ee689eeec2a68ca7fa64daa" }, "epiparameter": { "Package": "epiparameter", @@ -3766,8 +3767,7 @@ "stats", "graphics" ], - "Repository": "RSPM", - "Encoding": "UTF-8" + "Repository": "CRAN" }, "lambda.r": { "Package": "lambda.r", @@ -4623,7 +4623,7 @@ "NeedsCompilation": "yes", "Author": "Gábor Csárdi [aut, cre], Jim Hester [aut], Posit Software, PBC [cph, fnd] (ROR: ), Winston Chang [ctb] (R6, callr, processx), Ascent Digital Services [cph, fnd] (callr, processx), Hadley Wickham [ctb, cph] (cli, curl, pkgbuild, yaml), Jeroen Ooms [ctb] (curl, jsonlite), Maëlle Salmon [ctb] (desc, pkgsearch), Duncan Temple Lang [ctb] (jsonlite), Lloyd Hilaiel [cph] (jsonlite), Alec Wong [ctb] (keyring), Michel Berkelaar and lpSolve authors [ctb] (lpSolve), R Consortium [fnd] (pkgsearch), Jay Loden [ctb] (ps), Dave Daeschler [ctb] (ps), Giampaolo Rodola [ctb] (ps), Shawn Garbett [ctb] (yaml), Jeremy Stephens [ctb] (yaml), Kirill Simonov [ctb] (yaml), Yihui Xie [ctb] (yaml), Zhuoer Dong [ctb] (yaml), Jeffrey Horner [ctb] (yaml), Will Beasley [ctb] (yaml), Brendan O'Connor [ctb] (yaml), Gregory Warnes [ctb] (yaml), Michael Quinn [ctb] (yaml), Zhian Kamvar [ctb] (yaml), Charlie Gao [ctb] (yaml), Kuba Podgórski [ctb] (zip), Rich Geldreich [ctb] (zip)", "Maintainer": "Gábor Csárdi ", - "Repository": "https://packagemanager.posit.co/cran/latest" + "Repository": "CRAN" }, "patchwork": { "Package": "patchwork", @@ -4939,7 +4939,7 @@ }, "primarycensored": { "Package": "primarycensored", - "Version": "1.5.0", + "Version": "1.5.1", "Source": "Repository", "Title": "Primary Event Censored Distributions", "Authors@R": "c(person(given = \"Sam\", family = \"Abbott\", role = c(\"aut\", \"cre\", \"cph\"), email = \"contact@samabbott.co.uk\", comment = c(ORCID = \"0000-0001-8057-8037\")), person(given = \"Sam\", family = \"Brand\", role = c(\"aut\"), email = \"usi1@cdc.gov\", comment = c(ORCID = \"0000-0003-0645-5367\")), person(given = \"Adam\", family = \"Howes\", role = c(\"ctb\"), email = \"adamthowes@gmail.com\", comment = c(ORCID = \"0000-0003-2386-4031\")), person(given = \"James Mba\", family = \"Azam\", role = c(\"aut\"), email = \"james.azam@lshtm.ac.uk\", comment = c(ORCID = \"0000-0001-5782-7330\")), person(given = \"Carl\", family = \"Pearson\", role = c(\"aut\"), email = \"carl.ab.pearson@gmail.com\", comment = c(ORCID = \"0000-0003-0701-7860\")), person(given = \"Sebastian\", family = \"Funk\", role = c(\"aut\"), email = \"sebastian.funk@lshtm.ac.uk\", comment = c(ORCID = \"0000-0002-2842-3406\")), person(given = \"Kelly\", family = \"Charniga\", role = c(\"aut\"), email = \" kelly.charniga@gmail.com\", comment = c(ORCID = \"0000-0002-7648-7041\")))", @@ -6848,7 +6848,7 @@ }, "tinytex": { "Package": "tinytex", - "Version": "0.59", + "Version": "0.60", "Source": "Repository", "Type": "Package", "Title": "Helper Functions to Install and Maintain TeX Live, and Compile LaTeX Documents", From 2d32cb5723748b25a0ea8e090093a7fd8e4a2c3c Mon Sep 17 00:00:00 2001 From: Degoot-AM Date: Thu, 18 Jun 2026 11:40:43 +0000 Subject: [PATCH 02/10] add new episode for introduction to probabilities --- episodes/introduction-to-probabilities.Rmd | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 episodes/introduction-to-probabilities.Rmd diff --git a/episodes/introduction-to-probabilities.Rmd b/episodes/introduction-to-probabilities.Rmd new file mode 100644 index 00000000..ca64a022 --- /dev/null +++ b/episodes/introduction-to-probabilities.Rmd @@ -0,0 +1,24 @@ +--- +title: 'Introduction to probabilities' +teaching: 10 +exercises: 2 +--- + +:::::::::::::::::::::::::::::::::::::: questions + +- What is probability? +- What is probability distribution? + +:::::::::::::::::::::::::::::::::::::::::::::::: + +::::::::::::::::::::::::::::::::::::: objectives + +- Understand and interpret probability +- Understand probability distribution + +:::::::::::::::::::::::::::::::::::::::::::::::: + +## Introduction + +## What is probability? + From d5c072c8627fc80f930131519ffaab4016158ea0 Mon Sep 17 00:00:00 2001 From: Degoot-AM Date: Thu, 18 Jun 2026 14:02:42 +0000 Subject: [PATCH 03/10] add what is probability sections --- .Rprofile | 1 - episodes/introduction-to-probabilities.Rmd | 130 ++++++++++++++++++++- renv/activate.R | 2 +- 3 files changed, 128 insertions(+), 5 deletions(-) delete mode 100644 .Rprofile diff --git a/.Rprofile b/.Rprofile deleted file mode 100644 index 81b960f5..00000000 --- a/.Rprofile +++ /dev/null @@ -1 +0,0 @@ -source("renv/activate.R") diff --git a/episodes/introduction-to-probabilities.Rmd b/episodes/introduction-to-probabilities.Rmd index ca64a022..8189d243 100644 --- a/episodes/introduction-to-probabilities.Rmd +++ b/episodes/introduction-to-probabilities.Rmd @@ -7,18 +7,142 @@ exercises: 2 :::::::::::::::::::::::::::::::::::::: questions - What is probability? -- What is probability distribution? +- What is a probability distribution? :::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::: objectives -- Understand and interpret probability -- Understand probability distribution +- Understand the concept and interpretation of probability +- Understand the idea of a probability distribution. :::::::::::::::::::::::::::::::::::::::::::::::: ## Introduction +Probability is a mathematical framework for quantifying uncertainty. It allows us to measure how likely an event is to occur and provides the foundation for statistical inference, risk assessment, and predictive modelling. + ## What is probability? +There are two interpretations of probability, both are widely used in statistics and epidemiology, although they arise from different philosophical perspectives. + +1. **Standard (frequentist) definition** + +The standard interpretation of probability is based on the long-run frequency of an event occurring in repeated observations or experiments. + +For example, during the 2014 Ebola outbreak in Sierra Leone, there were 14,124 reported cases, of which 3,956 resulted in death. The observed probability of death among reported cases is therefore +$$P(death \;from \;Ebola) = \frac{3956}{14124} \approx 0.28$$. + +This means that approximately $28\%$ of reported Ebola cases resulted in death. Under the frequentist interpretation, probability is viewed as the proportion of times an event occurs when the same process is repeated many times under similar conditions. + + +2. **Subjective Probability** + + +The long-run interpretation of probability can make it difficult to interpret it for single +event--particularly for unique events that cannot be repeated many times. + +For example, we cannot repeatedly recreate the 2014 Ebola outbreak to directly verify its case fatality risk. In such situations, probability may be interpreted as a degree of belief based on available information, knowledge, and experience. + +For example: + +"The probability that my best friend calls today is 40%." + +This statement represents a subjective probability, and different individuals may assign different probabilities to the same event depending on their knowledge and assumptions. Unlike the frequentist interpretation, subjective probability is not derived from repeated experiments or observations. + +### Four baisc rules of probabilities + +Probabilities always lie between 0 and 1, where 0 represents an impossible event and 1 represents a certain event. Most probability calculations are based on a few simple rules that can be applied repeatedly. + +1. **Complement rule** + +The probability that an event does not occur is + +$$ +P(A^c) = 1 - P(A), +$$ + +where $(A^c)$ denotes the complement of event (A). + +For example, in the 2014 Ebola outbreak in Sierra Leone, the probability of death among reported cases was approximately + +$$ +P(\text{death from Ebola}) = 0.28. +$$ + +Therefore, the probability of recovery is + +$$ +P(\text{recovery from Ebola}) = 1 - 0.28 = 0.72. +$$ + +2. **Equally likely outcomes rule** + +If an experiment has (n) possible outcomes and all outcomes are equally likely, then the probability of an event (A) is + +$$ +P(A) = \frac{\text{number of outcomes in } A}{n}. +$$ + +Rolling a fair six-sided die is a classic example. Since each face is equally likely to occur, + +$$ +P(\text{rolling a 4}) = \frac{1}{6}. +$$ +Similarly, + +$$ +P(\text{rolling an even number}) = \frac{3}{6} = \frac{1}{2}, +$$ + +because there are three even numbers (2, 4, and 6). + + + + +3. **Addition rule** + +If two events (A) and (B) are mutually exclusive (they cannot occur at the same time), then + +$$ +P(A \text{ or } B) = P(A \cup B) = P(A) + P(B). +$$ + +For example, when rolling a die, the events + +- (A): rolling a 2 +- (B): rolling a 5 + +are mutually exclusive because a single roll cannot be both 2 and 5. + +Therefore, + +$$ +P(2 \text{ or } 5) = P(2) + P(5) += \frac{1}{6} + \frac{1}{6} += \frac{1}{3}. +$$ +4. **Multiplication rule** + +f two events (A) and (B) are independent (the occurrence of one does not affect the probability of the other), then + +$$ +P(A \text{ and } B) = P(A \cap B) = P(A)P(B). +$$ + +For example, consider: + +- (A): a patient dies from Ebola, P(A)=0.28 + +- (B): the internet is working on a given day, P(B)=0.90 + +If these events are independent, then + +$$ +P(A \text{ and } B) += P(A)P(B) += 0.28 \times 0.90 += 0.252. +$$ + +Thus, the probability that both events occur is 0.252. diff --git a/renv/activate.R b/renv/activate.R index 8bedf604..20ffd442 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -3,7 +3,7 @@ local({ # the requested version of renv version <- "1.2.3" - attr(version, "md5") <- "59c2d234587132accb321be54c64b7eb" + attr(version, "md5") <- "1bd9f58e1cfe27ce035933937c6f03de" attr(version, "sha") <- NULL # the project directory From 3d56d427a983c352756b9c3193c0a3055835778d Mon Sep 17 00:00:00 2001 From: Degoot-AM Date: Thu, 18 Jun 2026 14:05:43 +0000 Subject: [PATCH 04/10] add probability episode --- config.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/config.yaml b/config.yaml index 22375487..8555e672 100644 --- a/config.yaml +++ b/config.yaml @@ -20,7 +20,7 @@ carpentry: 'epiverse-trace' title: 'Outbreak analytics with R' # Date the lesson was created (YYYY-MM-DD, this is empty by default) -created: +created: # Comma-separated list of keywords for the lesson keywords: 'forecasts, epidemic models, interventions' @@ -65,19 +65,20 @@ contact: 'andree.valle-campos@lshtm.ac.uk' # - another-learner.md # Order of episodes in your lesson -episodes: +episodes: +- introduction-to-probabilities.Rmd - delays-introduction.Rmd - delays-distribution.Rmd -- introduction-to-probabilities.Rmd + # Information for Learners -learners: +learners: # Information for Instructors -instructors: +instructors: # Learner Profiles -profiles: +profiles: # Customisation --------------------------------------------- # From 6cad210f9dcd60d5fd951a76308b9efc1711f376 Mon Sep 17 00:00:00 2001 From: Degoot-AM Date: Thu, 18 Jun 2026 18:19:48 +0000 Subject: [PATCH 05/10] add probability distribution section --- episodes/introduction-to-probabilities.Rmd | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/episodes/introduction-to-probabilities.Rmd b/episodes/introduction-to-probabilities.Rmd index 8189d243..88bbfa21 100644 --- a/episodes/introduction-to-probabilities.Rmd +++ b/episodes/introduction-to-probabilities.Rmd @@ -146,3 +146,52 @@ P(A \text{ and } B) $$ Thus, the probability that both events occur is 0.252. + +## What is a probability distribution? + +A **probability distribution** describes how probabilities are assigned to the possible values of a random variable. It provides a concise summary of the uncertainty and variability observed in a process and forms the foundation of many statistical methods used in epidemiology and outbreak analysis. + +#### Illustrative Example + +Suppose we record the number of days from disease onset to death for each of the 3,956 Ebola deaths in the previous example. Let $(X)$ denote the number of days from onset to death. We observe that $(X)$ can take values ranging from 1 to 20 days, as shown in Table 1. + + + + +| **x (day)** | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | +| -------------- | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | +| **nₓ (cases)** | 5 | 8 | 12 | 20 | 35 | 60 | 90 | 140 | 260 | 390 | 460 | 500 | 490 | 440 | 360 | 260 | 180 | 120 | 80 | 46 | +| **P(X = x)** | 0.0013 | 0.0020 | 0.0030 | 0.0051 | 0.0089 | 0.0152 | 0.0228 | 0.0354 | 0.0657 | 0.0986 | 0.1164 | 0.1264 | 0.1239 | 0.1113 | 0.0911 | 0.0657 | 0.0455 | 0.0304 | 0.0202 | 0.0116 | + +**Table 1**: Hypothetical probability distribution of Ebola outcome times. The probability associated with each day is computed as $P(X= x= \frac{n_x}{N})$, where $(n_x)$ is the number of cases with outcome on day $x$, and $(N=3956)$ is the total number of cases. + +The first row of the table lists the possible values of the random variable (X), while the second row gives the corresponding probabilities. Together, these probabilities constitute the probability distribution of (X). + + +Probability distributions are often visualized using graphs. The Figure below shows the probability mass function (PMF), which illustrates how the probabilities are distributed across the possible outcome times. +```{r, echo=FALSE} +# Days +x <- 1:20 + +# Frequencies (n_x) +nx <- c(5, 8, 12, 20, 35, 60, 90, 140, 260, 390, + 460, 500, 490, 440, 360, 260, 180, 120, 80, 46) + +# Total cases +N <- sum(nx) + +# Probability mass function +px <- nx / N + +barplot(px, + names.arg = x, + xlab = "Days from onset to death", + ylab = "Probability P(X = x)", + main = "Onset to death distribution", + col = "skyblue", + border = "white") +``` + + +In this figure, the x-axis shows the number of days from disease onset to outcome, and the y-axis shows the probability associated with each day. The height of each bar represents the proportion of cases whose outcome occurred on that day. The collection of bars forms the probability distribution, describing how outcome times are distributed among the cases. + From 560942354f90302ac519e247e99f24ebaec3f364 Mon Sep 17 00:00:00 2001 From: Degoot-AM Date: Thu, 18 Jun 2026 19:07:26 +0000 Subject: [PATCH 06/10] add continuous dist fig --- episodes/fig/continuous-dist.png | Bin 0 -> 7981 bytes episodes/introduction-to-probabilities.Rmd | 59 +++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 episodes/fig/continuous-dist.png diff --git a/episodes/fig/continuous-dist.png b/episodes/fig/continuous-dist.png new file mode 100644 index 0000000000000000000000000000000000000000..5f5ad7ef46c2688049bead945a30ab117a5bef78 GIT binary patch literal 7981 zcmcIpXIN9+lfMC^Nec)FC}>owR8f#FgpM@ny?3NHX+ac%h)4-Vq)0Ck1VV37I!G5n z4~Wzdy7aPn|If4gWp|(554)evz4y$VId^_@X6DSqXlp7{Q?gP506?v(0@VcoBEloE zP5#etJ@ssiFcAC5tLl-Hlg}(_EdT)fvMThMUf^f^T)^jBeiyPknAJx!NbG!p+3ACW z`5Q!#7PuaDLh&7|6SaMuVM*?tD2~^l)*l#oy7iCT5Vc42szM}0cfY*7A@I>(RiJl# zuBEB`(f;K{Wone21A~C+ON*iI$g1k>nb7UQ&E~?8l}Bn&IVf~K@47hv1~ZZp!{9x6 zA#Vj>#j+H1S{d3~_;ZLBR)atu+5L3 z&VMQCy}1d9dZwk=$Akn|MBP)unAW!BIjEH!X8pMmFw0aa*f(a^sk8=$<#KgvH^siL zBuBD6cZ~++AWX*C-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u, 18 Jun 2026 19:07:26 +0000 Subject: [PATCH 07/10] add continuous dist fig resolve confilcts --- episodes/introduction-to-probabilities.Rmd | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/episodes/introduction-to-probabilities.Rmd b/episodes/introduction-to-probabilities.Rmd index 658d5f70..d5b5bd4b 100644 --- a/episodes/introduction-to-probabilities.Rmd +++ b/episodes/introduction-to-probabilities.Rmd @@ -249,8 +249,19 @@ The Ebola example above is a discrete distribution because the variable X (numbe A continuous probability distribution is used when the random variable can take any value within a continuous range, including fractions and decimals. +<<<<<<< HEAD For example, variables such as height, blood pressure, incubation time (measured precisely), or time-to-event measured in hours or seconds are continuous. In this case, probabilities are not assigned to exact values $(e.g., P(X=2.5))$, because this probability is essentially zero. Instead, probabilities are assigned to intervals, such as: $P(2≤X≤3)$. Continuous distributions are described using a probability density function (PDF) rather than a PMF. Common examples of continuous distributions include the normal distribution, exponential distribution, and gamma distribution, which are widely used in epidemiology and outbreak modelling +======= +For example, variables such as height, blood pressure, incubation time (measured precisely), or time-to-event measured in hours or seconds are continuous. In this case, probabilities are not assigned to exact values (e.g., $P(X=162.5)$ for a person height), because this probability is essentially zero. Instead, probabilities are assigned to intervals, such as: $P(162≤X≤165)$. + +Continuous distributions are described using a probability density function (PDF) rather than a PMF. In PDF, instead of bars, the probabilities are represented by histograms. + +![Examples of continuous probability distributions for hights (in **CM**) as continuous varaibles. Taken from Chapter 3 of [OpenIntro Statistics book](https://https://www.openintro.org/book/os/). Adding more bins to the histogram provides greater detail. +This sample is extremely large, which is why much smaller bins still work well](fig/continuous-dist.png) + + +>>>>>>> b4116f1 (add continuous dist fig) From 094b248e7a576abd0bf3b2624b8c8779fbb0e231 Mon Sep 17 00:00:00 2001 From: Degoot-AM Date: Fri, 19 Jun 2026 08:44:43 +0000 Subject: [PATCH 08/10] update some sections --- episodes/introduction-to-probabilities.Rmd | 15 ++++++++++++--- renv/profiles/lesson-requirements/renv.lock | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/episodes/introduction-to-probabilities.Rmd b/episodes/introduction-to-probabilities.Rmd index d5b5bd4b..c0f49faa 100644 --- a/episodes/introduction-to-probabilities.Rmd +++ b/episodes/introduction-to-probabilities.Rmd @@ -258,10 +258,19 @@ Common examples of continuous distributions include the normal distribution, exp ======= For example, variables such as height, blood pressure, incubation time (measured precisely), or time-to-event measured in hours or seconds are continuous. In this case, probabilities are not assigned to exact values (e.g., $P(X=162.5)$ for a person height), because this probability is essentially zero. Instead, probabilities are assigned to intervals, such as: $P(162≤X≤165)$. -Continuous distributions are described using a probability density function (PDF) rather than a PMF. In PDF, instead of bars, the probabilities are represented by histograms. +Continuous distributions are described using a probability density function (PDF) rather than a probability mass function (PMF). Unlike discrete distributions, probabilities in the continuous case are not assigned to individual values but to intervals of values. + +A useful way to visualise a continuous distribution is through a histogram, where the heights of the bars approximate the underlying probability density. As the number of bins increases, the histogram provides a more detailed approximation of the smooth density curve. + +![Examples of continuous probability distributions for hieght (in **cm**) as continuous varaibles. Taken from Chapter 3 of [OpenIntro Statistics book](https://https://www.openintro.org/book/os/). Increasing the number of bins produces a finer approximation of the underlying probability density.](fig/continuous-dist.png) + +This smooth curve represents a probability **density function** (also called a **density** or **distribution**). The total area under the density curve is 1, representing the entire probability space. + +Unlike a discrete distribution, probabilities are not assigned to individual values. Instead, the probability that a continuous random variable falls within a given interval is represented by the **area under the density curve** over that interval. For example, the probability that an outcome occurs between two values a and b is given by the area under the curve between a and b. + +A key advantage of continuous probability distributions is that they allow us to estimate probabilities for values that were not directly observed in the sample. + -![Examples of continuous probability distributions for hights (in **CM**) as continuous varaibles. Taken from Chapter 3 of [OpenIntro Statistics book](https://https://www.openintro.org/book/os/). Adding more bins to the histogram provides greater detail. -This sample is extremely large, which is why much smaller bins still work well](fig/continuous-dist.png) >>>>>>> b4116f1 (add continuous dist fig) diff --git a/renv/profiles/lesson-requirements/renv.lock b/renv/profiles/lesson-requirements/renv.lock index ae9f9467..da2b6aa2 100644 --- a/renv/profiles/lesson-requirements/renv.lock +++ b/renv/profiles/lesson-requirements/renv.lock @@ -7248,7 +7248,7 @@ }, "withr": { "Package": "withr", - "Version": "3.0.2", + "Version": "3.0.3", "Source": "Repository", "Title": "Run Code 'With' Temporarily Modified Global State", "Authors@R": "c( person(\"Jim\", \"Hester\", role = \"aut\"), person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = c(\"aut\", \"cre\")), person(\"Kirill\", \"Müller\", , \"krlmlr+r@mailbox.org\", role = \"aut\"), person(\"Kevin\", \"Ushey\", , \"kevinushey@gmail.com\", role = \"aut\"), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Winston\", \"Chang\", role = \"aut\"), person(\"Jennifer\", \"Bryan\", role = \"ctb\"), person(\"Richard\", \"Cotton\", role = \"ctb\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", @@ -7306,7 +7306,7 @@ }, "xfun": { "Package": "xfun", - "Version": "0.58", + "Version": "0.59", "Source": "Repository", "Type": "Package", "Title": "Supporting Functions for Packages Maintained by 'Yihui Xie'", From ff761fb5d223d4456218200c73670b65972aed69 Mon Sep 17 00:00:00 2001 From: Degoot-AM Date: Fri, 19 Jun 2026 09:25:49 +0000 Subject: [PATCH 09/10] add questions and take away points --- episodes/fig/normal-dist.jpg | Bin 0 -> 17038 bytes episodes/introduction-to-probabilities.Rmd | 55 ++++++++++++++++++--- 2 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 episodes/fig/normal-dist.jpg diff --git a/episodes/fig/normal-dist.jpg b/episodes/fig/normal-dist.jpg new file mode 100644 index 0000000000000000000000000000000000000000..73d80d956e085a1ccf5716337ddf30fd2b791b0a GIT binary patch literal 17038 zcma)j1yG#Lvi9O0oDf`sy9Ot~B0)o7ao51&uEAmPKnO0u-7P?H_h5^KAi>>T{{8Hn zoOAE3`e&=Qrgmnh=bi59>F1e#pXQ!c066k8Z)5;)Z~y=t>;rgO1Ox*R;NemKzYF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^)_F471HeyuIn2RW9Q z?_a}K!TqmQnEy1Ac~SST)k2c)^KsUk)UBCh3Fp(L9~iA@!(I~>8jS_I0QVWOcwL1M zK4LA5RoYPzyzFOlNWpf;bYE|#TQyvLMh|04&RgBGOf6D+oRS$a>iK4q#?yh}Gwjkc z19P+t0cM~hTVN=8gH{1z&a`TD=C;eRx!c}&?^Y3;*a(Ml#bZE={p&ZJ#JXtShU^ChPO@O&NP-y?U|jLo@vmBeYgTo-g> zMOE7^Uh6{WdlzFfTZpo_$^-U{Jy8+SC#!W5sW9LI=_(g5PxKbL$=z{Ba1;6;G}lm1 zQ&O(n92{K~W}A3;uU3oF z1@!q&-7pA?ousz##gu1g;tD={L%m~(b^=#kVkAFT`vN+GLp%}=yiru#2u-d7svt== zwW^7jYr5J0v>3|{D!0gua9gN4&8?xJ_<^)gzvjuFIjFJwrCgrI*t%6Kb(Wd7PmyHw zlG~`swAB^c-H~Jc36S$m3YHyp-SX)1;y1gP!;b#5!)_(cgTDX&)eyk7e^j4mvr!eX z$m=0Sso5n|9#ezSv$wITbUSlzr;k6o>gwYBtRk~&6W`~*cJ^-v%D +Suppose two diseases have the same average time from onset to outcome (12 days), but Disease A has a standard deviation of 2 days and Disease B has a standard deviation of 6 days. +- Which disease has greater variability in outcome times? ->>>>>>> b4116f1 (add continuous dist fig) +- Which distribution would appear wider? + +- Which disease would have greater uncertainty in predicting when an individual outcome will occur? + +- Sketch the two distributions and explain the differences. + +:::::::::::::::::::::::::: + +::::::::::::::::::::::::::::::::::::: keypoints + +- What is a probability distribution? + +- How can a probability distribution be represented using tables, graphs, and mathematical functions? + +- What is the difference between discrete and continuous distributions? + +- What do the location and spread of a distribution represent? + +- How do distribution parameters determine the shape of a distribution? + +:::::::::::::::::::::::::::::::::::::::::::::::: From c76378d3454f659db5ff926fc78d4871c48efe00 Mon Sep 17 00:00:00 2001 From: Degoot-AM Date: Fri, 19 Jun 2026 09:34:08 +0000 Subject: [PATCH 10/10] add references --- episodes/introduction-to-probabilities.Rmd | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/episodes/introduction-to-probabilities.Rmd b/episodes/introduction-to-probabilities.Rmd index face981a..54da2e2b 100644 --- a/episodes/introduction-to-probabilities.Rmd +++ b/episodes/introduction-to-probabilities.Rmd @@ -21,6 +21,8 @@ exercises: 2 ## Introduction Probability is a mathematical framework for quantifying uncertainty. It allows us to measure how likely an event is to occur and provides the foundation for statistical inference, risk assessment, and predictive modelling. +This episode provides a brief introduction about probability, probability distributions. + ## What is probability? @@ -36,7 +38,7 @@ $$P(death \;from \;Ebola) = \frac{3956}{14124} \approx 0.28$$. This means that approximately $28\%$ of reported Ebola cases resulted in death. Under the frequentist interpretation, probability is viewed as the proportion of times an event occurs when the same process is repeated many times under similar conditions. -2. **Subjective Probability** +2. **Subjective probability** The long-run interpretation of probability can make it difficult to interpret it for single @@ -151,7 +153,7 @@ Thus, the probability that both events occur is 0.252. A **probability distribution** describes how probabilities are assigned to the possible values of a random variable. It provides a concise summary of the uncertainty and variability observed in a process and forms the foundation of many statistical methods used in epidemiology and outbreak analysis. -#### Illustrative Example +#### Illustrative example Suppose we record the number of days from disease onset to death for each of the 3,956 Ebola deaths in the previous example. Let $(X)$ denote the number of days from onset to death. We observe that $(X)$ can take values ranging from 1 to 20 days, as shown in Table 1. @@ -264,7 +266,7 @@ Unlike a discrete distribution, probabilities are not assigned to individual val A key advantage of continuous probability distributions is that they allow us to estimate probabilities for values that were not directly observed in the sample. -### Parameterization of Probability Distributions +### Parameterization of probability distributions So far, we have described probability distributions using tables and graphs. Another common approach is to describe a distribution using a **mathematical function** whose shape is determined by a set of parameters. This process is known as **parameterization**. @@ -302,6 +304,8 @@ Suppose two diseases have the same average time from onset to outcome (12 days), :::::::::::::::::::::::::: + + ::::::::::::::::::::::::::::::::::::: keypoints - What is a probability distribution? @@ -315,3 +319,9 @@ Suppose two diseases have the same average time from onset to outcome (12 days), - How do distribution parameters determine the shape of a distribution? :::::::::::::::::::::::::::::::::::::::::::::::: + +### References + +- OpenIntro Statistics. https://https://www.openintro.org/book/os/ + +- Krzywinski M, Altman N. Points of significance: Importance of being uncertain. Nat Methods. 2013 Sep;10(9):809-10. doi: 10.1038/nmeth.2613. PMID: 24143821.