View source: R/4-model-selection.R
stages_bj | R Documentation |
Join stages from more complex to simpler models using a distance and a threshold value.
stages_bj( object = NULL, distance = "kullback", thr = 0.1, scope = NULL, ignore = object$name_unobserved, trace = 0 )
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 |
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.
The final staged event tree obtained.
DD <- generate_xor_dataset(n = 5, N = 1000) model <- stages_bj(full(DD, lambda = 1), trace = 2) summary(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.