timchurches / blog Goto Github PK
View Code? Open in Web Editor NEWPersonal blog
Personal blog
Hi Tim,
Me again. Thank you so much for your reply! My issue isn't related to the incidence package. I am getting the following error, running from a Mac OS R v. 3.6.2:
My preamble is:
#install.packages("EpiModel")
#install.packages("tidyverse")
#install.packages("magrittr")
#install.packages("lubridate")
#install.packages("stringr")
#install.packages("tibble")
#install.packages("broom")
#install.packages("ggplot2")
#install.packages("gt")
#install.packages("knitr")
#install.packages("devtools")
#install.packages("DiagrammeR")
#install.packages("parallel")
#install.packages("foreach")
#install.packages("tictoc")
#install.packages("incidence")
#install.packages("earlyR")
#install.packages("incidence")
library(incidence)
library(EpiModel)
library(tidyverse)
library(magrittr)
library(lubridate)
library(stringr)
library(tibble)
library(broom)
library(ggplot2)
library(gt)
library(knitr)
library(devtools)
library(DiagrammeR)
library(parallel)
library(foreach)
library(tictoc)
library(incidence)
library(earlyR)
The error comes after library(EpiModel):
library(EpiModel)
Loading required package: tergm
Loading required package: ergm
Error: package or namespace load failed for ‘ergm’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘robustbase’
Error: package ‘ergm’ could not be loaded
Any chance you saw the same issue? I can't seem to get EpiModel to work at all! TY in advance!
I'm running into trouble creating the simulation parameters. When I try to create param_docs
, I get:
Error: No common type for `Default` <character> and `Default` <double>.
If I run rlang::last_error()
it reports:
<error/vctrs_error_incompatible_type>
No common type for `Default` <character> and `Default` <double>.
Backtrace:
1. tibble::tribble(...)
8. vctrs:::vec_ptype2.character.default(...)
9. vctrs::vec_default_ptype2(x, y, x_arg = x_arg, y_arg = y_arg)
10. vctrs::stop_incompatible_type(x, y, x_arg = x_arg, y_arg = y_arg)
11. vctrs:::stop_incompatible(...)
12. vctrs:::stop_vctrs(...)
I see that some of the ~Default
entries in param_docs
are numbers, some are characters, and some are logical arguments? Would that create an error of this type, or am I doing something wrong?
Thanks for any suggestions.
Hi Tim,
Your blogs on COVID-19 is very useful and informative. Thank you very much.
When I looked at your parameter on your blog here https://timchurches.github.io/blog/posts/2020-02-18-analysing-covid-19-2019-ncov-outbreak-data-with-r-part-1/#estimating-changes-in-the-effective-reproduction-number, you wrote ... So let’s retain the mean SI estimated by Li et al. of 7.5 days, with an SD of 3.4, but let’s also allow that mean SI to vary between 2.3 and 8.4 using a truncated normal distribution with an SD of 2.0. We’ll also allow the SD or the SD to vary between 0.5 and 4.0.
You could also the image below. My questions are:
Thanks again.
Hopefully I'm confused, but the model seems to assume contact probability does not depend on the proportion of susceptibles to total population. While the parameters allow time-dependent adjustment of contact probability (e.g. if social distancing is introduced) their is no way to adjust the contact probability as the relative proportion of susceptibles drops. Thus no ability for herd immunity. All susceptibles eventually become infected & recovered/dead. If only half of the original susceptibles remain after some number of simulation steps, then it is expected that the probability of a infected coming into contact with a susceptible would decline by some similar proportion.
Any suggestions or clarifications much appreciated!
I am replicating the code on the blog post "Modelling the effects of public health interventions on COVID-19 transmission using R - part 2". However, I got the error (object 'arrivals.icm' not found) after I executed the following command:
baseline_sim <- simulate(ncores = 4)
It seems to me there is an oversight in the model, in that (in addition to fatalities) there are 2 ways to exit the H compartment. One is disch.rand and the other prog.rand. The problem is that prog.rand ALSO controls transition from I or Q to R. Further issue is that disch.rand transitions into a state ("D"?) that isn't really part of the model (and is certainly distinct from R state).
So...if one wants to have a separate probability and transition for H to R than that occurring for Q or I to R, which seems reasonable, then currently you're out of luck.
Loved the blog and impressive coding...just needs a few little tweaks to really be great! Thanks!
The hosp.cap input was not updated to be a vector (as were other inputs), so Experiment 2 adjusting for hospital capacity does not work. I have a simple fix.
Hi, I am new to R and trying to replicate this code. Apologize if the question is very naive.
I cannot seem to replicate the MLE estimation for R0. I get the following messages for the codes and I am not sure about what to do.
res <- get_R(incidence_growth_phase, si_mean = si_mean, si_sd = si_sd)
Warning message:
'EpiEstim::OverallInfectivity' is deprecated.
Use 'overall_infectivity' instead.
See help("Deprecated")
plot(res, "R")
Warning message:
In plot.window(...) : Internal(pretty()): very small range.. corrected
In the project modelling-the-effects-of-public-health-interventions-on-covid-19-transmission-part-2
When I run the command
baseline_sim <- simulate(ncores=4)
I get the error
Error in { : task 1 failed - "could not find function "init_status.icm""
I'm using Windows. Please, what could I do to fix?
Changing ncores to 1 prevents the error to happen.
same problem. Windows users Just change or add ncores=1 when running simulate function, it might take time but it works!
Originally posted by @SandyBy in #5 (comment)
Same error when I run the following command. How can i fix this? Thank you for helping.
ramp_quar_rate_sim <- simulate(quar.rate = quar_rate_ramp(1:366))
Error in { : task 1 failed - "could not find function "init_status.icm""
At the point in your blog (Modelling the effects of public health interventions on COVID-19 transmission using R - part 1) where the dataframe sims_incidence_rates is set up, I get this error:
Error in incidence(.) : could not find function "incidence"
Hi Tim,
In connection with your post "Modelling the effects of public health interventions on COVID-19 transmission using R - part 2" posted on March 17, 2020, I am writing this to you. I am facing a problem while I have changed e.num from 0 to any positive value. My system is showing the follwoing error.
Error in sample.int(length(x), size, replace, prob) : NA in probability vector
Please help!
Thanks.
Moumita.
their previous csv addresses are deprecated now. changed to:
time_series_covid19_confirmed_global.csv
time_series_covid19_deaths_global.csv
time_series_covid19_recovered_global.csv
I'm using SIR-ICM to model an outbreak in large population (around 10 million). I want to know the size of susceptible individuals to use in this model. I'm in a doubt to use the actual population size as the size of susceptible individuals because of non-uniform mixing of individuals. Could anyone make a rough estimate of the size of susceptible individuals?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.