Reorder generating sequence of the given decomposable model such that the RIP (running intersection property is kept). The first variable in the root parameter appears in the first distribution of the model generating sequence. The ordering of the variables given in the root will be followed as far as possible.

reorderRIP(model, root = NULL)

Arguments

model

Compositional model

root

A vector of variables. The first variable in the perfect ordering will be the first variable on 'root'. The ordering of the variables given in 'root' will be followed as far as possible.

Value

Decomposable Compositional model with root variable in the first distribution

Examples

data(m) mDecomposable <- toDecomposable(m) getVariables(mDecomposable)
#> [[1]] #> [1] "T" "R" "W" #> #> [[2]] #> [1] "T" "R" "N" #> #> [[3]] #> [1] "U" "R" #> #> [[4]] #> [1] "U" "B" #> #> [[5]] #> [1] "N" "D" #>