new.cibn: Create a causal independence Bayesian network

Description Usage Arguments Details References See Also Examples

View source: R/cibn.r

Description

Create a causal independence Bayesian network based on prior knowledge on the DAG and on CID parameters.

Usage

1
new.cibn(model.code = NULL, path = NULL, maximal = TRUE)

Arguments

model.code

The model code. See details below.

path

The path to the model code in text format. See details below.

maximal

Logical value indicating whether the maximal CID should be applied. Default is TRUE.

Details

For each variable, one command variable and one command model must be specified. Further details will be added soon, see the examples below.

The name of a variable must begin with a capital letter and cannot include special characters excepting '_'. The name of a state cannot include special characters excepting '_', and cannot begin with 'LAMBDA' or 'AUX'.

S3 methods print, summary and plot are available for class cibn.

References

A. Magrini (2021). Efficient decomposition of Bayesian networks with non-graded variables. To be appeared on International Journal of Statistics and Probability, 10(2).

See Also

query.cibn; sample.cibn.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
## A simple Bayesian network to infer risk attitude of bank customers
#
#   Variables:
#    - 'Age': age in years, double-graded variable
#        with sample space: (18_30, 31_50, 51_);
#    - 'Edu': education level, double-graded variable
#        with sample space: (primary_or_less, secondary, tertiary);
#    - 'Marital': marital status, graded variable
#        with sample space: (single, convivent);
#    - 'Parent': parentship, graded variable
#        with sample space: (no, yes);
#    - 'Risk': risk attitude, double-graded variable
#        with sample space: (low, normal, high);
#    - 'Portf': type of portfolio, double-graded variable
#        with sample space: (money_market, mixed, stock_market);
#    - 'Life': life insurance, multi-valued nominal variable
#        with sample space: (long_term, short_term, none).
#
#   Edges in the DAG:
#    - 'Age' -> 'Marital'
#    - 'Age' -> 'Parent'
#    - 'Age' -> 'Risk'
#    - 'Edu' -> 'Risk'
#    - 'Marital' -> 'Risk'
#    - 'Parent' -> 'Risk'
#    - 'Risk' -> 'Portf'
#    - 'Risk' -> 'Life'
#
#   Causal interactions:
#    - between 'Marital' and 'Parent' in determining 'Risk'
#

# load model code
data(bankrisk_code)

# create the network
bankrisk_bn <- new.cibn(bankrisk_code)
bankrisk_bn <- new.cibn(bankrisk_code, maximal=FALSE)  ## disable maximal CID

# summary
summary(bankrisk_bn)

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