getCPT: Functionalities for causal independence Bayesian networks

Description Usage Arguments Details See Also Examples

View source: R/cibn.r

Description

Obtain variable names, types, description fields, sample spaces, parent sets and CPTs for a causal independence Bayesian network.

Usage

1
2
3
4
5
6

Arguments

x

An object of class cibn.

full

Only for function getParSets: logical value indicating whether the full DAG (i.e., augmented with latent causes and auxiliary nodes implied by the CID) should be considered. If FALSE (the default), the DAG before the CID is considered.

variables

Only for function getCPT: vector of character strings indicating the name of the variables for which the CPT should be computed. If NULL (the default), the CPT of all the variables in the Bayesian network will be computed.

Details

Function getVariables returns the variable names, function getTypes returns the variable types, function getDescription returns the description fields, function getStates returns the sample spaces, function getParSets returns the parent sets, and function getCPT computes one or more CPTs of interest.

See Also

new.cibn.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(bankrisk_code)
bankrisk_bn <- new.cibn(bankrisk_code)
#
getVariables(bankrisk_bn)
getTypes(bankrisk_bn)
getStates(bankrisk_bn)
getDescription(bankrisk_bn)
#
getParSets(bankrisk_bn)
getParSets(bankrisk_bn, full=TRUE)  ## parent sets of the full DAG
#
getCPT(bankrisk_bn)  ## CPTs of all variables
getCPT(bankrisk_bn, variables=c("Portf","Life"))

alessandromagrini/cibn documentation built on Feb. 7, 2022, 10:55 p.m.