Details
This object contains the methods to create and results from optimal sampling algorithms. Currently the only option multiple-model optimization. This algorithm calculates the requested number of sample times where the concentration time profiles are the most separated, thereby minimizing the risk of choosing the incorrect Bayesian posterior for an individual. Future updates will add D-optimal sampling times.
References
Bayard, David S. & and Neely, Michael. (2017). Experiment Design for Nonparametric Models Based on Minimizing Bayes Risk: Application to Voriconazole. Journal of Pharmacokinetics and Pharmacodynamics, 44(2): 95–111. https://doi.org/10.1007/s10928-016-9498-5.
Public fields
sampleTimeThe optimal sample times, based on requested
typeargument to$newcreation method.bayesRiskOnly present for MM-optimal sampling. The Bayesian risk of mis-classifying a subject based on the sample times. This is more useful for comparisons between sampling strategies, with minimization the goal.
simdataA PM_sim object with the simulated profiles
mmIntA list with the
mmIntvalues,NULLifmmIntargument to$newis missing.
Methods
Method new()
Determine optimal sample times which are the most informative about the model parameters.
Arguments
popparThere are several choices for the population parameters.
A PM_result loaded with PM_load, in which case the
$finalfield will be used, e.g.run1 <- PM_load(1)andpoppar = run1.A PM_final object, typically as a field in a PM_result, e.g.,
poppar = run1$final.A list containing three items in this order, but of any name: vector of weights, vector of mean parameter values, and a covariance matrix. If only one distribution is to be specified the
weightsvector should be of length 1 and contain a 1. If multiple distributions are to be sampled, theweightsvector should be of length equal to the number of distributions and its values should sum to 1, e.g.c(0.25,0.05,0.7). The means matrix may be a vector for a single distribution, or a matrix withlength(weights)rows and number of columns equal to the number of parameters.
modelOne of three choices:
PM_model object
Character vector with the filename of a Pmetrics model in the working directory.
If
modelis missing, there are two possibilities: ** Whenpopparis a PM_result with a valid$modelfield, the model inpopparwill be used. ** In the absence of apopparwith a valid model field, look for a file called "model.txt" in the working directory.
dataOne of three choices:
PM_data object
Character vector with the filename of a Pmetrics data in the working directory.
If
datais missing, there are two possibilities: ** Whenpopparis a PM_result with a valid$datafield, the data inpopparwill be used. ** In the absence of apopparwith a valid data field, look for a file called "data.csv" in the working directory. In either choice, the value for outputs can be coded as any number(s) other than -99. The number(s) will be replaced in the simulator output with the simulated values.
nsampThe number of MM-optimal sample times to compute; default is 1, but can be any number. Values >4 will take an exponentially longer time.
weightList whose names indicate the type of weighting, and values indicate the relative weight. Values should sum to 1. Names can be any of the following:
none The default. MMopt times will be chosen to maximally discriminate all responses at all times.
AUC MMopt times will be chosen to maximally discriminate AUC, regardless of the shape of the response profile.
max MMopt times will be chosen to maximally discriminate maximum, regardless of the shape of the response profile.
min MMopt times will be chosen to maximally discriminate minimum, regardless of the shape of the response profile.
Any combination of AUC, max, and min can be chosen. If "none" is specified, other weight types will be ignored and the relative value will be set to 1. For example,
list(auc = 0.5,max = 0.5)orlist(auc = 0.2, min = 0.8). The default islist(none = 1).predIntThe interval in fractional hours for simulated predicted outputs at times other than those specified in the template
data. The default is 0.5, which means there will be simulated outputs every 30 minutes from time 0 up to the maximal time in the template file. You may also specifypredIntas a vector of 3 values, e.g.c(1,4,1), similar to the R command seq, where the first value is the start time, the second is the stop time, and the third is the step value. Outputs for times specified in the template file will also be simulated. To simulate outputs only at the output times in the template data (i.e. EVID=0 events), usepredInt = 0. Note that the maximum number of predictions total is 594, so the interval must be sufficiently large to accommodate this for a given number of output equations and total time to simulate over. IfpredIntis set so that this cap is exceeded, predictions will be truncated.mmIntSpecify the time intervals from which MMopt times can be selected. These should only include simulated times specified by
predInt.algorithmOptimal sampling algorithm. Currently not modifiable and the only option is "mm".
outeqOutput equation to optimize
...Other parameters to pass to PM_sim$new(). Most are not necessary, but
usePost = TRUEcan be used to calculate individual MMopt times. In this case, the number of posterior distributions contained inpoppar$final$postPointsneeds to match the number of subjects indata. You can also passincludeandexcludeto limit the subjects used indata. This will work whetherusePostisTRUEorFALSE. Note that the following arguments to PM_sim$new cannot be modified.nsimis zerooutnameis "MMsim"combineisTRUE
cleanBoolean parameter to specify whether temporary files made in the course of the simulation run should be deleted. Defaults to
TRUE. This is primarily used for debugging.
Method print()
Print method