bwd_seq_gen: Calculate the order in which nodes in the tree should be...

Description Usage Arguments Value See Also Examples

View source: R/bwd_seq_gen.R

Description

Tree is a complex graphical model where we can have multiple parents and multiple children for a node. Hence the order in which the tree should be tranversed becomes significant. Backward algorithm is a dynamic programming problem where to calculate the values at a node, we need the values of the children nodes beforehand, which need to be traversed before this node. This algorithm outputs a possible(not unique) order of the traversal of nodes ensuring that the childrens are traversed first before the parents

Usage

1
bwd_seq_gen(hmm, nlevel = 100)

Arguments

hmm

hmm Object of class List given as output by initHMM

nlevel

No. of levels in the tree, if known. Default is 100

Value

Vector of length "D", where "D" is the number of nodes in the tree

See Also

backward

Examples

1
2
3
4
tmat = matrix(c(0,0,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0),
               5,5, byrow= TRUE ) #for "X" (5 nodes) shaped tree
hmmA = initHMM(c("A","B"),list(c("L","R")), tmat) #one feature with two discrete levels "L" and "R"
bt_sq = bwd_seq_gen(hmmA)

treeHMM documentation built on Dec. 16, 2019, 1:38 a.m.

Related to bwd_seq_gen in treeHMM...