copy | R Documentation |
PMXStanModel
objectMakes a copy of an existing PMXStanModel
object into a new path.
copy(model, newpath = NULL, compile = FALSE)
model |
a |
newpath |
a string for user to specify the path to store the new model object. If not provided, the new path will be named by adding a suffix "_copy" to the path of the model being copied. |
compile |
a logical variable indicating whether to compile the Stan code in the new |
The copy()
function for a PMXStanModel
object aims to provide a convenient way for the
following scenarios:
- Fitting the same model to different datasets. With each copy of the model, a new input dataset
can be used for generating samples, and each will result in a PMXStanFit
objects. These results
can then be compared and summarized.
- An exploratory, stage-wise modeling exercise, commonly used when current knowledge is not sufficient to choose among options through the model building process. One can start from a copy of the same "parent" version of the model, make specific changes one at a time, and later make a choice based on certain criteria to compare different fittings.
A replicated version of the specified existing PMXStanModel
object.
Yuan Xiong and Wenping Wang
PMXStanModel
for the creation of a new PMXStanModel
object.
## Not run: m1 <- PMXStanModel(path = tempfile("pk_m1")) m2 <- copy(m1, newpath = "pk_m2", compile = TRUE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.