Skip to contents

If the $save method has previously been invoked on a PM_sim object, this function will load those results.

Provides an alternative method to call the simulator directly from output of a model fitting run.

Usage

PM_sim$run

Arguments

file_name

The name of the .rds file to load.

poppar

A population parameter result, which is a PM_final object. This can be found in PM_result$final$data.

...

Additional parameters to be passed to SIMrun and optionally, "combine = T" as an argument will be passed to SIMparse.

Value

A PM_sim object

A PM_sim object created by calling SIMparse at the completion of the simulation.

Details

This object is created after a successful run of the simulator.

There are two methods of creating a PM_sim object.

  • PM_result$sim

  • PM_sim$run

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.

See makeAUC

The saved object is an .rds file. When loaded, it should be assigned to an R object, e.g. sim1 <- PM_sim$load("filename").

Calling this function is equivalent to PM_result$sim().

Public fields

obs

Observations

amt

Amounts

parValues

Retained simulated parameter values after discarding any due to truncation limits

totalSets

Number of all simulated parameter values

totalMeans

Mean of all simulated parameter values

totalCov

Covariance of all simulated parameter values

data

A matrix that contains all the above elements as columns

Methods


Method new()

Create new simulation objects with results of $sim method for PM_result

Usage

PM_sim$new(list)

Arguments

list

List of output passed by $sim.


Method save()

Save the current PM_sim object into a .rds file.

Usage

PM_sim$save(file_name = "PMsim.rds")

Arguments

file_name

Name of the file to be created, the default is PMsim.rds


Method plot()

Plot PM_sim object.

Usage

PM_sim$plot(...)

Arguments

...

Arguments passed to plot.PMsim.


Method pta()

Estimates the Probability of Target Attaintment (PTA), based on the results of the current Simulation.

Usage

PM_sim$pta(targets, target.type, ...)

Arguments

targets

A vector of pharmacodynamic targets, such as Minimum Inhibitory Concentrations (MICs), e.g. c(0.25, 0.5,1,2,4,8,16,32). This can also be a sampled distribution using makePTAtarget.

target.type

A numeric or character vector, length 1. If numeric, must correspond to an observation time common to all PMsim objects in simdata, rounded to the nearest hour. In this case, the target statistic will be the ratio of observation at time target.type to target. This enables testing of a specific timed concentration (e.g. one hour after a dose or C1) which may be called a peak, but is not actually the maximum drug concentration. Be sure that the time in the simulated data is used, e.g. 122 after a dose given at 120. Character values may be one of "time", "auc", "peak", or "min", for, respectively, percent time above target within the time range specified by start and end, ratio of area under the curve within the time range to target, ratio of peak concentration within the time range to target, or ratio of minimum concentration within the time range to target.

...

Additional parameters, refer to makePTA


Method auc()

Calculate AUC

Usage

PM_sim$auc(...)

Arguments

...

Arguments passed to makeAUC


Method clone()

The objects of this class are cloneable with this method.

Usage

PM_sim$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.