graphSigma: Applying Lauritzen's formula on covariance matrix

Description Usage Arguments Value Examples

Description

This function applies the lauritzen's formula to a covariance matrix to take into account a decomposable graph structure. It uses the provided covariance matrix and the provided graph to compute the covariance matrix that perfectly fits the set of conditional independencies encoded by the graph's cliques and seperators.

Usage

1
graphSigma(A, C, S, nS)

Arguments

A

An initial covariance Matrix.

C

A list of numeric vectors which are the graph's maximal cliques.

S

A list of numeric vectors which are the graph's minimal seperators.

nS

A numeric vector which indicates the multiplicity of each minimal seperator. It must have the same length as S.

Value

This function returns a covarianece matrix which takes into account the provided graph structure and the initial covariance matrix.

Examples

1
2
3
4
5
6
7
8
A <- matrix(0,5,5)
diag(A) <- 1:5
diag(A[-1,-5]) <- 1:4
diag(A[-5,-1]) <- 1:4
cliques <- list(c(1,2),c(2,3), c(3,4),c(4,5))
separators <- list(c(2),c(3),c(4))
nS <- c(1,1,1)
Anew <- graphSigma(A, cliques, separators, nS)

km20/gemalgorithm documentation built on May 29, 2019, 2:50 p.m.