This object contains all of the results after a Pmetrics runs. It is created by using the PM_load function.
Details
After a run completes, results are stored on your hard drive. They are loaded back into R with PM_load to create the PM_result object, which contains both the results and functions to analyze or plot the result.
Public fields
popA PM_pop object
postA PM_post object
finalA PM_final object
cycleA PM_cycle object
opA PM_op object
covA PM_cov object
dataPM_data object representing the original .csv data file used in the run. The predictions contained in the
$datafields from$popand$postwill be added to this PM_data object to permit easy addition of such predictions to raw data plots. See plot.PM_data for more details.modeltext string representing the original model file used in the run
errfileName of error file if it exists
successBoolean if successful run
validIf the
$validatemethod has been executed after a run, this field will contain the information required to plot visual predictive checks and normalized prediction error discrepancies via the npde code developed by Comets et al. Use the$savemethod on the augmentedPM_resultobject to save it with the new validation results.opt_sampIf the
$optmethod has been executed after a run, this field will contain a PM_opt object which has optimal sampling times and methods to plot them. Use the$savemethod on the augmentedPM_resultobject to save it with the new optimal sampling results.
Methods
Method new()
Create new object populated with data from previous run
Usage
PM_result$new(out, path = ".", quiet = TRUE)Arguments
outThe parsed output from PM_load, which is automatically generated. This is not a user-modifiable.
pathinclude Path to the folder containing the raw results of the run. Default is the current working directory. .
quietQuietly validate. Default is
FALSE.
Details
Creation of new PM_result objects is via PM_load.
Method fit()
Fit the model to the data
#' @details
This method is used to fit the model in the PM_result object to data.
It calls the $fit method of the model stored in the model field.
Arguments
dataOptional data to fit. If not provided, the data stored in the
datafield of the PM_result object will be used. This can be useful to continue a prior run that did not converge before the maximum number of cycles, e.g.run2 <- run1$fit(cycles = 10000, prior = 1)...Additional arguments passed to the model's
$fitmethod.
Method plot()
Plot generic function based on type
Method summary()
Summary generic function based on type
Method nca()
Perform non-compartmental analysis
Arguments
...Arguments passed to makeNCA.
Details
See makeNCA.
Method report()
Re-generate the report
Arguments
...Parameters passed to PM_report. In particular, pay attention to
path.
Method sim()
Calls PM_sim. Default is to use the $final, $model, and $data objects
within the PM_result. It is common to supply a different data template.
Occasionally it is necessary to use a different model with the $final field,
or vice versa. If all three are different, use PM_sim$new() instead.
Method save()
Save the current PM_result object to an .Rdata file.
Arguments
runThe run output folder number to save the revised result. If missing, will save in the current working directory. For example, if folder "1" is in your current working directory, specify
run = 1to save the result to the "outputs" subfolder of the "1" folder.fileCustom file name. Default is "PMout.Rdata". If
runis not specified,fileshould be the full path and filename.
Details
This is useful if you have updated the result in some way, for example you
have run the $validate() method on the PM_result object, which returns
an internal simulation based validation as a new valid field. To save this
validation, use this $save method. Note that unless a file name is provided,
the changes will overwrite the
previous run results, although unchanged items will be preserved. This is the
usual workflow. However, a custom file name may be useful to share the run
results with someone.
The saved object is an .Rdata file. When loaded, it should be assigned to an R
object, e.g. run2 <- PM_result$new("filename"). An equivalent statement would
be run2 <- PM_load(file = "filename").
Method validate()
Validate the result by internal simulation methods.
Arguments
...Arguments passed to PM_valid.
Method step()
Conduct stepwise linear regression of Bayesian posterior parameter values and covariates.
Arguments
...Arguments passed to PM_step.
Method opt()
Calculate optimal sampling times.
Method to compute optimal sampling times.
Arguments
...Parameters to pass to PM_opt.
Details
See PM_opt for details.
Method load()
Deprecated method to load prior results saved with the $save method.
Replaced by PM_load.
Method continue()
Continue fitting the model to the data using the final population points from the prior run as the prior for the new run.