A helper function to evaluate the negative two log-likelihood (-2LL) of leaf (terminal) nodes for a
dataset. When given a semtree
and a unique dataset, the model
estimates -2LL for the tree parameters and data subsets that fit the tree
branching criteria.
evaluateTree(
tree,
test_set,
data_type = "raw",
leaf_ids = NULL,
loglik = c("default", "model", "mvn")
)
A list with two elements:
Combined -2LL for leaf node models of the tree.
Number of leaf nodes used for the deviance calculations.
A fitted semtree
object
Dataset to fit to a fitted semtree
object
type of data ("raw", "cov", "cor")
Identifies which nodes are leaf nodes. Default is NULL, which checks model for leaf nodes and fills this information in automatically.
Algorithm to compute log likelihood. The default is 'model' and refers to a model-based computation. This is preferable because it is more general. As an alternative, 'mvn' computes the log likelihood based on the multivariate normal density and the model-implied mean and covariance matrix.
Andreas M. Brandmaier, John J. Prindle
Brandmaier, A.M., Oertzen, T. v., McArdle, J.J., & Lindenberger, U. (2013). Structural equation model trees. Psychological Methods, 18(1), 71-86.
evaluateDataLikelihood
, semtree
,
semforest