scoreparameters {BiDAG} | R Documentation |
Initializing score object
Description
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.
Usage
scoreparameters(
scoretype = c("bge", "bde", "bdecat", "usr"),
data,
bgepar = list(am = 1, aw = NULL, edgepf = 1),
bdepar = list(chi = 0.5, edgepf = 2),
bdecatpar = list(chi = 0.5, edgepf = 2),
dbnpar = list(samestruct = TRUE, slices = 2, b = 0, stationary = TRUE, rowids = NULL,
datalist = NULL, learninit = TRUE),
usrpar = list(pctesttype = c("bge", "bde", "bdecat")),
mixedpar = list(nbin = 0),
MDAG = FALSE,
DBN = FALSE,
weightvector = NULL,
bgnodes = NULL,
edgepmat = NULL,
nodeslabels = NULL
)
## S3 method for class 'scoreparameters'
print(x, ...)
## S3 method for class 'scoreparameters'
summary(object, ...)
Arguments
scoretype |
the score to be used to assess the DAG structure: "bge" for Gaussian data, "bde" for binary data, "bdecat" for categorical data, "usr" for a user defined score; when "usr" score is chosen, one must define a function (which evaluates the log score of a node given its parents) in the following format: usrDAGcorescore(j,parentnodes,n,param), where 'j' is node to be scores, 'parentnodes' are the parents of this node, 'n' number of nodes in the netwrok and 'param' is an object of class 'scoreparameters' |
data |
the data matrix with n columns (the number of variables) and a number of rows equal to the number of observations |
bgepar |
a list which contains parameters for BGe score:
|
bdepar |
a list which contains parameters for BDe score for binary data:
|
bdecatpar |
a list which contains parameters for BDe score for categorical data:
|
dbnpar |
which type of score to use for the slices
|
usrpar |
a list which contains parameters for the user defined score
|
mixedpar |
a list which contains parameters for the BGe and BDe score for mixed data
|
MDAG |
logical, when TRUE the score is initialized for a model with multiple sets of parameters but the same structure |
DBN |
logical, when TRUE the score is initialized for a dynamic Baysian network; FALSE by default |
weightvector |
(optional) a numerical vector of positive values representing the weight of each observation; should be NULL(default) for non-weighted data |
bgnodes |
(optional) a vector that contains column indices in the data defining the nodes that are forced to be root nodes in the sampled graphs; root 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 and defined via element |
edgepmat |
(optional) a matrix of positive numerical values providing the per edge penalization factor to be added to the score, NULL by default |
nodeslabels |
(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 |
x |
object of class 'scoreparameters' |
... |
ignored |
object |
object of class 'scoreparameters' |
Value
an object of class scoreparameters
, which includes all necessary information for calculating the BDe/BGe score
Author(s)
Polina Suter, Jack kuipers
References
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
Examples
myDAG<-pcalg::randomDAG(20, prob=0.15, lB = 0.4, uB = 2)
myData<-pcalg::rmvDAG(200, myDAG)
myScore<-scoreparameters("bge", myData)