Reorder MCMC Start Values to Match Prior Specification
Source:R/mcmc_setup.R
reorder_start_values.Rd
Ensures that the rows of a matrix of MCMC start values are ordered consistently with the names in the param_priors
list. This is useful when passing initial values to an MCMC routine that expects a specific parameter order.
Arguments
- start_values
A matrix of initial parameter values for MCMC, where each row corresponds to a parameter and each column to a chain or initialization. The row names should be the parameter names.
- param_priors
A named list of prior specifications (e.g., as used by
mcstate::pmcmc_parameters$new()
), where names correspond to parameter names.
Value
A reordered matrix of start values with the row order matching the order of names in param_priors
. Parameters missing from start_values
are dropped (with a warning optionally).