discretedistribution {lestat}R Documentation

Create Object Representing a Discrete Distribution

Description

An object representing a discrete distribution is created, based on explicitly given possible values and probabilities for these.

Usage

discretedistribution(vals, probs = rep(1, length(vals)))

Arguments

vals

A vector listing the possible values of the discrete distribution.

probs

If given, probs must have the same length as vals, and should list the probabilities of the possible values. If not given, all possible values are assigned equal probabilities.

Value

A discrete probability distribution.

Author(s)

Petter Mostad <mostad@chalmers.se>

Examples

dist <- discretedistribution(1:10)
expectation(dist)
variance(dist)

[Package lestat version 1.9 Index]