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),
  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),
  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:

  • 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

bdepar

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

bdecatpar

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

dbnpar

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

  • b the number of static variables; all static variables have to be in the first b columns of the data; for DBNs static variables have the same meaning as bgnodes for usual Bayesian networks; for DBNs parameters parameter bgnodes is ignored

  • rowids optional vector of time IDs; usefull for identifying data for initial time slice

  • datalist indicates is data is passed as a list for a two step DBN; useful for unbalanced number of samples in timi slices

usrpar

a list which contains parameters for the user defined score

  • pctesttype (optional) conditional independence test ("bde","bge","bdecat")

mixedpar

a list which contains parameters for the BGe and BDe score for mixed data

  • nbin a positive integer number of binary nodes in the network (the binary nodes are always assumed in first nbin columns of the 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 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 and defined via element b of the parameters dbnpar

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)

[Package BiDAG version 2.0.4 Index]