stages_bj {stagedtrees} | R Documentation |
Backward joining of stages
Description
Join stages from more complex to simpler models using a distance and a threshold value.
Usage
stages_bj(
object,
distance = "kullback",
thr = 0.1,
scope = NULL,
ignore = object$name_unobserved,
trace = 0
)
Arguments
object |
an object of class |
distance |
character, see details. |
thr |
the threshold for joining stages |
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 in the model stages are joined iteratively.
At each iteration the two stages with minimum distance are selected and
joined if their distance is less than thr
.
Available distances are: manhattan (manhattan
), euclidean (euclidean
),
Renyi divergence (reny
), Kullback-Liebler (kullback
),
total-variation (totvar
), squared Hellinger (hellinger
),
Bhattacharyya (bhatt
), Chan-Darwiche (chandarw
).
See also probdist.
Value
The final staged event tree obtained.
Examples
DD <- generate_xor_dataset(p = 5, n = 1000)
model <- stages_bj(full(DD, lambda = 1), trace = 2)
summary(model)