Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

scoreContribution

Compute the score's contribution in a network of each observation.


Description

This function computes the score's contribution of each observation to the total network score.

Usage

scoreContribution(object = NULL, 
                  dag = NULL, data.df = NULL, data.dists = NULL,
                  verbose = FALSE)

Arguments

object

an object of class 'abnLearned' produced by mostProbable, searchHeuristic or searchHillClimber.

dag

a matrix or a formula statement (see details) defining the network structure, a directed acyclic graph (DAG), see details for format. Note that colnames and rownames must be set.

data.df

a data frame containing the data used for learning the network, binary variables must be declared as factors and no missing values all allowed in any variable.

data.dists

a named list giving the distribution for each node in the network, see details.

verbose

if TRUE then provides some additional output.

Details

This function computes the score contribution of each observation to the total network score. This function is available only in the 'mle' settings. To do so one uses the glm and predict functions. This function is an attempt to perform diagnostic for an ABN analysis.

Value

A named list that contains the scores contributions: maximum likelihood, aic, bic, mdl and diagonal values of the hat matrix.

Author(s)

Gilles Kratzer

Examples

## Use a subset of a built-in simulated data set
mydat <- ex1.dag.data[,c("b1","g1","p1")]

## setup distribution list for each node
mydists <- list(b1="binomial", g1="gaussian", p1="poisson")

## now build cache
mycache <- buildScoreCache(data.df = mydat, data.dists = mydists, max.parents = 2, method = "mle")

## Find the globally best DAG
mp.dag <- mostProbable(score.cache=mycache, score="bic", verbose = FALSE)

out <- scoreContribution(object = mp.dag)

## Observations contribution per network node
boxplot(out$bic)

abn

Modelling Multivariate Data with Additive Bayesian Networks

v2.5-0
GPL (>= 2)
Authors
Gilles Kratzer [aut, cre] (<https://orcid.org/0000-0002-5929-8935>), Fraser Iain Lewis [aut] (<https://orcid.org/0000-0003-4580-2712>), Reinhard Furrer [ctb] (<https://orcid.org/0000-0002-6319-2332>), Marta Pittavino [ctb] (<https://orcid.org/0000-0002-1232-1034>)
Initial release
2021-04-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.