Learn R Programming

saturnin (version 1.1.1)

lweights_multinomial: Computation of the log-weight matrix in a multinomial setting.

Description

The function computes the log-weights of all edges in a multinomial setting. The result should be used in edge.prob with argument log set to TRUE. Prior counts can be generated using the function prior_unif_dirichlet. Computation can be parallelized by setting nbcores to more than 2. Parallelization relies on parallel.

Usage

lweights_multinomial(data, prior = defaut.prior, nbcores = 1)

Arguments

data
Matrix containing discrete data.
prior
Prior to be used for the Dirichlet distribution.
nbcores
Number of cores to be used in parallelized computation.

Value

W
log-weight matrix.

References

This package implements the method described in the paper "Bayesian Inference of Graphical Model Structures Using Trees" by L. Schwaller, S. Robin, M. Stumpf, 2015 (submitted and availavable on arXiv).

Examples

Run this code
library('saturnin')
data(data_multinomial)

W <- lweights_multinomial(data_multinomial)

prob <- edge.prob(W, log = TRUE)

Run the code above in your browser using DataLab