mh: Metropolis-Hastings MCMC sampling

Description Usage Arguments Author(s)

View source: R/MetropHastings.R

Description

Simple protocol for a MCMC sampling algorithm. Given a set of priors, and a likelihood function, the algorithm samples new values for N parameters from a standard normal with a jump variance that is automatically adjusted. The algoritm accepts new proposal proportional to a random fraction.

Usage

1
mh(dat, start, LL, priors, N, giveup = 100)

Arguments

dat

dataset to be based to the likelihood function

start

a vector of starting values

LL

a likelihood function that accepts the parameters and data

priors

functions that give the prior probability for the parameter

N

total number of sampling rounds (one rounds goes through all parameters once).

giveup

after how many rounds of no new accepted values does the algorithm give up and assume convergence?

Author(s)

Marco D. Visser


MarcoDVisser/MCMCR documentation built on May 7, 2019, 2:49 p.m.