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

Function list_distributions() and convert_params_to_summary_stats() #319

Open
chloerice48 opened this issue May 28, 2024 · 3 comments
Open

Comments

@chloerice48
Copy link

Feedback from WG4 google document: Function list_distributions() is it possible to also list the pathogen/variant info in the output?

Function convert_params_to_summary_stats(), could the IQR, 95% percentile also be provided?

@joshwlambert
Copy link
Member

Feedback from WG4 google document: Function list_distributions() is it possible to also list the pathogen/variant info in the output?

This change has been made in pull request #321. The list_distribution() function has been renamed parameter_tbl() now shows the pathogen. Here is an example:

library(epiparameter)
db <- epidist_db()
#> Returning 122 results that match the criteria (99 are parameterised). 
#> Use subset to filter by entry variables or single_epidist to return a single entry. 
#> To retrieve the citation for each use the 'get_citation' function
parameter_tbl(db)
#> # Parameter table:
#> # A data frame:    122 × 7
#>    disease  pathogen epi_distribution prob_distribution author  year sample_size
#>    <chr>    <chr>    <chr>            <chr>             <chr>  <dbl>       <dbl>
#>  1 Adenovi… Adenovi… incubation peri… lnorm             Lessl…  2009          14
#>  2 Human C… Human_C… incubation peri… lnorm             Lessl…  2009          13
#>  3 SARS     SARS-Co… incubation peri… lnorm             Lessl…  2009         157
#>  4 Influen… Influen… incubation peri… lnorm             Lessl…  2009         151
#>  5 Influen… Influen… incubation peri… lnorm             Lessl…  2009          90
#>  6 Influen… Influen… incubation peri… lnorm             Lessl…  2009          78
#>  7 Measles  Measles… incubation peri… lnorm             Lessl…  2009          55
#>  8 Parainf… Parainf… incubation peri… lnorm             Lessl…  2009          11
#>  9 RSV      RSV      incubation peri… lnorm             Lessl…  2009          24
#> 10 Rhinovi… Rhinovi… incubation peri… lnorm             Lessl…  2009          28
#> # ℹ 112 more rows

Created on 2024-05-30 with reprex v2.1.0

@joshwlambert
Copy link
Member

Function convert_params_to_summary_stats(), could the IQR, 95% percentile also be provided?

It is not clear to me what this is requesting. Converting from IQR or 95th percentile will not be done by convert_params_to_summary_stats(), but would be in extract_param() (as it would likely require numerical estimation).

The extract_param() function can already extract from percentiles, here is an example:

library(epiparameter)
extract_param(
  type = "percentiles", 
  values = c(5, 25), 
  distribution = "gamma", 
  percentiles = c(0.05, 0.95)
)
#> Stochastic numerical optimisation used. 
#> Rerun function multiple times to check global optimum is found
#>    shape    scale 
#> 4.589714 2.912114

Created on 2024-05-30 with reprex v2.1.0

I will give some thought to adding extraction from interquartile range to the extract_param() function.

@joshwlambert joshwlambert added this to the v0.3.0 milestone Jun 28, 2024
@joshwlambert
Copy link
Member

Moving this to v0.4.0 milestone.

@joshwlambert joshwlambert modified the milestones: v0.3.0, v0.4.0 Oct 23, 2024
@joshwlambert joshwlambert removed this from the v0.4.0 milestone Jan 6, 2025
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