Logarithm of the acceptance probability
lAccept.ratio(
cur.par,
prop.par,
llh.cur,
lprior.cur,
dat,
likelihood,
proposal,
prior,
Hpar,
MCpar
)The log-acceptance probability.
The current parameter in the Markov chain
The candidate parameter
An angular data set, e.g., constructed by
cons.angular.dat: A matrix which rows are the Cartesian coordinates of points on the unit simplex (summing to one).
The likelihood function.
Should be of type
function(x, par, log, vectorial), where log and
vectorial are logical flags indicating respectively if
the result is to be returned on the log-scale, and if the
value is a vector of length nrow(x) or a single number
(the likelihood, or the log-likelihood, for the data set x).
See dpairbeta or dnestlog
for templates.
The proposal function: of type
function(type = c("r","d"),
cur.par, prop.par, MCpar, log)
.
Should
return the (logarithm of) the proposal density for the move
cur.par --> prop.par if type == "d". If
type =="r", proposal must return a candidate
parameter, depending on cur.par, as a vector.
See proposal.pb or proposal.nl
for templates.
The prior distribution: of type
function(type=c("r","d"),
n ,par, Hpar, log, dimData
),
where dimData is the dimension of the sample
space (e.g., for
the two-dimensional simplex (triangle), dimData=3.
Should return either a matrix with n rows containing a
random parameter sample generated under the prior
(if type == "d"), or the density of the
parameter par (the logarithm of the density if
log==TRUE.
See prior.pb and prior.nl for templates.
A list containing Hyper-parameters to be passed to
prior.
A list containing MCMC tuning parameters to be
passed to proposal.
lAccept.ratio is a functional: likelihood,proposal,prior are user defined functions. Should not be called directly, but through the MCMC sampler posteriorMCMC generating the posterior.