probspace.default {probs}R Documentation

Probability Spaces Forms a probability space from a set of outcomes and (optional) vector of probabilities.

Description

Probability Spaces Forms a probability space from a set of outcomes and (optional) vector of probabilities.

Usage

## Default S3 method:
probspace(x, probs, ...)

Arguments

x

a vector, data frame, or list of outcomes.

probs

a vector of non-negative weights of the same length as outcomes

...

further arguments to be passed to or from other methods.

Details

The elements of probs will be normalized to ensure that their sum is one. If probs is not specified, then the equally likely model is assumed in which every outcome has the same probability.

Value

If outcomes is a vector or data frame, then the value is a data frame with an added probs column. If outcomes is a list, then the value is a list with components outcomes (the supplied list) and a probs component.

Author(s)

G. Jay Kerns gkerns@ysu.edu.

Examples

R <- rolldie(3)
probspace(R)

[Package probs version 0.9.9 Index]