dbnR0.8.0 package

Dynamic Bayesian Network Learning and Inference

acc_successions

Returns a vector with the number of consecutive nodes in each level

add_attr_to_fit

Adds the mu vector and sigma matrix as attributes to the bn.fit or dbn...

AIC.dbn.fit

Calculate the AIC of a dynamic Bayesian network

AIC.dbn

Calculate the AIC of a dynamic Bayesian network

all.equal.dbn.fit

Check if two fitted networks are equal to each other

all.equal.dbn

Check if two network structures are equal to each other

approx_prediction_step

Performs approximate inference in a time slice of the dbn

approximate_inference

Performs approximate inference forecasting with the GDBN over a datase...

as_named_vector

Converts a single row data.table into a named vector

as.character.dbn

Convert a network structure into a model string

BIC.dbn.fit

Calculate the BIC of a dynamic Bayesian network

BIC.dbn

Calculate the BIC of a dynamic Bayesian network

bn_translate_exp

Experimental function that translates a natPosition vector into a DBN ...

calc_mu_cpp

Calculate the mu vector of means of a Gaussian linear network. This is...

calc_mu

Calculate the mu vector from a fitted BN or DBN

calc_sigma_cpp

Calculate the sigma covariance matrix of a Gaussian linear network. Th...

calc_sigma

Calculate the sigma covariance matrix from a fitted BN or DBN

cash-set-.dbn.fit

Replacement function for parameters inside DBNs

Causlist

R6 class that defines causal lists in the PSO

check_time0_formatted

Checks if the vector of names are time formatted to t_0

cl_to_arc_matrix_cpp

Create a matrix with the arcs defined in a causlist object

coef.dbn.fit

Extracts the coefficients of a DBN

create_blacklist

Creates the blacklist of arcs from a folded data.table

create_causlist_cpp

Create a causal list from a DBN. This is the C++ backend of the functi...

create_natcauslist_cpp

Create a natural causal list from a DBN. This is the C++ backend of th...

crop_names_cpp

If the names of the nodes have "_t_0" appended at the end, remove it

cte_times_vel_cpp

Multiply a Velocity by a constant real number

degree.bn.fit

Calculates the degree of a list of nodes

degree.bn

Calculates the degree of a list of nodes

degree.dbn.fit

Calculates the degree of a list of nodes

degree.dbn

Calculates the degree of a list of nodes

degree

Calculates the degree of a list of nodes

dmmhc

Learns the structure of a markovian n DBN model from data

dynamic_ordering

Gets the ordering of a single time slice in a DBN

exact_inference_backwards

Performs exact inference smoothing with the GDBN over a dataset

exact_inference

Performs exact inference forecasting with the GDBN over a dataset

exact_prediction_step

Performs exact inference in a time slice of the dbn

expand_time_nodes

Extends the names of the nodes in t_0 to t_(max-1)

filter_same_cycle

Filter the instances in a data.table with different ids in each row

filtered_fold_dt

Fold a dataset avoiding overlapping of different time series

fit_dbn_params

Fits a markovian n DBN model

fitted.dbn.fit

Extracts the fitted values of a DBN

fold_dt_rec

Widens the dataset to take into account the t previous time slices

fold_dt

Widens the dataset to take into account the t previous time slices

forecast_ts

Performs forecasting with the GDBN over a dataset

generate_random_network_exp

Generate a random DBN and a sampled dataset

init_cl_cpp

Initialize the nodes vector

init_list_cpp

Initialize the particles

initialize_cl_cpp

Create a causality list and initialize it

learn_dbn_struc

Learns the structure of a markovian n DBN model from data

logLik.dbn.fit

Calculate the log-likelihood of a dynamic Bayesian network

logLik.dbn

Calculate the log-likelihood of a dynamic Bayesian network

mean.dbn.fit

Average the parameters of multiple dbn.fit objects with identical stru...

merge_nets

Merges and replicates the arcs in the static BN into all the time-slic...

mvn_inference

Performs inference over a multivariate normal distribution

nat_cl_to_arc_matrix_cpp

Create a matrix with the arcs defined in a causlist object

nat_cte_times_vel_cpp

Multiply a Velocity by a constant real number

nat_pos_minus_pos_cpp

Subtracts two natPositions to obtain the natVelocity that transforms p...

nat_pos_plus_vel_cpp

Add a velocity to a position

nat_vel_plus_vel_cpp

Adds two natVelocities

natCauslist

R6 class that defines causal lists in the PSO

natParticle

R6 class that defines a Particle in the PSO algorithm

natPosition

R6 class that defines DBNs as vectors of natural numbers

natPsoCtrl

R6 class that defines the PSO controller

natPsoho

Learn a DBN structure with a PSO approach

natVelocity

R6 class that defines velocities in the PSO

node_levels

Defines a level for every node in the net

nodes_gen_exp

Generates the names of the nodes in t_0 and in all the network

nodes-set-.bn.fit

Relabel the names of the nodes of a BN or a DBN

nodes-set-.bn

Relabel the names of the nodes of a BN or a DBN

nodes-set-.dbn.fit

Relabel the names of the nodes of a BN or a DBN

nodes-set-.dbn

Relabel the names of the nodes of a BN or a DBN

nodes-set

Relabel the names of the nodes of a BN or a DBN

nodes.bn.fit

Returns a list with the names of the nodes of a BN or a DBN

nodes.bn

Returns a list with the names of the nodes of a BN or a DBN

nodes.dbn.fit

Returns a list with the names of the nodes of a BN or a DBN

nodes.dbn

Returns a list with the names of the nodes of a BN or a DBN

nodes

Returns a list with the names of the nodes of a BN or a DBN

one_hot_cpp

One-hot encoder for natural numbers without the 0

one_hot

One hot encoder for natural numbers without the 0.

ordering_gen_exp

Generates the names of n variables.

Particle

R6 class that defines a Particle in the PSO algorithm

plot_dynamic_network

Plots a dynamic Bayesian network in a hierarchical way

plot_static_network

Plots a Bayesian network in a hierarchical way

plot.dbn.fit

Plots a fitted dynamic Bayesian network

plot.dbn

Plots a dynamic Bayesian network

pos_minus_pos_cpp

Subtracts two Positions to obtain the Velocity that transforms one int...

pos_plus_vel_cpp

Add a velocity to a position

Position

R6 class that defines DBNs as causality lists

predict_bn

Performs inference over a fitted GBN

predict_dt

Performs inference over a test dataset with a GBN

predict.dbn.fit

Performs inference in every row of a dataset with a DBN

print.dbn.fit

Print method for "dbn.fit" objects

print.dbn

Print method for "dbn" objects

PsoCtrl

R6 class that defines the PSO controller

psoho

Learn a DBN structure with a PSO approach

randomize_vl_cpp

Randomize a velocity with the given probabilities

rbn.dbn.fit

Simulates random samples from a fitted DBN

recount_arcs_exp

Experimental function that recounts the number of arcs in the position

reduce_freq

Reduce the frequency of the time series data in a data.table

rename_nodes_cpp

Return a list of nodes with the time slice appended up to the desired ...

residuals.dbn.fit

Returns the residuals from fitting a DBN

score.bn

Computes the score of a BN or a DBN

score.dbn

Computes the score of a BN or a DBN

score

Computes the score of a BN or a DBN

shift_values

Move the window of values backwards in a folded dataset row

sigma.dbn.fit

Returns the standard deviation of the residuals from fitting a DBN

smooth_ts

Performs smoothing with the GDBN over a dataset

sub-subset-.dbn.fit

Replacement function for parameters inside DBNs

time_rename

Renames the columns in a data.table so that they end in '_t_0'

trunc_geom

Geometric distribution sampler truncated to a maximum

vel_plus_vel_cpp

Add two Velocities

Velocity

R6 class that defines velocities affecting causality lists in the PSO

Learning and inference over dynamic Bayesian networks of arbitrary Markovian order. Extends some of the functionality offered by the 'bnlearn' package to learn the networks from data and perform exact inference. It offers three structure learning algorithms for dynamic Bayesian networks: Trabelsi G. (2013) <doi:10.1007/978-3-642-41398-8_34>, Santos F.P. and Maciel C.D. (2014) <doi:10.1109/BRC.2014.6880957>, Quesada D., Bielza C. and LarraƱaga P. (2021) <doi:10.1007/978-3-030-86271-8_14>. It also offers the possibility to perform forecasts of arbitrary length. A tool for visualizing the structure of the net is also provided via the 'visNetwork' package. Further detailed information and examples can be found in our Journal of Statistical Software paper Quesada D., LarraƱaga P. and Bielza C. (2025) <doi:10.18637/jss.v115.i06>.