drawSamplesByTime: Draw samples from a MCMC sampler, by time.

Description Usage Arguments See Also Examples

View source: R/mcmc.R

Description

Draws samples from an MCMC sampler for a specified number of seconds.

Usage

1
2
  drawSamplesByTime(sampler, time, burnin, burninleft,
    thin, verbose, samplesIncrement = 10000)

Arguments

sampler

A sampler object

time

The number of seconds to spend drawing samples.

burnin

The number of samples to discard from the beginning of the sample (includes previous runs)

burninleft

The number of samples still to be discarded.

thin

The frequency with which samples should be kept. eg for thin = 3, every third sample will be kept.

verbose

A logical. Should a progress bar be displayed?

samplesIncrement

The size by which the samples should be incremented.

See Also

draw, drawSamplesByStepCount

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(310)
x1 <- factor(c(1, 1, 0, 1))
x2 <- factor(c(0, 1, 0, 1))
dat <- data.frame(x1 = x1, x2 = x2)

prior <- function(net) 1
initial <- bn(c(), c())

sampler <- BNSampler(dat, initial, prior)
samples <- draw(sampler, time = 15)

rjbgoudie/structmcmc documentation built on Nov. 3, 2020, 3:41 a.m.