proposal.pb: PB model: proposal distribution

View source: R/proposal.pb.r

proposal.pbR 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 "r", "d"

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 pb.MCpar for the default value

log

Logical. Only used when type =="d". Should the result be returned on the log-scale ?

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)

BMAmevt documentation built on April 21, 2023, 9:07 a.m.