View source: R/core_bayes_estimate.R
| log_posterior_hyper | R Documentation |
These functions compute conditional log-posterior distributions used in a (hierarchical) MCMC sampler.
log_posterior_hyper(
phi_j_mat,
theta_j_mat,
log_prior_hyper_fun,
log_prior_lower_fun,
temperatures,
suppress_warnings = TRUE
)
log_posterior_lower(
thetas_one_subj_mat,
all_phis_mat,
model_subj,
log_prior_lower_funs,
temperatures,
suppress_warnings = TRUE
)
phi_j_mat |
a numeric matrix of current group-level parameters for one individual-level parameter. It must be 2 x n_chains and provide the mean and standard deviation; in that order. |
theta_j_mat |
a numeric matrix of individual-level parameter values across all individuals and chains for one model parameter. Must be n_chains x n_subj. |
log_prior_hyper_fun |
a function that returns the log-prior density of
the hyperparameters. Must be a single function (not a list of functions) and
it must accept |
log_prior_lower_fun |
a function that returns the log-prior density of
individual parameter values given the mean and standard deviation at the
group-level (as stored in |
temperatures |
a numeric vector of temperature scaling values, one per chain, used when applying tempered inference (e.g., in TIDE). |
suppress_warnings |
logical, if TRUE, warnings created from
|
thetas_one_subj_mat |
a named matrix of lower-level parameters for a single participant. Each row represents one parameter, and each column one chain. |
all_phis_mat |
a named matrix of all current group-level parameters.
Each mean group-level parameter must be named |
model_subj |
a |
log_prior_lower_funs |
a named list of functions, one per parameter
stored in |
log_posterior_hyper() computes the conditional log-posterior for a
group-level hyperparameter matrix phi_j_mat, given
the individual-level parameters across subjects theta_j_mat (for one
type of model parameter).
log_posterior_lower() computes the conditional log-posterior for
an individual participant’s parameter matrix thetas_one_subj_mat, given
prior distributions. In the hierarchical setting, the prior distributions
are conditioned on the group-level parameters.
A list with two elements:
posterior_vals, the total log-posterior values (log-likelihood +
log-prior) per chain.
log_like_vals, the log-likelihood components only, per chain.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.