learn.dynamic.network {bnstruct} | R Documentation |
learn a dynamic network (structure and parameters) of a BN from a BNDataset.
Description
Learn a dynamic network (structure and parameters) of a BN from a BNDataset (see the Details
section).
This method is a wrapper for learn.network
to simplify the learning of a dynamic network.
It provides an automated generation of the layering
required to represent the set of time constraints
encoded in a dynamic network. In this function, it is assumed that the dataset contains the observations for each variable
in all the time steps:
V_1^{t_1}, V_2^{t_1}, V_n^{t_1}, V_1^{t_2}, ... , V_n^{t_k}
.
Variables in time step j
can be parents for any variable in time steps k>=j
, but not for variables i<j
.
If a layering is provided for a time step, it is valid in each time step, and not throughout the whole dynamic network;
a global layering can however be provided.
Usage
learn.dynamic.network(x, ...)
## S4 method for signature 'BN'
learn.dynamic.network(
x,
y = NULL,
num.time.steps = num.time.steps(y),
algo = "mmhc",
scoring.func = "BDeu",
initial.network = NULL,
alpha = 0.05,
ess = 1,
bootstrap = FALSE,
layering = c(),
max.fanin = num.variables(y) - 1,
max.fanin.layers = NULL,
max.parents = num.variables(y) - 1,
max.parents.layers = NULL,
layer.struct = NULL,
cont.nodes = c(),
use.imputed.data = FALSE,
use.cpc = TRUE,
mandatory.edges = NULL,
...
)
## S4 method for signature 'BNDataset'
learn.dynamic.network(
x,
num.time.steps = num.time.steps(x),
algo = "mmhc",
scoring.func = "BDeu",
initial.network = NULL,
alpha = 0.05,
ess = 1,
bootstrap = FALSE,
layering = c(),
max.fanin = num.variables(x) - 1,
max.fanin.layers = NULL,
max.parents = num.variables(x) - 1,
max.parents.layers = NULL,
layer.struct = NULL,
cont.nodes = c(),
use.imputed.data = FALSE,
use.cpc = TRUE,
mandatory.edges = NULL,
...
)
Arguments
x |
can be a |
... |
potential further arguments for methods. |
y |
|
num.time.steps |
the number of time steps to be represented in the dynamic BN. |
algo |
the algorithm to use. Currently, one among |
scoring.func |
the scoring function to use. Currently, one among
|
initial.network |
network structure to be used as starting point for structure search.
Can take different values:
a |
alpha |
confidence threshold (only for |
ess |
Equivalent Sample Size value. |
bootstrap |
|
layering |
vector containing the layers each node belongs to. |
max.fanin |
maximum number of parents for each node (only for |
max.fanin.layers |
matrix of available parents in each layer (only for |
max.parents |
maximum number of parents for each node (for |
max.parents.layers |
matrix of available parents in each layer (only for |
layer.struct |
|
cont.nodes |
vector containing the index of continuous variables. |
use.imputed.data |
|
use.cpc |
(when using |
mandatory.edges |
binary matrix, where a |
Details
The other parameters available are the ones of learn.network
, refer to the documentation of that function
for more details. See also the documentation for learn.structure
and learn.params
for more informations.
Value
new BN
object with structure (DAG) and conditional probabilities
as learnt from the given dataset.
See Also
learn.network learn.structure learn.params
Examples
## Not run:
mydataset <- BNDataset("data.file", "header.file")
net <- learn.dynamic.network(mydataset, num.time.steps=2)
## End(Not run)