About CPTtools

A Bayesian network is built from a set of variables aranged in an acyclic directed graph. For each variable, the conditional probability distribution of that variable given its parents in the graph. For a discrete network, this takes the form of a conditional probability table (CPT).

If the experts specify the table directly, the number of values to be specified is exponential in the number of parents. For this reason, various parametric forms for the conditional probability tables have been developed, in which the number of values to be specified is usually linear in the number of parents. This package collects R code for generating the CPTs for these various parametric forms.

The second type of tool contained in the package is tools for analyzing the output of Bayesian networks. This includes both graphs for displayig multiple conditional probabilities, and graphs for analyzing sequences of evidence.

The tools here were originally developed to be used with StatShop (a proprietary Bayes net scoring engine developed at ETS), but have been adapted to work with RNetica. There is no dependence on RNetica, the tools here could be easily used (perhaps with some minor adaptation) with other Bayesian network packages.

Getting Started

I recently did a demonstration of CPTtools for my Bayes net class and recorded it using Tegrity. I'm posting a few of those resources here as a way of getting started.

CPTtools License Information

CPTtools is made available under the Artistic License, version 2.0.

Current Version Status

The current version (0.8-1) is now fully debugged and contains a users manual. This version also has the new updated discrete partial credit models meant to work with the Peanut parameterized network package.

Also included in the new version are R datasets corresponding to ACED.

New with the 0.8 release is a method for the observable characteristic plots of Sinharay and Almond, OCP.

New with the 0.7 release is a method for the lattice function barchart for Conditional Probabilty Frames. Check it out

CPTtools Releases

CPTtools is now released through R Universe. To get the latest version, execute the following R command:

  install.packages("CPTtools",
                   repos=c(ralmond="https://ralmond.r-universe.dev",
                           cran="https://cloud.r-project.org"))
The latest verison is also now availabe at https://github.com/ralmond/CPTtools. The latest stable version is available using:
  devtools::install_github("ralmond/CPTtools")
The unstable version can be found by adding ref="working". The following releases are archived here:
ReleaseSourceWindows BinaryMac BinaryManualNotes
0.1-4CPTtools_0.1-4.zip DiBello-Samejima models only
0.2-3CPTtools_0.2-3.tar.gz Weight of evidence graphs merged in.
0.3-1CPTtools_0.3-1.tar.gz CPTtools_0.3-1.zip CPTtools_0.3-1.tgz CPTtools-manual_0.3-1.pdf Discrete Partial Credit framework and complete docs
0.3-2CPTtools_0.3-2.tar.gz CPTtools_0.3-2.zip CPTtools_0.3-2.tgz CPTtools-manual_0.3-2.pdf Peanut Release
0.4-2CPTtools_0.4-2.tar.gz CPTtools_0.4-2.zip CPTtools_0.4-2.tgz CPTtools-manual_0.4-2.pdf Debugging with test cases.
0.4-3 CPTtools_0.4-3.tar.gz CPTtools_0.4-3.zip CPTtools_0.4-3.tgz CPTtools-manual_0.4-3.pdf Added normal link and docs back in.
0.5-1 CPTtools_0.5-1.tar.gz CPTtools_0.5-1.zip CPTtools_0.5-1.tgz CPTtools-manual_0.5-1.pdf Functions as.CPA and as.CPF moved from RNetica
Added barchart.CPF, requires lattice package.
0.5-3 CPTtools_0.5-3.tar.gz CPTtools_0.5-3.zip CPTtools_0.5-3.tgz CPTtools-manual_0.5-3.pdf Added fcKappa and gkLambda functions and fixed a few exports.
0.6-1 CPTtools_0.6-1.tar.gz CPTtools_0.6-1.zip CPTtools_0.6-1.tgz CPTtools-manual_0.6-1.pdf Added isMonotonic function..
0.7-2 CPTtools_0.7-2.tar.gz CPTtools_0.7-2.zip CPTtools_0.7-2.tgz CPTtools-manual_0.7-2.pdf Minor fixes with PNetica documentation cleanup.
0.8-1R UniverseAdded vignettes, OCP functions and Goodman and Kruskal's gamma function.
Note the source versions have been compiled and tested under Linux/Unix, Mac OS X and Windows. As this is written purely in R, no software other than R is required to install this package, and the source package should install on all platforms. (If installing from the R menus, you need to select "Install source package...")

Development Version

The latest development version is available as a subversion repository at: https://github.com/ralmond/CPTtools.

If you have patches or other correspondence about CPTtools you can contact me at russell.g.almond@gmail.com. If you are filing a bug report, please be sure to include:

  1. The version number of CPTtools and R that you are using.
  2. Your operating system and whether it is 64 or 32 bit.
  3. The exact text of any error message that is generated.
  4. A small script that reproduces the problem (if at all possible).

Legal Notices

The software is offered AS IS, without any warranty of any kind. Support is provided on a volunteer basis, and may not be immediately forthcoming.


Site last updated on 2022-06-23.