posterior computes a posterior value for one (or multiple) parameter
set(s).
posterior(
v_params,
l_params_all = load_all_params(),
v_param_names = c("p_S1S2", "hr_S1", "hr_S2"),
v_lb = c(p_S1S2 = 0.01, hr_S1 = 1, hr_S2 = 5),
v_ub = c(p_S1S2 = 0.5, hr_S1 = 4.5, hr_S2 = 15),
v_weights = NULL
)Vector (or matrix) of model parameters.
List with all parameters of the decision model.
Vector with parameter names.
Vector with lower bounds for each parameter.
Vector with upper bounds for each parameter.
Numeric vector with one weight per calibration target, used
to compute the overall log-likelihood as a weighted sum of the
target-specific log-likelihoods. If NULL (default), all targets get
an equal weight of one.
A scalar (or vector) with posterior values.
# \donttest{
v_param_names <- c("p_S1S2", "hr_S1", "hr_S2")
n_param <- length(v_param_names)
v_lb <- c(p_S1S2 = 0.01, hr_S1 = 1.0, hr_S2 = 5) # lower bound
v_ub <- c(p_S1S2 = 0.50, hr_S1 = 4.5, hr_S2 = 15) # upper bound
v_target_names <- c("Surv", "Prev", "PropSicker")
n_target <- length(v_target_names)
posterior(v_params = sample_prior(n_samp = 5))
#> [1] 1.293195e-70 2.203668e-147 8.221343e-103 3.557418e+06 1.976894e-14
# }