A framework for performing elementary probability calculations on finite sample spaces. It is built around the concept of a probability space, which is an object of outcomes and an object
probs of probabilities associated with the outcomes.
There are two ways to represent a probability space in the
prob package. The first is with a data frame that has a
probs column. Entries of
probs should be nonnegative and sum to one. The second way is with a list having two components:
probs. The component
outcomes is a list containing elements of the most arbitrary sort; they can be data frames, vectors, more lists, whatever. The
probs component is a vector (of the same length as
outcomes), which associates to each element of
outcomes a nonnegative number. As before, the only additional requirement is that the
probs be one.
There are functions in the
prob package to address many topics in a standard course in elementary probability. In particular, there are methods for setting up sample spaces, counting tools, defining probability spaces, performing set algebra, calculating probability and conditional probability, tools for simulation and checking the law of large numbers, adding random variables, and finding marginal distributions. See
vignette("prob") for details.
There are some functions included to set up some of the standard sample spaces usually encountered in an elementary probability course. Examples include tossing a coin, rolling a die, drawing from a 52 card deck, etc. If you know of topics that would be of general interest and could be incorporated in the
prob package framework, I would be happy to hear about them. Comments and suggestions are always welcomed.
prob package is a first step toward addressing probability in
R, and has been written in the spirit of simplicity. The procedures work best to solve problems that are manageable in scope. Users that wish to investigate especially large or intricate problems are encouraged to modify and streamline the code to suit their individual needs.
Characteristic functions for the base probability distributions have been included. For details, type
vignette("charfunc") at the command prompt.
|VGAM, reshape, MASS, hypergeo
|GPL version 3 or newer
G. Jay Kerns <email@example.com>
Maintainer: G. Jay Kerns <firstname.lastname@example.org>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.