Learn R Programming

gRapHD (version 0.2.5)

fit: Log-likelihood, AIC, BIC

Description

Calculates -2*log-likelihood, AIC, and BIC for a triangulated graph (decomposable model).

Usage

fit(model=NULL, edges=NULL, dataset, homog=NULL)

Arguments

model

gRapHD object.

edges

matrix with 2 columns, each row representing one edge, and each column one of the vertices in the edge.

dataset

matrix or data frame (nrow(dataset) observations and ncol(dataset) variables).

homog

only used in the mixed model case. TRUE if the model is homogeneous. The default is NULL, indicating that the attribute homog of the model parameter must be used (or TRUE if only edges is provided).

Value

Vector with: model dimension (no of free parameters), -2*log-likelihood, AIC, and BIC. Note that all parameters are assumed to be estimable in the dimension calculation.

References

Lauritzen, S.L. (1996) Graphical Models, Oxford University Press.

Examples

Run this code
# NOT RUN {
data(dsCont)
m1 <- minForest(dsCont,homog=TRUE,forbEdges=NULL,stat="LR")
fit(edges=m1@edges,dataset=dsCont)
# }

Run the code above in your browser using DataLab