sampleTriple: Sample the parents of a triple of nodes (Gibbs sampler).

Description Usage Arguments Value See Also

View source: R/mcmc-gibbs.R

Description

Sample from posterior distribution on graph, conditional on all the edges, except for those corresponding to the parents sets of two nodes.

Usage

1
2
3
  sampleTriple(currentNetwork, numberOfNodes, nodesSeq,
    scoresParents, parentsTables, allRows, rowsThatContain,
    logScoreFUN, logScoreParameters, blankBit, bitLengths)

Arguments

currentNetwork

A currentNetwork object

numberOfNodes

The number of nodes in the network. A numeric vector of length 1.

nodesSeq

The vector 1:nNodes(currentNetwork). (Supplied as an argument for possible speed gain)

scoresParents

A list of the form returned by scoreParentsTable()

parentsTables

A list of tables of the form returned by enumerateParentsTable()

allRows

The vector 1:nrow(parentsTables). (Supplied as an argument for possible speed gain)

rowsThatContain

A list of the form created by getRowsThatContain()

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.

logScoreParameters

A list of parameters that are passed to logScoreFUN.

Value

Returns the sampled network. A currentNetwork object.

See Also

BNGibbsSampler, sampleNode


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