stan2mcmc: Convert a Stanfit object to a MCMC object

View source: R/stan2mcmc.R

stan2mcmcR Documentation

Convert a Stanfit object to a MCMC object

Description

Converts a stanfit object into a mcmc object for easier analysis.

Usage

stan2mcmc(stanFit)

Arguments

stanFit

a stanfit object from the output of either fecr_stan() or fec_stan()

Details

The output can be analyzed as a mcmc object with the functions from the coda package. NOTE: The resulting MCMC object does not contain warm-up samples and is already thinned.

Value

A MCMC object with a list of relevant parameters.

Author(s)

Craig Wang

Examples

data(epgs)

## apply zero-infation model for the paired design 
model <- fecr_stan(epgs$before, epgs$after, rawCounts = FALSE, 
            indEfficacy = FALSE, preCF = 10, 
            paired = TRUE, zeroInflation = TRUE)
samples <- stan2mcmc(model$stan.samples)
summary(samples)
plot(samples)

eggCounts documentation built on Oct. 15, 2023, 1:06 a.m.