Skip to contents

Calculates the negative log-likelihood of the prior distributions for model parameters.

Usage

evaluate_priors(parameters, priors)

Arguments

parameters

A named list of parameter values to be passed to MakeADFun. Can be generated using the get_parameters function.

priors

A named list of prior specifications for the parameters. Each element should be a list with elements type, par1, par2, and index. Can be generated using the get_priors function.

Value

A numeric scalar representing the negative sum of log-prior densities across all parameters.

Examples

parameters <- list(par_log_m4 = log(0.167))
priors <- list(
  par_log_m4 = list(type = "normal", par1 = log(0.12), par2 = 0.4, 
                    index = which("par_log_m4" == names(parameters)))
)
evaluate_priors(parameters, priors)
#> [1] 0.3439966