View source: R/create_posterior_func.R
create_posterior_func | R Documentation |
Creates a new function which calculates the posterior probability of a set of parameter values conditional on the Ct data.
create_posterior_func(
parTab,
data,
PRIOR_FUNC = NULL,
INCIDENCE_FUNC = NULL,
solve_ver = "likelihood",
solve_likelihood = TRUE,
use_pos = FALSE,
...
)
parTab |
A vector of model parameters with names corresponding to the parameter control table. |
data |
A tibble containing two columns: t for sample time and ct for the Ct values. |
PRIOR_FUNC |
A function for the prior distribution. NULL by default. |
INCIDENCE_FUNC |
A function that returns a vector of daily infection probabilities/ incidence. NULL by default. |
solve_likelihood |
Solves the likelihood. TRUE by default. |
use_pos |
To fit the model using ALL PCR results (i.e. including samples testing negative), set this to FALSE. If the data only include positive Ct values (i.e. only Ct values < the LOD), then this should be set to TRUE. FALSE by default. |
solver_ver |
Can be set to 'model' or 'likelihood.' 'model' returns the predicted Ct distribution rather than the posterior probability. Set to 'likelihood' by default. |
Returns a single log posterior probability or the predicted Ct distribution.
James Hay, jhay@hsph.harvard.edu
Other create posterior functions:
create_post_func_seeirr_combined()
,
create_post_func_seeirr()
,
create_posterior_func_detectable()
incidence_function <- solveSEIRModel_lsoda_wrapper
data(example_seir_partab)
posterior_func <- create_posterior_func(parTab=example_seir_partab,
data=example_ct_data,
PRIOR_FUNC=prior_func_seir,
INCIDENCE_FUNC=incidence_function,
use_pos=FALSE) ## Important argument, see text
posterior_func(example_seir_partab$values)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.