findConditional: Find fitted conditional MoTBFs

View source: R/Inference.R

findConditionalR Documentation

Find fitted conditional MoTBFs

Description

This function returns the conditional probability function of a node given an MoTBF-bayesian network and the value of its parents.

Usage

findConditional(node, bn, evi = NULL)

Arguments

node

A character string, representing the tardet variable.

bn

A list of lists obtained from MoTBFs_Learning, containing the conditional functions.

evi

A data.frame of dimension '1xn' that contains the values of the 'n' parents of the target node. This argument can be NULL if "node" is a root node.

Value

A list containing the conditional distribution of the target variable.

Examples


## Dataset
  data("ecoli", package = "MoTBFs")
  data <- ecoli[,-c(1,9)]

## Get directed acyclic graph
  dag <- LearningHC(data)
  
## Learn bayesian network
  bn <- MoTBFs_Learning(dag, data = data, numIntervals = 4, POTENTIAL_TYPE = "MTE")
  
## Specify the evidence set and node of interest
  evi <- data.frame(lip = "0.48", alm1 = 0.55, gvh = 1, stringsAsFactors=FALSE)
  node = "alm2"
  
## Get the conditional distribution
  findConditional(node, bn, evi)


MoTBFs documentation built on April 18, 2022, 5:06 p.m.