Learn R Programming

MoTBFs (version 2.0)

goodnessMoTBFBN: BIC of a hybrid BN

Description

Compute the BIC score and the loglikelihood from the fitted MoTBFs functions in a hybrid Bayesian network, i.e., from objects of class motbf.fit.

Usage

logLikelihood.MoTBFBN(object, data)

BiC.MoTBFBN(object, data)

Value

A numeric value giving the log-likelihood of the BN.

Arguments

object

The output of the 'motbf.fit()' function

data

The dataset of class data.frame.

See Also

MoTBFs_Learning

Examples

Run this code

## Dataset Ecoli
require(MoTBFs)
data(ecoli)
data <- ecoli[,-c(1)] ## remove variable sequence

## Directed acyclic graph
dag <- LearningHC(data)

## Learning BN
intervals <- 3
potential <- "MOP"
P1 <- MoTBFs_Learning(graph = dag, data = data, POTENTIAL_TYPE=potential,
numIntervals = intervals, maxParam = 5)
logLikelihood.MoTBFBN(P1, data) ##BIC$LogLikelihood
BIC <- BiC.MoTBFBN(P1, data)
BIC$BIC

## Learning BN
intervals <- 2
potential <- "MTE"
P2 <- MoTBFs_Learning(graph = dag, data = data, POTENTIAL_TYPE=potential,
numIntervals = intervals, maxParam = 10)
logLikelihood.MoTBFBN(P2, data) ##BIC$LogLikelihood
BIC <- BiC.MoTBFBN(P2, data)
BIC$BIC 

Run the code above in your browser using DataLab