Sample parameter vectors using uniform sampling
Each parameter value will be randomly sampled from a uniform distribution with the bounds being estimate ± estimate * fraction.
sample_parameters_uniformly(
model,
parameter_estimates,
fraction = 0.1,
force_posdef_samples = NULL,
n = 1,
seed = NULL,
scale = "normal"
)
(data.frame) samples
(Model) Pharmpy model
(array) Parameter estimates for parameters to use
(numeric) Fraction of estimate value to use for distribution bounds
(numeric (optional)) Number of samples to reject before forcing variability parameters to give positive definite covariance matrices.
(numeric) Number of samples
(numeric (optional)) Random number generator or seed
(str) Scale to perform sampling on. Valid options are 'normal' and 'UCP'
sample_parameters_from_covariance_matrix : Sample parameter vectors using the
uncertainty covariance matrix
sample_individual_estimates : Sample individual estiates given their covariance
if (FALSE) {
model <- load_example_model("pheno")
results <- load_example_modelfit_results("pheno")
rng <- create_rng(23)
pe <- results$parameter_estimates
sample_parameters_uniformly(model, pe, n=3, seed=rng)
}
Run the code above in your browser using DataLab