Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential Issue in loglike_to_density #19

Open
sergejkaiser opened this issue Apr 1, 2020 · 1 comment
Open

Potential Issue in loglike_to_density #19

sergejkaiser opened this issue Apr 1, 2020 · 1 comment

Comments

@sergejkaiser
Copy link

sergejkaiser commented Apr 1, 2020

I created a data frame with the dates and counts of the confirmed covid 19 cases in belgium. When I estimated R with the get_R function is zero. When I further analysed the package code, the root cause seems to be the transformations in the loglike_to_density function. For this dataset log likelihood values are negative and after loglike_to_density function they become all equal to 0.

library(earlyR)
library(dplyr)
library(tidyr)
library(lubridate)
cases_be <- data.frame( I= c(1, 2,    11,   9,    10,   52,   59,   115,  54,   71,   54,   89,  
                                                                               167,  305,  258,  362,  321,  329,  451,  556,  870,  1080, 1105,
                                                                               646,  1028, 1329, 2453, 2023, 3612), dates = c("2020-02-04", "2020-03-01", "2020-03-02", "2020-03-03", "2020-03-04",
"2020-03-05", "2020-03-06", "2020-03-07", "2020-03-08", "2020-03-09",
"2020-03-10", "2020-03-11", "2020-03-12", "2020-03-13", "2020-03-14",
"2020-03-15", "2020-03-16", "2020-03-17", "2020-03-18", "2020-03-19",
"2020-03-20", "2020-03-21", "2020-03-22", "2020-03-23", "2020-03-24",
"2020-03-25", "2020-03-26", "2020-03-27", "2020-03-28"))
  cases_be %>%
  select(dates, I) %>% mutate (dates = lubridate::ymd(dates)) %>%
  uncount(I) %>%
  pull(dates) -> local_case_dates_be
  local_case_dates_be %>%
  incidence( .,last_date = "2020-03-28") -> local_cases_be_final
 
Res <- earlyR::get_R(x=local_cases_be_final, si_mean = 7.5, si_sd = 3.4,max_R = 8)

@aswansyahputra
Copy link

Is there any solution available for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants