bnpost: BN Exact Posterior.

Description Usage Arguments See Also Examples

View source: R/post-exact.R

Description

method description

Usage

1
2
  bnpost(bnspace, logScore, data,
    logScoreFUN = logScoreMultDir)

Arguments

bnspace

...

logScore

...

data

...

logScoreFUN

A list of four elements:

offline

A function that computes the logScore of a Bayesian Network

online

A function that incrementally computes the logScore of a Bayesian Network

local

A function that computes the local logScore of a Bayesian Network

prepare

A function that prepares the data, and any further pre-computation required by the logScore functions.

For Multinomial-Dirichlet models, logScoreMultDirFUN returns the appropriate list; for Normal models with Zellner g-priors, logScoreNormalFUN returns the appropriate list.

See Also

bnpostmcmc, top.bnpost, map.bnpost, gp.bnpost, entropy.bnpost, tp.bnpost, eht.bnpost

Examples

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

bnspace <- enumerateBNSpace(2)
lsmd <- logScoreMultDir(bnspace, data = dat, hyperparameters = "bdeu")
post <- bnpost(bnspace = bnspace, logScore = lsmd, data = dat)

gp(post)
ep(post)

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