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
# packages | |
# install.packages(c("data.table", "remotes", "EpiNow2")) | |
# remotes::install_github("epiforecasts/EpiNow2") | |
# remotes::install_github("epiforecasts/covidregionaldata") | |
library(data.table) | |
library(EpiNow2) | |
library(covidregionaldata) | |
# target country (must be supported in covidregionaldata) | |
country <- "uk" # harder to fit "india" |
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
# load required packages | |
library(EpiNow2) | |
library(future.apply) | |
library(purrr) | |
library(data.table) | |
warning("This gist is depreciated. Please use the following development repository: https://github.com/seabbs/regional-secondary.git") | |
# extract priors from a posterior and update fitting args | |
extract_secondary_priors <- function(posterior) { |
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
# set number of cores to use fitting the model | |
# no benefit on runtime if cores > chains which is set to 4 by default | |
options(mc.cores = 4) | |
# Packages ---------------------------------------------------------------- | |
# install.packages(c("data.table", "remotes", "ggplot2")) | |
# remotes::install_github("epiforecasts/EpiNow2") | |
# remotes::install_github("epiforecasts/covidregionaldata") | |
library(data.table) | |
library(ggplot2) |
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
# Note: estimate_truncation is experimental so use this for exploratory purposes | |
# only and/or with a high level of interpretation | |
# Packages ---------------------------------------------------------------- | |
# install packages | |
# install.packages(c("data.table", "purrr", "remotes", "EpiNow2")) | |
library(data.table) | |
library(purrr) | |
library(covidregionaldata) | |
library(EpiNow2) |
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
# packages | |
# install.packages(c("data.table", "remotes", "EpiNow2")) | |
library(data.table) | |
library(EpiNow2) | |
library(covidregionaldata) | |
# target country (must be present in ECDC data) | |
country <- "france" | |
# set number of cores to use fitting the model |
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
#!bin/bash | |
cd /home/azureuser/covid-rt-estimates | |
git add --all | |
git commit -m "update estimates" | |
git push |
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
#!bin/bash | |
cd /home/azureuser/ | |
git clone [email protected]:epiforecasts/covid-rt-estimates.git | |
cd covid-rt-estimates | |
sudo bash bin/update-docker.sh "build" | |
sudo bash bin/update-via-docker.sh | |
FILE=last-update/update-complete | |
while [ ! -f "$FILE" ]; do |
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
library(EpiNow2) | |
library(data.table) | |
# Get example case counts | |
reported_cases <- EpiNow2::example_confirmed[1:60] | |
# Add a dummy breakpoint (used only when optionally estimating breakpoints) | |
reported_cases <- reported_cases[, breakpoint := data.table::fifelse((date >= as.Date("2020-03-16") & date <= as.Date("2020-03-29")) | date >= as.Date("2020-04-11"), | |
1, 0)] | |
# Set up example generation time |
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
#!bin/bash | |
sudo apt-get update | |
sudo apt-get install -y docker.io | |
sudo docker login docker.pkg.github.com | |
sudo docker pull docker.pkg.github.com/epiforecasts/epinow2/epinow2:latest | |
sudo docker tag docker.pkg.github.com/epiforecasts/epinow2/epinow2:latest epinow2 | |
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
#!/bin/bash | |
# Get rid of the older update script | |
rm update-via-ssh.sh | |
# Get the new update script | |
curl --fail https://raw.githubusercontent.com/epiforecasts/covid-rt-estimates/master/bin/update-via-ssh.sh > update-via-ssh.sh | |
# Run the update script | |
bash update-via-ssh.sh ~/.ssh/id_rsa azureuser@$1 github-username-here github-pat-here |