get.total.iterations: Total Number of Iterations

Description Usage Arguments Value Author(s) See Also Examples

View source: R/get_outputs.R

Description

Function get.total.iterations gives the total number of iterations of MCMCs summed over chains whith burnin being subtracted from each chain. Function get.stored.mcmc.length gives the total length of the MCMCs stored on disk minus those iterations that correspond to burnin. Result of the latter will be different from the former only if the MCMCs were run with value of thin larger than one.

Usage

1
2
3
get.total.iterations(mcmc.list, burnin = 0)

get.stored.mcmc.length(mcmc.list, burnin = 0)

Arguments

mcmc.list

List of bayesTFR.mcmc objects.

burnin

Number of iterations to be subtracted from each chain.

Value

A single number.

Author(s)

Hana Sevcikova

See Also

bayesTFR.mcmc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sim.dir <- file.path(find.package("bayesTFR"), "ex-data", "bayesTFR.output")
mcmc.set <- get.tfr.mcmc(sim.dir=sim.dir)
get.total.iterations(mcmc.set$mcmc.list) # 60=1chain x 60iters
get.total.iterations(mcmc.set$mcmc.list, burnin=20) # 40=1x(60-20)

## Not run: 
sim.dir <- tempfile()
m <- run.tfr.mcmc(iter=10, nr.chains=2, output.dir=sim.dir, thin=5, verbose=TRUE)
get.total.iterations(m$mcmc.list) # 20=2x10
get.stored.mcmc.length(m$mcmc.list) # 6=2x3
unlink(sim.dir, recursive=TRUE)

## End(Not run)

jasonacollins/bayesTFR1 documentation built on May 23, 2019, 7:34 a.m.