This function creates a Gaussian mixture Bayesian network as an object of S3
class gmbn
. A Bayesian network is a probabilistic graphical model that
represents the conditional dependencies and independencies between random
variables by a directed acyclic graph. It encodes a global joint distribution
over the nodes, which decomposes into a product of local conditional
distributions:
gmbn
class can be extended to the
time factor by regarding the nodes as the state of the system at a given time
slice add_nodes
(by passing NULL
as argument gmgm
) and
add_arcs
, which allows to quickly initialize a gmbn
object that can be passed to a learning function.
gmbn(...)
A list of class gmbn
containing the gmm
objects passed
as arguments.
Objects of class gmm
describing the local joint
distributions over the nodes and their parents. Each gmm
object must
be named after the node whose distribution it describes and contain variables
named after this node and its parents. Two types of parents are accepted:
other nodes (whose gmm
objects must be defined) and instantiations of
nodes at previous time slices (if the created gmbn
object is a
temporal Bayesian network). In the second case, the time lag must be added at
the end of the variable name after a period .
(e.g. the instantiation
of a node X
at time slice X.1
).
Davies, S. and Moore, A. (2000). Mix-nets: Factored Mixtures of Gaussians in Bayesian Networks with Mixed Continuous And Discrete Variables. In Proceedings of the 16th Conference on Uncertainty in Artificial Intelligence, pages 168--175, Stanford, CA, USA.
Hulst, J. (2006). Modeling physiological processes with dynamic Bayesian networks. Master's thesis, Delft University of Technology.
gmdbn
, gmm
data(data_body)
gmbn_1 <- gmbn(
AGE = split_comp(add_var(NULL, data_body[, "AGE"]), n_sub = 3),
FAT = split_comp(add_var(NULL,
data_body[, c("FAT", "GENDER", "HEIGHT", "WEIGHT")]),
n_sub = 2),
GENDER = split_comp(add_var(NULL, data_body[, "GENDER"]), n_sub = 2),
GLYCO = split_comp(add_var(NULL, data_body[, c("GLYCO", "AGE", "WAIST")]),
n_sub = 2),
HEIGHT = split_comp(add_var(NULL, data_body[, c("HEIGHT", "GENDER")])),
WAIST = split_comp(add_var(NULL,
data_body[, c("WAIST", "AGE", "FAT", "HEIGHT",
"WEIGHT")]),
n_sub = 3),
WEIGHT = split_comp(add_var(NULL, data_body[, c("WEIGHT", "HEIGHT")]),
n_sub = 2)
)
library(dplyr)
data(data_air)
data <- data_air %>%
group_by(DATE) %>%
mutate(NO2.1 = lag(NO2), O3.1 = lag(O3), TEMP.1 = lag(TEMP),
WIND.1 = lag(WIND)) %>%
ungroup()
gmbn_2 <- gmbn(
NO2 = split_comp(add_var(NULL, data[, c("NO2", "NO2.1", "WIND")]), n_sub = 3),
O3 = split_comp(add_var(NULL,
data[, c("O3", "NO2", "NO2.1", "O3.1", "TEMP",
"TEMP.1")]),
n_sub = 3),
TEMP = split_comp(add_var(NULL, data[, c("TEMP", "TEMP.1")]), n_sub = 3),
WIND = split_comp(add_var(NULL, data[, c("WIND", "WIND.1")]), n_sub = 3)
)
Run the code above in your browser using DataLab