Description Usage Arguments Details References See Also Examples
Create a causal independence Bayesian network based on prior knowledge on the DAG and on CID parameters.
1 |
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 |
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
.
A. Magrini (2021). Efficient decomposition of Bayesian networks with non-graded variables. To be appeared on International Journal of Statistics and Probability, 10(2).
query.cibn; sample.cibn.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.