ewoe.CPF: Calculates the expected weight of evidence from a conditional...

ewoe.CPFR Documentation

Calculates the expected weight of evidence from a conditional probability frame.

Description

The expected weight of evidence (EWOE) is a measure of how much information about a hypothesis can be learned from a potential observation. The hypothesis corresponds to a grouping of the rows of the CPF (and the negation of the hypothesis to the remaining rows).

Usage

ewoe.CPF(cpf, pos = 1L, neg = NULL)

Arguments

cpf

A conditional probability frame (CPF), data frame, or matrix whose columns represent states of one variable, and rows represent configurations of the parent variable(s).

pos

An expression for selecting rows of the cpf which corresponds to the hypothesis.

neg

An expression for selecting the rows corresponding to the complement of the hypothesis. (The default value is -pos if pos is numeric; !pos if pos is logical, and setdiff(rownames(cpf),pos if pos is a character vector.

Details

Good (1985) defines the weight of evidence E for a hypothesis H as

W(H:E) = log \frac{P(E|H)}{P(E|\not H)} = log \frac{P(H|E)}{P(\not H|E)} - log \frac{P(H)}{P(\not H)}.

The expected weight of evidence (Good and Card, 1971) looks at potential future observations to find which might have the highest weight of evidence. The expected weight of evidence is

EWOE(H:E) = \sum_{e in E} W(H:e) P(e|H) .

In this calculation, the potential evidence corresponds to the columns of the (numericPart) of cpf. The hypothesis is found by splitting the rows. The pos and neg arguments can be any way of specifying a set of rows.

This is similar to the mutualInformation, only EWOE works for a binary hypothesis, while mutualInformation works for any number of states.

Value

A numeric value giving the weight of evidence in _centibans_ (where the logs are taken base 10 and the result is multiplied by 100).

Author(s)

Russell Almond

References

Good, I.J. (1985). Weight of Evidence: A brief survey. In Bernardo, J., DeGroot, M., Lindley, D. and Smith, A. (eds). Bayesian Statistics 2. North Holland. 249–269.

Good, I. J. and Card, W. (1971). The Diagnostic Process with Special Reference to Errors. Methods of Information in Medicine, 10, 176–188.

See Also

CPF, mutualInformation, expTable

Examples

ACED <- dplyr::inner_join(ACED.scores,ACED.items,by="SubjID")
expcr <- expTable(ACED,"cr","tCommonRatio1a",
                  pvecregex="P\\.<var>\\.\\.<state>")
ewoe.CPF(expcr,"H")
ewoe.CPF(expcr,c("H","M"))



ralmond/CPTtools documentation built on Dec. 27, 2024, 7:15 a.m.