sample_sim: Sample model parameters for a simulation

View source: R/sample_sim.r

sample_simR Documentation

Sample model parameters for a simulation

Description

This function samples parameters for a simulation. It wraps around the sample_par function on the background

Usage

sample_sim(nrepl = 2, nsub = 3, type = "noIIV", ...)

Arguments

nrepl

Number of replicates for the simulation

nsub

Number of subjects for the simulation

type

character with the type of simulation to perform (see details)

...

Additional arguments passed to sample_par mainly for passing information for ext and cov files

Details

This function is a high level function wrapper for the sample_par function specified for different types of simulations that might occur. Currently the following situations can be sampled:

  • noIIV: Sample without uncertainty and without IIV

  • sameIIV: Sample without uncertainty and with the same IIV values within subjects

  • varIIV: Sample without uncertainty and with different IIV values within subjects

  • unc_noIIV: Sample with uncertainty and without IIV

  • unc_sameIIV: Sample with uncertainty and and with the same IIV values within subjects

  • unc_varIIV: Sample with uncertainty and with different IIV values within subjects

In all the cases above where uncertainty is sampled, this is done only for THETA values.

Value

a dataframe with sampled values

Author(s)

Richard Hooijmaijers

Examples


ext <- system.file("example_models","PK.1CMT.ORAL.COV.ext", package = "amp.sim")
cov <- system.file("example_models","PK.1CMT.ORAL.COV.cov", package = "amp.sim")
sample_sim(nrepl=2,nsub=3,type="unc_varIIV", ext=ext,cov=cov)
sample_sim(nrepl=2,nsub=3,type="sameIIV", ext=ext)


amp.sim documentation built on May 7, 2026, 5:08 p.m.