Description Usage Arguments Details Value Author(s)
Build a dynamic discrete Bayesian Network using climate data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | buildDynamicCBN(y, x = NULL, structure.learning.algorithm = "tabu",
structure.learning.args.list = list(),
param.learning.method = "bayes", epochs = 2, forbid.GG = FALSE,
forbid.DD = FALSE, forbid.DtoG = FALSE, force.closest.GD = NULL,
closest.GD.direction = NULL, forbid.GD = FALSE,
structure.learning.steps = 1, fix.intermediate = TRUE,
structure.learning.algorithm2 = NULL,
structure.learning.args.list2 = list(),
structure.learning.algorithm3 = NULL,
structure.learning.args.list3 = list(), keep.dynamic.distance = TRUE,
remove.past.G = TRUE, forbid.backwards = FALSE,
forbid.past.dynamic.GD = TRUE, forbid.dynamic.GG = FALSE,
forbid.past.DD = FALSE, return.intermediate = FALSE,
compile.junction = FALSE, parallelize = FALSE, n.cores = NULL,
cluster.type = "FORK")
|
y |
Either a Stations dataset, as output by |
x |
By default |
structure.learning.algorithm |
Algorithm used to perform structure learning, with name
as text. Supports all the score-based, constraint-based and hybrid bayesian network structure
learning algorithms from |
structure.learning.args.list |
List of arguments passed to structure.learning.algorithm,
in particular distance argument if local learning is used. Note that other arguments, e.g.
|
param.learning.method |
Either "bayes" or "mle", passed to learn the parameters for the
Conditional Probability Tables for the built DAG |
epochs |
Number of epochs to consider for Dynamic Bayesian Networks. |
forbid.GG |
If set to TRUE, arcs between grid or G nodes will be forbidden. |
forbid.DD |
If set to TRUE, arcs between local, i.e. station or D nodes, will be forbidden. |
forbid.DtoG |
If set to TRUE, arcs from D nodes to G nodes will be forbidden. |
force.closest.GD |
Expects a positive integer or |
closest.GD.direction |
Either |
forbid.GD |
If set to TRUE, arcs between G and D nodes will be forbidden. See
|
structure.learning.steps |
It is used to perform structure learning in up to three steps.
Note that
Note that only first two options are valid when |
fix.intermediate |
Set to TRUE to forbid the creation of new arcs in the next steps
for already built DAGs. See |
structure.learning.algorithm2 |
Same as structure.learning.algorithm for the second
step if |
structure.learning.args.list2 |
Same as structure.learning.args.list for the second
step if |
structure.learning.algorithm3 |
Same as structure.learning.algorithm for the third
step if |
structure.learning.args.list3 |
Same as structure.learning.args.list for the third step
if |
keep.dynamic.distance |
When |
remove.past.G |
When |
forbid.backwards |
When |
forbid.past.dynamic.GD |
When |
forbid.dynamic.GG |
When |
forbid.past.DD |
When |
return.intermediate |
Add the intermediate DAGs to the output, as $intermediateDBN1 and
$intermediateDBN2 (if any) if |
compile.junction |
Compile the junction from BN.fit to compute probabilities. Can be set
to FALSE, in which case it can still be computed if needed at the training stage, i.e. through
|
parallelize |
Set to |
n.cores |
When |
cluster.type |
Either "PSOCK" or "FORK". Use the former under Windows systems,
refer to |
buildDynamicCBN() can be used with or without a Grid dataset. A Grid dataset may be specified
by either using parameter x
or using a "pp.forBN" class object (as output from
prepare_predictors.forBN()
) for parameter y
. If none is specified the Bayesian
Network may be used as a naive weather generator.
Structure Learning Algorithms
Use structure.learning.algorithm
to specify the algorithm for the structure (DAG) learning
process.
Currently it DOES NOT support local discovery algorithms, expect malfuncion if used.
List of supported algorithms:
"hc"
, "tabu"
(score-based), "gs"
, "iamb"
, "fast.iamb"
,
"inter.iamb"
(constraint-based),
"mmhc"
, "rsmax2"
(hybrid).
Check their corresponding parameters in bnlearn
, arguments may be
passed to the algorithm through
the parameter structure.learning.args.list. Do not forget to set the distance argument
in structure.learning.args.list
for
local learning.
Two or Three Step Learning
structure.learning.steps
allows to build separate DAGs for each set of nodes.
Note that by employing the three structure.learning.algorithm
,
structure.learning.algorithm2
, structure.learning.algorithm3
arguments and their
corresponding structure.learning.args.list*
counterparts, many different configurations
can be used for the structure learning process, e.g. by using grow-shrink for D nodes with
distance set to 1, then injecting the left nodes using hill-climbing without distance
restriction.
fix.intermediate
, if set to TRUE
, will forbid the creation of new arcs
between nodes that were present in the previous learning step. E.g. if
structure.learning.steps = c("local", "global\-past")
, no new arcs between D nodes
will be created in the second step, as the first DAG will be considered finished.
If set to FALSE
, the previous step DAG will be kept, but the next
learning algorithm could create new arcs between D nodes over the first one.
Forbidding or Forcing Arcs
For non dynamic Bayesian Networks, i.e. when dynamic = FALSE
(default),
forbid.GG
, forbid.DD
, forbid.DtoG
, force.closest.GD
,
forbid.GD
, fix.intermediate
, structure.learning.steps
allow
introducing constraints to the structure learning algorithm. The user might also combine them
with structure.learning.args.list$whitelist
and
structure.learning.args.list$blacklist
. As whitelist
has priority over
blacklist
, i.e. an arc placed in both will always be present in the DAG, they provide
maximum flexibility. Bearing the priority of the whitelist
, force.closest.GD = TRUE
and forbid.GD = TRUE
will, for example, forbid the placement of aditional
arcs beyond those specified as the closest G-D.
When manually specifying a whitelist or blacklist through structure.learning.args.list
,
beware of the naming convention. It overrides the names and marks them as either "D.X" or "G.X",
preditand and predictor nodes, respectivelly. It is best to plot a dummy network using plotDBN()
first.
Aditional details
Parameters output.marginals
and compile.junction
are useful to save time if the
user only intends to visualize the DAG.
An object of type DBN which contains the learnt Bayesian Network.
MN Legasa
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.