View source: R/1b-base-model-function.R
sevt_fit | R Documentation |
Estimate transition probabilities in a staged event tree from data. Probabilities are estimated with the relative frequencies plus, eventually, an additive (Laplace) smoothing.
sevt_fit(object, data = NULL, lambda = object$lambda)
object |
an object of class |
data |
data.frame or contingency table with observations of
the variables in |
lambda |
smoothing parameter or pseudocount. |
The data in form of contingency tables and the log-likelihood of the model is stored in the returned staged event tree.
A fitted staged event tree, that is an object of class sevt
with ctables
, prob
and ll
components.
######### model <- sevt(list( X = c("good", "bad"), Y = c("high", "low") )) D <- data.frame( X = c("good", "good", "bad"), Y = c("high", "low", "low") ) model.fit <- sevt_fit(model, data = D, lambda = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.