readHistory {CPTtools}R Documentation

Reads a file of histories of marginal distributions.

Description

In running a typical Bayes net engine, as each piece of evidence comes in, updated marginal distributions for several variables are output. This function reads a such a log, expressed as a comma separated value file, and creates a data structure suitable for doing weight of evidence analyses.

Usage

readHistory(csvfile)

Arguments

csvfile

A name of a CSV file containing StatShop marginal distributions, one per row. Expects a column named "Item" from which the names are taken and "Result" which contains the values.

Details

This works with an excerpted log from a StatShop/ACED interaction. In this case the Item column should contain the name of the item presented at this iteration, possibly with an .xml suffix. The Results column should contain a probability vector of the form: [High:0.527,Medium:0.447,Low:0.025]. This function parses the CSV file and creates a matrix with rows corresponding to the rows in the CSV file and values from the probability vectors.

Value

A matrix whose column names are taken from the probability vectors and row names are taken from the Item field with the .xml suffix removed.

Author(s)

Russell Almond

References

http://research.ets.org/~ralmond/StatShop/dataFormats.html

See Also

parseProbVec, woeHist

Examples

## Not run: 
  allcorrect <- parseProbVec("CorrectSequence.csv")

## End(Not run)

[Package CPTtools version 0.5-1 Index]