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

Extraction of {epireview} parameters to provide consensus distribution #356

Open
adamkucharski opened this issue Jul 11, 2024 · 0 comments

Comments

@adamkucharski
Copy link
Member

adamkucharski commented Jul 11, 2024

During epireview x epiverse event on 11th July, we discussed having a function that could generate random draws from across the available distributions, either filtering only on parameters with known distributions, or defining an assumed distribution to allow samples to be generated from all distributions with enough data for extraction (e.g. by using extract_param and generate.

The below script gives a tally of how many parameters in {epireview} fall into different extraction categories. 95% CrI excluded as this refers to the parameter uncertainty rather than distributional uncertainty. 95% CI can be ambiguous, so need to include a check against sample size to decide which it refers to – perhaps using the relationship (sample sd) = sd/(sample size) and identify outliers? And use the 95% CI = 2*sd approximation similarly?

pathogen_select <- "ebola"
distn_select <- "Human delay - Symptom Onset/Fever to Death"

data_in <- load_epidata(pathogen = pathogen_select)
params_in <- data_in[["params"]] |> 
              dplyr::filter(article_qa_score>50) |>  # filter by score
              dplyr::filter(parameter_type==distn_select) # filter by type

tally_results <- params_in |> 
  dplyr::summarise(
    dist_known = sum(!is.na(distribution_type) & !is.na(distribution_par1_type) & !is.na(distribution_par2_type)),
    na_dist_par_sd = sum(is.na(distribution_type)  & parameter_uncertainty_singe_type == "Standard Deviation",na.rm=T),
    na_dist_par_range = sum(is.na(distribution_type) & is.na(parameter_uncertainty_singe_type) & parameter_uncertainty_type == "Range",na.rm=T),
    na_dist_par_95ci = sum(is.na(distribution_type)  & is.na(parameter_uncertainty_singe_type) & parameter_uncertainty_type == "95% CI",na.rm=T),
    na_dist_par_iqr = sum(is.na(distribution_type)   & is.na(parameter_uncertainty_singe_type) & parameter_uncertainty_type == "IQR",na.rm=T)
  )

print(t(tally_results))
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