MoTBFs (version 1.2)

MoTBFs_Learning: Learning MoTBFs in a Network

Description

Learn mixtures of truncated basis functions in a full hybrid network.

Usage

MoTBFs_Learning(
  graph,
  data,
  numIntervals,
  POTENTIAL_TYPE,
  maxParam = NULL,
  s = NULL,
  priorData = NULL
)

Arguments

graph

A network of the class "bn", "graphNEL" or "network".

data

A datase of class "data.frame"; it can contain continuous and discrete variables.

numIntervals

A "numeric" value indicating the maximum number of intervals in which we want to split the domain of the parent variables.

POTENTIAL_TYPE

A "character" string specifying the posibles potential types, must be one of "MOP" or "MTE".

maxParam

A "numeric" value which indicate the maximum number of coefficients in the function. By default it is NULL; if not, the output is the function which gets the best BIC with at most this number of parameters.

s

A "numeric" coefficient which fixes the confidence of the prior knowledge we are going to introduce. By default it is NULL, only we must modify it if we want to incorporate prior information to the fits.

priorData

Prior dataset with values of the variables we have information apriori about. This dataset must be of "data.frame" class.

Value

A list of lists. Each list contains two elements

Child

A "charater" string which contains the name of the child variable.

functions

A list with three elements: the name of the parents, a "numeric" vector with the limits of the interval and the fitted function in this interval.

Details

If the variable is discrete then it computes the probabilities and the size of each leaf.

See Also

printBN and ecoli

Examples

Run this code
# NOT RUN {
## 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, numIntervals = intervals, POTENTIAL_TYPE=potential,
maxParam = 5)
printBN(P1)

 ## Learning BN
intervals <- 4
potential <- "MTE"
P2 <- MoTBFs_Learning(graph = dag, data = data, numIntervals = intervals, POTENTIAL_TYPE=potential,
maxParam = 15)
printBN(P2)


# }

Run the code above in your browser using DataLab