Navigation Menu

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

can't simulate for single day or single trajectory #18

Closed
annecori opened this issue Jan 23, 2020 · 0 comments · Fixed by #19
Closed

can't simulate for single day or single trajectory #18

annecori opened this issue Jan 23, 2020 · 0 comments · Fixed by #19
Assignees
Labels

Comments

@annecori
Copy link
Collaborator

annecori commented Jan 23, 2020

i <- incidence(Sys.Date())
si <- c(0.2, 0.5, 0.2, 0.1)
R0 <- 2
### this works: project(x = i,
+               R = R0,
+               si = si,
+               n_sim = 2,  # doesn't work with 1 in project function
+               R_fix_within = TRUE,
+               n_days = 2, # doing 2 days as project function currently not working with one day - will only use first day though
+               model = "poisson")

/// Incidence projections //

  // class: projections, matrix
  // 2 dates (rows); 2 simulations (columns)

 // first rows/columns:
           [,1] [,2]
2020-01-24    2    0
2020-01-25    2    0

 // dates:
[1] "2020-01-24" "2020-01-25"

### this does NOT work:

> project(x = i,
+               R = R0,
+               si = si,
+               n_sim = 1,  # doesn't work with 1 in project function
+               R_fix_within = TRUE,
+               n_days = 2, # doing 2 days as project function currently not working with one day - will only use first day though
+               model = "poisson")
Error in 1:nrow(out) : argument of length 0


### this does NOT work:

> project(x = i,
+               R = R0,
+               si = si,
+               n_sim = 2,  # doesn't work with 1 in project function
+               R_fix_within = TRUE,
+               n_days = 1, # doing 2 days as project function currently not working with one day - will only use first day though
+               model = "poisson")
Error in 1:nrow(out) : argument of length 0
@zkamvar zkamvar self-assigned this Jan 23, 2020
@zkamvar zkamvar added the bug label Jan 23, 2020
zkamvar added a commit that referenced this issue Jan 23, 2020
I've also updated the data so that it will be safe from the R 4.0 change
that will treat matrices as class "matrix", "array".

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

Successfully merging a pull request may close this issue.

2 participants