This function returns an object of class scoreparameters containing the data and parameters needed for calculation of the BDe/BGe score, or a user defined score.
scoreparameters(
scoretype = c("bge", "bde", "bdecat"),
data,
bgepar = list(am = 1, aw = NULL),
bdepar = list(chi = 0.5, edgepf = 2),
bdecatpar = list(chi = 0.5, edgepf = 2),
dbnpar = list(samestruct = TRUE, slices = 2),
usrpar = list(pctesttype = c("bge", "bde", "bdecat")),
DBN = FALSE,
MDAG = FALSE,
weightvector = NULL,
bgnodes = NULL,
edgepmat = NULL,
nodeslabels = NULL,
multwv = NULL
)the score to be used to assess the DAG structure: "bge" for Gaussian data, "bde" for binary data, "bdecat" for categorical data, "dbn" for dynamic Bayesian networks, "usr" for a user defined score
the data matrix with n columns (the number of variables) and a number of rows equal to the number of observations
a list which contains parameters for BGe score:
am (optional) a positive numerical value, 1 by default
aw (optional) a positive numerical value should be more than n+1, n+am+1 by default
a list which contains parameters for BDe score for binary data:
chi (optional) a positive number of prior pseudo counts used by the BDe score, 0.5 by default
edgepf (optional) a positive numerical value providing the edge penalization factor to be combined with the BDe score, 2 by default
a list which contains parameters for BDe score for categorical data:
chi (optional) a positive number of prior pseudo counts used by the BDe score, 0.5 by default
edgepf (optional) a positive numerical value providing the edge penalization factor to be combined with the BDe score, 2 by default
which type of score to use for the slices
samestruct logical, when TRUE the structure of the first time slice is assumed to be the same as internal structure of all other time slices
slices integer representing the number of time slices in a DBN
a list which contains parameters for the user defined score
pctesttype (optional) conditional independence test ("bde","bge","bdecat","usrCItest")
suffStat (optional) a list containing sufficient statistics for the CI test
otherpars (optional) a list containing other parameters needed for score evaluation
logical, when TRUE the score is initialized for a dynamic Baysian network; FALSE by default
logical, when TRUE the score is initialized for a multiple DAG models; FALSE by default
(optional) a numerical vector of positive values representing the weight of each observation; should be NULL(default) for non-weighted data
(optional) a numerical vector which contains numbers of columns in the data defining background nodes, background nodes are nodes which have no parents but can be parents of other nodes in the network; in case of DBNs bgnodes represent static variables which do not change over time
(optional) a matrix of positive numerical values providing the per edge penalization factor to be added to the score, NULL by default
(optional) a vector of characters which denote the names of nodes in the Bayesian network; by default column names of the data will be taken
list(optional) of weightvectors for MDAG model
an object of class scoreparameters, which includes all necessary information for calculating the BDe/BGe score
Geiger D and Heckerman D (2002). Parameter priors for directed acyclic graphical models and the characterization of several probability distributions. The Annals of Statistics 30, 1412-1440.
Kuipers J, Moffa G and Heckerman D (2014). Addendum on the scoring of Gaussian acyclic graphical models. The Annals of Statistics 42, 1689-1691.
Heckerman D and Geiger D (1995). Learning Bayesian networks: A unification for discrete and Gaussian domains. In Eleventh Conference on Uncertainty in Artificial Intelligence, pages 274-284.
Scutari M (2016). An Empirical-Bayes Score for Discrete Bayesian Networks. Journal of Machine Learning Research 52, 438-448
# NOT RUN {
myDAG<-pcalg::randomDAG(20, prob=0.15, lB = 0.4, uB = 2)
myData<-pcalg::rmvDAG(200, myDAG)
myScore<-scoreparameters("bge", myData)
# }
Run the code above in your browser using DataLab