| estim | R Documentation |
Generic function for calculating the posterior mean and
mean squared error of a basket trial design. It defaults to the function
estim.default which does not rely on any baskwrap-specific function.
estim(design, ...)
## Default S3 method:
estim(design, ...)
## S3 method for class 'fujikawa_x'
estim(
design,
n,
p1,
lambda = NULL,
epsilon,
tau,
logbase = 2,
iter = 1000,
weight_fun = weights_jsd,
weight_params = list(epsilon = epsilon, tau = tau, logbase = logbase),
globalweight_fun = NULL,
globalweight_params = list(),
...
)
design |
An object created with one of the |
... |
Further arguments. |
n |
The sample size per basket. |
p1 |
Probabilities under the alternative hypothesis. If
|
lambda |
The posterior probability threshold. |
epsilon |
Tuning parameter that determines the amount of borrowing.
See |
tau |
Tuning parameter that determines how similar the baskets
have to be that information is shared. See |
logbase |
Tuning parameter. The base of the logarithm that is used to calculate the Jensen-Shannon divergence. |
iter |
The number of iterations in the simulation. Is ignored if
|
weight_fun |
Which functions should be used to calculated the pairwise
weights? Default is |
weight_params |
A list of tuning parameters specific to |
globalweight_fun |
Which functions should be used to calculated the global weights? Currently, this is only supported for the exact backend. |
globalweight_params |
A list of tuning parameters specific to
|
estim.default is in fact just a wrapper of basksim::get_details() that
select posterior mean and mean squared error.
A list containing means of the posterior distribution and the mean squared errors for all baskets.
# Example for a basket trial with Fujikawa's Design
design <- setup_fujikawa_x(k = 3, p0 = 0.2)
estim(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95,
epsilon = 2, tau = 0, iter = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.