residualsMultDir: Residuals from a Multinomial-Dirichlet model

Description Usage Arguments Details

View source: R/cross-validation.R

Description

Given a Bayesian network, some training data and some test data, the model given by fitting the Bayesian network to the training data is used to predict each node of the test data, given the parents of that node in the Bayesian network.

Usage

1
2
  residualsMultDir(x, weights = 1, train, test,
    metric = kronecker_delta, verbose = F)

Arguments

x

A BN, or a bn.list

weights

A numeric vector weights for the models x

train

A data frame of training data

test

A data frame of test data

metric

A function that measures the distance between the predictions and the true values

verbose

Logical indicating whether verbose output should be given

Details

The residual is then computed, using the supplied metric.

Alternatively, a bn.list of Bayesian networks can be supplied, together with a vector of weights. The models (Bayesian networks) are then averaged over, according to the supplied weights, to give a model averaging prediction.

The residuals are again computed, using the suppplied metric.


rjbgoudie/structmcmc documentation built on Nov. 3, 2020, 3:41 a.m.