sample_parameters_from_covariance_matrix function

sample_parameters_from_covariance_matrix

sample_parameters_from_covariance_matrix

Sample parameter vectors using the covariance matrix

If parameters is not provided all estimated parameters will be used

sample_parameters_from_covariance_matrix( model, parameter_estimates, covariance_matrix, force_posdef_samples = NULL, force_posdef_covmatrix = FALSE, n = 1, seed = 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
  • seed: (numeric (optional)) Random number generator

Returns

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

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, seed=rng) ## End(Not run)

See Also

sample_parameters_uniformly : Sample parameter vectors using uniform distribution

sample_individual_estimates : Sample individual estiates given their covariance

  • Maintainer: Rikard Nordgren
  • License: LGPL (>= 3)
  • Last published: 2024-12-04