Evaluates a JAGS formula on a posterior distribution obtained from a fitted model.

JAGS_evaluate_formula(fit, formula, parameter, data, prior_list)

Arguments

fit

model fitted with either runjags posterior samples obtained with rjags-package

formula

formula specifying the right hand side of the assignment (the left hand side is ignored). If the formula has a "log(intercept)" attribute set to TRUE, the intercept values will be log-transformed before computing the linear predictor.

parameter

name of the parameter created with the formula

data

data.frame containing predictors included in the formula

prior_list

named list of prior distribution of parameters specified within the formula

Value

JAGS_evaluate_formula returns a matrix of the evaluated posterior samples on the supplied data.