Learn R Programming

metropolis (version 0.1.8)

as.mcmc.metropolis.samples: Convert glm_metropolis output to mcmc object from package coda

Description

Allows use of useful functions from coda package

Usage

# S3 method for metropolis.samples
as.mcmc(x, ...)

Arguments

x

an object from the function "metropolis"

...

not used

Value

An object of type "mcmc" from the coda package

Details

TBA

Examples

Run this code
# NOT RUN {
library("coda")
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)
res2 = as.mcmc(res)
summary(res2)
# }

Run the code above in your browser using DataLab