ddiscrete {exams.forge}R Documentation

Discrete Probability Function

Description

Creates a discrete probability function based on x with a resolution unit. If unit is not given then unit will be 10, 100, 1000, ... depending on the length of the discrete probability function.

Usage

ddiscrete(x, unit = NULL, zero = FALSE)

Arguments

x

numeric: number of elements of vector of initial probabilities

unit

integer: reciprocal of the smallest non-zero probability (default: NULL)

zero

logical: zeros are allowed in the final probabilities (default: FALSE)

Value

A discrete probability function.

Examples

ddiscrete(runif(6))
ddiscrete(6)
ddiscrete(6, 20)
ddiscrete(c(1,0,0,0), zero=TRUE)

[Package exams.forge version 1.0.10 Index]