This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
date | cases | deaths | |
---|---|---|---|
2020-02-05 | 10 | 0 | |
2020-02-06 | 10 | 0 | |
2020-02-07 | 41 | 0 | |
2020-02-08 | 3 | 0 | |
2020-02-09 | 6 | 0 | |
2020-02-10 | 65 | 0 | |
2020-02-11 | 0 | 0 | |
2020-02-12 | 39 | 0 | |
2020-02-13 | 44 | 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Correcting for real-time CFR bias ------------------------------------------------- | |
# This script builds on the theory outlined in this vignette: | |
# https://epiverse-trace.github.io/cfr/articles/estimate_from_individual_data.html | |
# Load packages | |
library(cfr) | |
library(dplyr) | |
library(ggplot2) | |
library(gridExtra) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define delay params | |
param_1 <- log(5) | |
param_2 <- 1 | |
# Onsets at time 0 | |
initial_onsets <- 100 | |
# CFR | |
cfr <- 0.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define R0 | |
r_number <- 1.4 | |
# Final size model | |
attack_rate <- finalsize::final_size(r_number)$n_infected | |
print(attack_rate) | |
# Calculate total exposures over the whole epidemic | |
# (note: later in epidemic, now-immune people will be re-exposed) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define parameters | |
xx <- 1e3 # Number of values to simulate from positive and negative distribution | |
xx_pos <- xx; xx_neg <- xx | |
set.seed(1) | |
# Set up plot | |
par(mfcol=c(2,2),mgp=c(2,0.7,0),mar = c(3,3,1,3)) | |
for(kk in 1:2){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define parameters | |
bkg_val <- 15 # background value | |
xx <- 1e3 # Number of values to simulate from positive and negative distribution | |
xx_pos <- xx; xx_neg <- xx | |
set.seed(1) | |
# Set up plot | |
par(mfcol=c(2,2),mgp=c(2,0.7,0),mar = c(3,3,1,3)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Analysis of VE during epidemic when vaccine protection < infection protection ------------------------------------------------------------- | |
# Adam Kucharski (2024) | |
# Define assumptions about exposure over time in epidemic ----------------- | |
xx <- seq(0,6,1/30) # time points for model | |
peak_time <- 3 # peak in months post-vaccine campaign | |
peak_width <- 0.8 # variance in epidemic width (i.e. sd of distribution) | |
exposure_prop <- 0.6 # proportion of population exposure during wave |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Banishment | Traitors | Correct | Total | |
---|---|---|---|---|
Nicky | 3 | 0 | 19 | |
Imran | 3 | 0 | 17 | |
Ivan | 3 | 0 | 16 | |
Tom | 3 | 0 | 14 | |
Alyssa | 2 | 1 | 14 | |
Rayan | 2 | 0 | 13 | |
Theo | 2 | 0 | 10 | |
Amanda | 2 | 1 | 8 | |
Maddy | 3 | 0 | 6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example code for simulation recovery of infection dynamics from deaths for COVID ----------------------------------------- | |
# Load libraries: | |
# install.packages("EpiNow2", repos = "https://epiforecasts.r-universe.dev") | |
library(EpiNow2) | |
# Simulate data and delays ----------------------------------------- | |
# Simulate infections with a sharp drop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# - - - - - - - - - - - - - - - - - - - - - - - | |
# Code by Adam Kucharski to accompany post 'Counting current COVID infections' (2nd Jan 2024) | |
# Post is available at: https://kucharski.substack.com | |
# Code in this file is shared under an MIT license (https://opensource.org/license/mit/) | |
# - - - - - - - - - - - - - - - - - - - - - - - | |
# Load libraries | |
library(dplyr) | |
library(readr) |
NewerOlder