stages_bhcr {stagedtrees} | R Documentation |
Backward random hill-climbing
Description
Randomly try to join stages. This is a pretty-useless function, used for comparisons.
Usage
stages_bhcr(
object,
score = function(x) {
return(-BIC(x))
},
max_iter = 100,
trace = 0
)
Arguments
object |
an object of class |
score |
the score function to be maximized. |
max_iter |
the maximum number of iteration. |
trace |
if >0 increasingly amount of info
is printed (via |
Details
At each iteration a variable and
two of its stages are randomly selected.
If joining the stages increases the score, the model is
updated. The procedure is repeated until the
number of iterations reaches max_iter
.
Value
an object of class sevt
.
Examples
DD <- generate_xor_dataset(p = 4, n = 100)
model <- stages_bhcr(full(DD), trace = 2)
summary(model)
[Package stagedtrees version 2.3.0 Index]