ep.sampler: Extract posterior edge probabiities from a sampler.

Description Usage Arguments Value See Also Examples

View source: R/post-mcmc.R

Description

Computes the edge probabilities implied by the MCMC samples contained in a MCMC sampler function.

Usage

1
2
  ## S3 method for class 'sampler'
 ep(x, start, end, verbose = F, ...)

Arguments

x

An MCMC sampler 'function'

start

...

end

...

verbose

...

...

Further arguments passed to ep.parental.list() for method = "flatten", or ep.table() for method = "tabulate"

Value

A matrix of class 'ep' with entry (i,j) containing the probability of an edge from node i –> j

See Also

ep, ep.bnpostmcmc.list

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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 = 50)

ep(sampler)

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