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

estimate_join fails with uninformative error #120

Open
sangeetabhatia03 opened this issue May 28, 2021 · 1 comment
Open

estimate_join fails with uninformative error #120

sangeetabhatia03 opened this issue May 28, 2021 · 1 comment

Comments

@sangeetabhatia03
Copy link
Collaborator

incid <- array(c(20, 49, 66, 71, 88, 97, 110, 139, 160, 229, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1), dim = c(10, 1, 2))
si_for_est <- structure(c(0, 0.0109271014298609, 0.0642438529179909, 0.106855472976164,
0.12306728253113, 0.121829045299574, 0.111040351371263, 0.0960718845838475,
0.080195134014859, 0.0652126770986732, 0.0519814334659148, 0.040788378193821,
0.0316014204991031, 0.0242283956789802, 0.0184129440362466, 0.013889008185358,
0.0104092453079867, 0.00775765059724476, 0.00575308532856567,
0.00424792304600063, 0.00312437608196081, 0.00228999572316568,
0.0016731661617051, 0.00121900103725681, 0.000885809191340847,
0.000642160737961417, 0.000464514524466608, 0.000335336927699048,
0.000241632912065137, 0.000173813009963775, 0.000124828171693681,
0, 0.0000103800103182646, 0.000768325053224188, 0.00670878308447795,
0.0230631536967196, 0.0484355618204519, 0.0757802097883441, 0.0977343683866287,
0.110045750786206, 0.112074009114762, 0.105667913970107, 0.09372696086706,
0.0791193104597284, 0.064108758150231, 0.0501885081793932, 0.0381550918711331,
0.0282824135490702, 0.0205074832227862, 0.0145847717721584, 0.0101962247269376,
0.00702000062782433, 0.0047673233358495, 0.00319767110173943,
0.00212087729484105, 0.00139236766621921, 0.000905581626701108,
0.000583940817584487, 0.000373568962290795, 0.000237243004788178,
0.00014964709866497, 0.0000937999537589569), .Dim = c(31L, 2L
), .Dimnames = list(NULL, c("si_distr_ref", "si_distr_variant"
)))

EpiEstim::estimate_joint(
incid, si_for_est, priors = default_priors(), seed = 1,
t_min = 2L, t_max = as.integer(10),
mcmc_control = EpiEstim::default_mcmc_controls()
)

Error in if (any(epsilon < 0)) { : missing value where TRUE/FALSE needed

traceback()
2: draw_R(epsilon_out[, i], incid$local, lambda, priors, t_min = t_min,
t_max = t_max) at gibbs_draws.R#481
1: EpiEstim::estimate_joint(incid, si_for_est, priors = default_priors(),
seed = 1, t_min = 2L, t_max = as.integer(10), mcmc_control = EpiEstim::default_mcmc_controls())

@sangeetabhatia03
Copy link
Collaborator Author

I think the cause is that in this example, R_init is c(4.387277 , NA) and therefore epsilon_init is NA.

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

1 participant