Function to simplify a staged tree model.
sevt_simplify(object, fit = TRUE)
an object of class sevt
representing the simplified model.
The returned model will be fitted if the input model
was.
an object of class sevt
logical, if TRUE
refit the model after simplification.
The simplify
function will produce the corresponding simple
staged tree, that is a staged tree where stages and positions are
equivalent.
To do so the function ceg
is used to compute positions, and
then the stages' vectors are replaced with the positions' vectors.
The model is the re-fitted if the input was a fitted staged tree.
Despite the name, the simplified staged tree has always a number
of stages greater or equal to the initial staged tree, thus it is
a more complex statistical model.
mod <- stages_kmeans(full(Titanic), k = 2)
simpl <- sevt_simplify(mod)
plot(simpl)
Run the code above in your browser using DataLab