Git Product home page Git Product logo

blog's People

Contributors

timchurches avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blog's Issues

error in EpiModel

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!

Error: No common type for `Default` <character> and `Default` <double>.

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.

Parameters to estimate effective reproduction number on your blog

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:

  • min_mean_si = 1, is it correct?
  • std_std_si =1, is it correct?
  • where should I put the value of 2.3?

image

Thanks again.

model flaw? contact proability constant regardless of proportion of susceptibles

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!

Model error: disch.rand and prog.rand both exit H compartment

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!

Calculating R0

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

could not find function "init_status.icm"

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!

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""

Error in incidence(.) : could not find function "incidence"

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"

Problem with e.num within the init.icm() function

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.

reference address for JHU data has changed

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

Number of Susceptible individuals in SIR-ICM

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.