fit: Log-likelihood, AIC, BIC

Description Usage Arguments Value Author(s) References Examples

View source: R/functions.r

Description

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

Usage

1
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.

Author(s)

Gabriel Coelho Goncalves de Abreu (abreu_ga@yahoo.com.br)

References

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

Examples

1
2
3
data(dsCont)
m1 <- minForest(dsCont,homog=TRUE,forbEdges=NULL,stat="LR")
fit(edges=m1@edges,dataset=dsCont)

Example output

Loading required package: graph
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, basename, cbind, colMeans, colSums, colnames,
    dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
    intersect, is.unsorted, lapply, lengths, mapply, match, mget,
    order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
    rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
    union, unique, unsplit, which, which.max, which.min


Attaching package: 'gRapHD'

The following object is masked from 'package:graph':

    DFS

Number of parameters    -2*Log-likelihood                  AIC 
              101.00             23924.77             24126.77 
                 BIC 
            24445.83 

gRapHD documentation built on Feb. 9, 2018, 6:05 a.m.

Related to fit in gRapHD...