sample_parameters_from_covariance_matrix {pharmr}R Documentation

sample_parameters_from_covariance_matrix

Description

Sample parameter vectors using the covariance matrix

If parameters is not provided all estimated parameters will be used

Usage

sample_parameters_from_covariance_matrix(
  model,
  parameter_estimates,
  covariance_matrix,
  force_posdef_samples = NULL,
  force_posdef_covmatrix = FALSE,
  n = 1,
  rng = NULL
)

Arguments

model

(Model) Input model

parameter_estimates

(array) Parameter estimates to use as means in sampling

covariance_matrix

(data.frame) Parameter uncertainty covariance matrix

force_posdef_samples

(numeric (optional)) Set to how many iterations to do before forcing all samples to be positive definite. NULL is default and means never and 0 means always

force_posdef_covmatrix

(logical) Set to TRUE to force the input covariance matrix to be positive definite

n

(numeric) Number of samples

rng

(numeric (optional)) Random number generator

Value

(data.frame) A dataframe with one sample per row

See Also

sample_parameters_uniformly : Sample parameter vectors using uniform distribution

sample_individual_estimates : Sample individual estiates given their covariance

Examples

## Not run: 
model <- load_example_model("pheno")
results <- load_example_modelfit_results("pheno")
rng <- create_rng(23)
cov <- results$covariance_matrix
pe <- results$parameter_estimates
sample_parameters_from_covariance_matrix(model, pe, cov, n=3, rng=rng)

## End(Not run)

[Package pharmr version 0.96.0 Index]