Learn R Programming

metropolis (version 0.1.8)

summary.metropolis.samples: Summarize a probability distribution from a Markov Chain

Description

This function allows you to summarize output from the metropolis function.

Usage

# S3 method for metropolis.samples
summary(object, keepburn = FALSE, ...)

Arguments

object

an object from the function "metropolis"

keepburn

keep the burnin iterations in calculations (if adapt=TRUE, keepburn=TRUE will yield potentially invalid summaries)

...

not used

Value

returns a list with the following fields: nsamples: number of simulated samples sd: standard deviation of parameter distributions se: standard deviation of parameter distribution means ESS_parms: effective sample size of parameter distribution means postmean: posterior means and normal based 95% credible intervals postmedian: posterior medians and percentile based 95% credible intervals postmode: posterior modes and highest posterior density based 95% credible intervals

Details

TBA

Examples

Run this code
# NOT RUN {
dat = data.frame(y = rbinom(100, 1, 0.5), x1=runif(100), x2 = runif(100))
res = metropolis_glm(y ~ x1 + x2, data=dat, family=binomial(), iter=10000, burnin=3000, 
adapt=TRUE, guided=TRUE, block=FALSE)
summary(res)
# }

Run the code above in your browser using DataLab