scoreagainstDAG {BiDAG} | R Documentation |
Calculating the score of a sample against a DAG
Description
This function calculates the score of a given sample against a DAG represented by its incidence matrix.
Usage
scoreagainstDAG(
scorepar,
incidence,
datatoscore = NULL,
marginalise = FALSE,
onlymain = FALSE,
bdecatCvec = NULL
)
Arguments
scorepar |
an object of class |
incidence |
a square matrix of dimensions equal to the number of variables with entries in |
datatoscore |
(optional) a matrix (vector) containing binary (for BDe score) or continuous (for the BGe score) observations (or just one observation) to be scored; the number of columns should be equal to the number of variables in the Bayesian network, the number of rows should be equal to the number of observations; by default all data from |
marginalise |
(optional for continuous data) defines, whether to use the posterior mean for scoring (default) or to marginalise over the posterior distribution (more computationally costly) |
onlymain |
(optional), defines the the score is computed for nodes excluding 'bgnodes'; FALSE by default |
bdecatCvec |
(optional for categorical data) |
Value
the log of the BDe/BGe score of given observations against a DAG
Author(s)
Jack Kuipers, Polina Suter
References
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, 1995.
Examples
Asiascore<-scoreparameters("bde", Asia[1:100,]) #we wish to score only first 100 observations
scoreagainstDAG(Asiascore, Asiamat)