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

evaluate to replace $qf() by $q() to use the output of a discretised function #129

Closed
avallecam opened this issue Feb 13, 2024 · 1 comment

Comments

@avallecam
Copy link
Member

When we use si$prob_dist$qf() from a discretised function we are using the output from the continuous function. I reported this in epiverse-trace/epiparameter#233. I copied here the reprex:

Line in {episoap} of issue:

si <- epiparameter::discretise(si_epidist)
si_x <- seq(1L, to = si$prob_dist$qf(0.999), by = 1L)

Reprex from {epiparameter}:

library(epiparameter)

covid_serialint <-
  epiparameter::epidist_db(
    disease = "covid",
    epi_dist = "serial",
    author = "Nishiura",
    single_epidist = TRUE
  )
#> Using Nishiura H, Linton N, Akhmetzhanov A (2020). "Serial interval of novel
#> coronavirus (COVID-19) infections." _International Journal of
#> Infectious Diseases_. doi:10.1016/j.ijid.2020.02.060
#> <https://doi.org/10.1016/j.ijid.2020.02.060>.. 
#> To retrieve the short citation use the 'get_citation' function

covid_serialint_discrete <-
  epiparameter::discretise(covid_serialint)

# get quantiles
# for discrete distribution
# from discretised distribution object
covid_serialint_discrete$prob_dist$q(0.6)
#> [1] 4

# get quantiles 
# for continuous distribution
# (but)
# from the discretise distribution object
covid_serialint_discrete$prob_dist$qf(0.6)
#> [1] 4.618906

# as in
quantile(covid_serialint,0.6)
#> [1] 4.618906

Created on 2024-02-01 with reprex v2.0.2

Tagging @joshwlambert @Degoot-AM @adamkucharski @jamesmbaazam as interest group from devday and as devs of this @Bisaloo @CarmenTamayo

@CarmenTamayo
Copy link
Contributor

This was resolved in #100 so closing the issue- thanks @avallecam !

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