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
obs
Observations 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
amt
Amounts 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
parValues
Retained 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
totalSets
Number of all simulated parameter values needed to obtain the requested number of simulated sets within any limits
totalMeans
Vector of means of all simulated parameter values, or in the case of multiple regimens in the template data file, a list of such vectors
totalCov
Covariance matrix for all simulated parameter values, or in the case of multiple regimens in the template data file, a list of such matrices
data
For 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
data
will 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
poppar
One of four things:
Population prior parameters as a PM_final object found in
PM_result$final
. Normally these would be supplied by calling the$sim
method 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
$save
method. The file will be loaded.The results of running SIMparse on a prior simulation.
...
Additional parameters to be passed to SIMrun and optionally,
combine = TRUE
as 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
at
Index 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
at
Index of the PM_sim object to use. Default is 1.
...
Arguments passed to makeAUC.
Method summary()
Summarize simulation
Arguments
at
Index of the PM_sim object to be summarized. Default is 1.
field
Quoted character value, one of
obs for simulated observations
amt for simulated amounts in each compartment
parValues for simulated parameter values
by
Optional quoted column name(s) to group by, e.g.
by = "id"
orby = c("id", "outeq")
.individual
If "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. Ifindividual
isFALSE
(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.