drawSamplesByStepCount: Draw samples from a MCMC sampler, by step count.

Description Usage Arguments See Also Examples

View source: R/mcmc.R

Description

Draws a specific number of samples from an MCMC sampler.

Usage

1
2
  drawSamplesByStepCount(sampler, n, burnin, burninleft,
    lengthout, thin, verbose)

Arguments

sampler

A sampler object

n

The number of samples to draw.

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.

lengthout

The length of the final samples object

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?

See Also

draw, drawSamplesByTime

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, n = 100)

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