Learn R Programming

gRapfa (version 1.0)

MergeSelect: Selection of nodes to merged at a level

Description

At a given level of an APFA object, the function performs a greedy search of node pairs to be merged.

Usage

MergeSelect(G, NS = NULL, this.level, crit = "BIC", verbose = FALSE)

Arguments

G
an APFA igraph object
NS
a node by symbol array. Supplying this instead of G will speed computations.
this.level
The level in which nodes are searched to be merged.
crit
The criterion for the model selection, either AIC or BIC.
verbose
If verbose is TRUE, then the all the information on the merge selection of nodes at each level are printed in the output.

Value

Returns the list of G: resulting APFA and ns: node-symbol array.

Details

The function performs greedy selection at the given level. That is to say, the delta ICs for all nodes pairs at the given level are computed, the pair leading to the greatest reduction are merged, the delta ICs are recomputed as necessary, and the process continues until no further reduction in IC can be made.

See Also

dIC, MergeNodes

Examples

Run this code
data(Wheeze)
G <- st(Wheeze)
G <- contract.last.level(G)
G1 <- MergeSelect(G, this.level=3)
G <- G1$G
G$layout <- getXY(G)
plot(G)

Run the code above in your browser using DataLab