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
PM_opt$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_sim object, in which case the simulated data will be used to calculate optimal sampling times. Here
modelanddataare not required, as they will be extracted from the PM_sim object.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 data frame of support points in rows, where the columns contain the parameter values for each support point. The first row has the parameter names. Compatible
modelanddataobjects must be specified to simulate the output profiles from each support point.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. Compatiblemodelanddataobjects must be specified to simulate the output profiles from the support points generated by sampling from the specified distributions.
modelA PM_model object, required or optional depending on the
popparargument.When
popparis a PM_sim object,modelis ignored.When
popparis a PM_result object,modelis optional. If missing, the model from the$modelfield of the PM_result will be used. If specified,modelmust be compatible with the primary support point parameter names and values inpoppar.When
popparis a PM_final object,modelis mandatory and must be compatible with the primary support point parameter names and values inpoppar.When
popparis a data frame of support points,modelis mandatory and must be compatible with the parameter names and values in the data frame.When
popparis a list of weights, means, and covariance,modelis mandatory and must be compatible with the parameter names and values.
dataA PM_data object, required or optional depending on the
popparargument.When
popparis a PM_sim object,datais ignored.When
popparis a PM_result object,datais optional. If missing, the data from the$datafield of the PM_result will be used. If specified,datamust be compatible with the model that is either in the PM_result or as specified bymodel.When
popparis a PM_final object,datais mandatory and must be compatible with the model that is specified bymodel.When
popparis a data frame of support points,datais mandatory and must be compatible with the model that is specified bymodel.When
popparis a list of weights, means, and covariance,datais mandatory and must be compatible with the model that is specified bymodel.
For any choice of
data, 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. Good practice is to use -1 for out values to be simulated.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.