View source: R/core_bayes_estimate.R
| call_log_posterior_m | R Documentation |
This internal function computes the Metropolis acceptance decision for a set of MCMC proposals, using either hierarchical or non-hierarchical posterior evaluation. It returns updated log-posterior and log-likelihood values, as well as a logical vector indicating accepted proposals.
call_log_posterior_m(
proposal_mat,
prev_prms_mat,
prev_pis,
prev_lls,
level,
re_eval,
...
)
proposal_mat |
a numeric matrix of proposed parameter values. Each column corresponds to one chain; rows represent parameters. |
prev_prms_mat |
a numeric matrix of current (previous) parameter values.
Must have the same dimensions as |
prev_pis |
a numeric vector of current log-posterior values for each chain. |
prev_lls |
a numeric vector of current log-likelihood values for each chain. |
level |
a character string specifying the sampling level, either
|
re_eval |
logical. If |
... |
Additional arguments passed to |
This function implements a vectorized Metropolis acceptance step for
multiple MCMC chains simultaneously. The posterior is calculated using
either log_posterior_lower() for subject-level parameters or
log_posterior_hyper() for group-level parameters.
Log-posterior and log-likelihood values are only updated where proposals
were accepted. In cases where proposals yield invalid posteriors (i.e.,
NA), they are automatically rejected.
A list with three elements:
pisA numeric vector of updated log-posterior values.
llsA numeric vector of updated log-likelihood values.
acceptA logical vector of length equal to the number of chains, indicating which proposals were accepted.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.