sevt_simplify {stagedtrees}R Documentation

Simplify a staged tree model

Description

Function to simplify a staged tree model.

Usage

sevt_simplify(object, fit = TRUE)

Arguments

object

an object of class sevt

fit

logical, if TRUE refit the model after simplification.

Details

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.

Value

an object of class sevt representing the simplified model. The returned model will be fitted if the input model was.

Examples

mod <- stages_kmeans(full(Titanic), k = 2)
simpl <- sevt_simplify(mod)
plot(simpl)

[Package stagedtrees version 2.3.0 Index]