stages_bhc {stagedtrees} | R Documentation |
Backward hill-climbing
Description
Greedy search of staged event trees with iterative joining of stages.
Usage
stages_bhc(
object,
score = function(x) {
return(-BIC(x))
},
max_iter = Inf,
scope = NULL,
ignore = object$name_unobserved,
trace = 0
)
Arguments
object |
an object of class |
score |
the score function to be maximized. |
max_iter |
the maximum number of iterations per variable. |
scope |
names of variables that should be considered for the optimization. |
ignore |
vector of stages which will be ignored and left untouched,
by default the name of the unobserved stages stored in
|
trace |
if >0 increasingly amount of info
is printed (via |
Details
For each variable the algorithm tries to join stages and moves to the best model that increases the score. When no increase is possible it moves to the next variable.
Value
The final staged event tree obtained.
Examples
DD <- generate_xor_dataset(p = 4, n = 100)
model <- stages_bhc(full(DD), trace = 2)
summary(model)
[Package stagedtrees version 2.3.0 Index]