metropolis: Extract information on Metropolis-Hastings updates.

View source: R/helper-functions.R

metropolisR Documentation

Extract information on Metropolis-Hastings updates.

Description

Given an object of class SummaryResults, extract the standard deviation of the proposal density, the proportion of proposals accepted, and autocorrelation, for Metropolis-Hastings updates. See the documentation for fetchSummary for details.

Usage

metropolis(object)

Arguments

object

An object of class SummaryResults.

Value

If Metropolis-Hastings updates where carried out, a matrix; otherwise NULL.

See Also

fetchSummary

Examples

library(demdata)
deaths <- Counts(round(VADeaths2))
popn <- Counts(VAPopn)
filename <- tempfile()
estimateModel(Model(y ~ Poisson(mean ~ age)),
              y = deaths,
              exposure = popn,
              filename = filename,
              nBurnin = 2,
              nSim = 5,
              nChain = 2)
summary.est <- fetchSummary(filename)
metropolis(summary.est)

StatisticsNZ/demest documentation built on Nov. 2, 2023, 7:56 p.m.