evsi.remote.Rd
Calculate the expected value of sample information from a decision-analytic model
evsi.remote( outputs, inputs, study = NULL, datagen_fn = NULL, pars = NULL, n = 100, aux_pars = NULL, method = NULL, likelihood = NULL, analysis_model = NULL, analysis_options = NULL, decision_model = NULL, Q = 30, npreg_method = "gam", nsim = NULL, verbose = FALSE, ... )
outputs | a vector of values for the quantity of interest, sampled from the uncertainty distribution of this quantity that is induced by the uncertainty about the parameters. |
---|---|
inputs | Matrix or data frame of samples from the uncertainty
distribution of the input parameters of the decision model. The number
of columns should equal the number of parameters, and the columns should
be named. This should have the same number of rows as there are samples
in |
study | Name of one of the built-in study types supported by this
package for EVSI calculation. If this is supplied, then the columns of
Currently supported studies are
Either |
datagen_fn | If the proposed study is not one of the built-in types supported, it can be specified in this argument as an R function to sample predicted data from the study. This function should have the following specification:
|
pars | Character vector identifying which columns of The |
n | Sample size of future study - optional argument to datagen_fn - facilitates calculating EVSI for multiple sample sizes. TODO if we want to design trials with multiple unbalanced arms, we'll need more than one argument. |
aux_pars | A list of additional fixed arguments to supply to the
function to generate the data, whether that is a built-in or user-defined
function, e.g. |
method | haracter string indicating the calculation method. The default methods are based on nonparametric regression. |
likelihood | Likelihood function, required (and only required) for the importance sampling method. This should have two arguments as follows:
The function should return a vector whose length matches the number of rows of the parameters data frame given as the second argument. Each element of the vector gives the likelihood of the corresponding set of parameters, given the data in the first argument. Examples of this are currently in Note the definition of the likelihood should agree with the definition of
|
analysis_model | Function which fits a Bayesian model to the generated
data. Under development (need to decide format, output, JAGS dependencies,
etc.). Required for |
analysis_options | List of arguments required by |
decision_model | Function which evaluates the decision-analytic model,
given parameter values. Under development - for |
Q | Number of quantiles to use in |
npreg_method | Method to use to calculate the EVPPI, for those methods
that require it. This is passed to |
nsim | Number of simulations from the model to use for calculating EVPPI.
The first |
verbose | Set to |
... | Other arguments required by specific methods |
set.seed(1) nsam <- 10000 inputs <- data.frame( p1 = rnorm(nsam, 1, 1), p2 = rnorm(nsam, 0, 2) ) outputs_nb <- data.frame( t1 = 0, t2 = inputs$p1 - inputs$p2 ) datagen_normal <- function(inputs, n=100, sd=1){ data.frame(xbar = rnorm(n = nrow(inputs), mean = inputs[,"p1"], sd = sd / sqrt(n))) } evsi.remote(outputs_nb, inputs, datagen_fn = datagen_normal, n=c(10,100,1000))#>#> $n #> [1] 10 100 1000 #> #> $evsi #> [1] 0.0687 0.0807 0.0817 #>