50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

stagedtrees (version 2.3.0)

sevt_simplify: Simplify a staged tree model

Description

Function to simplify a staged tree model.

Usage

sevt_simplify(object, fit = TRUE)

Value

an object of class sevt

representing the simplified model. The returned model will be fitted if the input model was.

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.

Examples

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

Run the code above in your browser using DataLab