View source: R/4-model-selection.R
stages_hclust | R Documentation |
Build a stage event tree with k
stages for each variable by
clustering stage probabilities with hierarchical clustering.
stages_hclust( object, distance = "totvar", k = length(object$tree[[1]]), method = "complete", ignore = object$name_unobserved, limit = length(object$tree), scope = NULL )
object |
an object of class |
distance |
character, the distance measure to be used, either
a possible |
k |
integer or (named) vector: number of clusters, that is stages per variable. Values will be recycled if needed. |
method |
the agglomeration method to be used in |
ignore |
vector of stages which will be ignored and left untouched,
by default the name of the unobserved stages stored in
|
limit |
the maximum number of variables to consider. |
scope |
names of the variables to consider. |
hclust_sevt
performs hierarchical clustering
of the initial stage probabilities in object
and it aggregates them into the specified number
of stages (k
).
A different number of stages for the different variables
in the model can be specified by supplying a (named) vector
via the argument k
.
A staged event tree object.
data("Titanic") model <- stages_hclust(full(Titanic, join_unobserved = TRUE, lambda = 1), k = 2) summary(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.