Details
There are two methods of creating a PM_sim object.
PM_result$sim()
PM_sim$new()
These both call SIMrun to execute the simulation and SIMparse to process the results and return the PM_sim objects. See help on both of these functions for further details.
Public fields
obsObservations for each output as a data frame with columns id, time, out, outeq, or in the case of multiple regimens in the template data file, a list of such data frames
amtAmounts in each compartment as a data frame with columns id, time, out, comp, or in the case of multiple regimens in the template data file, a list of such data frames
parValuesRetained simulated parameter values after discarding any due to truncation limits, as a data frame with columns id and parameters for each simulated subject, or in the case of multiple regimens in the template data file, a list of such data frames
totalSetsNumber of all simulated parameter values needed to obtain the requested number of simulated sets within any limits
totalMeansVector of means of all simulated parameter values, or in the case of multiple regimens in the template data file, a list of such vectors
totalCovCovariance matrix for all simulated parameter values, or in the case of multiple regimens in the template data file, a list of such matrices
dataFor one simulation regimen in the template data, a list of class PMsim that contains all the above elements. For multiple simulation regimens, a list of class PM_simlist that contains as many PMsim objects as regimens in the template data file used for the simulation, i.e
datawill be a list of lists.
Methods
Method new()
This is a wrapper function that combines SIMrun and SIMparse in R6.
It can be called directly
or via the $sim method for PM_result objects.
Usage
PM_sim$new(poppar, ...)Arguments
popparOne of four things:
Population prior parameters as a PM_final object found in
PM_result$final. Normally these would be supplied by calling the$simmethod for a PM_result object, e.g.PmetricsData::NPex$sim(...).A manually specified prior, see SIMrun for more details.
The name of a previously saved simulation via the
$savemethod. The file will be loaded.The results of running SIMparse on a prior simulation.
...Additional parameters to be passed to SIMrun and optionally,
combine = TRUEas an argument will be passed to SIMparse.
Returns
A PM_sim object created by calling SIMparse at the completion of the
simulation.
Method save()
Save the current PM_sim object into a .rds file.
Method plot()
Plot PM_sim object.
Arguments
atIndex of the PM_sim object to be plotted. Default is 1. result.
...Arguments passed to plot.PM_sim.
Method pta()
Estimates the Probability of Target Attaintment (PTA), based on the results of the current Simulation.
Arguments
...Additional parameters, refer to makePTA
Method auc()
Calculates the AUC of the specified simulation
Arguments
atIndex of the PM_sim object to use. Default is 1.
...Arguments passed to makeAUC.
Method summary()
Summarize simulation
Arguments
atIndex of the PM_sim object to be summarized. Default is 1.
fieldQuoted character value, one of
obs for simulated observations
amt for simulated amounts in each compartment
parValues for simulated parameter values
byOptional quoted column name(s) to group by, e.g.
by = "id"orby = c("id", "outeq").individualIf "id" is included within
by, the summary statistics will be calculated for each individual, i.e. each individual's mean, sd, median, min and max observations. IfindividualisFALSE(the default), then those summaries will again be summarized to present, for example, the mean of all subjects' mean observations, or the mean of their maximum observations. This argument will be ignored if "id" is not inby.
Method run()
Deprecated method to run a simulation. Replaced by PM_sim$new() to be
consistent with R6.
Method load()
Deprecated method to load a prior simulation. Replaced by PM_sim$new() to be
consistent with R6.
