proposal.pb {BMAmevt} | R Documentation |
PB model: proposal distribution
Description
Density of the proposal distribution q(cur.par,prop.par)
and random generator for MCMC algorithm in the PB model.
Usage
proposal.pb(type = c("r", "d"), cur.par, prop.par, MCpar, log = TRUE)
Arguments
type |
One of the character strings |
cur.par |
Current state of the chain |
prop.par |
Candidate parameter |
MCpar |
A list made of a single element: MCMC parameter for the standard deviation of the log-normal proposition, on the log scale. See |
log |
Logical. Only used when |
Details
The components prop.par[i]
of the proposal parameter are generated independently, from the lognormal distribution:
prop.par = rlnorm(length(cur.par), meanlog=log(cur.par),
sdlog=rep(MCpar$sdlog,length(cur.par)))
Value
Either the (log-)density of the proposal prop.par
, given cur.par
(if type == "d"
), or a proposal parameter (a vector), if type =="r"
.
Examples
## Not run: proposal.pb(type = "r",
cur.par = rep(1,4), MCpar=get("pb.MCpar"))
## End(Not run)
## Not run: proposal.pb(type = "d", cur.par = rep(1,4),
prop.par=rep(1.5,4), MCpar=get("pb.MCpar"))
## End(Not run)