A staged event tree object is a list with components:
tree (required): A named list with one component
for each variable in the model,
a character vector with the names of
the levels for that variable.
The order of the variables in tree
is the
order of the event tree.
stages (required): A named list with one component
for each variable but the first,
a character vector storing the stages for
the situations related to path ending in that
variable.
ctables: A named list with one component
for each variable, the flat contingency table of that variable
given the previous variables.
lambda: The smoothing parameter used to compute probabilities.
name_unobserved: The stage name for unobserved situations.
prob: The conditional probability tables for every
variable and stage. Stored in a named list with
one component for each variable, a list with
one component for each stage.
ll: The log-likelihood of the estimated
model.
If present, logLik.sevt
will
return this value instead of computing the log-likelihood.
The tree structure is never defined explicitly, instead it
is implicitly defined by the list tree
containing the order
of the variables and the names of their levels. This is
sufficient to define a complete symmetric tree where an
internal node at a depth related to a variable v
has a number of children equal to the cardinality of
the levels of v
.
The stages information is instead stored as a list of
vectors, where each vector is indexed as the internal nodes
of the tree at a given depth.
To define a staged tree from data (data frame or table) the
user can call either full
or indep
which both construct the staged tree object, attach the data in
ctables
and compute probabilities. After, one of the
available model selection algorithm can be used, see for example
stages_hc
, stages_bhc
or
stages_hclust
.
If, mainly for development, only the staged tree structure is needed
(without data or probabilities) the basic
sevt
constructor can
be used.